Commit 34497c6df9ed84026ebc0cc4b17460979e33dda8
1 parent
1a978504
涉及到秒杀跳转,分享的bug优化。
Showing
14 changed files
with
128 additions
and
41 deletions
components/goods_list/goods_list.wxml
@@ -4,15 +4,15 @@ | @@ -4,15 +4,15 @@ | ||
4 | <view class="collects"> | 4 | <view class="collects"> |
5 | <view class="hang "> | 5 | <view class="hang "> |
6 | <!-- 商品详情 --> | 6 | <!-- 商品详情 --> |
7 | - <view class="collect ib" wx:for="{{recommend}}" bindtap="go_url" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&title={{item.goods_name}}"> | ||
8 | - <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&title={{item.goods_name}}" hover-class="none"> | 7 | + <view class="collect ib" wx:for="{{recommend}}" bindtap="go_url" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&title={{item.goods_name}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}"> |
8 | + <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&title={{item.goods_name}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}" hover-class="none"> | ||
9 | <!-- 商品图⽚ --> | 9 | <!-- 商品图⽚ --> |
10 | <image class="sp" src="{{url+item.original_img}}" mode="aspectFill" binderror="bind_bnerr_xc" data-url="{{url+item.original_img}}" data-errorimg="recommend[{{index}}].original_img"></image> | 10 | <image class="sp" src="{{url+item.original_img}}" mode="aspectFill" binderror="bind_bnerr_xc" data-url="{{url+item.original_img}}" data-errorimg="recommend[{{index}}].original_img"></image> |
11 | <view class="bottom"> | 11 | <view class="bottom"> |
12 | <!-- 商品名称 --> | 12 | <!-- 商品名称 --> |
13 | <view class="goods_name ellipsis-2 fs28">{{item.goods_name}}</view> | 13 | <view class="goods_name ellipsis-2 fs28">{{item.goods_name}}</view> |
14 | <!-- 判断是否有活动价 --> | 14 | <!-- 判断是否有活动价 --> |
15 | - <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}"> | 15 | + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0}}"> |
16 | <view class="pdt10"> | 16 | <view class="pdt10"> |
17 | <view class="money flex xc-wc" > | 17 | <view class="money flex xc-wc" > |
18 | <text wx:if="{{item.prom_integral}}"><text class="fs35" style="font-weight: bold;">{{item.prom_integral}}</text>积分</text> | 18 | <text wx:if="{{item.prom_integral}}"><text class="fs35" style="font-weight: bold;">{{item.prom_integral}}</text>积分</text> |
packageA/pages/activity_share/activity_share.js
@@ -167,10 +167,22 @@ Page({ | @@ -167,10 +167,22 @@ Page({ | ||
167 | if(item){ | 167 | if(item){ |
168 | var price = item.price; | 168 | var price = item.price; |
169 | if(!price) price=item.shop_price; | 169 | if(!price) price=item.shop_price; |
170 | - | 170 | + switch(th.data.currentIndex){ |
171 | + case 0: item.prom_type=1;break; | ||
172 | + case 1: item.prom_type=6;break; | ||
173 | + case 2: | ||
174 | + if(th.data.currentIndex2==1) item.prom_type = 5; | ||
175 | + if(th.data.currentIndex2==2) { | ||
176 | + item.prom_type = 3; | ||
177 | + item.id=item.prom_id; | ||
178 | + } | ||
179 | + break; | ||
180 | + } | ||
181 | + item.prom_id=item.id; | ||
182 | + | ||
171 | var title= item.goods_name; | 183 | var title= item.goods_name; |
172 | var img=this.data.url+item.original_img; | 184 | var img=this.data.url+item.original_img; |
173 | - var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id; | 185 | + var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id+"&prom_type="+item.prom_type+"&prom_id="+item.prom_id; |
174 | if(getApp().globalData.user_id){ | 186 | if(getApp().globalData.user_id){ |
175 | url+="&first_leader="+getApp().globalData.user_id; | 187 | url+="&first_leader="+getApp().globalData.user_id; |
176 | } | 188 | } |
@@ -547,7 +559,26 @@ Page({ | @@ -547,7 +559,26 @@ Page({ | ||
547 | 559 | ||
548 | var app = getApp(); | 560 | var app = getApp(); |
549 | var unit = that.data.screenWidth / 750 * 1.35; //基础单位, | 561 | var unit = that.data.screenWidth / 750 * 1.35; //基础单位, |
562 | + | ||
563 | + var prom_type=0; | ||
564 | + var prom_id=th.data.share_good.id; | ||
565 | + switch(th.data.currentIndex){ | ||
566 | + case 0: prom_type=1;break; | ||
567 | + case 1: prom_type=6;break; | ||
568 | + case 2: | ||
569 | + if(th.data.currentIndex2==1) prom_type = 5; | ||
570 | + if(th.data.currentIndex2==2){ | ||
571 | + prom_type = 3; | ||
572 | + prom_id=th.data.share_good.prom_id; | ||
573 | + } | ||
574 | + break; | ||
575 | + } | ||
576 | + | ||
577 | + | ||
578 | + | ||
550 | var scene = th.data.share_good.goods_id+""; | 579 | var scene = th.data.share_good.goods_id+""; |
580 | + scene+="."+prom_type+"."+prom_id; | ||
581 | + | ||
551 | var user_id=getApp().globalData.user_id?getApp().globalData.user_id:0; | 582 | var user_id=getApp().globalData.user_id?getApp().globalData.user_id:0; |
552 | if(user_id>0){ | 583 | if(user_id>0){ |
553 | scene+="_"+user_id; | 584 | scene+="_"+user_id; |
@@ -1129,14 +1160,27 @@ Page({ | @@ -1129,14 +1160,27 @@ Page({ | ||
1129 | this.data.currentPage=1; | 1160 | this.data.currentPage=1; |
1130 | this.requestGoodsList(); | 1161 | this.requestGoodsList(); |
1131 | }, | 1162 | }, |
1132 | - | ||
1133 | - | ||
1134 | - go_goods:function(e){ | ||
1135 | - var index=e.currentTarget.dataset.index; | ||
1136 | - var item=this.data.list[index]; | ||
1137 | - var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id; | ||
1138 | - getApp().goto(url); | ||
1139 | - }, | 1163 | + |
1164 | + | ||
1165 | + go_goods: function (e) { | ||
1166 | + var index = e.currentTarget.dataset.index; | ||
1167 | + var item = this.data.list[index]; | ||
1168 | + var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id; | ||
1169 | + | ||
1170 | + switch(this.data.currentIndex){ | ||
1171 | + case 0: item.prom_type = 1;break; | ||
1172 | + case 1: item.prom_type = 6;break; | ||
1173 | + case 2: | ||
1174 | + if(th.data.currentIndex2==1) item.prom_type = 5; | ||
1175 | + if(th.data.currentIndex2==2) item.prom_type = 3; | ||
1176 | + break; | ||
1177 | + } | ||
1178 | + | ||
1179 | + item.prom_id = item.id; | ||
1180 | + url+="&prom_type="+item.prom_type+"&prom_id="+item.prom_id | ||
1181 | + | ||
1182 | + getApp().goto(url); | ||
1183 | + }, | ||
1140 | 1184 | ||
1141 | go_coll_good:function(e){ | 1185 | go_coll_good:function(e){ |
1142 | var gid=e.currentTarget.dataset.gid; | 1186 | var gid=e.currentTarget.dataset.gid; |
packageA/pages/distribution/goods/goods.wxml
@@ -75,13 +75,13 @@ | @@ -75,13 +75,13 @@ | ||
75 | 75 | ||
76 | </label> --> | 76 | </label> --> |
77 | <checkbox value="{{item.goods_id}}" checked="{{item.checked}}" wx:if="{{!(options.index == 1 && currentTabIndex ==1)}}"/> | 77 | <checkbox value="{{item.goods_id}}" checked="{{item.checked}}" wx:if="{{!(options.index == 1 && currentTabIndex ==1)}}"/> |
78 | - <view class="flex pdl10" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> | 78 | + <view class="flex pdl10" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}"> |
79 | <view class="pdr20"><image class="img" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" lazy-load/></view> | 79 | <view class="pdr20"><image class="img" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" lazy-load/></view> |
80 | <view class="flex fdc jc_sb"> | 80 | <view class="flex fdc jc_sb"> |
81 | <view class="ellipsis-2">{{item.goods_name}}</view> | 81 | <view class="ellipsis-2">{{item.goods_name}}</view> |
82 | <view> | 82 | <view> |
83 | <!-- 判断是否有活动价 --> | 83 | <!-- 判断是否有活动价 --> |
84 | - <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}"> | 84 | + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0}}"> |
85 | <view class="flex xc-wc ai-center" > | 85 | <view class="flex xc-wc ai-center" > |
86 | <text wx:if="{{item.prom_integral}}"><text class="fs30">{{item.prom_integral}}</text>积分</text> | 86 | <text wx:if="{{item.prom_integral}}"><text class="fs30">{{item.prom_integral}}</text>积分</text> |
87 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> | 87 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> |
@@ -214,7 +214,7 @@ | @@ -214,7 +214,7 @@ | ||
214 | </checkbox-group> | 214 | </checkbox-group> |
215 | 215 | ||
216 | <checkbox-group class="fs26 flex pd16 wrap" catchchange="checkboxChange" wx:else> | 216 | <checkbox-group class="fs26 flex pd16 wrap" catchchange="checkboxChange" wx:else> |
217 | - <view class="item2 bg-white" wx:for="{{list.pageData}}" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> | 217 | + <view class="item2 bg-white" wx:for="{{list.pageData}}" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}"> |
218 | <image class="img2" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" mode="aspectFit" lazy-load/> | 218 | <image class="img2" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" mode="aspectFit" lazy-load/> |
219 | <view class="pd20 fs26 flex jc_sb fdc f1"> | 219 | <view class="pd20 fs26 flex jc_sb fdc f1"> |
220 | <view class="ellipsis-2">{{item.goods_name}}</view> | 220 | <view class="ellipsis-2">{{item.goods_name}}</view> |
@@ -222,7 +222,7 @@ | @@ -222,7 +222,7 @@ | ||
222 | <checkbox value="{{item.goods_id}}" checked="{{item.checked}}" data-name="checkbox" wx:if="{{!(options.index == 1 && currentTabIndex ==1)}}"/> | 222 | <checkbox value="{{item.goods_id}}" checked="{{item.checked}}" data-name="checkbox" wx:if="{{!(options.index == 1 && currentTabIndex ==1)}}"/> |
223 | <view> | 223 | <view> |
224 | <!-- 判断是否有活动价 --> | 224 | <!-- 判断是否有活动价 --> |
225 | - <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}"> | 225 | + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0 }}"> |
226 | <view class="flex xc-wc ai-center" > | 226 | <view class="flex xc-wc ai-center" > |
227 | <text wx:if="{{item.prom_integral}}"><text class="fs30">{{item.prom_integral}}</text>积分</text> | 227 | <text wx:if="{{item.prom_integral}}"><text class="fs30">{{item.prom_integral}}</text>积分</text> |
228 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> | 228 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> |
packageA/pages/distribution/shop/shop.wxml
@@ -69,14 +69,14 @@ | @@ -69,14 +69,14 @@ | ||
69 | <view class="content"> | 69 | <view class="content"> |
70 | <view class="fs26" wx:if="{{isShowRow}}"> | 70 | <view class="fs26" wx:if="{{isShowRow}}"> |
71 | <view class="item bg-white flex ai-center pd20" wx:for="{{list}}"> | 71 | <view class="item bg-white flex ai-center pd20" wx:for="{{list}}"> |
72 | - <view class="flex pdl10" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> | 72 | + <view class="flex pdl10" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}"> |
73 | <view class="img-container pdr20" data-txt="已售:{{item.sales_sum}}"> | 73 | <view class="img-container pdr20" data-txt="已售:{{item.sales_sum}}"> |
74 | <image class="img" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" lazy-load mode="aspectFit" /> | 74 | <image class="img" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" lazy-load mode="aspectFit" /> |
75 | </view> | 75 | </view> |
76 | <view class="flex fdc jc_sb"> | 76 | <view class="flex fdc jc_sb"> |
77 | <view class="ellipsis-2 h68 mgb20">{{item.goods_name}}</view> | 77 | <view class="ellipsis-2 h68 mgb20">{{item.goods_name}}</view> |
78 | <!-- 判断是否有活动价 --> | 78 | <!-- 判断是否有活动价 --> |
79 | - <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}"> | 79 | + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0}}"> |
80 | <view class="flex xc-wc pdt20"> | 80 | <view class="flex xc-wc pdt20"> |
81 | <text wx:if="{{item.prom_integral}}"> | 81 | <text wx:if="{{item.prom_integral}}"> |
82 | <text class="fs30">{{item.prom_integral}}</text> | 82 | <text class="fs30">{{item.prom_integral}}</text> |
@@ -213,14 +213,14 @@ | @@ -213,14 +213,14 @@ | ||
213 | </view> | 213 | </view> |
214 | </view> | 214 | </view> |
215 | <view class="fs26 flex pd20 wrap" wx:else> | 215 | <view class="fs26 flex pd20 wrap" wx:else> |
216 | - <view class="item2 bg-white" wx:for="{{list}}" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> | 216 | + <view class="item2 bg-white" wx:for="{{list}}" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}"> |
217 | <view class="img-container" data-txt="已售:{{item.sales_sum}}"> | 217 | <view class="img-container" data-txt="已售:{{item.sales_sum}}"> |
218 | <image class="img2" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" lazy-load="true" /> | 218 | <image class="img2" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" lazy-load="true" /> |
219 | </view> | 219 | </view> |
220 | <view class="pd20 fs26"> | 220 | <view class="pd20 fs26"> |
221 | <view class="ellipsis-2 h68 mgb20">{{item.goods_name}}</view> | 221 | <view class="ellipsis-2 h68 mgb20">{{item.goods_name}}</view> |
222 | <!-- 判断是否有活动价 --> | 222 | <!-- 判断是否有活动价 --> |
223 | - <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}"> | 223 | + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0}}"> |
224 | <view class="flex xc-wc"> | 224 | <view class="flex xc-wc"> |
225 | <text wx:if="{{item.prom_integral}}"> | 225 | <text wx:if="{{item.prom_integral}}"> |
226 | <text class="fs30" style="font-weight: bold;">{{item.prom_integral}}</text> | 226 | <text class="fs30" style="font-weight: bold;">{{item.prom_integral}}</text> |
pages/activity/seckill_list/seckill_list.js
@@ -76,7 +76,7 @@ Page({ | @@ -76,7 +76,7 @@ Page({ | ||
76 | }, | 76 | }, |
77 | onHide:function(){ | 77 | onHide:function(){ |
78 | //--清理定时器-- | 78 | //--清理定时器-- |
79 | - clearInterval(this.timer); | 79 | + clearInterval(this.data.timer); |
80 | this.setData({isshow:0}); | 80 | this.setData({isshow:0}); |
81 | }, | 81 | }, |
82 | //---小于10的格式化函数---- | 82 | //---小于10的格式化函数---- |
pages/cart/cart/cart.js
@@ -2376,6 +2376,28 @@ Page({ | @@ -2376,6 +2376,28 @@ Page({ | ||
2376 | go_url(e){ | 2376 | go_url(e){ |
2377 | var url=e.currentTarget.dataset.url; | 2377 | var url=e.currentTarget.dataset.url; |
2378 | getApp().goto(url); | 2378 | getApp().goto(url); |
2379 | + }, | ||
2380 | + | ||
2381 | + //跳转到商品 | ||
2382 | + go_gd:function (e) { | ||
2383 | + var gd= e.currentTarget.dataset.gd; | ||
2384 | + var good_url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + gd; | ||
2385 | + var url="/api/weshop/activitylist/getGoodActInfo"; | ||
2386 | + var req_data={ | ||
2387 | + store_id:os.stoid,goodsidlist:gd,is_detail:1 | ||
2388 | + }; | ||
2389 | + //获取秒杀的多规格 | ||
2390 | + getApp().request.promiseGet(url, {data:req_data}).then(res=>{ | ||
2391 | + if(res.data.code==0 && res.data.data){ | ||
2392 | + if(res.data.data.length==1){ | ||
2393 | + good_url+="&prom_type="+res.data.data[0].prom_type+"&prom_id="+res.data.data[0].act_id; | ||
2394 | + } | ||
2395 | + getApp().goto(good_url); | ||
2396 | + | ||
2397 | + }else{ | ||
2398 | + getApp().goto(good_url); | ||
2399 | + } | ||
2400 | + }) | ||
2379 | } | 2401 | } |
2380 | 2402 | ||
2381 | }); | 2403 | }); |
2382 | \ No newline at end of file | 2404 | \ No newline at end of file |
pages/cart/cart/cart.wxml
@@ -56,7 +56,6 @@ | @@ -56,7 +56,6 @@ | ||
56 | <view class="shmd_m"> | 56 | <view class="shmd_m"> |
57 | <!-- 门店 --> | 57 | <!-- 门店 --> |
58 | <!--<radio color="red" bindtap="check_th_all_item" class="order-raido flex-center" checked="{{checkAllToggle||item.selected}}" data-pitems="{{pidx}}"></radio>--> | 58 | <!--<radio color="red" bindtap="check_th_all_item" class="order-raido flex-center" checked="{{checkAllToggle||item.selected}}" data-pitems="{{pidx}}"></radio>--> |
59 | - | ||
60 | <icon wx:if="{{checkAllToggle||item.selected}}" class="order-raido flex-center" bindtap="check_th_all_item" data-pitems="{{pidx}}" | 59 | <icon wx:if="{{checkAllToggle||item.selected}}" class="order-raido flex-center" bindtap="check_th_all_item" data-pitems="{{pidx}}" |
61 | color="red" size="20" type="success"></icon> | 60 | color="red" size="20" type="success"></icon> |
62 | <view wx:else class="icon_no_sele2" bindtap="check_th_all_item" data-pitems="{{pidx}}"></view> | 61 | <view wx:else class="icon_no_sele2" bindtap="check_th_all_item" data-pitems="{{pidx}}"></view> |
@@ -77,7 +76,7 @@ | @@ -77,7 +76,7 @@ | ||
77 | </block> | 76 | </block> |
78 | <block wx:else><view class="order-raido flex-vertical " style="width: 45rpx"></view></block> | 77 | <block wx:else><view class="order-raido flex-vertical " style="width: 45rpx"></view></block> |
79 | 78 | ||
80 | - <navigator class="goods-img rel" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}"> | 79 | + <navigator class="goods-img rel" bindtap="go_gd" data-gd="{{items.goods_id}}"> |
81 | <image class="wh100" src="{{items.original_img}}" binderror="bind_bnerr2" data-errorimg="requestData[{{pidx}}].goods[{{idx}}].original_img" data-url="{{items.original_img}}"></image> | 80 | <image class="wh100" src="{{items.original_img}}" binderror="bind_bnerr2" data-errorimg="requestData[{{pidx}}].goods[{{idx}}].original_img" data-url="{{items.original_img}}"></image> |
82 | <block wx:if="{{items.is_gift}}"> | 81 | <block wx:if="{{items.is_gift}}"> |
83 | <view style="background-color:red" class="abs flex-center fs26" wx:if="{{items.is_gift==1}}">赠品</view> | 82 | <view style="background-color:red" class="abs flex-center fs26" wx:if="{{items.is_gift==1}}">赠品</view> |
@@ -102,7 +101,7 @@ | @@ -102,7 +101,7 @@ | ||
102 | </navigator> | 101 | </navigator> |
103 | <view class="goods-cont"> | 102 | <view class="goods-cont"> |
104 | <view class="goods-name"> | 103 | <view class="goods-name"> |
105 | - <navigator class="ellipsis-2 fs30" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}">{{items.goods_name}}</navigator> | 104 | + <navigator bindtap="go_gd" class="ellipsis-2 fs30" data-gd="{{items.goods_id}}">{{items.goods_name}}</navigator> |
106 | 105 | ||
107 | <view class="specifications ellipsis-1"> | 106 | <view class="specifications ellipsis-1"> |
108 | <view wx:if="{{items.goods_color || items.goods_spec}}"> | 107 | <view wx:if="{{items.goods_color || items.goods_spec}}"> |
pages/cart/cart2/cart2.js
@@ -289,7 +289,6 @@ Page({ | @@ -289,7 +289,6 @@ Page({ | ||
289 | } | 289 | } |
290 | 290 | ||
291 | }, 1); | 291 | }, 1); |
292 | - | ||
293 | //值在这里换 | 292 | //值在这里换 |
294 | getApp().globalData.plus_buy_back = 0; | 293 | getApp().globalData.plus_buy_back = 0; |
295 | }, | 294 | }, |
@@ -3815,6 +3814,11 @@ Page({ | @@ -3815,6 +3814,11 @@ Page({ | ||
3815 | var index = e.currentTarget.dataset.index; | 3814 | var index = e.currentTarget.dataset.index; |
3816 | var txt = "cartlist[" + index + "].focus"; | 3815 | var txt = "cartlist[" + index + "].focus"; |
3817 | this.setData({[txt]:0}) | 3816 | this.setData({[txt]:0}) |
3817 | + }, | ||
3818 | + | ||
3819 | + go_url:function (e) { | ||
3820 | + var url = e.currentTarget.dataset.url; | ||
3821 | + getApp().goto(url); | ||
3818 | } | 3822 | } |
3819 | 3823 | ||
3820 | 3824 |
pages/cart/cart2/cart2.wxml
@@ -78,15 +78,13 @@ | @@ -78,15 +78,13 @@ | ||
78 | </view> | 78 | </view> |
79 | <view class="order-detail" wx:for="{{item.goods}}" wx:for-index="idx" wx:for-item="items"> | 79 | <view class="order-detail" wx:for="{{item.goods}}" wx:for-index="idx" wx:for-item="items"> |
80 | <!----商品图片-----> | 80 | <!----商品图片-----> |
81 | - <view class="goods-img" style="position: relative; overflow: hidden"> | 81 | + <view class="goods-img" style="position: relative; overflow: hidden" bindtap="go_url" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}&prom_type={{items.prom_type}}&prom_id={{items.prom_id}}"> |
82 | <image wx:if="{{items.is_gift}}" src="{{imgUrl}}/miniapp/images/giveaway.png" class="gift_image"></image> | 82 | <image wx:if="{{items.is_gift}}" src="{{imgUrl}}/miniapp/images/giveaway.png" class="gift_image"></image> |
83 | <text class="zuhe" wx:if="{{items.prom_type==7}}">组合购</text> | 83 | <text class="zuhe" wx:if="{{items.prom_type==7}}">组合购</text> |
84 | - | ||
85 | - | ||
86 | <image class="wh100 bdr14" src="{{items.original_img}}" binderror='cart_set_err' data-err='cartlist[{{pidx}}].goods[{{idx}}].original_img'></image> | 84 | <image class="wh100 bdr14" src="{{items.original_img}}" binderror='cart_set_err' data-err='cartlist[{{pidx}}].goods[{{idx}}].original_img'></image> |
87 | </view> | 85 | </view> |
88 | <!----商品名称规格----> | 86 | <!----商品名称规格----> |
89 | - <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}"> | 87 | + <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}&prom_type={{items.prom_type}}&prom_id={{items.prom_id}}" > |
90 | <view class="goods-name ellipsis-2">{{items.goods_name}}</view> | 88 | <view class="goods-name ellipsis-2">{{items.goods_name}}</view> |
91 | <!-- 商品属性 --> | 89 | <!-- 商品属性 --> |
92 | <view class="flex-vertical fs28 color-gray n_guige"> | 90 | <view class="flex-vertical fs28 color-gray n_guige"> |
@@ -252,10 +250,10 @@ | @@ -252,10 +250,10 @@ | ||
252 | <!-- <view>门店:{{bn_pickname}}</view> --> | 250 | <!-- <view>门店:{{bn_pickname}}</view> --> |
253 | </view> | 251 | </view> |
254 | <view class="order-detail"> | 252 | <view class="order-detail"> |
255 | - <view class="goods-img"> | 253 | + <view class="goods-img" bindtap="go_url" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}&prom_type={{bn_goods.prom_type}}&prom_id={{bn_goods.prom_id}}"> |
256 | <image class="wh100 bdr14" src="{{bn_goods.original_img}}" binderror='cart_set_err' data-err="bn_goods.original_img"></image> | 254 | <image class="wh100 bdr14" src="{{bn_goods.original_img}}" binderror='cart_set_err' data-err="bn_goods.original_img"></image> |
257 | </view> | 255 | </view> |
258 | - <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}"> | 256 | + <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}&prom_type={{items.prom_type}}&prom_id={{items.prom_id}}"> |
259 | <view class="goods-name ellipsis-2">{{bn_goods.goods_name}}</view> | 257 | <view class="goods-name ellipsis-2">{{bn_goods.goods_name}}</view> |
260 | <!-- 商品属性 --> | 258 | <!-- 商品属性 --> |
261 | <view class="flex-vertical fs28 xc-ash color-gray n_guige"> | 259 | <view class="flex-vertical fs28 xc-ash color-gray n_guige"> |
pages/goods/goodsInfo/goodsInfo.js
@@ -2135,7 +2135,7 @@ Page({ | @@ -2135,7 +2135,7 @@ Page({ | ||
2135 | 2135 | ||
2136 | 2136 | ||
2137 | var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" | 2137 | var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" |
2138 | - + th.data.sele_g.gid+"&prom_type="+th.data.sele_g.prom_type+"&prom_id="+th.data.sele_g.prom_id; | 2138 | + + th.data.sele_g.goods_id+"&prom_type="+th.data.sele_g.prom_type+"&prom_id="+th.data.sele_g.prom_id; |
2139 | if (getApp().globalData.user_id) { | 2139 | if (getApp().globalData.user_id) { |
2140 | url += "&first_leader=" + getApp().globalData.user_id; | 2140 | url += "&first_leader=" + getApp().globalData.user_id; |
2141 | } | 2141 | } |
@@ -4308,10 +4308,8 @@ Page({ | @@ -4308,10 +4308,8 @@ Page({ | ||
4308 | var unit = that.data.screenWidth / 750 * 1.35; //基础单位, | 4308 | var unit = that.data.screenWidth / 750 * 1.35; //基础单位, |
4309 | var path2 = that.data.data.original_img; | 4309 | var path2 = that.data.data.original_img; |
4310 | var scene = th.data.gid + ""; | 4310 | var scene = th.data.gid + ""; |
4311 | + scene+="."+th.data.sele_g.prom_type+"."+th.data.sele_g.prom_id; | ||
4311 | 4312 | ||
4312 | - if(th.data.sele_g.prom_type==1){ | ||
4313 | - scene+="."+th.data.sele_g.prom_type+"."+th.data.sele_g.prom_id; | ||
4314 | - } | ||
4315 | var user_id = getApp().globalData.user_id ? getApp().globalData.user_id : 0; | 4313 | var user_id = getApp().globalData.user_id ? getApp().globalData.user_id : 0; |
4316 | if (user_id > 0) { | 4314 | if (user_id > 0) { |
4317 | scene += "_" + user_id; | 4315 | scene += "_" + user_id; |
pages/goods/goodsList/goodsList.wxml
@@ -177,7 +177,7 @@ | @@ -177,7 +177,7 @@ | ||
177 | <view class="item-cont"> | 177 | <view class="item-cont"> |
178 | <view class="title ellipsis-2">{{item.goods_name}}</view> | 178 | <view class="title ellipsis-2">{{item.goods_name}}</view> |
179 | <!-- 判断是否有活动价 --> | 179 | <!-- 判断是否有活动价 --> |
180 | - <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2}}"> | 180 | + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0}}"> |
181 | <view class="flex on"> | 181 | <view class="flex on"> |
182 | <!-- 活动价 --> | 182 | <!-- 活动价 --> |
183 | <view class="price"> | 183 | <view class="price"> |
pages/goods/search/search.wxml
@@ -35,7 +35,7 @@ | @@ -35,7 +35,7 @@ | ||
35 | <view class="item-cont"> | 35 | <view class="item-cont"> |
36 | <view class="title ellipsis-2">{{item.goods_name}}</view> | 36 | <view class="title ellipsis-2">{{item.goods_name}}</view> |
37 | <!-- 判断是否有活动价,小程序没有有团购和拼单 --> | 37 | <!-- 判断是否有活动价,小程序没有有团购和拼单 --> |
38 | - <block wx:if="{{(item.prom_price>0 || item.prom_integral) && item.prom_type!=2}}"> | 38 | + <block wx:if="{{(item.prom_price>0 || item.prom_integral) && item.prom_type!=2 && item.prom_id>0}}"> |
39 | <!-- 活动价 --> | 39 | <!-- 活动价 --> |
40 | <view class="price"> | 40 | <view class="price"> |
41 | <text wx:if="{{item.prom_integral}}">{{item.prom_integral}}积分</text> | 41 | <text wx:if="{{item.prom_integral}}">{{item.prom_integral}}积分</text> |
pages/user/order_detail/order_detail.js
@@ -1441,6 +1441,28 @@ Page({ | @@ -1441,6 +1441,28 @@ Page({ | ||
1441 | corpId: id, | 1441 | corpId: id, |
1442 | success(res) {} | 1442 | success(res) {} |
1443 | }) | 1443 | }) |
1444 | + }, | ||
1445 | + | ||
1446 | + //跳转到商品 | ||
1447 | + go_gd:function (e) { | ||
1448 | + var gd= e.currentTarget.dataset.gd; | ||
1449 | + var good_url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + gd; | ||
1450 | + var url="/api/weshop/activitylist/getGoodActInfo"; | ||
1451 | + var req_data={ | ||
1452 | + store_id:os.stoid,goodsidlist:gd,is_detail:1 | ||
1453 | + }; | ||
1454 | + //获取秒杀的多规格 | ||
1455 | + getApp().request.promiseGet(url, {data:req_data}).then(res=>{ | ||
1456 | + if(res.data.code==0 && res.data.data){ | ||
1457 | + if(res.data.data.length==1){ | ||
1458 | + good_url+="&prom_type="+res.data.data[0].prom_type+"&prom_id="+res.data.data[0].act_id; | ||
1459 | + } | ||
1460 | + getApp().goto(good_url); | ||
1461 | + | ||
1462 | + }else{ | ||
1463 | + getApp().goto(good_url); | ||
1464 | + } | ||
1465 | + }) | ||
1444 | } | 1466 | } |
1445 | 1467 | ||
1446 | 1468 |
pages/user/order_detail/order_detail.wxml
@@ -20,12 +20,12 @@ | @@ -20,12 +20,12 @@ | ||
20 | </view> | 20 | </view> |
21 | <!--wx:if="{{item.return_btn!=4}}" --> | 21 | <!--wx:if="{{item.return_btn!=4}}" --> |
22 | <view class="order-detail" wx:for="{{order.order_goods}}" wx:key="{{index}}" > | 22 | <view class="order-detail" wx:for="{{order.order_goods}}" wx:key="{{index}}" > |
23 | - <view class="goods-img"> | 23 | + <view class="goods-img" bindtap="go_gd" data-gd="{{item.goods_id}}"> |
24 | <image class="wh100" src="{{resourceUrl+item.original_img}}" binderror="bind_bnerr" lazy-load="true" | 24 | <image class="wh100" src="{{resourceUrl+item.original_img}}" binderror="bind_bnerr" lazy-load="true" |
25 | data-errorimg="order.order_goods[{{index}}].original_img"></image> | 25 | data-errorimg="order.order_goods[{{index}}].original_img"></image> |
26 | </view> | 26 | </view> |
27 | - | ||
28 | - <navigator class="order-cont" openType="navigate" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> | 27 | + <!-- 跳转到商品 --> |
28 | + <navigator class="order-cont" bindtap="go_gd" data-gd="{{item.goods_id}}"> | ||
29 | <view class="goods-name">{{item.goods_name}}</view> | 29 | <view class="goods-name">{{item.goods_name}}</view> |
30 | <!--<view class="goods-color">{{item.goods_spec}} {{item.goods_color}}</view>--> | 30 | <!--<view class="goods-color">{{item.goods_spec}} {{item.goods_color}}</view>--> |
31 | <view class="goods-color">{{filters.show_gui_ge(item.goods_spec,item.goods_color)}}</view> | 31 | <view class="goods-color">{{filters.show_gui_ge(item.goods_spec,item.goods_color)}}</view> |