As a tourist Destination, Beijing may worth your two week time. As a city, Shanghai is far better. Beijing is very pedestrian unfriendly. Beijing people (more accurately, it's beijing's government) simply do not understand that pedestrian are the key to city life. Many of its streets are too wide. To make it worse, they install ugly fences to split these streets into halves. One unexpected advantage for Beijing is it's food, the local food. It's far superior to shanghai's.