小程序修改代码
This commit is contained in:
@ -117,7 +117,9 @@ Page({
|
||||
},
|
||||
|
||||
// 取消订单
|
||||
cancelOrder() {
|
||||
cancelOrder(e) {
|
||||
// console.log(e);
|
||||
const id = e.currentTarget.dataset.id;
|
||||
wx.showModal({
|
||||
title: '取消订单',
|
||||
content: '是否要取消订单?',
|
||||
@ -126,9 +128,9 @@ Page({
|
||||
wx.request({
|
||||
url: baseUrl + "/courseOrder/cancel",
|
||||
method: 'POST',
|
||||
data: { courseId: this.data.orderId },
|
||||
data: { courseId: id },
|
||||
header: { Authorization: wx.getStorageSync('token') },
|
||||
success: () => this.getOrderDetail()
|
||||
success: () => this.fetchOrders()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@
|
||||
<text class="font_6 text_5">{{ item.createTime }}</text>
|
||||
<view class="flex-row">
|
||||
<!-- 仅待支付时可操作 -->
|
||||
<view wx:if="{{ item.orderStatus === '待支付' }}" class="flex-col justify-start items-center text-wrapper" catch:tap="cancelOrder">
|
||||
<view wx:if="{{ item.orderStatus === '待支付' }}" class="flex-col justify-start items-center text-wrapper" catch:tap="cancelOrder" data-id="{{ item.id }}">
|
||||
<text class="font_7">取消订单</text>
|
||||
</view>
|
||||
<view wx:if="{{ item.orderStatus === '待支付' }}" class="flex-col justify-start items-center text-wrapper_2 ml-11" catch:tap="payOrder">
|
||||
|
Reference in New Issue
Block a user