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 | 72 | <view class="xc-goods-attribute"> |
| 73 | 73 | <view hidden="{{ismend==1}}" class="spec-name">商品规格</view> |
| 74 | 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 | 76 | data-gid='{{item.goods_id}}' wx:for="{{sku_g_pt}}" wx:key="sku_g"> |
| 77 | 77 | {{item.gg}} |
| 78 | 78 | </view> | ... | ... |
pages/goods/goodsInfo/buy_pt.wxml
| ... | ... | @@ -85,14 +85,14 @@ |
| 85 | 85 | <view hidden="{{ismend==1}}" class="spec-name">商品规格</view> |
| 86 | 86 | <block wx:if="{{is_normal==0}}"> |
| 87 | 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 | 89 | </view> |
| 90 | 90 | </view> |
| 91 | 91 | </block> |
| 92 | 92 | |
| 93 | 93 | <block wx:else> |
| 94 | 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 | 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 | 97 | </view> |
| 98 | 98 | </block> | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
| ... | ... | @@ -285,6 +285,9 @@ Page({ |
| 285 | 285 | istop: 0, //是否置顶风格为1 |
| 286 | 286 | searchbox_transparent: 1, |
| 287 | 287 | template_id:[],//订阅消息id |
| 288 | + | |
| 289 | + front_pick:null, //商品详情页面的默认门店 | |
| 290 | + | |
| 288 | 291 | }, |
| 289 | 292 | |
| 290 | 293 | //------初始化加载---------- |
| ... | ... | @@ -1192,6 +1195,7 @@ Page({ |
| 1192 | 1195 | ee.setData({ |
| 1193 | 1196 | data: t.data.data, |
| 1194 | 1197 | sele_g: t.data.data, |
| 1198 | + front_g:t.data.data, | |
| 1195 | 1199 | userInfo: getApp().globalData.userInfo |
| 1196 | 1200 | }); |
| 1197 | 1201 | |
| ... | ... | @@ -2720,7 +2724,8 @@ Page({ |
| 2720 | 2724 | |
| 2721 | 2725 | this.setData({ |
| 2722 | 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 | 3471 | item['disc'] = txt; |
| 3467 | 3472 | if (item) this.setData({ |
| 3468 | 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 | 453 | |
| 454 | 454 | <!-- 秒杀的活动名称 --> |
| 455 | 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 | 457 | </view> |
| 458 | 458 | |
| 459 | 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 | 462 | <view wx:if="{{isLogin}}" class="xc-share-frame t-c shrink0" bindtap="clickShare" style="flex-shrink:0;position: relative;top: -22rpx;"> |
| 463 | 463 | <view class="iconfont icon-share"></view> |
| ... | ... | @@ -676,7 +676,7 @@ |
| 676 | 676 | |
| 677 | 677 | |
| 678 | 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 | 680 | <view data-coupon="1" bindtap="switchCoupon" class="cx-frame flex" style="position: relative"> |
| 681 | 681 | <view class="cx-sizs fs30">领券</view> |
| 682 | 682 | <view class="flex ai_c f1 pdh20"> |
| ... | ... | @@ -728,7 +728,7 @@ |
| 728 | 728 | <view class="no_store" wx:elif="{{def_pick_store && def_pick_store.is_no_dis_act}}"> |
| 729 | 729 | (该店不可售) |
| 730 | 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 | 733 | </view> |
| 734 | 734 | </block> |
| ... | ... | @@ -737,6 +737,7 @@ |
| 737 | 737 | </view> |
| 738 | 738 | </view> |
| 739 | 739 | </view> |
| 740 | + | |
| 740 | 741 | <!-- 保障服务 --> |
| 741 | 742 | <view class="bz_view flex bdt16 ai_c" wx:if="{{bconfig.service_bz}}"> |
| 742 | 743 | <image class="bzfu_img" src="{{iurl}}/miniapp/images/bzfu_w.png"></image> |
| ... | ... | @@ -1108,7 +1109,7 @@ |
| 1108 | 1109 | <!-- 普通商品购买 --> |
| 1109 | 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 | 1113 | <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view> |
| 1113 | 1114 | <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即购买</view> |
| 1114 | 1115 | </block> |
| ... | ... | @@ -1178,10 +1179,10 @@ |
| 1178 | 1179 | <view bindtap="openSpecModel_pt" data-it="1" data-ind="1" class="join-btn cart-btn line-h"> |
| 1179 | 1180 | <view class="fir-v"> |
| 1180 | 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 | 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 | 1186 | </view> |
| 1186 | 1187 | <view>单独购买</view> |
| 1187 | 1188 | </view> |
| ... | ... | @@ -1236,10 +1237,10 @@ |
| 1236 | 1237 | <block wx:if="{{is_shopbuy}}"> |
| 1237 | 1238 | <view bindtap="go_pay_integral_normal" class="join-btn cart-btn line-h"> |
| 1238 | 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 | 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 | 1244 | </view> |
| 1244 | 1245 | <view>单独购买</view> |
| 1245 | 1246 | </view> |
| ... | ... | @@ -1338,7 +1339,7 @@ |
| 1338 | 1339 | 已售:{{prom_act.buy_num+prom_act.virtual}} |
| 1339 | 1340 | </view> |
| 1340 | 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 | 1343 | </view> |
| 1343 | 1344 | </block> |
| 1344 | 1345 | <block wx:if="{{prom_type==2}}"> |
| ... | ... | @@ -1390,12 +1391,12 @@ |
| 1390 | 1391 | <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;"> |
| 1391 | 1392 | |
| 1392 | 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 | 1395 | {{item.gg}} |
| 1395 | 1396 | </view> |
| 1396 | 1397 | </block> |
| 1397 | 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 | 1400 | {{item.gg}} |
| 1400 | 1401 | </view> |
| 1401 | 1402 | </block> | ... | ... |