From 6423c593e05037fe3936dbd9235e33e8838cdeaf Mon Sep 17 00:00:00 2001 From: banche Date: Tue, 7 Dec 2021 11:29:08 +0800 Subject: [PATCH] update待支付提示 --- packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js | 230 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------- 1 file changed, 133 insertions(+), 97 deletions(-) diff --git a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js index 1c70c57..814fa70 100644 --- a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js +++ b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js @@ -3879,106 +3879,142 @@ Page({ openSpecModel_pt: function (e) { this.setData({ open_ind_store: 9, goodsInputNum: 1 }); + // 判断是否有待支付订单 + var aid = this.data.group_id; + var switOn = true; + s.request.promiseGet('/api/weshop/prom/luckyOrder/page', { + data: { + store_id: os.stoid, + user_id: oo.user_id, + aid: aid, + pay_status: 0, // 未支付 + order_status: 0, // 待支付 + pageSize: 1, + page: 1 + } + }).then(res => { + if(res.data.code == 0){ + if (res.data.data.total > 0) { + // 待支付订单页面 + wx.showModal({ + title: "您已经购买了该商品待支付中", + success: function (a) { + if (a.confirm) { + switOn = false; + wx.navigateTo({ + url: "/pages/user/order_detail/order_detail?order_id=" + res.data.data.pageData[0]['order_id'] + }); + } + } + }); + } else { + //--先判断会员状态-- + var user_info = getApp().globalData.userInfo; + if (user_info == null || user_info.mobile == undefined || user_info.mobile == '' || user_info.mobile == null) { + wx.navigateTo({ + url: '/pages/togoin/togoin', + }) + return false; + }; + + var th = this; + var ind = parseInt(e.currentTarget.dataset.ind); + + console.log('当前ind========>>>>', ind); + + //ind == 1是普通购买 + if (ind == 1) { + //如果拼单的sku data是空的,就要先获取一下 + if (th.data.sku_g_pt) { + th.get_sto(1); + th.setData({ + is_normal: ind, + openSpecModal_pt: 1 + }); + } else { + th.get_sto(1); + th.get_sku(o.stoid, th.data.data, th.data.gid, 1, function () { + th.setData({ + is_normal: ind, + openSpecModal_pt: 1 + }); + }); + + th.setData({ + is_normal: ind, + openSpecModal_pt: 1 + }); + }; + th.check_is_youhui(th.data.gid, 1); + } else { + + // //拼单商品从这里进,先判断有没有买过商品, + // getApp().request.get("/api/weshop/order/page", { + // data: { + // // pt_prom_id: th.data.prom_act.id, + // user_id: oo.user_id, + // store_id: os.stoid, + // pageSize: 1, + // page: 1 + // }, + // success: function (e) { + // //--跳转到已经购买的情况-- + // if (e.data.data.pageData.length > 0) { + // var odr = e.data.data.pageData[0]; + // //还未支付 + // if (odr.pt_status == 0 && (odr.order_status == 1 || odr.order_status == 0)) { + // wx.showModal({ + // title: "您已经购买了该商品待支付中", + // success: function (a) { + // if (a.confirm) { + // wx.navigateTo({ + // url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id, + // }); + // } + // } + // }); + // } else if (odr.pt_status == 1 && odr.order_status == 1) { + + // if (this.data.is_go_to_team_show) return false; + // this.data.is_go_to_team_show = 1; + // wx.showLoading(); + + // /*--- + // wx.redirectTo({ + // url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn, + // });--*/ + // getApp().goto("/pages/team/team_success/team_success?ordersn=" + odr.order_sn); + + // } else { + // th.setData({ + // is_normal: ind, + // openSpecModal_pt: 1 + // }); + // } + + // } else { + // th.setData({ + // is_normal: ind, + // openSpecModal_pt: 1 + // }); + // } + // } + // }); + th.get_sto(1); + th.setData({ + is_normal: 0, + openSpecModal_pt: 1 + }); + + } + } + + } + }); + - //--先判断会员状态-- - var user_info = getApp().globalData.userInfo; - if (user_info == null || user_info.mobile == undefined || user_info.mobile == '' || user_info.mobile == null) { - wx.navigateTo({ - url: '/pages/togoin/togoin', - }) - return false; - }; - var th = this; - var ind = parseInt(e.currentTarget.dataset.ind); - - console.log('当前ind========>>>>', ind); - - //ind == 1是普通购买 - if (ind == 1) { - //如果拼单的sku data是空的,就要先获取一下 - if (th.data.sku_g_pt) { - th.get_sto(1); - th.setData({ - is_normal: ind, - openSpecModal_pt: 1 - }); - } else { - th.get_sto(1); - th.get_sku(o.stoid, th.data.data, th.data.gid, 1, function () { - th.setData({ - is_normal: ind, - openSpecModal_pt: 1 - }); - }); - - th.setData({ - is_normal: ind, - openSpecModal_pt: 1 - }); - }; - th.check_is_youhui(th.data.gid, 1); - } else { - // //拼单商品从这里进,先判断有没有买过商品, - // getApp().request.get("/api/weshop/order/page", { - // data: { - // // pt_prom_id: th.data.prom_act.id, - // user_id: oo.user_id, - // store_id: os.stoid, - // pageSize: 1, - // page: 1 - // }, - // success: function (e) { - // //--跳转到已经购买的情况-- - // if (e.data.data.pageData.length > 0) { - // var odr = e.data.data.pageData[0]; - // //还未支付 - // if (odr.pt_status == 0 && (odr.order_status == 1 || odr.order_status == 0)) { - // wx.showModal({ - // title: "您已经购买了该商品待支付中", - // success: function (a) { - // if (a.confirm) { - // wx.navigateTo({ - // url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id, - // }); - // } - // } - // }); - // } else if (odr.pt_status == 1 && odr.order_status == 1) { - - // if (this.data.is_go_to_team_show) return false; - // this.data.is_go_to_team_show = 1; - // wx.showLoading(); - - // /*--- - // wx.redirectTo({ - // url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn, - // });--*/ - // getApp().goto("/pages/team/team_success/team_success?ordersn=" + odr.order_sn); - - // } else { - // th.setData({ - // is_normal: ind, - // openSpecModal_pt: 1 - // }); - // } - - // } else { - // th.setData({ - // is_normal: ind, - // openSpecModal_pt: 1 - // }); - // } - // } - // }); - th.get_sto(1); - th.setData({ - is_normal: 0, - openSpecModal_pt: 1 - }); - - } }, //-----------------拼单生成方法--------------------- -- libgit2 0.21.4