miniprogram/pages/all-orders/index.js
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
const APP = getApp()
Page({
data: {
hasOrder: false
},
cancelOrderTap: function(e) {
const that = this;
const orderId = e.currentTarget.dataset.id;
wx.showModal({
title: '确定要取消该订单吗?',
content: '',
success: function(res) {
if (res.confirm) {
wx.cloud.callContainer({
config: {
"env": "您的env参数" // 微信云托管的环境ID
},
path: "/api/CancelOrder",
method: 'GET',
header: {
'X-WX-SERVICE': '您的SERVICE参数',
"Content-Type": "application/json"
},
data: {
"id": orderId
},
success: res => {
if (res.data.code == 200) {
that.onShow(); //重新获取订单列表
wx.hideLoading()
} else {
wx.hideLoading()
}
},
fail: res => {
wx.hideLoading()
console.log('调用云托管失败!' + res)
}
})
// wx.request({
// url: 'https://localhost:61895/api/CancelOrder',
// method: 'GET',
// header: {
// "Content-Type": "application/json"
// },
// data:{
// "id": orderId
// },
// success: (res) => {
// console.log(res)
// if (res.statusCode == 200) {
// that.onShow(); //重新获取订单列表
// wx.hideLoading()
// } else {
// wx.hideLoading()
// }
// }
// })
}
后面还有 91 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。