Commit a1a735e7a713c265ac9d0fe6e0f7142e25d6c8f5

Authored by yvan.ni
1 parent d52fa942

商品多规格的优化

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 {{sele_g.goods_id==item.goods_id?'act':''}}" bindtap="sele_spec" data-nor="1"
  75 + <view class="spec_bt {{gid==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 {{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}}
  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}}
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,9 +285,6 @@ Page({
285 285 istop: 0, //是否置顶风格为1
286 286 searchbox_transparent: 1,
287 287 template_id:[],//订阅消息id
288   -
289   - front_pick:null, //商品详情页面的默认门店
290   -
291 288 },
292 289  
293 290 //------初始化加载----------
... ... @@ -1195,7 +1192,6 @@ Page({
1195 1192 ee.setData({
1196 1193 data: t.data.data,
1197 1194 sele_g: t.data.data,
1198   - front_g:t.data.data,
1199 1195 userInfo: getApp().globalData.userInfo
1200 1196 });
1201 1197  
... ... @@ -2724,8 +2720,7 @@ Page({
2724 2720  
2725 2721 this.setData({
2726 2722 openSpecModal: !1,
2727   - openSpecModal_pt: !1,
2728   - openSpecModal_flash_normal: !1
  2723 + openSpecModal_pt: !1
2729 2724 });
2730 2725 },
2731 2726  
... ... @@ -3471,7 +3466,8 @@ Page({
3471 3466 item['disc'] = txt;
3472 3467 if (item) this.setData({
3473 3468 sele_g: item,
3474   - //data: item,
  3469 + gid: gid,
  3470 + data: item,
3475 3471 });
3476 3472  
3477 3473  
... ...
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   - {{front_g.goods_name}}
  456 + {{sele_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;">{{front_g.goods_name}}</view>
  460 + <view class="fs32 ellipsis-2" style="max-width:80%; max-height: 90rpx;">{{sele_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 && front_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 && sele_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 && !front_g.whsle_id}}">
  731 + <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules>=2 && prom_type==0 && !sele_g.whsle_id}}">
732 732 (库存不足)
733 733 </view>
734 734 </block>
... ... @@ -737,7 +737,6 @@
737 737 </view>
738 738 </view>
739 739 </view>
740   -
741 740 <!-- 保障服务 -->
742 741 <view class="bz_view flex bdt16 ai_c" wx:if="{{bconfig.service_bz}}">
743 742 <image class="bzfu_img" src="{{iurl}}/miniapp/images/bzfu_w.png"></image>
... ... @@ -1109,7 +1108,7 @@
1109 1108 <!-- 普通商品购买 -->
1110 1109 <block wx:if="{{prom_type==0 || prom_type==3}}">
1111 1110 <!-- 线上销售的时候,要判断库存量, 线下库存的时候不用判断 -->
1112   - <block wx:if="{{(front_g.store_count>0 && sales_rules==1) || sales_rules>=2 }}">
  1111 + <block wx:if="{{(sele_g.store_count>0 && sales_rules==1) || sales_rules>=2 }}">
1113 1112 <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view>
1114 1113 <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即购买</view>
1115 1114 </block>
... ... @@ -1179,10 +1178,10 @@
1179 1178 <view bindtap="openSpecModel_pt" data-it="1" data-ind="1" class="join-btn cart-btn line-h">
1180 1179 <view class="fir-v">
1181 1180 <!-- ¥{{data.shop_price,2)}} -->
1182   - <block wx:if="{{card_field && front_g[card_field]>0}}">
1183   - {{filters.toFix(front_g[card_field],2)}}
  1181 + <block wx:if="{{card_field && sele_g[card_field]>0}}">
  1182 + {{filters.toFix(sele_g[card_field],2)}}
1184 1183 </block>
1185   - <block wx:else>{{filters.toFix(front_g.shop_price,2)}}</block>
  1184 + <block wx:else>{{filters.toFix(sele_g.shop_price,2)}}</block>
1186 1185 </view>
1187 1186 <view>单独购买</view>
1188 1187 </view>
... ... @@ -1237,10 +1236,10 @@
1237 1236 <block wx:if="{{is_shopbuy}}">
1238 1237 <view bindtap="go_pay_integral_normal" class="join-btn cart-btn line-h">
1239 1238 <view class="fir-v">
1240   - <block wx:if="{{card_field && front_g[card_field]>0}}">
1241   - {{filters.toFix(front_g[card_field],2)}}
  1239 + <block wx:if="{{card_field && sele_g[card_field]>0}}">
  1240 + {{filters.toFix(sele_g[card_field],2)}}
1242 1241 </block>
1243   - <block wx:else>{{filters.toFix(front_g.shop_price,2)}}</block>
  1242 + <block wx:else>{{filters.toFix(sele_g.shop_price,2)}}</block>
1244 1243 </view>
1245 1244 <view>单独购买</view>
1246 1245 </view>
... ... @@ -1339,7 +1338,7 @@
1339 1338 已售:{{prom_act.buy_num+prom_act.virtual}}
1340 1339 </view>
1341 1340 <view class="spec-goods-stock" wx:else>已售:{{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>
  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>
1343 1342 </view>
1344 1343 </block>
1345 1344 <block wx:if="{{prom_type==2}}">
... ... @@ -1391,12 +1390,12 @@
1391 1390 <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;">
1392 1391  
1393 1392 <block wx:if="{{sku_g_pt}}">
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">
  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">
1395 1394 {{item.gg}}
1396 1395 </view>
1397 1396 </block>
1398 1397 <block wx:else>
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">
  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">
1400 1399 {{item.gg}}
1401 1400 </view>
1402 1401 </block>
... ...