|
|
@@ -223,6 +223,11 @@ Page({ |
|
|
|
couponId: options.couponId, |
|
|
|
title: that.data.data.title ? that.data.data.title : '', |
|
|
|
}); |
|
|
|
if(options.cardType){ |
|
|
|
that.setData({ |
|
|
|
cardType: options.cardType |
|
|
|
}) |
|
|
|
} |
|
|
|
var parmer = { |
|
|
|
url: config.api.couponDetail, |
|
|
|
data: { |
|
|
@@ -354,56 +359,56 @@ Page({ |
|
|
|
if (err.code == "2011") { |
|
|
|
wx.showToast({ |
|
|
|
title: "商户信息没找到", |
|
|
|
image:imgurl.fail.url, |
|
|
|
image:'./../../../assets/images/fail.png', |
|
|
|
duration: 2000, |
|
|
|
mask: false |
|
|
|
}); |
|
|
|
} else if (err.code == "2013") { |
|
|
|
wx.showToast({ |
|
|
|
title: "商户信息禁用", |
|
|
|
image:imgurl.fail.url, |
|
|
|
image:'./../../../assets/images/fail.png', |
|
|
|
duration: 2000, |
|
|
|
mask: false |
|
|
|
}); |
|
|
|
} else if (err.code == "3000") { |
|
|
|
wx.showToast({ |
|
|
|
title: "库存不足", |
|
|
|
image:imgurl.fail.url, |
|
|
|
image:'./../../../assets/images/fail.png', |
|
|
|
duration: 2000, |
|
|
|
mask: false |
|
|
|
}); |
|
|
|
} else if (err.code == "3001") { |
|
|
|
wx.showToast({ |
|
|
|
title: "领取达到上限", |
|
|
|
image:imgurl.fail.url, |
|
|
|
image:'./../../../assets/images/fail.png', |
|
|
|
duration: 2000, |
|
|
|
mask: false |
|
|
|
}); |
|
|
|
} else if (err.code == "3002") { |
|
|
|
wx.showToast({ |
|
|
|
title: "订单失败", |
|
|
|
image:imgurl.fail.url, |
|
|
|
image:'./../../../assets/images/fail.png', |
|
|
|
duration: 2000, |
|
|
|
mask: false |
|
|
|
}); |
|
|
|
} else if (err.code == "3003") { |
|
|
|
wx.showToast({ |
|
|
|
title: "订单不存在", |
|
|
|
image:imgurl.fail.url, |
|
|
|
image:'./../../../assets/images/fail.png', |
|
|
|
duration: 2000, |
|
|
|
mask: false |
|
|
|
}); |
|
|
|
} else if (err.code == "3004") { |
|
|
|
wx.showToast({ |
|
|
|
title: "订单不存在", |
|
|
|
image:imgurl.fail.url, |
|
|
|
image:'./../../../assets/images/fail.png', |
|
|
|
duration: 2000, |
|
|
|
mask: false |
|
|
|
}); |
|
|
|
} else if (err.code == "4003") { |
|
|
|
wx.showToast({ |
|
|
|
title: "卡券已作废", |
|
|
|
image:imgurl.fail.url, |
|
|
|
image:'./../../../assets/images/fail.png', |
|
|
|
duration: 2000, |
|
|
|
mask: false |
|
|
|
}); |
|
|
@@ -475,10 +480,17 @@ Page({ |
|
|
|
/** |
|
|
|
* 用户支付成功以后跳转到券包列表 |
|
|
|
*/ |
|
|
|
wx.setStorage({ |
|
|
|
key: 'couponNum', |
|
|
|
data: "couponNum", |
|
|
|
}) |
|
|
|
if(that.data.cardType == 7){ |
|
|
|
wx.setStorage({ |
|
|
|
key: 'couponNum2', |
|
|
|
data: "couponNum2" |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
wx.setStorage({ |
|
|
|
key: 'couponNum', |
|
|
|
data: "couponNum" |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
fail: res => { |
|
|
@@ -506,10 +518,17 @@ Page({ |
|
|
|
} else { |
|
|
|
// 免费券 |
|
|
|
that.payOrderUpdate(orderId, "0", 1, '', 'free'); |
|
|
|
wx.setStorage({ |
|
|
|
key: 'couponNum', |
|
|
|
data: "couponNum" |
|
|
|
}) |
|
|
|
if(that.data.cardType == 7){ |
|
|
|
wx.setStorage({ |
|
|
|
key: 'couponNum2', |
|
|
|
data: "couponNum2" |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
wx.setStorage({ |
|
|
|
key: 'couponNum', |
|
|
|
data: "couponNum" |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|