My iPhone is water damaged but still powers on, what could be the problem?

I bought a phone assuming it was in recovery loop (which I can fix). But when I received it, it would not power on unless it was charging by mains. Even then it would only momentarily show the apple logo and then it would go off again. It just kept turning on and off repeatedly. I can't disconnect it when the apple logo appears or else it will just turn off again. The screen has some bright patches on it like there's something wrong with the LCD. I was wondering whether changing the battery and the screen could fix this problem.

I'd open it up if you feel comfortable doing that that and check the watermarks inside the iphone to see how bad the waterdamage was. I believe there's a watermark on the back of the lcd and below the battery but you can look it up.

The problem is it is water damaged, this will affect the screen and of logic board. From your description it has affected both and is unlikely to be economic to repair
Sorry
David