President Donald Trump departed China after a two-day trip, touting what he called “fantastic” trade deals while the war with Iran continued to loom over the visit.