[订单拆分,周五福利添加配送方式]
This commit is contained in:
@@ -13,7 +13,9 @@ Page({
|
||||
*/
|
||||
data: {
|
||||
statusHeight : app.globalData.statusBarHeight,
|
||||
order : '' //订单详情
|
||||
orderId : '', //订单id
|
||||
order : '', //订单详情
|
||||
orderType : '' //订单来源
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -21,14 +23,21 @@ Page({
|
||||
*/
|
||||
onLoad (options) {
|
||||
// 获取商品活动订单详情
|
||||
this.orderInfo(options.id);
|
||||
this.setData({
|
||||
orderType : options.orderType,
|
||||
orderId : options.id
|
||||
})
|
||||
this.orderInfo();
|
||||
},
|
||||
|
||||
/**
|
||||
* 商品活动订单详情
|
||||
*/
|
||||
orderInfo(id) {
|
||||
wx.$api.exchange.show(id).then(res=>{
|
||||
orderInfo() {
|
||||
let url = ''
|
||||
if(this.data.orderType == 'welfare' || this.data.orderType == 'welfareGoods') url = wx.$api.exchange.welfaresShow
|
||||
if(this.data.orderType == 'rights' || this.data.orderType == 'rightsCoupons') url = wx.$api.exchange.show
|
||||
url(this.data.orderId).then(res=>{
|
||||
this.setData({
|
||||
order : res.data
|
||||
})
|
||||
@@ -45,10 +54,28 @@ Page({
|
||||
content : '确认取消吗?',
|
||||
success : res=> {
|
||||
if (res.confirm) {
|
||||
wx.$api.exchange.cancel(orderId).then(res=>{
|
||||
wx.reLaunch({
|
||||
url: '/pages/order/order'
|
||||
})
|
||||
let url = ''
|
||||
if(this.data.orderType == 'welfare' || this.data.orderType == 'welfareGoods') url = wx.$api.exchange.welfaresCancel
|
||||
if(this.data.orderType == 'rights' || this.data.orderType == 'rightsCoupons') url = wx.$api.exchange.cancel
|
||||
|
||||
url(orderId).then(res=>{
|
||||
if(this.data.orderType == 'rightsCoupons') {
|
||||
wx.reLaunch({
|
||||
url: '/pages/order/order?orderType=rightsCoupons'
|
||||
})
|
||||
} else if(this.data.orderType == 'rights') {
|
||||
wx.reLaunch({
|
||||
url: '/pages/order/order?orderType=rights'
|
||||
})
|
||||
} else if(this.data.orderType == 'welfare') {
|
||||
wx.reLaunch({
|
||||
url: '/pages/order/order?orderType=welfare'
|
||||
})
|
||||
} else {
|
||||
wx.reLaunch({
|
||||
url: '/pages/order/order?orderType=welfareGoods'
|
||||
})
|
||||
}
|
||||
|
||||
wx.showToast({
|
||||
title: res.data,
|
||||
|
||||
Reference in New Issue
Block a user