Appears to be an connection issue between the charging port and the logic board.
First thing I would do is inspect the charging port for any debris / gunk preventing the lightning cable from plugging in fully if it isn't going in fully without a gap between the plug and the iPhone's metal housing frame.
You can use tweezers to do so, be careful when pushing out the gunk because you don't want to touch the 5-pins inside the charging port as that will cause it to depress down which may cause contact issues for charging in the future.
Once you have confirmed the cable is plugging in fully without any obstruction and still does not work then next is to open up the phone and inspect for any liquid damage. No liquid damage near charging port area / battery connector on board?
Test a replacement lightning connector on it and see if it's going to work or not. If it still does not then it's probably charging IC gone bad. Honestly I'm not sure if USB connection to computer is still doable with a bad charging IC.
Edit - This page is particularly useful in troubleshooting iPhones: iPhone 5s Troubleshooting