exports.main = async (event, context) => {
const { OPENID } = cloud.getWXContext();
const res = await cloud.cloudPay.unifiedOrder({
"openid": OPENID,
"body" : event.body,
"outTradeNo" : event.outTradeNo,
"spbillCreateIp" : "127.0.0.1",
"subMchId" : "1659201615",
"totalFee" : event.totalFee,
"envId": "cloud1-8gfd19nr926f700d",
"tradeType":"JSAPI",
"functionName": "pay_cb"
})
return res
noPay(){
wx.cloud.callFunction({
name: 'buy_pay',
}).then(res => {
_openid = res.result.openid
wx.cloud.database().collection('buy_orders').orderBy('time','desc').where({
status:0,
openid: this.data._openid,
}).get()
.then(res=>{
this.setData({
ordersList:res.data
});
});
});
},
为什么这个id并不能拿过来,我应该怎么拿过来并且判断过滤?
你这JS基础知识都属于刚入门,不过关,就开始写支付代码啊?
把this.data._openid打印出来, 有值吗