You forgot those Apple listed prices are US only and never included any Sales Tax. In reality everywhere on the planet are paying $100 to $200 more on top of those prices. In the case of China has both Import, and Sales Tax. ( It works more like VAT though ), it adds up to around $300 on top of $999, closer to $1299.
Edit: Yes in case Apple is ridiculously expensive in many part of the world.
First of all, you're quoting prices in China, which means that iPhone has significant taxes tacked on to it. Second, iPhone seems to be $1269, while the Huawei phone is $977.
iPhone is 256GB version vs Huawei's 128GB version. Huawei P20 comes with only one storage tier which is 128GB. So I chooses the middle tier to represent iPhone.
If you buy the XS Max with 512 GB of storage, unlocked (which happens to be $1,449.00, by the way). iPhone XS starts at $999.