按照微信开发文档,价格类型(priceType)分别为1:一口价,2:价格区间,3:显示折扣价;1:一口价,只需要传入price,price2不传;2:价格区间,price字段为左边界,price2字段为右边界,price和price2必传。3:折扣价,price字段为现价,price2字段为原价, price和price2必传;
我调用商品更新接口,传递的json参数为{"goodsInfo":{"priceType":"3","price":"50","price2":"90","goodsId":32}},返回的结果是{"errmsg":"goods price invalid","errcode":300003},即为价格输入不合规(如:现价比原价大、传入价格非数字等),而当我把传递参数改为{"goodsInfo":{"priceType":"3","price":"90","price2":"50","goodsId":32}},反而成功,并在小程序里显示