probably there is moisture in the USB port. if you can charge wireless do that. Otherwise clean the port by blowing in it or clean it with a plastic or wooden toothpick (not with anything metal !) let it dry out and it all should hopefully work again.
next time buy a rugged waterproof phone from the Galaxy Xcover serie bit more expensive but rugged and waterproof