If you use your own charger to charge, it this charging current intermittent, first you need to check that you use a data cable, it is not in bad contact. You can replace a new data line for charging, if there is no intermittent is this data line short circuit.
If the charging contact is still poor after replacing the data cable, you need to replace the tail plug of the phone.
If there is no response to the tail plug, it is generally not a problem of the tail plug, and the possibility of the copper wire breaking the core inside the data line is relatively large, which is a case of borrowing someone's data line to try it