The point of US dollars is that there are more people who accept US dollars for their trades, and therefore settling in US dollars is safe - you will always find someone else to trade with holding US dollars.
Barter, on the other hand, even if using yuan as the unit of accounting, has the drawback that you can only trade with people who accept yuan and is willing to barter with you (or you find a willing set of trade partners to chain barter with).