China’s factory output and consumer spending weakened in April as a tariff war with Washington intensified, adding to pressure on Beijing to shore up shaky economic growth.