[代码]let gameScoreData = {[代码][代码] [代码][代码]wxgame: {[代码][代码] [代码][代码]score: [代码][代码]16[代码][代码],[代码][代码] [代码][代码]update_time: [代码][代码]new[代码] [代码]Date[代码][代码]().getTime(),[代码][代码] [代码][代码]},[代码][代码] [代码][代码]cost_ms: [代码][代码]36500[代码][代码] [代码][代码]}[代码] [代码] [代码] [代码] [代码][代码]let userKVData = {[代码][代码] [代码][代码]key: [代码][代码]"score"[代码][代码],[代码][代码] [代码][代码]value: JSON.stringify(gameScoreData),[代码][代码] [代码][代码]}[代码] [代码] [代码] [代码] [代码][代码]wx.setUserCloudStorage({[代码][代码] [代码][代码]KVDataList: [userKVData],[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log([代码][代码]'--success res:'[代码][代码], res);[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log([代码][代码]'--fail res:'[代码][代码], res);[代码][代码] [代码][代码]},[代码][代码] [代码][代码]complete: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log([代码][代码]'--complete res:'[代码][代码], res);[代码][代码] [代码][代码]},[代码][代码] [代码][代码]});[代码]测过了,能用。
KVData到底应该怎么定义啊?kvdata多个key时应该怎么写啊?~~ 我这么写会报错,说“KVDataList must be an Array” let kvdata =new Array(); let data1={key:rankString,value:this.rankScore}; let data2={key:rankTimeString,value:date.getTime()}; kvdata.push(data1); kvdata.push(data2); wx.setUserCloudStorage(kvdata);
2018-06-22