Commit d0b39a9a9b7d75fc0e72f50a83bc568a46a18800
1 parent
8f42108a
服务卡项的点击跳转
Showing
4 changed files
with
75 additions
and
11 deletions
packageA/pages/cardList/cardList.js
| ... | ... | @@ -216,10 +216,43 @@ Page({ |
| 216 | 216 | }; |
| 217 | 217 | }, |
| 218 | 218 | |
| 219 | - go_goods: function(e) { | |
| 220 | - var gid = e.currentTarget.dataset.gid; | |
| 221 | - var url = "/packageA/pages/goodsInfo/goodsInfo?goods_id=" + gid; | |
| 222 | - app.goto(url); | |
| 219 | + go_goods:async function(e) { | |
| 220 | + var gid = e.currentTarget.dataset.gid; | |
| 221 | + var rurl = '/api/weshop/activitylist/listGoodActInfo2New'; | |
| 222 | + var req_d = { | |
| 223 | + "store_id": os.stoid, | |
| 224 | + "goods_id": gid, | |
| 225 | + "user_id": getApp().globalData.user_id, | |
| 226 | + "goods_type":1 | |
| 227 | + } | |
| 228 | + var res= await getApp().request.promiseGet(rurl, {data: req_d}); | |
| 229 | + | |
| 230 | + var url = "/packageA/pages/goodsInfo/goodsInfo?goods_id=" + gid; | |
| 231 | + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) { | |
| 232 | + var arr = res.data.data; | |
| 233 | + let times = new Date().getTime(); | |
| 234 | + //-- 预热也要计算 -- | |
| 235 | + var arr2 = arr.filter(function (e) { | |
| 236 | + return e.s_time < ut.gettimestamp() || (e.warm_uptime && e.warm_uptime < ut.gettimestamp()) | |
| 237 | + }) | |
| 238 | + if(arr2.length==1) { | |
| 239 | + switch(arr2[0].prom_type){ | |
| 240 | + case 1: | |
| 241 | + url+="&prom_type=1&prom_id="+arr[0].act_id; | |
| 242 | + break; | |
| 243 | + case 6: | |
| 244 | + url = `/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo?goods_id=${gid}&prom_type=${arr2[0].prom_type}&prom_id=${arr[0].act_id}`; | |
| 245 | + break; | |
| 246 | + case 8: | |
| 247 | + url = `/packageC/pages/presell/cardInfo/goodsInfo?goods_id=${gid}&prom_id=${arr[0].act_id}`; | |
| 248 | + break; | |
| 249 | + } | |
| 250 | + } | |
| 251 | + | |
| 252 | + } | |
| 253 | + | |
| 254 | + | |
| 255 | + app.goto(url); | |
| 223 | 256 | }, |
| 224 | 257 | |
| 225 | 258 | //图片失败,默认图片 | ... | ... |
packageA/pages/details_serviceCard/details_serviceCard.js
| ... | ... | @@ -237,9 +237,44 @@ Page({ |
| 237 | 237 | |
| 238 | 238 | |
| 239 | 239 | // 查看商品详情 |
| 240 | - viewDetails(e) { | |
| 240 | + async viewDetails(e) { | |
| 241 | 241 | let goods_id = e.currentTarget.dataset.gid; |
| 242 | 242 | let url = '/packageA/pages/goodsInfo/goodsInfo?goods_id=' + goods_id; |
| 243 | + | |
| 244 | + var rurl = '/api/weshop/activitylist/listGoodActInfo2New'; | |
| 245 | + var req_d = { | |
| 246 | + "store_id": os.stoid, | |
| 247 | + "goods_id": goods_id, | |
| 248 | + "user_id": getApp().globalData.user_id, | |
| 249 | + "goods_type": 1, | |
| 250 | + } | |
| 251 | + var res= await getApp().request.promiseGet(rurl, {data: req_d}); | |
| 252 | + | |
| 253 | + | |
| 254 | + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) { | |
| 255 | + var arr = res.data.data; | |
| 256 | + let times = new Date().getTime(); | |
| 257 | + //-- 预热也要计算 -- | |
| 258 | + var arr2 = arr.filter(function (e) { | |
| 259 | + return e.s_time < ut.gettimestamp() || (e.warm_uptime && e.warm_uptime < ut.gettimestamp()) | |
| 260 | + }) | |
| 261 | + if(arr2.length==1) { | |
| 262 | + switch(arr2[0].prom_type){ | |
| 263 | + case 1: | |
| 264 | + url+="&prom_type=1&prom_id="+arr[0].act_id; | |
| 265 | + break; | |
| 266 | + case 6: | |
| 267 | + url = `/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo?goods_id=${goods_id}&prom_type=${arr2[0].prom_type}&prom_id=${arr[0].act_id}`; | |
| 268 | + break; | |
| 269 | + case 8: | |
| 270 | + url = `/packageC/pages/presell/cardInfo/goodsInfo?goods_id=${goods_id}&prom_id=${arr[0].act_id}`; | |
| 271 | + break; | |
| 272 | + } | |
| 273 | + } | |
| 274 | + | |
| 275 | + } | |
| 276 | + | |
| 277 | + | |
| 243 | 278 | app.goto(url); |
| 244 | 279 | }, |
| 245 | 280 | ... | ... |
packageC/pages/presell/cardInfo/goodsInfo.js
| ... | ... | @@ -237,11 +237,6 @@ Page({ |
| 237 | 237 | |
| 238 | 238 | var share_openid= t.share_openid; |
| 239 | 239 | |
| 240 | - if(pre_id || presell_id){ | |
| 241 | - if(!presell_id) presell_id=pre_id; | |
| 242 | - if(!pre_id) pre_id=presell_id; | |
| 243 | - } | |
| 244 | - | |
| 245 | 240 | //检查测肤 |
| 246 | 241 | getApp().check_skin_face(t,1,gid); |
| 247 | 242 | |
| ... | ... | @@ -3437,7 +3432,7 @@ Page({ |
| 3437 | 3432 | |
| 3438 | 3433 | |
| 3439 | 3434 | getApp().request.get("/api/weshop/recharge/rechargePresell/countBuyGoodsSum", { |
| 3440 | - data: { store_id: os.stoid, user_id: user_id, goods_id: th.data.options.goods_id, prom_id: th.data.options.prom_id }, | |
| 3435 | + data: { store_id: os.stoid, user_id: user_id, goods_id: th.data.options.goods_id, prom_id: th.data.presellForm.id }, | |
| 3441 | 3436 | success: function (e) { |
| 3442 | 3437 | if (e.data.code == 0) { |
| 3443 | 3438 | ... | ... |
packageC/pages/presell/cart/cart2_pre.js