ソースを参照

支付错误提示添加

tags/2.2.4
Stormeye.Wu 6年前
コミット
3e329afc35
1個のファイルの変更35行の追加12行の削除
  1. +35
    -12
      pages/coupon/detail/index.js

+ 35
- 12
pages/coupon/detail/index.js ファイルの表示

@@ -203,8 +203,24 @@ Page({
console.log(err); console.log(err);
console.log(that.data.couponChannelId); console.log(that.data.couponChannelId);
console.log(that.data.couponId); console.log(that.data.couponId);
console.log("我即将要跳转到用户手机号授权的页面");
if (err.code == "3000") {
//console.log("我即将要跳转到用户手机号授权的页面");
if (err.code == "2011") {
wx.showToast({
title: "商户信息没找到",
image: "./../../../assets/img/fail.png",
duration: 2000,
mask: false
});
}
else if (err.code == "2013") {
wx.showToast({
title: "商户信息禁用",
image: "./../../../assets/img/fail.png",
duration: 2000,
mask: false
});
}
else if (err.code == "3000") {
wx.showToast({ wx.showToast({
title: "库存不足", title: "库存不足",
image: "./../../../assets/img/fail.png", image: "./../../../assets/img/fail.png",
@@ -212,7 +228,7 @@ Page({
mask: false mask: false
}); });
} }
if (err.code == "3001") {
else if (err.code == "3001") {
wx.showToast({ wx.showToast({
title: "领取达到上限", title: "领取达到上限",
image: "./../../../assets/img/fail.png", image: "./../../../assets/img/fail.png",
@@ -220,7 +236,7 @@ Page({
mask: false mask: false
}); });
} }
if (err.code == "3002") {
else if (err.code == "3002") {
wx.showToast({ wx.showToast({
title: "订单失败", title: "订单失败",
image: "./../../../assets/img/fail.png", image: "./../../../assets/img/fail.png",
@@ -228,7 +244,7 @@ Page({
mask: false mask: false
}); });
} }
if (err.code == "3003") {
else if (err.code == "3003") {
wx.showToast({ wx.showToast({
title: "订单不存在", title: "订单不存在",
image: "./../../../assets/img/fail.png", image: "./../../../assets/img/fail.png",
@@ -236,7 +252,7 @@ Page({
mask: false mask: false
}); });
} }
if (err.code == "3004") {
else if (err.code == "3004") {
wx.showToast({ wx.showToast({
title: "订单不存在", title: "订单不存在",
image: "./../../../assets/img/fail.png", image: "./../../../assets/img/fail.png",
@@ -245,7 +261,7 @@ Page({
}); });
} }


if (err.code == "4003") {
else if (err.code == "4003") {
wx.showToast({ wx.showToast({
title: "卡券已作废", title: "卡券已作废",
image: "./../../../assets/img/fail.png", image: "./../../../assets/img/fail.png",
@@ -254,7 +270,7 @@ Page({
}); });
} }


if (err.code == 11005) {
else if (err.code == 11005) {
// 用户手机未授权 // 用户手机未授权
/** /**
* 将值传到用户手机号授权的页面 * 将值传到用户手机号授权的页面
@@ -267,7 +283,7 @@ Page({
that.data.couponId that.data.couponId
}); });
} }
if (err.code == 11006) {
else if (err.code == 11006) {
// 用户手机已加密 // 用户手机已加密
wx.redirectTo({ wx.redirectTo({
url: "/pages/phoneinput/phoneinput?couponChannelId=" + url: "/pages/phoneinput/phoneinput?couponChannelId=" +
@@ -275,13 +291,20 @@ Page({
"&couponId=" + "&couponId=" +
that.data.couponId that.data.couponId
}); });
} else {
wx.showToast({
title: err.message,
image: "./../../../assets/img/fail.png",
duration: 2000,
mask: false
});
} }
}) })
.then(res => { .then(res => {
console.log(res); console.log(res);
console.log("点击领取卡券一直在loading"); console.log("点击领取卡券一直在loading");
if (res != "undefined") {
console.log(res);
if (typeof (res) != "undefined") {
console.log("", res);
let orderId = "" + res.data.id; let orderId = "" + res.data.id;
that.setData({ that.setData({
orderId: orderId orderId: orderId
@@ -424,7 +447,7 @@ Page({
} }
}) })
.catch(err => { .catch(err => {
console.log(err);
console.log("ERR", err);
}); });
} }
} }

読み込み中…
キャンセル
保存