|
|
@ -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(); //完成停止加载图标
|
|
|
|