From bd847bd02410aa1e2d121375c0052cfce6569bb4 Mon Sep 17 00:00:00 2001 From: meo <18801474720@163.com> Date: Sat, 29 Jun 2019 17:00:38 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=8B=BC=E5=9B=A2][=E4=BF=AE=E6=94=B9]:[?= =?UTF-8?q?=E6=8B=BC=E5=9B=A2=E5=BE=85=E6=94=AF=E4=BB=98=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/coupon/detail/index.js | 14 ++--- pages/spellGroup/mySpellGroup/index.js | 77 +++++++++++++++++++++--- pages/spellGroup/mySpellGroup/index.wxml | 4 +- 3 files changed, 79 insertions(+), 16 deletions(-) diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js index e18f774..64091f3 100644 --- a/pages/coupon/detail/index.js +++ b/pages/coupon/detail/index.js @@ -765,7 +765,7 @@ Page({ mask: false }); } else if (err.code == 3012) { - that.getUnPaidOrder(that.data.couponId, discount); + that.getUnPaidOrder(that.data.couponId); } else if (err.code == 11005) { /** * 将值传到用户手机号授权的页面 @@ -895,7 +895,7 @@ Page({ }) }, // 获得未支付的订单 - getUnPaidOrder(couponId, discount){ + getUnPaidOrder(couponId){ let that = this; Http.get({ url: config.api.getUnPaidOrder, @@ -903,10 +903,6 @@ Page({ couponId: couponId } }).then(res=>{ - /** - * discount 砍价订单 - * discount1 砍价按原价购买订单 - */ that.setData({ disOrderNumber: res.data.orderNumber, }) @@ -947,7 +943,11 @@ Page({ }) } }).catch(error=>{ - console.log(error) + wx.showToast({ + title: error.message, + icon: "none", + duration: 3000 + }) }) }, onShow() { diff --git a/pages/spellGroup/mySpellGroup/index.js b/pages/spellGroup/mySpellGroup/index.js index bca0159..684266d 100644 --- a/pages/spellGroup/mySpellGroup/index.js +++ b/pages/spellGroup/mySpellGroup/index.js @@ -30,7 +30,8 @@ Page({ showTime: true, limitCondition: "", minLimit: 0, - maxLimit: 0 + maxLimit: 0, + spellGroupOrder:false }, /** @@ -168,12 +169,73 @@ Page({ }, 1000) } }, + // 获得未支付的订单 + getUnPaidOrder(couponId) { + let that = this; + Http.get({ + url: config.api.getUnPaidOrder, + data: { + couponId: couponId + } + }).then(res => { + that.setData({ + disOrderNumber: res.data.orderNumber, + }) + + // 拼团订单 + if (res.data.payment/100 != Number(that.data.data.price)) { + that.setData({ + spellGroupOrder: true + }) + } else { + // 原价购买订单 + that.setData({ + spellGroupOrder: false + }) + } + if (that.data.spellGroupOrder) { + wx.showModal({ + title: '提示', + content: "您有未支付拼团订单,请先进行支付", + confirmText: "去支付", + success: function (res) { + if (res.confirm) { + wx.navigateTo({ + url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${that.data.disOrderNumber}`, + }) + } + } + }) + } else { + wx.showModal({ + title: '提示', + content: '您有未支付订单,请先进行支付', + confirmText: "去支付", + success: function (res) { + if (res.confirm) { + wx.navigateTo({ + url: `/pages/order/detail/index?orderId=${that.data.disOrderNumber}`, + }) + } + } + }) + } + }).catch(error => { + console.log(error) + wx.showToast({ + title: error.message, + icon:"none", + duration:3000 + }) + }) + }, /** * 发起拼团 */ - gotoSpell() { + gotoSpell(e) { this.setData({ - canSpell: false + canSpell: false, + formId: e.detail.formId }) this.orderFunc(0) }, @@ -411,10 +473,11 @@ Page({ mask: false }); } else if (err.code == 3012) { - wx.showToast({ - title: err.message, - icon: "none" - }) + // wx.showToast({ + // title: err.message, + // icon: "none" + // }) + that.getUnPaidOrder(that.data.data.couponId); } else if (err.code == 11005) { /** * 将值传到用户手机号授权的页面 diff --git a/pages/spellGroup/mySpellGroup/index.wxml b/pages/spellGroup/mySpellGroup/index.wxml index f73f7bf..2292445 100644 --- a/pages/spellGroup/mySpellGroup/index.wxml +++ b/pages/spellGroup/mySpellGroup/index.wxml @@ -90,8 +90,8 @@ - - + +