Most likely, your battery is unplugged or a ribbon cable is lose.
1)Unplug and replug your battery . Now see if it works.
2) Check the joycon rail cables (black sliding latch thing)
These two cables seem to have these properties:
A) This cable is for SL/SR/sync fixing I believe this is needed to Connect Wirelessly
B) this cable comes from the bottom part of the slider where the 'teeth' are on the joycon. This cable seems to be responsible for: Charging and Connecting to the System in Handheld mode
Unplug, replug A first, see if it works, then try B.
Good luck!