Commit 709f058a33036f02f5ef5b1671ba6e033ac8b9f7
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev
Showing
1 changed file
with
31 additions
and
1 deletions
packageA/pages/quan_pro/quan_pro.js
| ... | ... | @@ -77,6 +77,7 @@ Page({ |
| 77 | 77 | var item=this.data.q_data; |
| 78 | 78 | var cid = this.data.q_data.id; |
| 79 | 79 | var th=this; |
| 80 | + var good = new Array(); //单品且是免费领取专门使用 | |
| 80 | 81 | //--先判断会员状态-- |
| 81 | 82 | var user_info = getApp().globalData.userInfo; |
| 82 | 83 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { |
| ... | ... | @@ -103,6 +104,19 @@ Page({ |
| 103 | 104 | 'store_id': os.stoid, |
| 104 | 105 | 'type': 5 |
| 105 | 106 | }; |
| 107 | + if (item.useobjecttype == 20 && item.type == 1) { | |
| 108 | + getApp().request.get('/api/weshop/goods/list', { | |
| 109 | + data: { | |
| 110 | + store_id: os.stoid, | |
| 111 | + erpwareid: item.useobjectid, | |
| 112 | + }, | |
| 113 | + success(res) { | |
| 114 | + if (ut.ajax_ok2(res)) { | |
| 115 | + good = res.data.data; | |
| 116 | + } | |
| 117 | + } | |
| 118 | + }) | |
| 119 | + } | |
| 106 | 120 | |
| 107 | 121 | //-- 分享导购ID -- |
| 108 | 122 | if(getApp().globalData.guide_id){ |
| ... | ... | @@ -118,8 +132,24 @@ Page({ |
| 118 | 132 | if (res.data.code == 0) { |
| 119 | 133 | item.lqnum++; |
| 120 | 134 | var text3="q_data"; |
| 121 | - var obj = {};obj[text3] = item;obj['show_success']=1; | |
| 135 | + var obj = {};obj[text3] = item; | |
| 122 | 136 | th.setData(obj); |
| 137 | + if (good.length > 0) { | |
| 138 | + wx.showToast({ | |
| 139 | + title: '领取成功', | |
| 140 | + success() { | |
| 141 | + let item = good[0]; | |
| 142 | + let url = `/pages/goods/goodsInfo/goodsInfo?goods_id=${item.goods_id}&prom_type=${item.prom_type}&prom_id=${item.prom_id}` | |
| 143 | + setTimeout(()=>{ | |
| 144 | + getApp().goto(url) | |
| 145 | + },500) | |
| 146 | + } | |
| 147 | + }) | |
| 148 | + } else { | |
| 149 | + th.setData({ | |
| 150 | + show_success: 1, | |
| 151 | + }) | |
| 152 | + } | |
| 123 | 153 | } else { |
| 124 | 154 | app.confirmBox(res.data.msg); |
| 125 | 155 | } | ... | ... |