Personally, I would suggest u make ur connection in PEK.
Both PEK & PVG flights from YVR will arrive around 3-4pm, since you need at least 2 hrs to transfer from PVG to SHA, by the time you reach SHA most flights to XIAMEN will be gone, whereas in PEK you got way more frequency than SHA and dont need to transfer to another airport.
Well, MegLev Train might be very attractive indeed. In this case, why dont u stay over night in Shanghai, and take ur time enjoy the train, and the city(try some local dishes). instead of worrying abt missing ur connection. SHA isnt far from town compare with PVG(at least 1 hr from town).
Enjoy ur time in CHINA.