Mr. Trump has many fans in China, where he is known for his business acumen and ostentatious displays of wealth. The news media has also been kind to him, especially as he has sought closer ties with President Xi Jinping.

But Mr. Trump’s decision to withdraw from the climate agreement provoked widespread fury. On social media, news outlets referred to Mr. Trump as a “public enemy of the world,” saying he was endangering the health of the planet. On Weibo, a Twitter-like service, a CCTV post portrayed Mr. Trump as childish and impulsive in a fake chat with current and former world leaders.

“I don’t want to talk to you!” he tells President Obama. “You signed a terrible deal!”

CCTV’s message was clear: The United States can’t be trusted as a responsible global player, at least on environmental issues.