存储代码片段://更新表 var share = AV.Object.createWithoutData('ShareUsers', that.data.obid); // 修改属性 share.set('hNum', that.data.hNum + 1); share.set('total', that.data.total); //有这句就报错 此处的that.data.total=Number(that.data.total + that.data.price).toFixed(2) // 保存到云端 share.save();
错误信息:PUT https://imwexacf.api.lncld.net/1.1/classes/ShareUsers/5ca5ee2ea91c930071e5f0b0 400 (Bad Request)
看起来是 total 的类型不对,toFixed 返回的是字符串,但是似乎 total 是一个数字。
total
toFixed