Commit 6423c593e05037fe3936dbd9235e33e8838cdeaf
1 parent
894306c7
update待支付提示
Showing
1 changed file
with
133 additions
and
97 deletions
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
@@ -3879,106 +3879,142 @@ Page({ | @@ -3879,106 +3879,142 @@ Page({ | ||
3879 | openSpecModel_pt: function (e) { | 3879 | openSpecModel_pt: function (e) { |
3880 | 3880 | ||
3881 | this.setData({ open_ind_store: 9, goodsInputNum: 1 }); | 3881 | this.setData({ open_ind_store: 9, goodsInputNum: 1 }); |
3882 | + // 判断是否有待支付订单 | ||
3883 | + var aid = this.data.group_id; | ||
3884 | + var switOn = true; | ||
3885 | + s.request.promiseGet('/api/weshop/prom/luckyOrder/page', { | ||
3886 | + data: { | ||
3887 | + store_id: os.stoid, | ||
3888 | + user_id: oo.user_id, | ||
3889 | + aid: aid, | ||
3890 | + pay_status: 0, // 未支付 | ||
3891 | + order_status: 0, // 待支付 | ||
3892 | + pageSize: 1, | ||
3893 | + page: 1 | ||
3894 | + } | ||
3895 | + }).then(res => { | ||
3896 | + if(res.data.code == 0){ | ||
3897 | + if (res.data.data.total > 0) { | ||
3898 | + // 待支付订单页面 | ||
3899 | + wx.showModal({ | ||
3900 | + title: "您已经购买了该商品待支付中", | ||
3901 | + success: function (a) { | ||
3902 | + if (a.confirm) { | ||
3903 | + switOn = false; | ||
3904 | + wx.navigateTo({ | ||
3905 | + url: "/pages/user/order_detail/order_detail?order_id=" + res.data.data.pageData[0]['order_id'] | ||
3906 | + }); | ||
3907 | + } | ||
3908 | + } | ||
3909 | + }); | ||
3910 | + } else { | ||
3911 | + //--先判断会员状态-- | ||
3912 | + var user_info = getApp().globalData.userInfo; | ||
3913 | + if (user_info == null || user_info.mobile == undefined || user_info.mobile == '' || user_info.mobile == null) { | ||
3914 | + wx.navigateTo({ | ||
3915 | + url: '/pages/togoin/togoin', | ||
3916 | + }) | ||
3917 | + return false; | ||
3918 | + }; | ||
3919 | + | ||
3920 | + var th = this; | ||
3921 | + var ind = parseInt(e.currentTarget.dataset.ind); | ||
3922 | + | ||
3923 | + console.log('当前ind========>>>>', ind); | ||
3924 | + | ||
3925 | + //ind == 1是普通购买 | ||
3926 | + if (ind == 1) { | ||
3927 | + //如果拼单的sku data是空的,就要先获取一下 | ||
3928 | + if (th.data.sku_g_pt) { | ||
3929 | + th.get_sto(1); | ||
3930 | + th.setData({ | ||
3931 | + is_normal: ind, | ||
3932 | + openSpecModal_pt: 1 | ||
3933 | + }); | ||
3934 | + } else { | ||
3935 | + th.get_sto(1); | ||
3936 | + th.get_sku(o.stoid, th.data.data, th.data.gid, 1, function () { | ||
3937 | + th.setData({ | ||
3938 | + is_normal: ind, | ||
3939 | + openSpecModal_pt: 1 | ||
3940 | + }); | ||
3941 | + }); | ||
3942 | + | ||
3943 | + th.setData({ | ||
3944 | + is_normal: ind, | ||
3945 | + openSpecModal_pt: 1 | ||
3946 | + }); | ||
3947 | + }; | ||
3948 | + th.check_is_youhui(th.data.gid, 1); | ||
3949 | + } else { | ||
3950 | + | ||
3951 | + // //拼单商品从这里进,先判断有没有买过商品, | ||
3952 | + // getApp().request.get("/api/weshop/order/page", { | ||
3953 | + // data: { | ||
3954 | + // // pt_prom_id: th.data.prom_act.id, | ||
3955 | + // user_id: oo.user_id, | ||
3956 | + // store_id: os.stoid, | ||
3957 | + // pageSize: 1, | ||
3958 | + // page: 1 | ||
3959 | + // }, | ||
3960 | + // success: function (e) { | ||
3961 | + // //--跳转到已经购买的情况-- | ||
3962 | + // if (e.data.data.pageData.length > 0) { | ||
3963 | + // var odr = e.data.data.pageData[0]; | ||
3964 | + // //还未支付 | ||
3965 | + // if (odr.pt_status == 0 && (odr.order_status == 1 || odr.order_status == 0)) { | ||
3966 | + // wx.showModal({ | ||
3967 | + // title: "您已经购买了该商品待支付中", | ||
3968 | + // success: function (a) { | ||
3969 | + // if (a.confirm) { | ||
3970 | + // wx.navigateTo({ | ||
3971 | + // url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id, | ||
3972 | + // }); | ||
3973 | + // } | ||
3974 | + // } | ||
3975 | + // }); | ||
3976 | + // } else if (odr.pt_status == 1 && odr.order_status == 1) { | ||
3977 | + | ||
3978 | + // if (this.data.is_go_to_team_show) return false; | ||
3979 | + // this.data.is_go_to_team_show = 1; | ||
3980 | + // wx.showLoading(); | ||
3981 | + | ||
3982 | + // /*--- | ||
3983 | + // wx.redirectTo({ | ||
3984 | + // url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn, | ||
3985 | + // });--*/ | ||
3986 | + // getApp().goto("/pages/team/team_success/team_success?ordersn=" + odr.order_sn); | ||
3987 | + | ||
3988 | + // } else { | ||
3989 | + // th.setData({ | ||
3990 | + // is_normal: ind, | ||
3991 | + // openSpecModal_pt: 1 | ||
3992 | + // }); | ||
3993 | + // } | ||
3994 | + | ||
3995 | + // } else { | ||
3996 | + // th.setData({ | ||
3997 | + // is_normal: ind, | ||
3998 | + // openSpecModal_pt: 1 | ||
3999 | + // }); | ||
4000 | + // } | ||
4001 | + // } | ||
4002 | + // }); | ||
4003 | + th.get_sto(1); | ||
4004 | + th.setData({ | ||
4005 | + is_normal: 0, | ||
4006 | + openSpecModal_pt: 1 | ||
4007 | + }); | ||
4008 | + | ||
4009 | + } | ||
4010 | + } | ||
4011 | + | ||
4012 | + } | ||
4013 | + }); | ||
4014 | + | ||
3882 | 4015 | ||
3883 | - //--先判断会员状态-- | ||
3884 | - var user_info = getApp().globalData.userInfo; | ||
3885 | - if (user_info == null || user_info.mobile == undefined || user_info.mobile == '' || user_info.mobile == null) { | ||
3886 | - wx.navigateTo({ | ||
3887 | - url: '/pages/togoin/togoin', | ||
3888 | - }) | ||
3889 | - return false; | ||
3890 | - }; | ||
3891 | 4016 | ||
3892 | - var th = this; | ||
3893 | - var ind = parseInt(e.currentTarget.dataset.ind); | ||
3894 | - | ||
3895 | - console.log('当前ind========>>>>', ind); | ||
3896 | - | ||
3897 | - //ind == 1是普通购买 | ||
3898 | - if (ind == 1) { | ||
3899 | - //如果拼单的sku data是空的,就要先获取一下 | ||
3900 | - if (th.data.sku_g_pt) { | ||
3901 | - th.get_sto(1); | ||
3902 | - th.setData({ | ||
3903 | - is_normal: ind, | ||
3904 | - openSpecModal_pt: 1 | ||
3905 | - }); | ||
3906 | - } else { | ||
3907 | - th.get_sto(1); | ||
3908 | - th.get_sku(o.stoid, th.data.data, th.data.gid, 1, function () { | ||
3909 | - th.setData({ | ||
3910 | - is_normal: ind, | ||
3911 | - openSpecModal_pt: 1 | ||
3912 | - }); | ||
3913 | - }); | ||
3914 | - | ||
3915 | - th.setData({ | ||
3916 | - is_normal: ind, | ||
3917 | - openSpecModal_pt: 1 | ||
3918 | - }); | ||
3919 | - }; | ||
3920 | - th.check_is_youhui(th.data.gid, 1); | ||
3921 | - } else { | ||
3922 | 4017 | ||
3923 | - // //拼单商品从这里进,先判断有没有买过商品, | ||
3924 | - // getApp().request.get("/api/weshop/order/page", { | ||
3925 | - // data: { | ||
3926 | - // // pt_prom_id: th.data.prom_act.id, | ||
3927 | - // user_id: oo.user_id, | ||
3928 | - // store_id: os.stoid, | ||
3929 | - // pageSize: 1, | ||
3930 | - // page: 1 | ||
3931 | - // }, | ||
3932 | - // success: function (e) { | ||
3933 | - // //--跳转到已经购买的情况-- | ||
3934 | - // if (e.data.data.pageData.length > 0) { | ||
3935 | - // var odr = e.data.data.pageData[0]; | ||
3936 | - // //还未支付 | ||
3937 | - // if (odr.pt_status == 0 && (odr.order_status == 1 || odr.order_status == 0)) { | ||
3938 | - // wx.showModal({ | ||
3939 | - // title: "您已经购买了该商品待支付中", | ||
3940 | - // success: function (a) { | ||
3941 | - // if (a.confirm) { | ||
3942 | - // wx.navigateTo({ | ||
3943 | - // url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id, | ||
3944 | - // }); | ||
3945 | - // } | ||
3946 | - // } | ||
3947 | - // }); | ||
3948 | - // } else if (odr.pt_status == 1 && odr.order_status == 1) { | ||
3949 | - | ||
3950 | - // if (this.data.is_go_to_team_show) return false; | ||
3951 | - // this.data.is_go_to_team_show = 1; | ||
3952 | - // wx.showLoading(); | ||
3953 | - | ||
3954 | - // /*--- | ||
3955 | - // wx.redirectTo({ | ||
3956 | - // url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn, | ||
3957 | - // });--*/ | ||
3958 | - // getApp().goto("/pages/team/team_success/team_success?ordersn=" + odr.order_sn); | ||
3959 | - | ||
3960 | - // } else { | ||
3961 | - // th.setData({ | ||
3962 | - // is_normal: ind, | ||
3963 | - // openSpecModal_pt: 1 | ||
3964 | - // }); | ||
3965 | - // } | ||
3966 | - | ||
3967 | - // } else { | ||
3968 | - // th.setData({ | ||
3969 | - // is_normal: ind, | ||
3970 | - // openSpecModal_pt: 1 | ||
3971 | - // }); | ||
3972 | - // } | ||
3973 | - // } | ||
3974 | - // }); | ||
3975 | - th.get_sto(1); | ||
3976 | - th.setData({ | ||
3977 | - is_normal: 0, | ||
3978 | - openSpecModal_pt: 1 | ||
3979 | - }); | ||
3980 | - | ||
3981 | - } | ||
3982 | }, | 4018 | }, |
3983 | 4019 | ||
3984 | //-----------------拼单生成方法--------------------- | 4020 | //-----------------拼单生成方法--------------------- |