Commit e153dbf5345efd25028c77dfc985d57752c6392b
1 parent
0494e613
预售商品购买
Showing
3 changed files
with
45 additions
and
1 deletions
packageC/pages/presell/cardInfo/goodsInfo.js
packageC/pages/presell/cart/cart2.js
| ... | ... | @@ -504,7 +504,7 @@ Page({ |
| 504 | 504 | } |
| 505 | 505 | |
| 506 | 506 | //如果是服务卡是时候 |
| 507 | - if(act.goods_type==1){ | |
| 507 | + if(gg.fwk){ | |
| 508 | 508 | th.get_card_detail(act, prelist,gg); |
| 509 | 509 | } |
| 510 | 510 | //如果是商品的时候 |
| ... | ... | @@ -540,6 +540,7 @@ Page({ |
| 540 | 540 | t.data.data['buynum'] = th.data.gg.goods_num; |
| 541 | 541 | t.data.data.prom_id=th.data.gg.prom_id; |
| 542 | 542 | t.data.data.prom_type=8; |
| 543 | + t.data.data.goods_name=t.data.data.serviceName; | |
| 543 | 544 | |
| 544 | 545 | |
| 545 | 546 | //这个位置要拿活动的预售价 | ... | ... |
packageC/pages/presell/cart/cart2_pre.js
| ... | ... | @@ -208,6 +208,48 @@ Page({ |
| 208 | 208 | wx.showToast({ title: "未找到商品", icon: 'none', duration: 3000 }); |
| 209 | 209 | return false; |
| 210 | 210 | } |
| 211 | + | |
| 212 | + if(gg.fwk){ | |
| 213 | + th.get_card_detail(prelist,act,gg); | |
| 214 | + }else{ | |
| 215 | + th.get_goods_detail(prelist,act,gg); | |
| 216 | + } | |
| 217 | + | |
| 218 | + }, | |
| 219 | + | |
| 220 | + //获取服务卡项的详情 | |
| 221 | + get_card_detail(prelist,act,gg){ | |
| 222 | + var th=this; | |
| 223 | + //--------如果goods_id一样,就是要立即购买----- | |
| 224 | + var cd_url="/api/weshop/serviceCard/get/" + os.stoid + "/" + gg.goods_id | |
| 225 | + //-- 调用商品 -- | |
| 226 | + a.get(cd_url, { | |
| 227 | + success: function (t) { | |
| 228 | + var gd = t.data.data; | |
| 229 | + if (!gd) return false; | |
| 230 | + | |
| 231 | + t.data.data.original_img = os.imghost + t.data.data.imgUrl; | |
| 232 | + t.data.data['buynum'] = gg.goods_num; | |
| 233 | + t.data.data.prom_type=8; | |
| 234 | + t.data.data.prom_id=gg.prom_id; | |
| 235 | + t.data.data.goods_name=t.data.data.serviceName; | |
| 236 | + | |
| 237 | + var distr_t = 0, et = 1; | |
| 238 | + | |
| 239 | + t.data.data.shop_price = prelist.presell_money; | |
| 240 | + th.setData({ | |
| 241 | + bn_goods: t.data.data, bn_pickname: gg.pick_name, prelist: prelist, act: act, | |
| 242 | + bn_pick: gg.pick_id, bn_t_exp_t: distr_t, bn_exp_type: et | |
| 243 | + }); | |
| 244 | + //计算价格 | |
| 245 | + th.calculatePrice2(); | |
| 246 | + } | |
| 247 | + }); | |
| 248 | + }, | |
| 249 | + | |
| 250 | + //获取商品的详情 | |
| 251 | + get_goods_detail(prelist,act,gg){ | |
| 252 | + var th=this; | |
| 211 | 253 | //-- 调用商品 -- |
| 212 | 254 | a.get("/api/weshop/goods/get/" + os.stoid + "/" + gg.goods_id, { |
| 213 | 255 | success: function (t) { | ... | ... |