代码如下:
onLoad: async function (options) {
const self = this;
let gid='C13223496312899452';
let batch = -1;
const ares = await wx.cloud.callContainer({
config: {
env: 'prod-123412gt1leosfe18677d',
},
path: '/wea/program15',
method: 'POST',
header: {
'X-WX-SERVICE': 'hoxun',
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
},
data: {
postflag: "trace_goods",
gid: gid,
batch: batch,
nickName: '张三'
},
success(res) { console.log('res=',res)
self.setData({
goods: res.data,
})
},
});
self.setData({
goods: JSON.parse(res.data),
})