Commit 1037a9aa2c6e468e98cd9e4c8c5659edf887188a
1 parent
879a397e
商品多规格的优化
Showing
4 changed files
with
25 additions
and
20 deletions
pages/goods/goodsInfo/buy_com_pop.wxml
@@ -72,7 +72,7 @@ | @@ -72,7 +72,7 @@ | ||
72 | <view class="xc-goods-attribute"> | 72 | <view class="xc-goods-attribute"> |
73 | <view hidden="{{ismend==1}}" class="spec-name">商品规格</view> | 73 | <view hidden="{{ismend==1}}" class="spec-name">商品规格</view> |
74 | <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;"> | 74 | <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;"> |
75 | - <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-nor="1" | 75 | + <view class="spec_bt {{sele_g.goods_id==item.goods_id?'act':''}}" bindtap="sele_spec" data-nor="1" |
76 | data-gid='{{item.goods_id}}' wx:for="{{sku_g_pt}}" wx:key="sku_g"> | 76 | data-gid='{{item.goods_id}}' wx:for="{{sku_g_pt}}" wx:key="sku_g"> |
77 | {{item.gg}} | 77 | {{item.gg}} |
78 | </view> | 78 | </view> |
pages/goods/goodsInfo/buy_pt.wxml
@@ -85,14 +85,14 @@ | @@ -85,14 +85,14 @@ | ||
85 | <view hidden="{{ismend==1}}" class="spec-name">商品规格</view> | 85 | <view hidden="{{ismend==1}}" class="spec-name">商品规格</view> |
86 | <block wx:if="{{is_normal==0}}"> | 86 | <block wx:if="{{is_normal==0}}"> |
87 | <view hidden="{{ismend==1}}" class="flex"> | 87 | <view hidden="{{ismend==1}}" class="flex"> |
88 | - <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">{{item.gg}} | 88 | + <view class="spec_bt {{sele_g.goods_id==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">{{item.gg}} |
89 | </view> | 89 | </view> |
90 | </view> | 90 | </view> |
91 | </block> | 91 | </block> |
92 | 92 | ||
93 | <block wx:else> | 93 | <block wx:else> |
94 | <view hidden="{{ismend==1}}" class="flex"> | 94 | <view hidden="{{ismend==1}}" class="flex"> |
95 | - <view class="spec_bt {{sele_g.goods_id==item.goods_id?'act':''}}" | 95 | + <view class="spec_bt {{sele_g.goods_id==item.goods_id?'act':''}}" |
96 | bindtap="sele_spec" data-nor="1" data-gid='{{item.goods_id}}' wx:for="{{sku_g_pt}}" wx:key="sku_g">{{item.gg}}</view> | 96 | bindtap="sele_spec" data-nor="1" data-gid='{{item.goods_id}}' wx:for="{{sku_g_pt}}" wx:key="sku_g">{{item.gg}}</view> |
97 | </view> | 97 | </view> |
98 | </block> | 98 | </block> |
pages/goods/goodsInfo/goodsInfo.js
@@ -285,6 +285,9 @@ Page({ | @@ -285,6 +285,9 @@ Page({ | ||
285 | istop: 0, //是否置顶风格为1 | 285 | istop: 0, //是否置顶风格为1 |
286 | searchbox_transparent: 1, | 286 | searchbox_transparent: 1, |
287 | template_id:[],//订阅消息id | 287 | template_id:[],//订阅消息id |
288 | + | ||
289 | + front_pick:null, //商品详情页面的默认门店 | ||
290 | + | ||
288 | }, | 291 | }, |
289 | 292 | ||
290 | //------初始化加载---------- | 293 | //------初始化加载---------- |
@@ -1192,6 +1195,7 @@ Page({ | @@ -1192,6 +1195,7 @@ Page({ | ||
1192 | ee.setData({ | 1195 | ee.setData({ |
1193 | data: t.data.data, | 1196 | data: t.data.data, |
1194 | sele_g: t.data.data, | 1197 | sele_g: t.data.data, |
1198 | + front_g:t.data.data, | ||
1195 | userInfo: getApp().globalData.userInfo | 1199 | userInfo: getApp().globalData.userInfo |
1196 | }); | 1200 | }); |
1197 | 1201 | ||
@@ -2720,7 +2724,8 @@ Page({ | @@ -2720,7 +2724,8 @@ Page({ | ||
2720 | 2724 | ||
2721 | this.setData({ | 2725 | this.setData({ |
2722 | openSpecModal: !1, | 2726 | openSpecModal: !1, |
2723 | - openSpecModal_pt: !1 | 2727 | + openSpecModal_pt: !1, |
2728 | + openSpecModal_flash_normal: !1 | ||
2724 | }); | 2729 | }); |
2725 | }, | 2730 | }, |
2726 | 2731 | ||
@@ -3466,8 +3471,7 @@ Page({ | @@ -3466,8 +3471,7 @@ Page({ | ||
3466 | item['disc'] = txt; | 3471 | item['disc'] = txt; |
3467 | if (item) this.setData({ | 3472 | if (item) this.setData({ |
3468 | sele_g: item, | 3473 | sele_g: item, |
3469 | - gid: gid, | ||
3470 | - data: item, | 3474 | + //data: item, |
3471 | }); | 3475 | }); |
3472 | 3476 | ||
3473 | 3477 |
pages/goods/goodsInfo/goodsInfo.wxml
@@ -453,11 +453,11 @@ | @@ -453,11 +453,11 @@ | ||
453 | 453 | ||
454 | <!-- 秒杀的活动名称 --> | 454 | <!-- 秒杀的活动名称 --> |
455 | <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0 && prom_type!=4 && prom_type!=2}}"> | 455 | <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0 && prom_type!=4 && prom_type!=2}}"> |
456 | - {{sele_g.goods_name}} | 456 | + {{front_g.goods_name}} |
457 | </view> | 457 | </view> |
458 | 458 | ||
459 | <view class="xc-explain flex jc_sb" wx:if="{{prom_type==2}}"> | 459 | <view class="xc-explain flex jc_sb" wx:if="{{prom_type==2}}"> |
460 | - <view class="fs32 ellipsis-2" style="max-width:80%; max-height: 90rpx;">{{sele_g.goods_name}}</view> | 460 | + <view class="fs32 ellipsis-2" style="max-width:80%; max-height: 90rpx;">{{front_g.goods_name}}</view> |
461 | <!-- 这个是分享按钮 --> | 461 | <!-- 这个是分享按钮 --> |
462 | <view wx:if="{{isLogin}}" class="xc-share-frame t-c shrink0" bindtap="clickShare" style="flex-shrink:0;position: relative;top: -22rpx;"> | 462 | <view wx:if="{{isLogin}}" class="xc-share-frame t-c shrink0" bindtap="clickShare" style="flex-shrink:0;position: relative;top: -22rpx;"> |
463 | <view class="iconfont icon-share"></view> | 463 | <view class="iconfont icon-share"></view> |
@@ -676,7 +676,7 @@ | @@ -676,7 +676,7 @@ | ||
676 | 676 | ||
677 | 677 | ||
678 | <!-- 许程 7.24暂时注释 --> | 678 | <!-- 许程 7.24暂时注释 --> |
679 | - <view class="bdt16" wx:if="{{ prom_type!=1 && prom_act.kttype!=3&&prom_act.kttype!=2&&prom_act.kttype!=1 && is_closecoupon!=1 && sele_g.is_xz_yh !=1 && fir_quan.length>0 }}"> | 679 | + <view class="bdt16" wx:if="{{ prom_type!=1 && prom_act.kttype!=3&&prom_act.kttype!=2&&prom_act.kttype!=1 && is_closecoupon!=1 && front_g.is_xz_yh !=1 && fir_quan.length>0 }}"> |
680 | <view data-coupon="1" bindtap="switchCoupon" class="cx-frame flex" style="position: relative"> | 680 | <view data-coupon="1" bindtap="switchCoupon" class="cx-frame flex" style="position: relative"> |
681 | <view class="cx-sizs fs30">领券</view> | 681 | <view class="cx-sizs fs30">领券</view> |
682 | <view class="flex ai_c f1 pdh20"> | 682 | <view class="flex ai_c f1 pdh20"> |
@@ -728,7 +728,7 @@ | @@ -728,7 +728,7 @@ | ||
728 | <view class="no_store" wx:elif="{{def_pick_store && def_pick_store.is_no_dis_act}}"> | 728 | <view class="no_store" wx:elif="{{def_pick_store && def_pick_store.is_no_dis_act}}"> |
729 | (该店不可售) | 729 | (该店不可售) |
730 | </view> | 730 | </view> |
731 | - <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules>=2 && prom_type==0 && !sele_g.whsle_id}}"> | 731 | + <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules>=2 && prom_type==0 && !front_g.whsle_id}}"> |
732 | (库存不足) | 732 | (库存不足) |
733 | </view> | 733 | </view> |
734 | </block> | 734 | </block> |
@@ -737,6 +737,7 @@ | @@ -737,6 +737,7 @@ | ||
737 | </view> | 737 | </view> |
738 | </view> | 738 | </view> |
739 | </view> | 739 | </view> |
740 | + | ||
740 | <!-- 保障服务 --> | 741 | <!-- 保障服务 --> |
741 | <view class="bz_view flex bdt16 ai_c" wx:if="{{bconfig.service_bz}}"> | 742 | <view class="bz_view flex bdt16 ai_c" wx:if="{{bconfig.service_bz}}"> |
742 | <image class="bzfu_img" src="{{iurl}}/miniapp/images/bzfu_w.png"></image> | 743 | <image class="bzfu_img" src="{{iurl}}/miniapp/images/bzfu_w.png"></image> |
@@ -1108,7 +1109,7 @@ | @@ -1108,7 +1109,7 @@ | ||
1108 | <!-- 普通商品购买 --> | 1109 | <!-- 普通商品购买 --> |
1109 | <block wx:if="{{prom_type==0 || prom_type==3}}"> | 1110 | <block wx:if="{{prom_type==0 || prom_type==3}}"> |
1110 | <!-- 线上销售的时候,要判断库存量, 线下库存的时候不用判断 --> | 1111 | <!-- 线上销售的时候,要判断库存量, 线下库存的时候不用判断 --> |
1111 | - <block wx:if="{{(sele_g.store_count>0 && sales_rules==1) || sales_rules>=2 }}"> | 1112 | + <block wx:if="{{(front_g.store_count>0 && sales_rules==1) || sales_rules>=2 }}"> |
1112 | <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view> | 1113 | <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view> |
1113 | <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即购买</view> | 1114 | <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即购买</view> |
1114 | </block> | 1115 | </block> |
@@ -1178,10 +1179,10 @@ | @@ -1178,10 +1179,10 @@ | ||
1178 | <view bindtap="openSpecModel_pt" data-it="1" data-ind="1" class="join-btn cart-btn line-h"> | 1179 | <view bindtap="openSpecModel_pt" data-it="1" data-ind="1" class="join-btn cart-btn line-h"> |
1179 | <view class="fir-v"> | 1180 | <view class="fir-v"> |
1180 | <!-- ¥{{data.shop_price,2)}} --> | 1181 | <!-- ¥{{data.shop_price,2)}} --> |
1181 | - <block wx:if="{{card_field && sele_g[card_field]>0}}"> | ||
1182 | - {{filters.toFix(sele_g[card_field],2)}} | 1182 | + <block wx:if="{{card_field && front_g[card_field]>0}}"> |
1183 | + {{filters.toFix(front_g[card_field],2)}} | ||
1183 | </block> | 1184 | </block> |
1184 | - <block wx:else>{{filters.toFix(sele_g.shop_price,2)}}</block> | 1185 | + <block wx:else>{{filters.toFix(front_g.shop_price,2)}}</block> |
1185 | </view> | 1186 | </view> |
1186 | <view>单独购买</view> | 1187 | <view>单独购买</view> |
1187 | </view> | 1188 | </view> |
@@ -1236,10 +1237,10 @@ | @@ -1236,10 +1237,10 @@ | ||
1236 | <block wx:if="{{is_shopbuy}}"> | 1237 | <block wx:if="{{is_shopbuy}}"> |
1237 | <view bindtap="go_pay_integral_normal" class="join-btn cart-btn line-h"> | 1238 | <view bindtap="go_pay_integral_normal" class="join-btn cart-btn line-h"> |
1238 | <view class="fir-v"> | 1239 | <view class="fir-v"> |
1239 | - <block wx:if="{{card_field && sele_g[card_field]>0}}"> | ||
1240 | - {{filters.toFix(sele_g[card_field],2)}} | 1240 | + <block wx:if="{{card_field && front_g[card_field]>0}}"> |
1241 | + {{filters.toFix(front_g[card_field],2)}} | ||
1241 | </block> | 1242 | </block> |
1242 | - <block wx:else>{{filters.toFix(sele_g.shop_price,2)}}</block> | 1243 | + <block wx:else>{{filters.toFix(front_g.shop_price,2)}}</block> |
1243 | </view> | 1244 | </view> |
1244 | <view>单独购买</view> | 1245 | <view>单独购买</view> |
1245 | </view> | 1246 | </view> |
@@ -1338,7 +1339,7 @@ | @@ -1338,7 +1339,7 @@ | ||
1338 | 已售:{{prom_act.buy_num+prom_act.virtual}} | 1339 | 已售:{{prom_act.buy_num+prom_act.virtual}} |
1339 | </view> | 1340 | </view> |
1340 | <view class="spec-goods-stock" wx:else>已售:{{prom_act.buy_num}}</view> | 1341 | <view class="spec-goods-stock" wx:else>已售:{{prom_act.buy_num}}</view> |
1341 | - <view class="spec-goods-stock">可售:{{(prom_act.is_virtual_count && prom_act.virtual) ? (prom_act.goods_num - prom_act.buy_num - prom_act.virtual) : (prom_act.goods_num-prom_act.buy_num)}}</view> | 1342 | + <view class="spec-goods-stock">可售:{{(prom_act.is_virtual_count && prom_act.virtual)?(prom_act.goods_num - prom_act.buy_num - prom_act.virtual) : (prom_act.goods_num-prom_act.buy_num)}}</view> |
1342 | </view> | 1343 | </view> |
1343 | </block> | 1344 | </block> |
1344 | <block wx:if="{{prom_type==2}}"> | 1345 | <block wx:if="{{prom_type==2}}"> |
@@ -1390,12 +1391,12 @@ | @@ -1390,12 +1391,12 @@ | ||
1390 | <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;"> | 1391 | <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;"> |
1391 | 1392 | ||
1392 | <block wx:if="{{sku_g_pt}}"> | 1393 | <block wx:if="{{sku_g_pt}}"> |
1393 | - <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g_pt}}" wx:key="sku_g"> | 1394 | + <view class="spec_bt {{sele_g.goods_id==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g_pt}}" wx:key="sku_g"> |
1394 | {{item.gg}} | 1395 | {{item.gg}} |
1395 | </view> | 1396 | </view> |
1396 | </block> | 1397 | </block> |
1397 | <block wx:else> | 1398 | <block wx:else> |
1398 | - <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g"> | 1399 | + <view class="spec_bt {{sele_g.goods_id==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g"> |
1399 | {{item.gg}} | 1400 | {{item.gg}} |
1400 | </view> | 1401 | </view> |
1401 | </block> | 1402 | </block> |