It sounds as though there is a problem with the DC socket on the mobo. Some of these are easy to change as they are connected by a mini harness. Others are trickier (ie, more expensive) as they are soldered in. The problem with the other laptop is unrelated, and I've never come across a virus that can have any effect on the charging circuitry.
Huawei P10 review