feat 轮次切换颜色修改+删除订单按钮

develop
GJW200011 4 years ago
parent e05a4781fa
commit 55fb1700c6

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

@ -14,13 +14,14 @@ Page({
switch_: ["麻花官网", "第三方平台"], switch_: ["麻花官网", "第三方平台"],
page: 1 page: 1
}, },
//回到顶部 //回到顶部
goTop: function (e) { // 一键回到顶部 goTop: function (e) { // 一键回到顶部
if (wx.pageScrollTo) { if (wx.pageScrollTo) {
wx.pageScrollTo({ wx.pageScrollTo({
scrollTop: 0 scrollTop: 0
}) })
}}, }
},
init_order(type) { init_order(type) {
http("/api/v1/order-list", "get", { http("/api/v1/order-list", "get", {
type type
@ -37,12 +38,33 @@ Page({
}, },
detail(e) { detail(e) {
wx.navigateTo({ wx.navigateTo({
url: '/pages/user/order_detail/order_detail?order_no=' + e.currentTarget.dataset.order_no+'&_type='+this.data._type, url: '/pages/user/order_detail/order_detail?order_no=' + e.currentTarget.dataset.order_no + '&_type=' + this.data._type,
}) })
}, },
pay(e) { pay(e) {
wx.navigateTo({ wx.navigateTo({
url: '/pages/user/order_detail/order_detail?order_no=' + e.currentTarget.dataset.order_no+'&_type='+this.data._type, url: '/pages/user/order_detail/order_detail?order_no=' + e.currentTarget.dataset.order_no + '&_type=' + this.data._type,
})
},
dele(e) {
var that = this
wx.showModal({
content: '订单删除不可恢复,是否删除?',
success(res) {
if (res.confirm) {
http("/api/v1/order-delete", "get", {
order_no: e.currentTarget.dataset.order_no
}).then(res => {
wx.showToast({
title: '删除成功!',
duration: 1000
})
setTimeout(() => {
that.init_order(1)
}, 200);
})
}
}
}) })
}, },
cancel(e) { cancel(e) {
@ -55,10 +77,12 @@ Page({
order_no: e.currentTarget.dataset.order_no order_no: e.currentTarget.dataset.order_no
}).then(res => { }).then(res => {
wx.showToast({ wx.showToast({
title: '取消订单成功!', title: '取消成功!',
duration: 1000 duration: 1000
}) })
that.init_order(1) setTimeout(() => {
that.init_order(1)
}, 200);
}) })
} }
} }
@ -115,10 +139,10 @@ Page({
onReachBottom: function () { onReachBottom: function () {
if (this.data.has_more) { if (this.data.has_more) {
wx.showNavigationBarLoading(); //在标题栏中显示加载图标 wx.showNavigationBarLoading(); //在标题栏中显示加载图标
let page = this.data.page + 1 let page = this.data.page + 1
let _data = { let _data = {
type: this.data._type, type: this.data._type,
page page
} }
http("/api/v1/order-list", "get", _data).then(res => { http("/api/v1/order-list", "get", _data).then(res => {
wx.hideNavigationBarLoading(); //完成停止加载图标 wx.hideNavigationBarLoading(); //完成停止加载图标

@ -6,8 +6,7 @@
<view class="warn">还未查询到您的观看记录</view> <view class="warn">还未查询到您的观看记录</view>
</view> </view>
<view wx:else> <view wx:else>
<view class="order_list" wx:for="{{order_list}}" <view class="order_list" wx:for="{{order_list}}" data-order_no="{{item.order_no}}" bindtap="detail">
data-order_no="{{item.order_no}}" bindtap="detail">
<van-cell custom-class="order_status_info" <van-cell custom-class="order_status_info"
value-class="value {{item.order_status==2?'_value1':(item.order_status==1?'_value2':'')}}"> value-class="value {{item.order_status==2?'_value1':(item.order_status==1?'_value2':'')}}">
<view slot="title" class="_title"><text style="font-weight:bold;">订单号:</text>{{item.order_no}}</view> <view slot="title" class="_title"><text style="font-weight:bold;">订单号:</text>{{item.order_no}}</view>
@ -28,9 +27,15 @@
</view> </view>
</view> </view>
</view> </view>
<view wx:if="{{item.order_status==2}}" slot="footer" class="_footer"> <view slot="footer" class="_footer">
<view class="_cancel" data-order_no="{{item.order_no}}" catchtap="cancel">取消订单</view> <block wx:if="{{item.order_status==2}}">
<view class="_confirm" data-order_no="{{item.order_no}}" catchtap="pay">立即支付</view> <view class="_cancel" data-order_no="{{item.order_no}}" catchtap="cancel">取消订单</view>
<view class="_confirm" data-order_no="{{item.order_no}}" catchtap="pay">立即支付</view>
</block>
<!-- -->
<block wx:if="{{item.order_status==12||item.order_status==15}}">
<view class="_confirm" data-order_no="{{item.order_no}}" catchtap="dele">删除订单</view>
</block>
</view> </view>
</van-card> </van-card>
</view> </view>

Loading…
Cancel
Save