diff --git a/images/ui/dram_activeleft.png b/images/ui/dram_activeleft.png index e508371..5c22a7a 100644 Binary files a/images/ui/dram_activeleft.png and b/images/ui/dram_activeleft.png differ diff --git a/images/ui/dram_activeright.png b/images/ui/dram_activeright.png index dac42fe..c056e2a 100644 Binary files a/images/ui/dram_activeright.png and b/images/ui/dram_activeright.png differ diff --git a/pages/user/my_order/my_order.js b/pages/user/my_order/my_order.js index f2f1f70..444a707 100644 --- a/pages/user/my_order/my_order.js +++ b/pages/user/my_order/my_order.js @@ -14,13 +14,14 @@ Page({ switch_: ["麻花官网", "第三方平台"], page: 1 }, - //回到顶部 - goTop: function (e) { // 一键回到顶部 - if (wx.pageScrollTo) { - wx.pageScrollTo({ - scrollTop: 0 - }) - }}, + //回到顶部 + goTop: function (e) { // 一键回到顶部 + if (wx.pageScrollTo) { + wx.pageScrollTo({ + scrollTop: 0 + }) + } + }, init_order(type) { http("/api/v1/order-list", "get", { type @@ -37,12 +38,33 @@ Page({ }, detail(e) { 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) { 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) { @@ -55,10 +77,12 @@ Page({ order_no: e.currentTarget.dataset.order_no }).then(res => { wx.showToast({ - title: '取消订单成功!', + title: '取消成功!', duration: 1000 }) - that.init_order(1) + setTimeout(() => { + that.init_order(1) + }, 200); }) } } @@ -115,10 +139,10 @@ Page({ onReachBottom: function () { if (this.data.has_more) { wx.showNavigationBarLoading(); //在标题栏中显示加载图标 - let page = this.data.page + 1 + let page = this.data.page + 1 let _data = { type: this.data._type, - page + page } http("/api/v1/order-list", "get", _data).then(res => { wx.hideNavigationBarLoading(); //完成停止加载图标 diff --git a/pages/user/my_order/my_order.wxml b/pages/user/my_order/my_order.wxml index a93bae7..60abb0e 100644 --- a/pages/user/my_order/my_order.wxml +++ b/pages/user/my_order/my_order.wxml @@ -6,8 +6,7 @@ 还未查询到您的观看记录 - + 订单号:{{item.order_no}} @@ -28,9 +27,15 @@ - - 取消订单 - 立即支付 + + + 取消订单 + 立即支付 + + + + 删除订单 +