小程序修改代码
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">
|
||||
|
@ -9,9 +9,9 @@
|
||||
<view class="flex-col flex-1 ml-11">
|
||||
<text class="self-start text">{{ courseObj.name }}</text>
|
||||
<view class="flex-row items-center self-stretch group mt-15">
|
||||
<text class="text_2">¥{{ courseObj.originPrice }}</text>
|
||||
<text class="text_2">¥{{ courseObj.discountPrice }}</text>
|
||||
<view class="flex-col justify-start relative ml-1">
|
||||
<text class="text_3">¥{{ courseObj.discountPrice }}</text>
|
||||
<text class="text_3">¥{{ courseObj.originPrice }}</text>
|
||||
<view class="divider pos"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -55,15 +55,15 @@
|
||||
<view class="mt-16 flex-col section_4">
|
||||
<view class="flex-row justify-between items-center">
|
||||
<text class="font text_12">课程价格</text>
|
||||
<text class="font_4">¥{{ orderObj.totalAmount }}</text>
|
||||
<text class="font_4">¥{{ orderObj.originPrice }}</text>
|
||||
</view>
|
||||
<view class="flex-row justify-between items-center mt-11">
|
||||
<text class="font text_13">价格折扣</text>
|
||||
<text class="font_4 text_14">-¥{{ orderObj.totalAmount - orderObj.originPrice }}</text>
|
||||
<text class="font_4 text_14">-¥{{ orderObj.originPrice - orderObj.totalAmount }}</text>
|
||||
</view>
|
||||
<view class="flex-row justify-between items-center group_9 mt-11">
|
||||
<text class="font_2 text_15">订单金额</text>
|
||||
<text class="font_4 text_16">¥{{ orderObj.originPrice }}</text>
|
||||
<text class="font_4 text_16">¥{{ orderObj.totalAmount }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<view class="flex-row items-center section">
|
||||
<image
|
||||
class="image"
|
||||
src="https://ide.code.fun/api/image?token=6854f3c94ae84d0012332367&name=f2d91149603a9b9bbd30ffd5a77c2043.png"
|
||||
src="./images/sousuo.png"
|
||||
/>
|
||||
<input class="text ml-3" placeholder="搜索更多好课" />
|
||||
</view>
|
||||
|
Reference in New Issue
Block a user