Commit c12364d35dabc50a3f9680268c063356f91cb8c1
Merge branch 'dev' into 'test'
Dev See merge request !1130
Showing
81 changed files
with
2113 additions
and
1270 deletions
app.js
@@ -51,7 +51,7 @@ App({ | @@ -51,7 +51,7 @@ App({ | ||
51 | config: null, //门店参数 | 51 | config: null, //门店参数 |
52 | config2: null, //门店配置 | 52 | config2: null, //门店配置 |
53 | code: null, | 53 | code: null, |
54 | - user_id:null,// qa-6519858,// | 54 | + user_id:null,// 6520352,// qa-6519858,// |
55 | // user_id:6520314,// qa-6519858,// | 55 | // user_id:6520314,// qa-6519858,// |
56 | // user_id:14148118,// qa-6519858,// | 56 | // user_id:14148118,// qa-6519858,// |
57 | buy_now: null, | 57 | buy_now: null, |
@@ -928,7 +928,7 @@ App({ | @@ -928,7 +928,7 @@ App({ | ||
928 | }); | 928 | }); |
929 | }, | 929 | }, |
930 | 930 | ||
931 | - user_tools_endTime(type) { | 931 | + user_tools_endTime(type,func) { |
932 | //调用接口判断商家工具有没有过期 | 932 | //调用接口判断商家工具有没有过期 |
933 | return this.request.promiseGet("/store/storemoduleendtime/page?store_id=" + os.stoid + "&type=" + type + "", {}).then(res => { | 933 | return this.request.promiseGet("/store/storemoduleendtime/page?store_id=" + os.stoid + "&type=" + type + "", {}).then(res => { |
934 | if (res.data.code == 0) { | 934 | if (res.data.code == 0) { |
@@ -938,8 +938,18 @@ App({ | @@ -938,8 +938,18 @@ App({ | ||
938 | if (item.is_sy == 0) { | 938 | if (item.is_sy == 0) { |
939 | var now = Date.parse(new Date()); now = now / 1000; | 939 | var now = Date.parse(new Date()); now = now / 1000; |
940 | if (item.end_time < now) { | 940 | if (item.end_time < now) { |
941 | + | ||
942 | + if(func){ | ||
943 | + func(0) | ||
944 | + return false; | ||
945 | + } | ||
941 | return 0 | 946 | return 0 |
942 | } | 947 | } |
948 | + if(func){ | ||
949 | + func(1) | ||
950 | + return false; | ||
951 | + } | ||
952 | + | ||
943 | return 1; | 953 | return 1; |
944 | } | 954 | } |
945 | } | 955 | } |
app.json
@@ -37,7 +37,7 @@ | @@ -37,7 +37,7 @@ | ||
37 | "pages/user/grow_value/grow_value", | 37 | "pages/user/grow_value/grow_value", |
38 | "pages/payment/pay_success/pay_success", | 38 | "pages/payment/pay_success/pay_success", |
39 | "pages/user/plus/plus", | 39 | "pages/user/plus/plus", |
40 | - "pages/user/cardinfo/cardinfo", | 40 | + |
41 | "pages/user/my_service/appment_main", | 41 | "pages/user/my_service/appment_main", |
42 | "pages/user/my_service/i_service", | 42 | "pages/user/my_service/i_service", |
43 | "pages/user/my_service/cosmetology_list", | 43 | "pages/user/my_service/cosmetology_list", |
@@ -209,7 +209,8 @@ | @@ -209,7 +209,8 @@ | ||
209 | "pages": [ | 209 | "pages": [ |
210 | "pages/togoin/togoin", | 210 | "pages/togoin/togoin", |
211 | "pages/user/Detailed/Detailed", | 211 | "pages/user/Detailed/Detailed", |
212 | - "pages/user/user_fw/user_fw" | 212 | + "pages/user/user_fw/user_fw", |
213 | + "pages/user/cardinfo/cardinfo" | ||
213 | ] | 214 | ] |
214 | } | 215 | } |
215 | 216 |
app.wxss
components/cart_collect_temp/cart_collect_temp.js
0 → 100644
1 | +Component({ | ||
2 | + properties: { | ||
3 | + // 这里定义了数据列表属性,列表显示数据 | ||
4 | + all_collocation_list: { | ||
5 | + type: Array, | ||
6 | + value: null | ||
7 | + }, | ||
8 | + // 是不是购物车 | ||
9 | + is_cart: { | ||
10 | + type: Boolean, | ||
11 | + value: false | ||
12 | + }, | ||
13 | + // 购物车的索引 | ||
14 | + cart_index: { | ||
15 | + type: Number, | ||
16 | + value: 0 | ||
17 | + } | ||
18 | + | ||
19 | + }, | ||
20 | + /*** 页面的初始数据***/ | ||
21 | + data: { | ||
22 | + imgUrl: getApp().globalData.setting.imghost, | ||
23 | + }, | ||
24 | + methods: { | ||
25 | + select_coll(e) { | ||
26 | + var index = e.currentTarget.dataset.index; | ||
27 | + var itr = this.properties.all_collocation_list[index]; | ||
28 | + var ob = { | ||
29 | + index: index, | ||
30 | + selected: !itr.selected | ||
31 | + } | ||
32 | + | ||
33 | + if(this.properties.is_cart){ | ||
34 | + ob.is_cart =1; | ||
35 | + ob.cart_index =this.properties.cart_index; | ||
36 | + } | ||
37 | + | ||
38 | + var txt = "all_collocation_list[" + index + "].selected" | ||
39 | + | ||
40 | + this.setData({[txt]: ob.selected}) | ||
41 | + this.triggerEvent('childFun', ob); | ||
42 | + }, | ||
43 | + | ||
44 | + //图片失败,默认图片 | ||
45 | + bind_bnerr3: function (e) { | ||
46 | + var _errImg = e.target.dataset.errorimg; | ||
47 | + var _Img = e.target.dataset.img; | ||
48 | + if (_Img != undefined) { | ||
49 | + var _errObj = {}; | ||
50 | + _errObj[_errImg] = "/public/images/default_goods_image_240.gif"; | ||
51 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | ||
52 | + } | ||
53 | + }, | ||
54 | + | ||
55 | + | ||
56 | + } | ||
57 | +}) | ||
0 | \ No newline at end of file | 58 | \ No newline at end of file |
components/cart_collect_temp/cart_collect_temp.json
0 → 100644
components/cart_collect_temp/cart_collect_temp.wxml
0 → 100644
1 | +<!-- 如果有搭配购商品的售 --> | ||
2 | +<view class="seckill" wx:if="{{all_collocation_list && all_collocation_list.length != 0}}" | ||
3 | + style="border-bottom: 20rpx solid #F0F0F0;border-top: 20rpx solid #F0F0F0;"> | ||
4 | + <view class="fs30 pd20">超值搭配</view> | ||
5 | + <view class=""> | ||
6 | + <scroll-view scroll-x="true" class="s_proms" style="height:400rpx" indicator-active-color='red' bindchange="ptSwiperChange" indicator-dots> | ||
7 | + <view class="flex" style="padding: 0; margin-left: 10rpx"> | ||
8 | + <navigator wx:for="{{all_collocation_list}}" style="flex-shrink: 0;width: 247rpx" class="nav" hover-class="none" | ||
9 | + url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" > | ||
10 | + <view class="imgview" style="height:247rpx;width: 247rpx"> | ||
11 | + <image src="{{imgUrl+item.original_img}}" mode="aspectFill" lazy-load="true" | ||
12 | + data-errorimg="all_collocation_list[{{index}}].original_img" | ||
13 | + binderror="bind_bnerr3" data-img="{{item.original_img}}"></image> | ||
14 | + </view> | ||
15 | + <view class="ellipsis-2 fs30" style="height: 84rpx;">{{item.goods_name}}</view> | ||
16 | + <view class="co-red flex jc_sb ai_c" style="margin-top:6rpx"> | ||
17 | + <view><text class="fs20">¥</text>{{item.price}}</view> | ||
18 | + <view style="margin-right:10rpx" catchtap="select_coll" data-index="{{index}}" > | ||
19 | + <icon color="{{item.selected?'red':'gray'}}" size="14" type="success"></icon> | ||
20 | + </view> | ||
21 | + </view> | ||
22 | + </navigator> | ||
23 | + </view> | ||
24 | + </scroll-view> | ||
25 | + </view> | ||
26 | +</view> |
components/cart_collect_temp/cart_collect_temp.wxss
0 → 100644
components/diy_advertising/diy_advertising.wxss
@@ -66,6 +66,14 @@ | @@ -66,6 +66,14 @@ | ||
66 | margin: 0rpx; | 66 | margin: 0rpx; |
67 | } | 67 | } |
68 | 68 | ||
69 | +.s8_gk2 image { | ||
70 | + width: 100%; | ||
71 | + height: 488rpx; | ||
72 | + vertical-align: top; | ||
73 | + padding: 0rpx; | ||
74 | + margin: 0rpx; | ||
75 | +} | ||
76 | + | ||
69 | .s7_gk7 image { | 77 | .s7_gk7 image { |
70 | width: 100%; | 78 | width: 100%; |
71 | height: 100%; | 79 | height: 100%; |
components/diy_goodsGroup/diy_goodsGroup.js
@@ -56,6 +56,11 @@ Component({ | @@ -56,6 +56,11 @@ Component({ | ||
56 | title_class: "", | 56 | title_class: "", |
57 | is_no_plus: 1, | 57 | is_no_plus: 1, |
58 | container: null, | 58 | container: null, |
59 | + | ||
60 | + //判断接口是不是调用完成 | ||
61 | + is_get:0, | ||
62 | + | ||
63 | + is_retail_price:0 //是否显示零售价 | ||
59 | }, | 64 | }, |
60 | 65 | ||
61 | lifetimes: { | 66 | lifetimes: { |
@@ -315,44 +320,10 @@ Component({ | @@ -315,44 +320,10 @@ Component({ | ||
315 | getApp().getConfig2(function (e) { | 320 | getApp().getConfig2(function (e) { |
316 | var swithc_list = e.switch_list; | 321 | var swithc_list = e.switch_list; |
317 | var sw_arr = JSON.parse(swithc_list); | 322 | var sw_arr = JSON.parse(swithc_list); |
318 | - //---如果后台又开等级卡的开关--- | ||
319 | - if (sw_arr.rank_switch && sw_arr.rank_switch == "2") { | ||
320 | - th.setData({ | ||
321 | - rank_switch: true | ||
322 | - }); | ||
323 | - //---回调卡的列表--- | ||
324 | - th.getPlusCardType(function (ob) { | ||
325 | - th.setData({ | ||
326 | - card_list: ob.card_list | ||
327 | - }); | ||
328 | - var ti = setInterval(function () { | ||
329 | - var user = getApp().globalData.userInfo; | ||
330 | - if (!user) return false; | ||
331 | - clearInterval(ti); | ||
332 | - | ||
333 | - if (user.card_field && user['card_expiredate']) { | ||
334 | - var str = user['card_expiredate'].replace(/-/g, '/'); | ||
335 | - var end = new Date(str); | ||
336 | - end = Date.parse(end) / 1000; | ||
337 | - var now = ut.gettimestamp(); | ||
338 | - | ||
339 | - //--- 判断是等级会员,且在有效期范围内 --- | ||
340 | - if (user.card_field && now < end) { | ||
341 | - var card_name = ob.name_map.get(user.card_field); | ||
342 | - if (card_name && card_name.length > 4) card_name = card_name.substring(0, 4); | ||
343 | - th.setData({ | ||
344 | - card_field: user.card_field, | ||
345 | - card_name: card_name, | ||
346 | - card_list: ob.card_list | ||
347 | - }); | ||
348 | - } | ||
349 | - | ||
350 | - } | ||
351 | - | ||
352 | - }, 500) | ||
353 | - }) | ||
354 | - | 323 | + if(sw_arr.is_retail_price){ |
324 | + th.setData({is_retail_price:1}); | ||
355 | } | 325 | } |
326 | + ut.get_plus_name_price(sw_arr,th); | ||
356 | }) | 327 | }) |
357 | } | 328 | } |
358 | }) | 329 | }) |
@@ -571,11 +542,12 @@ Component({ | @@ -571,11 +542,12 @@ Component({ | ||
571 | for (var i = 0; i < rData.length; i += 3) { | 542 | for (var i = 0; i < rData.length; i += 3) { |
572 | arr.push(rData.slice(i, i + 3)); | 543 | arr.push(rData.slice(i, i + 3)); |
573 | } | 544 | } |
574 | - th.setData({ goods_array: arr, page: th.data.currentPage - 1, }); | 545 | + th.setData({ goods_array: arr, page: th.data.currentPage - 1,is_get:1 }); |
575 | } else { | 546 | } else { |
576 | th.setData({ | 547 | th.setData({ |
577 | goods_array: th.data.requestData, | 548 | goods_array: th.data.requestData, |
578 | page: th.data.currentPage - 1, | 549 | page: th.data.currentPage - 1, |
550 | + is_get:1 | ||
579 | }); | 551 | }); |
580 | } | 552 | } |
581 | 553 |
components/diy_goodsGroup/diy_goodsGroup.wxml
@@ -25,7 +25,7 @@ | @@ -25,7 +25,7 @@ | ||
25 | </block> | 25 | </block> |
26 | 26 | ||
27 | 27 | ||
28 | -<view style="background-color: {{bg_color}};" wx:if="{{goods_array.length > 0 }}"> | 28 | +<view style="background-color: {{bg_color}};" wx:if="{{goods_array.length > 0 }}"> |
29 | <!--1个列表的时候--> | 29 | <!--1个列表的时候--> |
30 | <view class="zs_goods_wai" wx:if='{{object.column==1}}'> | 30 | <view class="zs_goods_wai" wx:if='{{object.column==1}}'> |
31 | <block wx:for="{{goods_array}}"> | 31 | <block wx:for="{{goods_array}}"> |
@@ -67,7 +67,7 @@ | @@ -67,7 +67,7 @@ | ||
67 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> | 67 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> |
68 | <text wx:if="{{item.prom_price}}">¥{{item.prom_price}}</text> | 68 | <text wx:if="{{item.prom_price}}">¥{{item.prom_price}}</text> |
69 | </view> | 69 | </view> |
70 | -<!-- <view class='del'>¥{{item.market_price}}</view>--> | 70 | + <view wx:if="{{is_retail_price}}" class='del'>¥{{item.market_price}}</view> |
71 | </block> | 71 | </block> |
72 | <block wx:else> | 72 | <block wx:else> |
73 | 73 | ||
@@ -89,10 +89,10 @@ | @@ -89,10 +89,10 @@ | ||
89 | </view> | 89 | </view> |
90 | <view class="flex" style="line-height: 28rpx;"> | 90 | <view class="flex" style="line-height: 28rpx;"> |
91 | <!-- 原价 --> | 91 | <!-- 原价 --> |
92 | -<!-- <view class="price flex xc-ash line_th">--> | ||
93 | -<!-- <view class="fs22">¥</view>--> | ||
94 | -<!--<!– <view class="fs22">{{item.market_price}}</view>–>--> | ||
95 | -<!-- </view>--> | 92 | + <view wx:if="{{is_retail_price}}" class="price flex xc-ash line_th"> |
93 | + <view class="fs22">¥</view> | ||
94 | + <view class="fs22">{{item.market_price}}</view> | ||
95 | + </view> | ||
96 | </view> | 96 | </view> |
97 | </block> | 97 | </block> |
98 | <blocK wx:else> | 98 | <blocK wx:else> |
@@ -105,10 +105,10 @@ | @@ -105,10 +105,10 @@ | ||
105 | </view> | 105 | </view> |
106 | <view class="flex" style="line-height: 28rpx;"> | 106 | <view class="flex" style="line-height: 28rpx;"> |
107 | <!-- 原价 --> | 107 | <!-- 原价 --> |
108 | -<!-- <view class="price flex xc-ash line_th">--> | ||
109 | -<!-- <view class="fs22">¥</view>--> | ||
110 | -<!--<!– <view class="fs22">{{item.market_price}}</view>–>--> | ||
111 | -<!-- </view>--> | 108 | + <view wx:if="{{is_retail_price}}" class="price flex xc-ash line_th"> |
109 | + <view class="fs22">¥</view> | ||
110 | + <view class="fs22">{{item.market_price}}</view> | ||
111 | + </view> | ||
112 | </view> | 112 | </view> |
113 | </blocK> | 113 | </blocK> |
114 | </block> | 114 | </block> |
@@ -122,10 +122,10 @@ | @@ -122,10 +122,10 @@ | ||
122 | <view class="fs35 wz_red">{{filter.toFix(item.shop_price,2)}}</view> | 122 | <view class="fs35 wz_red">{{filter.toFix(item.shop_price,2)}}</view> |
123 | </view> | 123 | </view> |
124 | <!-- 原价 --> | 124 | <!-- 原价 --> |
125 | -<!-- <view class="price flex xc-ash line_th">--> | ||
126 | -<!-- <view class="fs22">¥</view>--> | ||
127 | -<!--<!– <view class="fs22">{{item.market_price}}</view>–>--> | ||
128 | -<!-- </view>--> | 125 | + <view wx:if="{{is_retail_price}}" class="price flex xc-ash line_th"> |
126 | + <view class="fs22">¥</view> | ||
127 | + <view class="fs22">{{item.market_price}}</view> | ||
128 | + </view> | ||
129 | 129 | ||
130 | </view> | 130 | </view> |
131 | <view class="flex" style="line-height: 28rpx;"> | 131 | <view class="flex" style="line-height: 28rpx;"> |
@@ -150,10 +150,10 @@ | @@ -150,10 +150,10 @@ | ||
150 | </view> | 150 | </view> |
151 | <view class="flex" style="line-height: 28rpx;"> | 151 | <view class="flex" style="line-height: 28rpx;"> |
152 | <!-- 原价 --> | 152 | <!-- 原价 --> |
153 | -<!-- <view class="price flex xc-ash line_th">--> | ||
154 | -<!-- <view class="fs22">¥</view>--> | ||
155 | -<!-- <view class="fs22">{{item.market_price}}</view>--> | ||
156 | -<!-- </view>--> | 153 | + <view wx:if="{{is_retail_price}}" class="price flex xc-ash line_th"> |
154 | + <view class="fs22">¥</view> | ||
155 | + <view class="fs22">{{item.market_price}}</view> | ||
156 | + </view> | ||
157 | </view> | 157 | </view> |
158 | </block> | 158 | </block> |
159 | </block> | 159 | </block> |
@@ -161,7 +161,7 @@ | @@ -161,7 +161,7 @@ | ||
161 | 161 | ||
162 | <block wx:else> | 162 | <block wx:else> |
163 | <view class='wz_red'>¥{{item.shop_price}}</view> | 163 | <view class='wz_red'>¥{{item.shop_price}}</view> |
164 | -<!-- <view class='del'>¥{{item.market_price}}</view>--> | 164 | + <view wx:if="{{is_retail_price}}"class='del'>¥{{item.market_price}}</view> |
165 | </block> | 165 | </block> |
166 | 166 | ||
167 | </block> | 167 | </block> |
@@ -237,7 +237,7 @@ | @@ -237,7 +237,7 @@ | ||
237 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> | 237 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> |
238 | <text wx:if="{{item.prom_price}}">¥{{item.prom_price}}</text> | 238 | <text wx:if="{{item.prom_price}}">¥{{item.prom_price}}</text> |
239 | </view> | 239 | </view> |
240 | -<!-- <view class='del'>¥{{item.market_price}}</view>--> | 240 | + <view wx:if="{{is_retail_price}}" class='del'>¥{{item.market_price}}</view> |
241 | </block> | 241 | </block> |
242 | <block wx:else> | 242 | <block wx:else> |
243 | <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}"> | 243 | <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}"> |
@@ -258,10 +258,10 @@ | @@ -258,10 +258,10 @@ | ||
258 | </view> | 258 | </view> |
259 | <view class="flex" style="line-height: 28rpx;"> | 259 | <view class="flex" style="line-height: 28rpx;"> |
260 | <!-- 原价 --> | 260 | <!-- 原价 --> |
261 | -<!-- <view class="price flex xc-ash line_th">--> | ||
262 | -<!-- <view class="fs22">¥</view>--> | ||
263 | -<!-- <view class="fs22">{{item.market_price}}</view>--> | ||
264 | -<!-- </view>--> | 261 | + <view wx:if="{{is_retail_price}}" class="price flex xc-ash line_th"> |
262 | + <view class="fs22">¥</view> | ||
263 | + <view class="fs22">{{item.market_price}}</view> | ||
264 | + </view> | ||
265 | </view> | 265 | </view> |
266 | </block> | 266 | </block> |
267 | <blocK wx:else> | 267 | <blocK wx:else> |
@@ -274,10 +274,10 @@ | @@ -274,10 +274,10 @@ | ||
274 | </view> | 274 | </view> |
275 | <view class="flex" style="line-height: 28rpx;"> | 275 | <view class="flex" style="line-height: 28rpx;"> |
276 | <!-- 原价 --> | 276 | <!-- 原价 --> |
277 | -<!-- <view class="price flex xc-ash line_th">--> | ||
278 | -<!-- <view class="fs22">¥</view>--> | ||
279 | -<!-- <view class="fs22">{{item.market_price}}</view>--> | ||
280 | -<!-- </view>--> | 277 | + <view wx:if="{{is_retail_price}}" class="price flex xc-ash line_th"> |
278 | + <view class="fs22">¥</view> | ||
279 | + <view class="fs22">{{item.market_price}}</view> | ||
280 | + </view> | ||
281 | </view> | 281 | </view> |
282 | </blocK> | 282 | </blocK> |
283 | </block> | 283 | </block> |
@@ -291,10 +291,10 @@ | @@ -291,10 +291,10 @@ | ||
291 | <view class="fs35 wz_red">{{filter.toFix(item.shop_price,2)}}</view> | 291 | <view class="fs35 wz_red">{{filter.toFix(item.shop_price,2)}}</view> |
292 | </view> | 292 | </view> |
293 | <!-- 原价 --> | 293 | <!-- 原价 --> |
294 | -<!-- <view class="price flex xc-ash line_th">--> | ||
295 | -<!-- <view class="fs22">¥</view>--> | ||
296 | -<!-- <view class="fs22">{{item.market_price}}</view>--> | ||
297 | -<!-- </view>--> | 294 | + <view wx:if="{{is_retail_price}}" class="price flex xc-ash line_th"> |
295 | + <view class="fs22">¥</view> | ||
296 | + <view class="fs22">{{item.market_price}}</view> | ||
297 | + </view> | ||
298 | 298 | ||
299 | </view> | 299 | </view> |
300 | <view class="flex" style="line-height: 28rpx;"> | 300 | <view class="flex" style="line-height: 28rpx;"> |
@@ -319,17 +319,17 @@ | @@ -319,17 +319,17 @@ | ||
319 | </view> | 319 | </view> |
320 | <view class="flex" style="line-height: 28rpx;"> | 320 | <view class="flex" style="line-height: 28rpx;"> |
321 | <!-- 原价 --> | 321 | <!-- 原价 --> |
322 | -<!-- <view class="price flex xc-ash line_th">--> | ||
323 | -<!-- <view class="fs22">¥</view>--> | ||
324 | -<!-- <view class="fs22">{{item.market_price}}</view>--> | ||
325 | -<!-- </view>--> | 322 | + <view wx:if="{{is_retail_price}}" class="price flex xc-ash line_th"> |
323 | + <view class="fs22">¥</view> | ||
324 | + <view class="fs22">{{item.market_price}}</view> | ||
325 | + </view> | ||
326 | </view> | 326 | </view> |
327 | </block> | 327 | </block> |
328 | </block> | 328 | </block> |
329 | </block> | 329 | </block> |
330 | <block wx:else> | 330 | <block wx:else> |
331 | <view class='wz_red'>¥{{item.shop_price}}</view> | 331 | <view class='wz_red'>¥{{item.shop_price}}</view> |
332 | -<!-- <view class='del'>¥{{item.market_price}}</view>--> | 332 | + <view wx:if="{{is_retail_price}}" class='del'>¥{{item.market_price}}</view> |
333 | </block> | 333 | </block> |
334 | </block> | 334 | </block> |
335 | </view> | 335 | </view> |
@@ -406,7 +406,7 @@ | @@ -406,7 +406,7 @@ | ||
406 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> | 406 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> |
407 | <text wx:if="{{item.prom_price}}">¥{{item.prom_price}}</text> | 407 | <text wx:if="{{item.prom_price}}">¥{{item.prom_price}}</text> |
408 | </view> | 408 | </view> |
409 | -<!-- <view class='del'>¥{{item.market_price}}</view>--> | 409 | + <view wx:if="{{is_retail_price}}" class='del'>¥{{item.market_price}}</view> |
410 | </block> | 410 | </block> |
411 | <block wx:else> | 411 | <block wx:else> |
412 | <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}"> | 412 | <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}"> |
@@ -427,10 +427,10 @@ | @@ -427,10 +427,10 @@ | ||
427 | </view> | 427 | </view> |
428 | <view class="flex" style="line-height: 28rpx;"> | 428 | <view class="flex" style="line-height: 28rpx;"> |
429 | <!-- 原价 --> | 429 | <!-- 原价 --> |
430 | -<!-- <view class="price flex xc-ash line_th">--> | ||
431 | -<!-- <view class="fs22">¥</view>--> | ||
432 | -<!-- <view class="fs22">{{item.market_price}}</view>--> | ||
433 | -<!-- </view>--> | 430 | + <view wx:if="{{is_retail_price}}" class="price flex xc-ash line_th"> |
431 | + <view class="fs22">¥</view> | ||
432 | + <view class="fs22">{{item.market_price}}</view> | ||
433 | + </view> | ||
434 | </view> | 434 | </view> |
435 | </block> | 435 | </block> |
436 | <blocK wx:else> | 436 | <blocK wx:else> |
@@ -443,10 +443,10 @@ | @@ -443,10 +443,10 @@ | ||
443 | </view> | 443 | </view> |
444 | <view class="flex" style="line-height: 28rpx;"> | 444 | <view class="flex" style="line-height: 28rpx;"> |
445 | <!-- 原价 --> | 445 | <!-- 原价 --> |
446 | -<!-- <view class="price flex xc-ash line_th">--> | ||
447 | -<!-- <view class="fs22">¥</view>--> | ||
448 | -<!-- <view class="fs22">{{item.market_price}}</view>--> | ||
449 | -<!-- </view>--> | 446 | + <view wx:if="{{is_retail_price}}" class="price flex xc-ash line_th"> |
447 | + <view class="fs22">¥</view> | ||
448 | + <view class="fs22">{{item.market_price}}</view> | ||
449 | + </view> | ||
450 | </view> | 450 | </view> |
451 | </blocK> | 451 | </blocK> |
452 | </block> | 452 | </block> |
@@ -460,10 +460,10 @@ | @@ -460,10 +460,10 @@ | ||
460 | <view class="fs35 wz_red">{{filter.toFix(item.shop_price,2)}}</view> | 460 | <view class="fs35 wz_red">{{filter.toFix(item.shop_price,2)}}</view> |
461 | </view> | 461 | </view> |
462 | <!-- 原价 --> | 462 | <!-- 原价 --> |
463 | -<!-- <view class="price flex xc-ash line_th">--> | ||
464 | -<!-- <view class="fs22">¥</view>--> | ||
465 | -<!-- <view class="fs22">{{item.market_price}}</view>--> | ||
466 | -<!-- </view>--> | 463 | + <view wx:if="{{is_retail_price}}" class="price flex xc-ash line_th"> |
464 | + <view class="fs22">¥</view> | ||
465 | + <view class="fs22">{{item.market_price}}</view> | ||
466 | + </view> | ||
467 | 467 | ||
468 | </view> | 468 | </view> |
469 | <view class="flex" style="line-height: 28rpx;"> | 469 | <view class="flex" style="line-height: 28rpx;"> |
@@ -488,17 +488,17 @@ | @@ -488,17 +488,17 @@ | ||
488 | </view> | 488 | </view> |
489 | <view class="flex" style="line-height: 28rpx;"> | 489 | <view class="flex" style="line-height: 28rpx;"> |
490 | <!-- 原价 --> | 490 | <!-- 原价 --> |
491 | -<!-- <view class="price flex xc-ash line_th">--> | ||
492 | -<!-- <view class="fs22">¥</view>--> | ||
493 | -<!-- <view class="fs22">{{item.market_price}}</view>--> | ||
494 | -<!-- </view>--> | 491 | + <view class="price flex xc-ash line_th"> |
492 | + <view class="fs22">¥</view> | ||
493 | + <view class="fs22">{{item.market_price}}</view> | ||
494 | + </view> | ||
495 | </view> | 495 | </view> |
496 | </block> | 496 | </block> |
497 | </block> | 497 | </block> |
498 | </block> | 498 | </block> |
499 | <block wx:else> | 499 | <block wx:else> |
500 | <view class='wz_red'>¥{{item.shop_price}}</view> | 500 | <view class='wz_red'>¥{{item.shop_price}}</view> |
501 | -<!-- <view class='del'>¥{{item.market_price}}</view>--> | 501 | + <view wx:if="{{is_retail_price}}" class='del'>¥{{item.market_price}}</view> |
502 | </block> | 502 | </block> |
503 | </block> | 503 | </block> |
504 | </view> | 504 | </view> |
@@ -577,7 +577,7 @@ | @@ -577,7 +577,7 @@ | ||
577 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> | 577 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> |
578 | <text wx:if="{{item.prom_price}}">¥{{item.prom_price}}</text> | 578 | <text wx:if="{{item.prom_price}}">¥{{item.prom_price}}</text> |
579 | </view> | 579 | </view> |
580 | -<!-- <view class='del'>¥{{item.market_price}}</view>--> | 580 | + <view wx:if="{{is_retail_price}}" class='del'>¥{{item.market_price}}</view> |
581 | </block> | 581 | </block> |
582 | <!-- 不是活动的情况 --> | 582 | <!-- 不是活动的情况 --> |
583 | <block wx:else> | 583 | <block wx:else> |
@@ -600,10 +600,10 @@ | @@ -600,10 +600,10 @@ | ||
600 | </view> | 600 | </view> |
601 | <view class="flex" style="line-height: 28rpx;"> | 601 | <view class="flex" style="line-height: 28rpx;"> |
602 | <!-- 原价 --> | 602 | <!-- 原价 --> |
603 | -<!-- <view class="price flex xc-ash line_th">--> | ||
604 | -<!-- <view class="fs22">¥</view>--> | ||
605 | -<!-- <view class="fs22">{{item.market_price}}</view>--> | ||
606 | -<!-- </view>--> | 603 | + <view wx:if="{{is_retail_price}}" class="price flex xc-ash line_th"> |
604 | + <view class="fs22">¥</view> | ||
605 | + <view class="fs22">{{item.market_price}}</view> | ||
606 | + </view> | ||
607 | </view> | 607 | </view> |
608 | </block> | 608 | </block> |
609 | <blocK wx:else> | 609 | <blocK wx:else> |
@@ -616,10 +616,10 @@ | @@ -616,10 +616,10 @@ | ||
616 | </view> | 616 | </view> |
617 | <view class="flex" style="line-height: 28rpx;"> | 617 | <view class="flex" style="line-height: 28rpx;"> |
618 | <!-- 原价 --> | 618 | <!-- 原价 --> |
619 | -<!-- <view class="price flex xc-ash line_th">--> | ||
620 | -<!-- <view class="fs22">¥</view>--> | ||
621 | -<!-- <view class="fs22">{{item.market_price}}</view>--> | ||
622 | -<!-- </view>--> | 619 | + <view wx:if="{{is_retail_price}}" class="price flex xc-ash line_th"> |
620 | + <view class="fs22">¥</view> | ||
621 | + <view class="fs22">{{item.market_price}}</view> | ||
622 | + </view> | ||
623 | </view> | 623 | </view> |
624 | </blocK> | 624 | </blocK> |
625 | </block> | 625 | </block> |
@@ -633,10 +633,10 @@ | @@ -633,10 +633,10 @@ | ||
633 | <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view> | 633 | <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view> |
634 | </view> | 634 | </view> |
635 | <!-- 原价 --> | 635 | <!-- 原价 --> |
636 | -<!-- <view class="price flex xc-ash line_th">--> | ||
637 | -<!-- <view class="fs22">¥</view>--> | ||
638 | -<!-- <view class="fs22">{{item.market_price}}</view>--> | ||
639 | -<!-- </view>--> | 636 | + <view wx:if="{{is_retail_price}}" class="price flex xc-ash line_th"> |
637 | + <view class="fs22">¥</view> | ||
638 | + <view class="fs22">{{item.market_price}}</view> | ||
639 | + </view> | ||
640 | 640 | ||
641 | </view> | 641 | </view> |
642 | <view class="flex" style="line-height: 28rpx;"> | 642 | <view class="flex" style="line-height: 28rpx;"> |
@@ -660,10 +660,10 @@ | @@ -660,10 +660,10 @@ | ||
660 | </view> | 660 | </view> |
661 | <view class="flex" style="line-height: 28rpx;"> | 661 | <view class="flex" style="line-height: 28rpx;"> |
662 | <!-- 原价 --> | 662 | <!-- 原价 --> |
663 | -<!-- <view class="price flex xc-ash line_th">--> | ||
664 | -<!-- <view class="fs22">¥</view>--> | ||
665 | -<!-- <view class="fs22">{{item.market_price}}</view>--> | ||
666 | -<!-- </view>--> | 663 | + <view wx:if="{{is_retail_price}}" class="price flex xc-ash line_th"> |
664 | + <view class="fs22">¥</view> | ||
665 | + <view class="fs22">{{item.market_price}}</view> | ||
666 | + </view> | ||
667 | </view> | 667 | </view> |
668 | </block> | 668 | </block> |
669 | </block> | 669 | </block> |
@@ -671,7 +671,7 @@ | @@ -671,7 +671,7 @@ | ||
671 | 671 | ||
672 | <block wx:else> | 672 | <block wx:else> |
673 | <view class='wz_red'>¥{{item.shop_price}}</view> | 673 | <view class='wz_red'>¥{{item.shop_price}}</view> |
674 | -<!-- <view class='del'>¥{{item.market_price}}</view>--> | 674 | + <view wx:if="{{is_retail_price}}" class='del'>¥{{item.market_price}}</view> |
675 | </block> | 675 | </block> |
676 | 676 | ||
677 | </block> | 677 | </block> |
@@ -772,7 +772,7 @@ | @@ -772,7 +772,7 @@ | ||
772 | <text wx:if="{{aitem.prom_integral && aitem.prom_price}}">+</text> | 772 | <text wx:if="{{aitem.prom_integral && aitem.prom_price}}">+</text> |
773 | <text wx:if="{{aitem.prom_price}}">¥{{aitem.prom_price}}</text> | 773 | <text wx:if="{{aitem.prom_price}}">¥{{aitem.prom_price}}</text> |
774 | </view> | 774 | </view> |
775 | -<!-- <view class='del'>¥{{aitem.market_price}}</view>--> | 775 | + <view wx:if="{{is_retail_price}}" class='del'>¥{{aitem.market_price}}</view> |
776 | </block> | 776 | </block> |
777 | <block wx:else> | 777 | <block wx:else> |
778 | <block wx:if="{{g_filter.is_has_rank(rank_switch,aitem)}}"> | 778 | <block wx:if="{{g_filter.is_has_rank(rank_switch,aitem)}}"> |
@@ -793,10 +793,10 @@ | @@ -793,10 +793,10 @@ | ||
793 | </view> | 793 | </view> |
794 | <view class="flex" style="line-height: 28rpx;"> | 794 | <view class="flex" style="line-height: 28rpx;"> |
795 | <!-- 原价 --> | 795 | <!-- 原价 --> |
796 | -<!-- <view class="price flex xc-ash line_th">--> | ||
797 | -<!-- <view class="fs22">¥</view>--> | ||
798 | -<!-- <view class="fs22">{{aitem.market_price}}</view>--> | ||
799 | -<!-- </view>--> | 796 | + <view wx:if="{{is_retail_price}}" class="price flex xc-ash line_th"> |
797 | + <view class="fs22">¥</view> | ||
798 | + <view class="fs22">{{aitem.market_price}}</view> | ||
799 | + </view> | ||
800 | </view> | 800 | </view> |
801 | </block> | 801 | </block> |
802 | <blocK wx:else> | 802 | <blocK wx:else> |
@@ -809,10 +809,10 @@ | @@ -809,10 +809,10 @@ | ||
809 | </view> | 809 | </view> |
810 | <view class="flex" style="line-height: 28rpx;"> | 810 | <view class="flex" style="line-height: 28rpx;"> |
811 | <!-- 原价 --> | 811 | <!-- 原价 --> |
812 | -<!-- <view class="price flex xc-ash line_th">--> | ||
813 | -<!-- <view class="fs22">¥</view>--> | ||
814 | -<!-- <view class="fs22">{{aitem.market_price}}</view>--> | ||
815 | -<!-- </view>--> | 812 | + <view wx:if="{{is_retail_price}}" class="price flex xc-ash line_th"> |
813 | + <view class="fs22">¥</view> | ||
814 | + <view class="fs22">{{aitem.market_price}}</view> | ||
815 | + </view> | ||
816 | </view> | 816 | </view> |
817 | </blocK> | 817 | </blocK> |
818 | </block> | 818 | </block> |
@@ -826,10 +826,10 @@ | @@ -826,10 +826,10 @@ | ||
826 | <view class="fs35 wz_red">{{filter.toFix(aitem.shop_price,2)}}</view> | 826 | <view class="fs35 wz_red">{{filter.toFix(aitem.shop_price,2)}}</view> |
827 | </view> | 827 | </view> |
828 | <!-- 原价 --> | 828 | <!-- 原价 --> |
829 | -<!-- <view class="price flex xc-ash line_th">--> | ||
830 | -<!-- <view class="fs22">¥</view>--> | ||
831 | -<!-- <view class="fs22">{{aitem.market_price}}</view>--> | ||
832 | -<!-- </view>--> | 829 | + <view wx:if="{{is_retail_price}}" class="price flex xc-ash line_th"> |
830 | + <view class="fs22">¥</view> | ||
831 | + <view class="fs22">{{aitem.market_price}}</view> | ||
832 | + </view> | ||
833 | 833 | ||
834 | </view> | 834 | </view> |
835 | <view class="flex" style="line-height: 28rpx;"> | 835 | <view class="flex" style="line-height: 28rpx;"> |
@@ -854,17 +854,17 @@ | @@ -854,17 +854,17 @@ | ||
854 | </view> | 854 | </view> |
855 | <view class="flex" style="line-height: 28rpx;"> | 855 | <view class="flex" style="line-height: 28rpx;"> |
856 | <!-- 原价 --> | 856 | <!-- 原价 --> |
857 | -<!-- <view class="price flex xc-ash line_th">--> | ||
858 | -<!-- <view class="fs22">¥</view>--> | ||
859 | -<!-- <view class="fs22">{{aitem.market_price}}</view>--> | ||
860 | -<!-- </view>--> | 857 | + <view wx:if="{{is_retail_price}}" class="price flex xc-ash line_th"> |
858 | + <view class="fs22">¥</view> | ||
859 | + <view class="fs22">{{aitem.market_price}}</view> | ||
860 | + </view> | ||
861 | </view> | 861 | </view> |
862 | </block> | 862 | </block> |
863 | </block> | 863 | </block> |
864 | </block> | 864 | </block> |
865 | <block wx:else> | 865 | <block wx:else> |
866 | <view class='wz_red'>¥{{aitem.shop_price}}</view> | 866 | <view class='wz_red'>¥{{aitem.shop_price}}</view> |
867 | -<!-- <view class='del'>¥{{aitem.market_price}}</view>--> | 867 | + <view wx:if="{{is_retail_price}}" class='del'>¥{{aitem.market_price}}</view> |
868 | </block> | 868 | </block> |
869 | </block> | 869 | </block> |
870 | </view> | 870 | </view> |
@@ -898,5 +898,8 @@ | @@ -898,5 +898,8 @@ | ||
898 | </swiper> | 898 | </swiper> |
899 | 899 | ||
900 | </view> | 900 | </view> |
901 | -<view class="nodata-title" wx:else>暂无数据</view> | 901 | +<view class="nodata-title" wx:elif="{{is_get}}">暂无数据</view> |
902 | +<view class="flex jcc loader" wx:else> | ||
903 | + <image style="width: 40rpx; height: 40rpx; " src="{{url}}/miniapp/images/loader.gif"></image> | ||
904 | +</view> | ||
902 | </view> | 905 | </view> |
903 | \ No newline at end of file | 906 | \ No newline at end of file |
components/diy_goodsGroup/diy_goodsGroup.wxss
components/diy_groupbuy/diy_groupbuy.js
@@ -59,7 +59,19 @@ Component({ | @@ -59,7 +59,19 @@ Component({ | ||
59 | 59 | ||
60 | 60 | ||
61 | init: function (g_id) { | 61 | init: function (g_id) { |
62 | - var th = this, app = getApp(), goodsidlist = ""; | 62 | + |
63 | + var th=this; | ||
64 | + getApp().getConfig2(function (e) { | ||
65 | + var swithc_list = e.switch_list; | ||
66 | + var sw_arr = JSON.parse(swithc_list); | ||
67 | + | ||
68 | + if(sw_arr.is_retail_price){ | ||
69 | + th.setData({is_retail_price:1}); | ||
70 | + } | ||
71 | + }) | ||
72 | + | ||
73 | + | ||
74 | + var app = getApp(), goodsidlist = ""; | ||
63 | if (g_id.data && g_id.data.length > 0) { | 75 | if (g_id.data && g_id.data.length > 0) { |
64 | //--先把商品ID串起来-- | 76 | //--先把商品ID串起来-- |
65 | g_id.data.forEach(function (val, ind) { | 77 | g_id.data.forEach(function (val, ind) { |
components/diy_groupbuy/diy_groupbuy.wxml
@@ -39,7 +39,7 @@ | @@ -39,7 +39,7 @@ | ||
39 | <view class='sp_wz'> | 39 | <view class='sp_wz'> |
40 | <view class='sp_wzi'>{{aitem.goods_name}}</view> | 40 | <view class='sp_wzi'>{{aitem.goods_name}}</view> |
41 | <view class='sp_jg'>¥{{aitem.price}}</view> | 41 | <view class='sp_jg'>¥{{aitem.price}}</view> |
42 | -<!-- <view class='sp_jgx'>¥{{aitem.shop_price}}</view>--> | 42 | + <view wx:if="{{is_retail_price}}" class='sp_jgx'>¥{{aitem.market_price}}</view> |
43 | </view> | 43 | </view> |
44 | <!-- <view class="progress_box"> | 44 | <!-- <view class="progress_box"> |
45 | <text class="on_sale_list">已买:{{aitem.buy_num + aitem.virtual_num}}件</text> | 45 | <text class="on_sale_list">已买:{{aitem.buy_num + aitem.virtual_num}}件</text> |
@@ -94,7 +94,7 @@ | @@ -94,7 +94,7 @@ | ||
94 | </view> | 94 | </view> |
95 | <view> | 95 | <view> |
96 | <view class='sp_jg'>¥{{aitem.price}}</view> | 96 | <view class='sp_jg'>¥{{aitem.price}}</view> |
97 | -<!-- <view class='sp_jgx'>¥{{aitem.shop_price}}</view>--> | 97 | + <view wx:if="{{is_retail_price}}" class='sp_jgx'>¥{{aitem.market_price}}</view> |
98 | </view> | 98 | </view> |
99 | </view> | 99 | </view> |
100 | </view> | 100 | </view> |
components/diy_luckyGo/diy_luckyGo.js
@@ -60,7 +60,18 @@ Component({ | @@ -60,7 +60,18 @@ Component({ | ||
60 | // 这里是一个自定义方法 | 60 | // 这里是一个自定义方法 |
61 | customMethod: function () { }, | 61 | customMethod: function () { }, |
62 | init: function (g_id) { | 62 | init: function (g_id) { |
63 | - var th = this, app = getApp(), goodsidlist = ""; | 63 | + var th = this; |
64 | + | ||
65 | + getApp().getConfig2(function (e) { | ||
66 | + var swithc_list = e.switch_list; | ||
67 | + var sw_arr = JSON.parse(swithc_list); | ||
68 | + | ||
69 | + if(sw_arr.is_retail_price){ | ||
70 | + th.setData({is_retail_price:1}); | ||
71 | + } | ||
72 | + }) | ||
73 | + | ||
74 | + var app = getApp(), goodsidlist = ""; | ||
64 | if (g_id.data_type == 2) { | 75 | if (g_id.data_type == 2) { |
65 | if (g_id.data && g_id.data.length > 0) { | 76 | if (g_id.data && g_id.data.length > 0) { |
66 | //--先把商品ID串起来-- | 77 | //--先把商品ID串起来-- |
components/diy_luckyGo/diy_luckyGo.wxml
@@ -27,9 +27,9 @@ | @@ -27,9 +27,9 @@ | ||
27 | 27 | ||
28 | <view class="ellipsis-2 name fs28 clearbadge">{{aitem.title}}</view> | 28 | <view class="ellipsis-2 name fs28 clearbadge">{{aitem.title}}</view> |
29 | <view> | 29 | <view> |
30 | - <view class="flex ai-center"> | 30 | + <view class="flex ai-center" style="align-items: center;"> |
31 | <text class="rmb c-red">{{filters.price(aitem.group_price)}}</text> | 31 | <text class="rmb c-red">{{filters.price(aitem.group_price)}}</text> |
32 | -<!-- <view class="del fs22 c-a pdl10"><text class="rmb">{{aitem.shop_price}}</text></view>--> | 32 | + <view style="position: relative;top:-2rpx" wx:if="{{is_retail_price}}" class="del fs22 c-a pdl10"><text class="rmb">{{aitem.market_price}}</text></view> |
33 | </view> | 33 | </view> |
34 | </view> | 34 | </view> |
35 | 35 |
components/diy_pingd_buy/diy_pingd_buy.js
@@ -65,8 +65,22 @@ Component({ | @@ -65,8 +65,22 @@ Component({ | ||
65 | // 这里是一个自定义方法 | 65 | // 这里是一个自定义方法 |
66 | customMethod: function() {}, | 66 | customMethod: function() {}, |
67 | init: function(g_id) { | 67 | init: function(g_id) { |
68 | - var th = this, | ||
69 | - app = getApp(), all_array = [], | 68 | + |
69 | + var th = this; | ||
70 | + getApp().getConfig2(function (e) { | ||
71 | + var swithc_list = e.switch_list; | ||
72 | + var sw_arr = JSON.parse(swithc_list); | ||
73 | + | ||
74 | + if(sw_arr.is_retail_price){ | ||
75 | + th.setData({is_retail_price:1}); | ||
76 | + } | ||
77 | + }) | ||
78 | + | ||
79 | + | ||
80 | + | ||
81 | + | ||
82 | + | ||
83 | + var app = getApp(), all_array = [], | ||
70 | index = 0, | 84 | index = 0, |
71 | goodsidlist=""; | 85 | goodsidlist=""; |
72 | 86 |
components/diy_pingd_buy/diy_pingd_buy.wxml
@@ -46,7 +46,7 @@ | @@ -46,7 +46,7 @@ | ||
46 | <view class='sp_wz_p'> | 46 | <view class='sp_wz_p'> |
47 | <view class='sp_wzi_p'>{{aitem.title}}</view> | 47 | <view class='sp_wzi_p'>{{aitem.title}}</view> |
48 | <view class='sp_jg_p'>¥{{aitem.price}}</view> | 48 | <view class='sp_jg_p'>¥{{aitem.price}}</view> |
49 | - <!--<view class='sp_jgx_p'>¥{{aitem.market_price}}</view>--> | 49 | + <view wx:if="{{is_retail_price}}" class='sp_jgx_p'>¥{{aitem.market_price}}</view> |
50 | 50 | ||
51 | <view class="tuan_set_num"> | 51 | <view class="tuan_set_num"> |
52 | <view class="co-red2">{{aitem.ct_num}}人团</view> | 52 | <view class="co-red2">{{aitem.ct_num}}人团</view> |
@@ -91,7 +91,7 @@ | @@ -91,7 +91,7 @@ | ||
91 | </view> | 91 | </view> |
92 | <view class="money"> | 92 | <view class="money"> |
93 | <view class='sp_jg_p'>¥{{aitem.price}}</view> | 93 | <view class='sp_jg_p'>¥{{aitem.price}}</view> |
94 | -<!-- <view class='sp_jgx_p'>¥{{aitem.shop_price}}</view>--> | 94 | + <view wx:if="{{is_retail_price}}" class='sp_jgx_p'>¥{{aitem.market_price}}</view> |
95 | </view> | 95 | </view> |
96 | <view class="o1_sj_p" wx:if="{{aitem.end_time>newTime}}"> | 96 | <view class="o1_sj_p" wx:if="{{aitem.end_time>newTime}}"> |
97 | <image class="time_img" src="{{iurl}}/miniapp/images/time.png"></image> | 97 | <image class="time_img" src="{{iurl}}/miniapp/images/time.png"></image> |
components/diy_pregoods/diy_pregoods.js
@@ -33,7 +33,19 @@ Component({ | @@ -33,7 +33,19 @@ Component({ | ||
33 | methods: { | 33 | methods: { |
34 | // 这里是一个自定义方法 | 34 | // 这里是一个自定义方法 |
35 | init: function(g_id) { | 35 | init: function(g_id) { |
36 | - var th = this, app = getApp(), goodsidlist=""; | 36 | + var th = this; |
37 | + | ||
38 | + getApp().getConfig2(function (e) { | ||
39 | + var swithc_list = e.switch_list; | ||
40 | + var sw_arr = JSON.parse(swithc_list); | ||
41 | + | ||
42 | + if(sw_arr.is_retail_price){ | ||
43 | + th.setData({is_retail_price:1}); | ||
44 | + } | ||
45 | + }) | ||
46 | + | ||
47 | + | ||
48 | + var app = getApp(), goodsidlist=""; | ||
37 | if(g_id && g_id.length>0){ | 49 | if(g_id && g_id.length>0){ |
38 | //--先把商品ID串起来-- | 50 | //--先把商品ID串起来-- |
39 | g_id.forEach(function(val, ind) { | 51 | g_id.forEach(function(val, ind) { |
components/diy_pregoods/diy_pregoods.wxml
@@ -57,7 +57,7 @@ | @@ -57,7 +57,7 @@ | ||
57 | <view class='sp_wz'> | 57 | <view class='sp_wz'> |
58 | <view class='sp_wzi'>{{aitem.act_name}}</view> | 58 | <view class='sp_wzi'>{{aitem.act_name}}</view> |
59 | <view class='sp_jg'>¥{{aitem.presell_price}}</view> | 59 | <view class='sp_jg'>¥{{aitem.presell_price}}</view> |
60 | -<!-- <view class='sp_jgx'>¥{{aitem.shop_price}}</view>--> | 60 | + <view wx:if="{{is_retail_price}}" class='sp_jgx'>¥{{aitem.shop_price}}</view> |
61 | </view> | 61 | </view> |
62 | 62 | ||
63 | </view> | 63 | </view> |
@@ -88,7 +88,7 @@ | @@ -88,7 +88,7 @@ | ||
88 | </view> | 88 | </view> |
89 | <view class="money"> | 89 | <view class="money"> |
90 | <view class='sp_jg'>¥{{aitem.presell_price}}</view> | 90 | <view class='sp_jg'>¥{{aitem.presell_price}}</view> |
91 | - <view class='sp_jgx'>¥{{aitem.market_price}}</view> | 91 | + <view wx:if="{{is_retail_price}}"class='sp_jgx'>¥{{aitem.market_price}}</view> |
92 | </view> | 92 | </view> |
93 | 93 | ||
94 | <block wx:if="{{aitem.end_time<newTime}}"> | 94 | <block wx:if="{{aitem.end_time<newTime}}"> |
components/diy_seckill/diy_seckill.js
@@ -78,7 +78,19 @@ Component({ | @@ -78,7 +78,19 @@ Component({ | ||
78 | // 这里是一个自定义方法 | 78 | // 这里是一个自定义方法 |
79 | customMethod: function () { }, | 79 | customMethod: function () { }, |
80 | init: function (g_id) { | 80 | init: function (g_id) { |
81 | - var th = this, app = getApp(), goodsidlist = "", idlist = ""; | 81 | + var th = this; |
82 | + | ||
83 | + getApp().getConfig2(function (e) { | ||
84 | + var swithc_list = e.switch_list; | ||
85 | + var sw_arr = JSON.parse(swithc_list); | ||
86 | + | ||
87 | + if(sw_arr.is_retail_price){ | ||
88 | + th.setData({is_retail_price:1}); | ||
89 | + } | ||
90 | + }) | ||
91 | + | ||
92 | + | ||
93 | + var app = getApp(), goodsidlist = "", idlist = ""; | ||
82 | if (g_id.data_type == 2) { | 94 | if (g_id.data_type == 2) { |
83 | if (g_id.data && g_id.data.length > 0) { | 95 | if (g_id.data && g_id.data.length > 0) { |
84 | //--先把商品ID串起来-- | 96 | //--先把商品ID串起来-- |
components/diy_seckill/diy_seckill.wxml
@@ -82,7 +82,7 @@ | @@ -82,7 +82,7 @@ | ||
82 | <view class='sp_wz'> | 82 | <view class='sp_wz'> |
83 | <view class='sp_wzi ellipsis-2'>{{aitem.goods_name}}</view> | 83 | <view class='sp_wzi ellipsis-2'>{{aitem.goods_name}}</view> |
84 | <view class='sp_jg'>¥{{aitem.price}}</view> | 84 | <view class='sp_jg'>¥{{aitem.price}}</view> |
85 | -<!-- <view class='sp_jgx'>¥{{aitem.shop_price}}</view>--> | 85 | + <view wx:if="{{is_retail_price}}"class='sp_jgx'>¥{{aitem.market_price}}</view> |
86 | </view> | 86 | </view> |
87 | 87 | ||
88 | </view> | 88 | </view> |
components/goods_list/goods_list.js
@@ -18,14 +18,29 @@ Component({ | @@ -18,14 +18,29 @@ Component({ | ||
18 | max_card_field: "", | 18 | max_card_field: "", |
19 | card_list: null, | 19 | card_list: null, |
20 | is_no_plus: 1, | 20 | is_no_plus: 1, |
21 | + | ||
22 | + is_retail_price:0 | ||
23 | + | ||
21 | }, | 24 | }, |
22 | properties: { | 25 | properties: { |
23 | // 这⾥定义了innerText属性,属性值可以在组件使⽤时指定 | 26 | // 这⾥定义了innerText属性,属性值可以在组件使⽤时指定 |
24 | }, | 27 | }, |
25 | - ready: function () { }, | 28 | + ready: function () { |
29 | + | ||
30 | + var th=this; | ||
31 | + getApp().getConfig2(function (e) { | ||
32 | + var swithc_list = e.switch_list; | ||
33 | + var sw_arr = JSON.parse(swithc_list); | ||
34 | + if(sw_arr.is_retail_price){ | ||
35 | + th.setData({is_retail_price:1}); | ||
36 | + } | ||
37 | + },1); | ||
38 | + | ||
39 | + }, | ||
26 | pageLifetimes: { | 40 | pageLifetimes: { |
27 | //要处理一下,游客登录后的界面的变化,主要还该是改变会员 | 41 | //要处理一下,游客登录后的界面的变化,主要还该是改变会员 |
28 | show: function () { | 42 | show: function () { |
43 | + | ||
29 | this.init(); | 44 | this.init(); |
30 | if (getApp().globalData.login_back == 1) { | 45 | if (getApp().globalData.login_back == 1) { |
31 | getApp().globalData.login_back == 0; | 46 | getApp().globalData.login_back == 0; |
@@ -48,39 +63,7 @@ Component({ | @@ -48,39 +63,7 @@ Component({ | ||
48 | getApp().getConfig2(function (e) { | 63 | getApp().getConfig2(function (e) { |
49 | var swithc_list = e.switch_list; | 64 | var swithc_list = e.switch_list; |
50 | var sw_arr = JSON.parse(swithc_list); | 65 | var sw_arr = JSON.parse(swithc_list); |
51 | - //---如果后台有开等级卡的开关--- | ||
52 | - if (sw_arr.rank_switch && sw_arr.rank_switch == "2") { | ||
53 | - th.setData({ | ||
54 | - rank_switch: true | ||
55 | - }); | ||
56 | - //---回调卡的列表--- | ||
57 | - th.getPlusCardType(function (ob) { | ||
58 | - th.setData({ | ||
59 | - card_list: ob.card_list | ||
60 | - }); | ||
61 | - var ti = setInterval(function () { | ||
62 | - var user = getApp().globalData.userInfo; | ||
63 | - if (!user) return false; | ||
64 | - clearInterval(ti); | ||
65 | - if (user.card_field && user['card_expiredate']) { | ||
66 | - var str = user['card_expiredate'].replace(/-/g, '/'); | ||
67 | - var end = new Date(str); | ||
68 | - end = Date.parse(end) / 1000; | ||
69 | - var now = ut.gettimestamp(); | ||
70 | - //--- 判断是等级会员,且在有效期范围内 --- | ||
71 | - if (user.card_field && now < end) { | ||
72 | - var card_name = ob.name_map.get(user.card_field); | ||
73 | - if (card_name && card_name.length > 4) card_name = card_name.substring(0, 8); | ||
74 | - th.setData({ | ||
75 | - card_field: user.card_field, | ||
76 | - card_name: card_name, | ||
77 | - card_list: ob.card_list | ||
78 | - }); | ||
79 | - } | ||
80 | - } | ||
81 | - }, 500) | ||
82 | - }) | ||
83 | - } | 66 | + ut.get_plus_name_price(sw_arr,th); |
84 | }) | 67 | }) |
85 | 68 | ||
86 | } | 69 | } |
components/goods_list/goods_list.wxml
@@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
17 | <!-- 判断是否有活动价 --> | 17 | <!-- 判断是否有活动价 --> |
18 | <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_id>0 && item.prom_type!=7 && item.prom_type!=10}}"> | 18 | <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_id>0 && item.prom_type!=7 && item.prom_type!=10}}"> |
19 | <view class="pdt10"> | 19 | <view class="pdt10"> |
20 | - <view class="money flex xc-wc"> | 20 | + <view class="money flex xc-wc" style="line-height:28rpx"> |
21 | <text wx:if="{{item.prom_integral}}"><text class="fs35" style="font-weight: bold;">{{item.prom_integral}}</text>积分</text> | 21 | <text wx:if="{{item.prom_integral}}"><text class="fs35" style="font-weight: bold;">{{item.prom_integral}}</text>积分</text> |
22 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> | 22 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> |
23 | <!-- 活动价 --> | 23 | <!-- 活动价 --> |
@@ -26,13 +26,16 @@ | @@ -26,13 +26,16 @@ | ||
26 | <view class="fs35">{{item.prom_price}}</view> | 26 | <view class="fs35">{{item.prom_price}}</view> |
27 | </view> | 27 | </view> |
28 | </view> | 28 | </view> |
29 | -<!-- <view class="flex">--> | ||
30 | -<!-- <!– 原价 –>--> | ||
31 | -<!-- <view class="price flex xc-ash line_th">--> | ||
32 | -<!-- <view class="fs22">¥</view>--> | ||
33 | -<!-- <view class="fs22">{{item.market_price}}</view>--> | ||
34 | -<!-- </view>--> | ||
35 | -<!-- </view>--> | 29 | + |
30 | + <!-- 控制显示原价 --> | ||
31 | + <view class="flex" wx:if="{{is_retail_price}}"> | ||
32 | + <!-- 原价 --> | ||
33 | + <view class="price flex xc-ash line_th"> | ||
34 | + <view class="fs22">¥</view> | ||
35 | + <view class="fs22">{{item.market_price}}</view> | ||
36 | + </view> | ||
37 | + </view> | ||
38 | + | ||
36 | </view> | 39 | </view> |
37 | 40 | ||
38 | </block> | 41 | </block> |
@@ -54,15 +57,20 @@ | @@ -54,15 +57,20 @@ | ||
54 | </view> | 57 | </view> |
55 | </view> | 58 | </view> |
56 | </view> | 59 | </view> |
57 | -<!-- <view class="flex">--> | ||
58 | -<!-- <!– 原价 –>--> | ||
59 | -<!-- <view class="price flex xc-ash line_th">--> | ||
60 | -<!-- <view class="fs22">¥</view>--> | ||
61 | -<!-- <view class="fs22">{{item.market_price}}</view>--> | ||
62 | -<!-- </view>--> | ||
63 | -<!-- </view>--> | 60 | + |
61 | + | ||
62 | + | ||
63 | + <view class="flex" wx:if="{{is_retail_price}}"> | ||
64 | + <!-- 原价 --> | ||
65 | + <view class="price flex xc-ash line_th"> | ||
66 | + <view class="fs22">¥</view> | ||
67 | + <view class="fs22">{{item.market_price}}</view> | ||
68 | + </view> | ||
69 | + </view> | ||
70 | + | ||
71 | + | ||
64 | </block> | 72 | </block> |
65 | - <blocK wx:else> | 73 | + <block wx:else> |
66 | <view class="money flex"> | 74 | <view class="money flex"> |
67 | <!-- 办卡价 --> | 75 | <!-- 办卡价 --> |
68 | <view class="flex xc-wc"> | 76 | <view class="flex xc-wc"> |
@@ -70,14 +78,14 @@ | @@ -70,14 +78,14 @@ | ||
70 | <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view> | 78 | <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view> |
71 | </view> | 79 | </view> |
72 | </view> | 80 | </view> |
73 | -<!-- <view class="flex">--> | ||
74 | -<!-- <!– 原价 –>--> | ||
75 | -<!-- <view class="price flex xc-ash line_th">--> | ||
76 | -<!-- <view class="fs22">¥</view>--> | ||
77 | -<!-- <view class="fs22">{{item.market_price}}</view>--> | ||
78 | -<!-- </view>--> | ||
79 | -<!-- </view>--> | ||
80 | - </blocK> | 81 | + <view class="flex" wx:if="{{is_retail_price}}"> |
82 | + <!-- 原价 --> | ||
83 | + <view class="price flex xc-ash line_th"> | ||
84 | + <view class="fs22">¥</view> | ||
85 | + <view class="fs22">{{item.market_price}}</view> | ||
86 | + </view> | ||
87 | + </view> | ||
88 | + </block> | ||
81 | </block> | 89 | </block> |
82 | <block wx:else> | 90 | <block wx:else> |
83 | <!-- 如果商品有设置等级价⼤于0的 --> | 91 | <!-- 如果商品有设置等级价⼤于0的 --> |
@@ -89,10 +97,10 @@ | @@ -89,10 +97,10 @@ | ||
89 | <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view> | 97 | <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view> |
90 | </view> | 98 | </view> |
91 | <!-- 原价 --> | 99 | <!-- 原价 --> |
92 | -<!-- <view class="price flex xc-ash line_th">--> | ||
93 | -<!-- <view class="fs22">¥</view>--> | ||
94 | -<!-- <view class="fs22">{{item.market_price}}</view>--> | ||
95 | -<!-- </view>--> | 100 | + <view class="price flex xc-ash line_th" wx:if="{{is_retail_price}}"> |
101 | + <view class="fs22">¥</view> | ||
102 | + <view class="fs22">{{item.market_price}}</view> | ||
103 | + </view> | ||
96 | </view> | 104 | </view> |
97 | <view class="flexr"> | 105 | <view class="flexr"> |
98 | <!-- 等级价 --> | 106 | <!-- 等级价 --> |
@@ -114,13 +122,13 @@ | @@ -114,13 +122,13 @@ | ||
114 | <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view> | 122 | <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view> |
115 | </view> | 123 | </view> |
116 | </view> | 124 | </view> |
117 | -<!-- <view class="flex">--> | ||
118 | -<!-- <!– 原价 –>--> | ||
119 | -<!-- <view class="price flex xc-ash line_th">--> | ||
120 | -<!-- <view class="fs22">¥</view>--> | ||
121 | -<!-- <view class="fs22">{{item.market_price}}</view>--> | ||
122 | -<!-- </view>--> | ||
123 | -<!-- </view>--> | 125 | + <view class="flex" wx:if="{{is_retail_price}}"> |
126 | + <!-- 原价 --> | ||
127 | + <view class="price flex xc-ash line_th"> | ||
128 | + <view class="fs22">¥</view> | ||
129 | + <view class="fs22">{{item.market_price}}</view> | ||
130 | + </view> | ||
131 | + </view> | ||
124 | </block> | 132 | </block> |
125 | </block> | 133 | </block> |
126 | </block> | 134 | </block> |
@@ -133,13 +141,13 @@ | @@ -133,13 +141,13 @@ | ||
133 | <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view> | 141 | <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view> |
134 | </view> | 142 | </view> |
135 | </view> | 143 | </view> |
136 | -<!-- <view class="flex" style="">--> | ||
137 | -<!-- <!– 原价 –>--> | ||
138 | -<!-- <view class="price flex xc-ash line_th">--> | ||
139 | -<!-- <view class="fs22">¥</view>--> | ||
140 | -<!-- <view class="fs22">{{item.market_price}}</view>--> | ||
141 | -<!-- </view>--> | ||
142 | -<!-- </view>--> | 144 | + <view class="flex" style="" wx:if="{{is_retail_price}}"> |
145 | + <!-- 原价 --> | ||
146 | + <view class="price flex xc-ash line_th"> | ||
147 | + <view class="fs22">¥</view> | ||
148 | + <view class="fs22">{{item.market_price}}</view> | ||
149 | + </view> | ||
150 | + </view> | ||
143 | </view> | 151 | </view> |
144 | </block> | 152 | </block> |
145 | </view> | 153 | </view> |
components/qr_code/qr_code.js
@@ -35,7 +35,7 @@ Component({ | @@ -35,7 +35,7 @@ Component({ | ||
35 | this.setData({q_show: 1,object:e,barcode_canvas:list,qrcode_canvas:list,is_fw:e.is_fw }); | 35 | this.setData({q_show: 1,object:e,barcode_canvas:list,qrcode_canvas:list,is_fw:e.is_fw }); |
36 | var val=e.val; | 36 | var val=e.val; |
37 | 37 | ||
38 | - barcode('barcode'+this.data.index,val, 620, 160,this); | 38 | + barcode('barcode'+this.data.index,val+"", 620, 160,this); |
39 | qrcode('qrcode'+this.data.index, val, 520, 520,this); | 39 | qrcode('qrcode'+this.data.index, val, 520, 520,this); |
40 | } | 40 | } |
41 | }, | 41 | }, |
components/serviceCard_list/serviceCard_list.js
@@ -45,48 +45,7 @@ Component({ | @@ -45,48 +45,7 @@ Component({ | ||
45 | success: function (e) { | 45 | success: function (e) { |
46 | if (e.data.code == 0 && e.data && e.data.data) { | 46 | if (e.data.code == 0 && e.data && e.data.data) { |
47 | getApp().globalData.userInfo = e.data.data; | 47 | getApp().globalData.userInfo = e.data.data; |
48 | - getApp().getConfig2(function (e) { | ||
49 | - var swithc_list = e.switch_list; | ||
50 | - var sw_arr = JSON.parse(swithc_list); | ||
51 | - //---如果后台有开等级卡的开关--- | ||
52 | - if (sw_arr.rank_switch && sw_arr.rank_switch == "2") { | ||
53 | - th.setData({ | ||
54 | - rank_switch: true | ||
55 | - }); | ||
56 | - //---回调卡的列表--- | ||
57 | - th.getPlusCardType(function (ob) { | ||
58 | - th.setData({ | ||
59 | - card_list: ob.card_list | ||
60 | - }); | ||
61 | - var ti = setInterval(function () { | ||
62 | - var user = getApp().globalData.userInfo; | ||
63 | - if (!user) return false; | ||
64 | - clearInterval(ti); | ||
65 | - if (user.card_field && user['card_expiredate']) { | ||
66 | - var str = user['card_expiredate'].replace(/-/g, '/'); | ||
67 | - var end = new Date(str); | ||
68 | - end = Date.parse(end) / 1000; | ||
69 | - var now = ut.gettimestamp(); | ||
70 | - //--- 判断是等级会员,且在有效期范围内 --- | ||
71 | - if (user.card_field && now < end) { | ||
72 | - var card_name = ob.name_map.get(user.card_field); | ||
73 | - if (card_name && card_name.length > 4) card_name = card_name.substring(0, 8); | ||
74 | - th.setData({ | ||
75 | - card_field: user.card_field, | ||
76 | - card_name: card_name, | ||
77 | - card_list: ob.card_list | ||
78 | - }); | ||
79 | - } | ||
80 | - } | ||
81 | - }, 500) | ||
82 | - }) | ||
83 | - } | ||
84 | - }) | ||
85 | - | ||
86 | } | 48 | } |
87 | - | ||
88 | - | ||
89 | - | ||
90 | } | 49 | } |
91 | }) | 50 | }) |
92 | }, | 51 | }, |
components/serviceCard_list/serviceCard_list.wxml
@@ -37,95 +37,8 @@ | @@ -37,95 +37,8 @@ | ||
37 | 37 | ||
38 | </block> | 38 | </block> |
39 | <block wx:else> | 39 | <block wx:else> |
40 | - <!-- 商品价格,先判断下是后⼜等级价--> | ||
41 | - <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}"> | ||
42 | - <!-- 当会员是等级卡的时候 --> | ||
43 | - <block wx:if="{{card_field}}"> | ||
44 | - <!-- 等级价>0 --> | ||
45 | - <block wx:if="{{item[card_field]>0}}"> | ||
46 | - <view class="money flex"> | ||
47 | - <!-- 办卡价 --> | ||
48 | - <view class="flex xc-wc ai_and"> | ||
49 | - <view class="fs24">¥</view> | ||
50 | - <view class="fs35">{{filter.toFix(item[card_field],2)}}</view> | ||
51 | - <view class="card_bg ellipsis-1"> | ||
52 | - <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image> | ||
53 | - <text class="card_name">{{card_name}}</text> | ||
54 | - </view> | ||
55 | - </view> | ||
56 | - </view> | ||
57 | - <view class="flex"> | ||
58 | - <!-- 原价 --> | ||
59 | - <view class="price flex xc-ash line_th"> | ||
60 | - <view class="fs22">¥</view> | ||
61 | - <view class="fs22">{{item.market_price}}</view> | ||
62 | - </view> | ||
63 | - </view> | ||
64 | - </block> | ||
65 | - <blocK wx:else> | ||
66 | - <view class="money flex"> | ||
67 | - <!-- 办卡价 --> | ||
68 | - <view class="flex xc-wc"> | ||
69 | - <view class="fs24">¥</view> | ||
70 | - <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view> | ||
71 | - </view> | ||
72 | - </view> | ||
73 | - <view class="flex"> | ||
74 | - <!-- 原价 --> | ||
75 | - <view class="price flex xc-ash line_th"> | ||
76 | - <view class="fs22">¥</view> | ||
77 | - <view class="fs22">{{item.market_price}}</view> | ||
78 | - </view> | ||
79 | - </view> | ||
80 | - </blocK> | ||
81 | - </block> | ||
82 | - <block wx:else> | ||
83 | - <!-- 如果商品有设置等级价⼤于0的 --> | ||
84 | - <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}"> | ||
85 | - <view class="money flex"> | ||
86 | - <!-- 办卡价 --> | ||
87 | - <view class="flex xc-wc"> | ||
88 | - <view class="fs24">¥</view> | ||
89 | - <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view> | ||
90 | - </view> | ||
91 | - <!-- 原价 --> | ||
92 | - <view class="price flex xc-ash line_th"> | ||
93 | - <view class="fs22">¥</view> | ||
94 | - <view class="fs22">{{item.market_price}}</view> | ||
95 | - </view> | ||
96 | - </view> | ||
97 | - <view class="flexr" style=""> | ||
98 | - <!-- 等级价 --> | ||
99 | - <view class="price flex ai-center"> | ||
100 | - <view class="fs22">¥</view> | ||
101 | - <view class="fs28">{{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}</view> | ||
102 | - <view class="card_bg ellipsis-1"> | ||
103 | - <image src="{{url}}/miniapp/images/plus/dj_icon.png"></ image> | ||
104 | - <text class="card_name">{{g_filter.get_card_price(item,card_list,1)}}</text> | ||
105 | - </view> | ||
106 | - </view> | ||
107 | - </view> | ||
108 | - </block> | ||
109 | - <block wx:else> | ||
110 | - <view class="money flex"> | ||
111 | - <!-- 办卡价 --> | ||
112 | - <view class="flex xc-wc"> | ||
113 | - <view class="fs24">¥</view> | ||
114 | - <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view> | ||
115 | - </view> | ||
116 | - </view> | ||
117 | - <view class="flex"> | ||
118 | - <!-- 原价 --> | ||
119 | - <view class="price flex xc-ash line_th"> | ||
120 | - <view class="fs22">¥</view> | ||
121 | - <view class="fs22">{{item.market_price}}</view> | ||
122 | - </view> | ||
123 | - </view> | ||
124 | - </block> | ||
125 | - </block> | ||
126 | - </block> | ||
127 | <!-- 商品压根就没有等级价 --> | 40 | <!-- 商品压根就没有等级价 --> |
128 | - <view class="pdt10" wx:else> | 41 | + <view class="pdt10"> |
129 | <view class="money flex"> | 42 | <view class="money flex"> |
130 | <!-- 办卡价 --> | 43 | <!-- 办卡价 --> |
131 | <view class="flex xc-wc"> | 44 | <view class="flex xc-wc"> |
custom-tab-bar/index.js
@@ -20,6 +20,12 @@ Component({ | @@ -20,6 +20,12 @@ Component({ | ||
20 | } | 20 | } |
21 | }) | 21 | }) |
22 | 22 | ||
23 | + //过滤掉分销到期的 | ||
24 | + getApp().user_tools_endTime(2,function(e){ | ||
25 | + if(!e) th.setData({is_no_distri:1}) | ||
26 | + }); | ||
27 | + | ||
28 | + | ||
23 | //购买的信息用全局缓存 | 29 | //购买的信息用全局缓存 |
24 | if(getApp().globalData.dis_buy_obj){ | 30 | if(getApp().globalData.dis_buy_obj){ |
25 | var arr = getApp().globalData.dis_buy_obj; | 31 | var arr = getApp().globalData.dis_buy_obj; |
packageA/pages/distribution/goods/goods.wxml
@@ -83,7 +83,7 @@ | @@ -83,7 +83,7 @@ | ||
83 | <view class="ellipsis-2">{{item.goods_name}}</view> | 83 | <view class="ellipsis-2">{{item.goods_name}}</view> |
84 | <view> | 84 | <view> |
85 | <!-- 判断是否有活动价 --> | 85 | <!-- 判断是否有活动价 --> |
86 | - <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0}}"> | 86 | + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_id>0 && item.prom_type!=7 && item.prom_type!=10 }}"> |
87 | <view class="flex xc-wc ai-center"> | 87 | <view class="flex xc-wc ai-center"> |
88 | <text wx:if="{{item.prom_integral}}"><text class="fs30">{{item.prom_integral}}</text>积分</text> | 88 | <text wx:if="{{item.prom_integral}}"><text class="fs30">{{item.prom_integral}}</text>积分</text> |
89 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> | 89 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> |
packageA/pages/distribution/shop/shop.wxml
@@ -76,7 +76,7 @@ | @@ -76,7 +76,7 @@ | ||
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) && item.prom_type!=2 && item.prom_id>0}}"> | 79 | + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_id>0 && item.prom_type!=7 && item.prom_type!=10 }}"> |
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> |
packageA/pages/goodsInfo/goodsInfo.js
@@ -914,7 +914,7 @@ Page({ | @@ -914,7 +914,7 @@ Page({ | ||
914 | // 如果限购数量a<=redis可购买数量d, 当增加数量t>a,提示超出限购 | 914 | // 如果限购数量a<=redis可购买数量d, 当增加数量t>a,提示超出限购 |
915 | let actInfo = th.data.sele_g; | 915 | let actInfo = th.data.sele_g; |
916 | await th.get_buy_num2().then(function (data) { | 916 | await th.get_buy_num2().then(function (data) { |
917 | - let limited = actInfo.buy_limit; // 限购数量a | 917 | + let limited = actInfo.buy_limit==0?100000:actInfo.buy_limit; // 限购数量a |
918 | let promcardbuynum = data.data.data.promcardbuynum; | 918 | let promcardbuynum = data.data.data.promcardbuynum; |
919 | let buyedNum = promcardbuynum; // 自己已经购买的数量b | 919 | let buyedNum = promcardbuynum; // 自己已经购买的数量b |
920 | let canBuyNum = limited - buyedNum; // 自己还可购买的数量c | 920 | let canBuyNum = limited - buyedNum; // 自己还可购买的数量c |
@@ -1242,7 +1242,7 @@ Page({ | @@ -1242,7 +1242,7 @@ Page({ | ||
1242 | // 如果限购数量a<=redis可购买数量d, 当增加数量t>a,提示超出限购 | 1242 | // 如果限购数量a<=redis可购买数量d, 当增加数量t>a,提示超出限购 |
1243 | let actInfo = th.data.sele_g; | 1243 | let actInfo = th.data.sele_g; |
1244 | await th.get_buy_num2().then(function (data) { | 1244 | await th.get_buy_num2().then(function (data) { |
1245 | - let limited = actInfo.buy_limit; // 限购数量a | 1245 | + let limited = actInfo.buy_limit==0?100000:actInfo.buy_limit; // 限购数量a |
1246 | let promcardbuynum = data.data.data.promcardbuynum; | 1246 | let promcardbuynum = data.data.data.promcardbuynum; |
1247 | let buyedNum = promcardbuynum; // 自己已经购买的数量b | 1247 | let buyedNum = promcardbuynum; // 自己已经购买的数量b |
1248 | let canBuyNum = limited - buyedNum; // 自己还可购买的数量c | 1248 | let canBuyNum = limited - buyedNum; // 自己还可购买的数量c |
packageA/pages/profile/profile.js
@@ -586,6 +586,18 @@ Page({ | @@ -586,6 +586,18 @@ Page({ | ||
586 | this.setData({head_pic:uu.head_pic,nickname:uu.nickname}) | 586 | this.setData({head_pic:uu.head_pic,nickname:uu.nickname}) |
587 | } | 587 | } |
588 | 588 | ||
589 | + if(getApp().globalData.first_leader){ | ||
590 | + //--生成会员 -- | ||
591 | + getApp().promiseGet("/api/weshop/users/get/" + r.stoid + "/" + getApp().globalData.first_leader,{}).then(res=>{ | ||
592 | + if(res.data.code==0){ | ||
593 | + //更新会员 | ||
594 | + self.setData({ | ||
595 | + fir_user:res.data.data | ||
596 | + }) | ||
597 | + } | ||
598 | + }) | ||
599 | + } | ||
600 | + | ||
589 | app.request.get(url1, { | 601 | app.request.get(url1, { |
590 | success:async function(res) { | 602 | success:async function(res) { |
591 | if(res.data.code == 0) { | 603 | if(res.data.code == 0) { |
@@ -1132,7 +1144,7 @@ Page({ | @@ -1132,7 +1144,7 @@ Page({ | ||
1132 | 1144 | ||
1133 | //-- 需要推荐人 -- | 1145 | //-- 需要推荐人 -- |
1134 | if(this.data.reg_info.introducer_state){ | 1146 | if(this.data.reg_info.introducer_state){ |
1135 | - let tjrname = this.data.referee; | 1147 | + let tjrname = this.data.referee || this.data.fir_user.mobile; |
1136 | if (tjrname == "" || tjrname == null) { | 1148 | if (tjrname == "" || tjrname == null) { |
1137 | //app.my_warnning("请输入推荐人", 0, this); | 1149 | //app.my_warnning("请输入推荐人", 0, this); |
1138 | //return false; | 1150 | //return false; |
packageA/pages/profile/profile.wxml
@@ -29,8 +29,17 @@ | @@ -29,8 +29,17 @@ | ||
29 | <view class="user-name flex-vertical" data-type="nickname" wx:if="{{reg_info.introducer_state}}"> | 29 | <view class="user-name flex-vertical" data-type="nickname" wx:if="{{reg_info.introducer_state}}"> |
30 | <view class="user-name-txt">推荐人:</view> | 30 | <view class="user-name-txt">推荐人:</view> |
31 | 31 | ||
32 | + <block wx-if="{{fir_user}}"> | ||
33 | + <input bindblur="" disabled="true" value="{{fir_user.mobile}}" data-name="推荐人" | ||
34 | + class="user-txt-right f1 pdl20 t-r" /> | ||
35 | + </block> | ||
36 | + | ||
37 | + <block v-else> | ||
38 | + <input bindinput="getReferee" bindblur="" disabled="{{user['fromuser_id']}}" | ||
39 | + value="{{user['fromuser_id']?user['fromuser_id']:''}}" data-name="推荐人" class="user-txt-right f1 pdl20 t-r" placeholder="请输入推荐人手机号码或卡号"/> | ||
40 | + </block> | ||
41 | + | ||
32 | 42 | ||
33 | - <input bindinput="getReferee" bindblur="" disabled="{{user['fromuser_id']}}" value="{{user['fromuser_id']?user['fromuser_id']:''}}" data-name="推荐人" class="user-txt-right f1 pdl20 t-r" placeholder="请输入推荐人手机号码或卡号"/> | ||
34 | 43 | ||
35 | <block wx:if="{{!user['fromuser_id']}}"> | 44 | <block wx:if="{{!user['fromuser_id']}}"> |
36 | <view class="c-red pdl20 fs24" wx:if="{{reg_info.introducer && reg_info.introducer_state && (reg_info.introducer_type == 0)}}">+{{reg_info.introducer}}积分</view> | 45 | <view class="c-red pdl20 fs24" wx:if="{{reg_info.introducer && reg_info.introducer_state && (reg_info.introducer_type == 0)}}">+{{reg_info.introducer}}积分</view> |
packageB/pages/zuhegou/index/index.js
@@ -540,10 +540,12 @@ Page({ | @@ -540,10 +540,12 @@ Page({ | ||
540 | this.data.is_zuhe_addcart = 1; | 540 | this.data.is_zuhe_addcart = 1; |
541 | if (!haveAdded) { | 541 | if (!haveAdded) { |
542 | 542 | ||
543 | - | ||
544 | - | 543 | + //购买的商品的数量默认超量的数量 |
545 | th.data.sele_g = this.data.list[index]; | 544 | th.data.sele_g = this.data.list[index]; |
546 | - if (!th.data.sele_g.num) th.data.goodsInputNum = 1; | 545 | + if (!th.data.sele_g.num){ |
546 | + th.data.goodsInputNum = 1; | ||
547 | + if(th.data.sele_g.zhqty) th.data.goodsInputNum = th.data.sele_g.zhqty; | ||
548 | + } | ||
547 | 549 | ||
548 | //如果没有门店,活动商品的配送方式和门店的配送方式不一样 | 550 | //如果没有门店,活动商品的配送方式和门店的配送方式不一样 |
549 | if (!th.data.def_pick_store || | 551 | if (!th.data.def_pick_store || |
@@ -664,8 +666,11 @@ Page({ | @@ -664,8 +666,11 @@ Page({ | ||
664 | async check_pk_store_conut(func,is_no_msg,gd,by_num){ | 666 | async check_pk_store_conut(func,is_no_msg,gd,by_num){ |
665 | var th=this; | 667 | var th=this; |
666 | if(this.data.sales_rules!=2){ | 668 | if(this.data.sales_rules!=2){ |
667 | - if(func) func(); | ||
668 | - return false; | 669 | + if(is_no_msg) return true; |
670 | + else { | ||
671 | + if(func) func(); | ||
672 | + return false; | ||
673 | + } | ||
669 | } | 674 | } |
670 | //门店库存no | 675 | //门店库存no |
671 | var pkno= gd && gd.pickup_no?gd.pickup_no:this.data.def_pick_store.pickup_no; | 676 | var pkno= gd && gd.pickup_no?gd.pickup_no:this.data.def_pick_store.pickup_no; |
@@ -784,9 +789,17 @@ Page({ | @@ -784,9 +789,17 @@ Page({ | ||
784 | this.data.sele_index = index; | 789 | this.data.sele_index = index; |
785 | th.data.goodsInputNum = th.data.sele_g.num + 1; | 790 | th.data.goodsInputNum = th.data.sele_g.num + 1; |
786 | 791 | ||
792 | + //必须是组合购买的超量 | ||
793 | + var is_zhqty=0; | ||
794 | + if(th.data.goodsInputNum<th.data.sele_g.zhqty){ | ||
795 | + th.data.goodsInputNum=th.data.sele_g.zhqty; | ||
796 | + is_zhqty=1; | ||
797 | + } | ||
798 | + | ||
787 | th.check_pk_store_conut(function(){ | 799 | th.check_pk_store_conut(function(){ |
788 | if (th.data.sele_g.cart_num) { | 800 | if (th.data.sele_g.cart_num) { |
789 | th.data.s_cart_num = th.data.sele_g.cart_num + 1; | 801 | th.data.s_cart_num = th.data.sele_g.cart_num + 1; |
802 | + if(is_zhqty) th.data.s_cart_num=th.data.sele_g.zhqty; | ||
790 | } | 803 | } |
791 | th.add_cart_func(); | 804 | th.add_cart_func(); |
792 | }) | 805 | }) |
@@ -1195,7 +1208,7 @@ Page({ | @@ -1195,7 +1208,7 @@ Page({ | ||
1195 | if (th.data.adding) return false; | 1208 | if (th.data.adding) return false; |
1196 | th.data.adding = 1; | 1209 | th.data.adding = 1; |
1197 | //-------如果购物车中有相关的数据--------- | 1210 | //-------如果购物车中有相关的数据--------- |
1198 | - if (th.data.goodsInputNum > 1) { | 1211 | + if (th.data.list[index].num > 0) { |
1199 | var item = th.data.sele_g; | 1212 | var item = th.data.sele_g; |
1200 | if (th.data.goodsInputNum > o.store_count) { | 1213 | if (th.data.goodsInputNum > o.store_count) { |
1201 | th.data.adding = 0; | 1214 | th.data.adding = 0; |
@@ -2000,6 +2013,13 @@ Page({ | @@ -2000,6 +2013,13 @@ Page({ | ||
2000 | } | 2013 | } |
2001 | 2014 | ||
2002 | var num = item.goods_num; | 2015 | var num = item.goods_num; |
2016 | + | ||
2017 | + var is_num_change=0; | ||
2018 | + if(num<th.data.goodsInputNum){ | ||
2019 | + num=th.data.goodsInputNum; | ||
2020 | + is_num_change=1; | ||
2021 | + } | ||
2022 | + | ||
2003 | if (item.cbuy > -1 && item.cbuy < item.goods_num) { | 2023 | if (item.cbuy > -1 && item.cbuy < item.goods_num) { |
2004 | num = item.cbuy; | 2024 | num = item.cbuy; |
2005 | } | 2025 | } |
@@ -2024,6 +2044,9 @@ Page({ | @@ -2024,6 +2044,9 @@ Page({ | ||
2024 | updata['guide_id'] = getApp().globalData.guide_id; | 2044 | updata['guide_id'] = getApp().globalData.guide_id; |
2025 | updata['guide_type'] = 0; | 2045 | updata['guide_type'] = 0; |
2026 | } | 2046 | } |
2047 | + if(is_num_change){ | ||
2048 | + updata['goods_num']=num; | ||
2049 | + } | ||
2027 | 2050 | ||
2028 | getApp().request.put("/api/weshop/cart/update", { | 2051 | getApp().request.put("/api/weshop/cart/update", { |
2029 | data: updata, | 2052 | data: updata, |
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
@@ -6018,7 +6018,7 @@ Page({ | @@ -6018,7 +6018,7 @@ Page({ | ||
6018 | }, | 6018 | }, |
6019 | 6019 | ||
6020 | go_card_info: function () { | 6020 | go_card_info: function () { |
6021 | - getApp().goto("/pages/user/cardinfo/cardinfo"); | 6021 | + getApp().goto("/packageE/pages/user/cardinfo/cardinfo"); |
6022 | }, | 6022 | }, |
6023 | 6023 | ||
6024 | //-- 根据ID拿出门店 -- | 6024 | //-- 根据ID拿出门店 -- |
packageC/pages/presell/goodsInfo/goodsInfo.js
@@ -21,6 +21,9 @@ let self = null; | @@ -21,6 +21,9 @@ let self = null; | ||
21 | 21 | ||
22 | Page({ | 22 | Page({ |
23 | data: { | 23 | data: { |
24 | + type: 0, | ||
25 | + a_btn_type: true, //测试底部按钮显示 | ||
26 | + | ||
24 | start_stop: 2, //秒杀开始 结束 的控制(1正在进行,2即将开始) | 27 | start_stop: 2, //秒杀开始 结束 的控制(1正在进行,2即将开始) |
25 | color_type: 0, //线条控制 | 28 | color_type: 0, //线条控制 |
26 | color_type_one: 0, | 29 | color_type_one: 0, |
@@ -2379,13 +2382,30 @@ Page({ | @@ -2379,13 +2382,30 @@ Page({ | ||
2379 | countDown(time, prom_st) { | 2382 | countDown(time, prom_st) { |
2380 | if (!this.data.is_timer) return false; | 2383 | if (!this.data.is_timer) return false; |
2381 | var th = this; | 2384 | var th = this; |
2385 | + var {presellForm:{start_time,show_time,end_time},presellForm} = this.data; | ||
2382 | // 获取当前时间,同时得到活动结束时间数组 | 2386 | // 获取当前时间,同时得到活动结束时间数组 |
2383 | var endTime = time; | 2387 | var endTime = time; |
2384 | var newTime = ut.gettimestamp(); | 2388 | var newTime = ut.gettimestamp(); |
2385 | // 对结束时间进行处理渲染到页面 | 2389 | // 对结束时间进行处理渲染到页面 |
2386 | var obj = null; | 2390 | var obj = null; |
2387 | - // 如果活动未结束,对时间进行处理 | ||
2388 | - if (endTime - newTime > 0) { | 2391 | + var type = 0; |
2392 | + | ||
2393 | + if ( show_time && newTime>=show_time && newTime<start_time ) { | ||
2394 | + // 如果开启预热且在预热时间内 | ||
2395 | + var time = (start_time - newTime); | ||
2396 | + // 获取天、时、分、秒 | ||
2397 | + var day = parseInt(time / (60 * 60 * 24)); | ||
2398 | + var hou = parseInt(time % (60 * 60 * 24) / 3600); | ||
2399 | + var min = parseInt(time % (60 * 60 * 24) % 3600 / 60); | ||
2400 | + var sec = parseInt(time % (60 * 60 * 24) % 3600 % 60); | ||
2401 | + obj = { | ||
2402 | + day: this.timeFormat(day), | ||
2403 | + hou: this.timeFormat(hou), | ||
2404 | + min: this.timeFormat(min), | ||
2405 | + sec: this.timeFormat(sec) | ||
2406 | + } | ||
2407 | + } else if (endTime - newTime > 0) { | ||
2408 | + // 如果活动未结束,对时间进行处理 | ||
2389 | var time = (endTime - newTime); | 2409 | var time = (endTime - newTime); |
2390 | // 获取天、时、分、秒 | 2410 | // 获取天、时、分、秒 |
2391 | var day = parseInt(time / (60 * 60 * 24)); | 2411 | var day = parseInt(time / (60 * 60 * 24)); |
@@ -2398,8 +2418,8 @@ Page({ | @@ -2398,8 +2418,8 @@ Page({ | ||
2398 | min: this.timeFormat(min), | 2418 | min: this.timeFormat(min), |
2399 | sec: this.timeFormat(sec) | 2419 | sec: this.timeFormat(sec) |
2400 | } | 2420 | } |
2421 | + type = 1 | ||
2401 | } else { | 2422 | } else { |
2402 | - | ||
2403 | //活动已结束,全部设置为'00' | 2423 | //活动已结束,全部设置为'00' |
2404 | obj = { | 2424 | obj = { |
2405 | day: '00', | 2425 | day: '00', |
@@ -2407,19 +2427,20 @@ Page({ | @@ -2407,19 +2427,20 @@ Page({ | ||
2407 | min: '00', | 2427 | min: '00', |
2408 | sec: '00' | 2428 | sec: '00' |
2409 | } | 2429 | } |
2430 | + | ||
2410 | th.setData({ | 2431 | th.setData({ |
2411 | prom_time_text: '活动已经结束:', | 2432 | prom_time_text: '活动已经结束:', |
2412 | - prom_st: 3 | 2433 | + prom_st: 3, |
2434 | + djs: obj, | ||
2435 | + type: 2 | ||
2413 | }) | 2436 | }) |
2414 | - th.setData({ | ||
2415 | - djs: obj | ||
2416 | - }); | ||
2417 | - return false; | ||
2418 | 2437 | ||
2438 | + return false; | ||
2419 | } | 2439 | } |
2420 | 2440 | ||
2421 | th.setData({ | 2441 | th.setData({ |
2422 | - djs: obj | 2442 | + djs: obj, |
2443 | + type: type | ||
2423 | }); | 2444 | }); |
2424 | setTimeout(function () { | 2445 | setTimeout(function () { |
2425 | th.countDown(endTime) | 2446 | th.countDown(endTime) |
@@ -4510,7 +4531,7 @@ Page({ | @@ -4510,7 +4531,7 @@ Page({ | ||
4510 | getApp().goto("/pages/user/plus/plus"); | 4531 | getApp().goto("/pages/user/plus/plus"); |
4511 | }, | 4532 | }, |
4512 | go_card_info: function () { | 4533 | go_card_info: function () { |
4513 | - getApp().goto("/pages/user/cardinfo/cardinfo"); | 4534 | + getApp().goto("/packageE/pages/user/cardinfo/cardinfo"); |
4514 | }, | 4535 | }, |
4515 | //-- 根据ID拿出门店 -- | 4536 | //-- 根据ID拿出门店 -- |
4516 | get_pick_from_list(pid) { | 4537 | get_pick_from_list(pid) { |
@@ -4716,6 +4737,7 @@ Page({ | @@ -4716,6 +4737,7 @@ Page({ | ||
4716 | presell_id: presell_id, | 4737 | presell_id: presell_id, |
4717 | goods_id: th.data.gid | 4738 | goods_id: th.data.gid |
4718 | } | 4739 | } |
4740 | + console.log('获取预售从表') | ||
4719 | //------获取预售从表---------- | 4741 | //------获取预售从表---------- |
4720 | await getApp().request.promiseGet(url, { | 4742 | await getApp().request.promiseGet(url, { |
4721 | data: rd | 4743 | data: rd |
@@ -4730,6 +4752,7 @@ Page({ | @@ -4730,6 +4752,7 @@ Page({ | ||
4730 | }) | 4752 | }) |
4731 | 4753 | ||
4732 | } else { | 4754 | } else { |
4755 | + console.log('获取预售从表', 'pre_id', th.data.pre_id) | ||
4733 | //------获取预售从表---------- | 4756 | //------获取预售从表---------- |
4734 | await getApp().request.promiseGet("/api/weshop/marketing/marketingPresellList/get/" + os.stoid + "/" + th.data.pre_id, {}).then(res => { | 4757 | await getApp().request.promiseGet("/api/weshop/marketing/marketingPresellList/get/" + os.stoid + "/" + th.data.pre_id, {}).then(res => { |
4735 | if (res.data.code == 0 && res.data.data) { | 4758 | if (res.data.code == 0 && res.data.data) { |
@@ -4798,12 +4821,13 @@ Page({ | @@ -4798,12 +4821,13 @@ Page({ | ||
4798 | } | 4821 | } |
4799 | 4822 | ||
4800 | if (act_data.start_time > ut.gettimestamp()) { | 4823 | if (act_data.start_time > ut.gettimestamp()) { |
4801 | - wx.showToast({ title: "活动还未开始", icon: 'none', duration: 3000 }); | ||
4802 | - setTimeout(function () { | ||
4803 | - ut.wx_back(); | ||
4804 | - }, 2000) | ||
4805 | - gnext = 0; | ||
4806 | - return false; | 4824 | + // wx.showToast({ title: "活动还未开始", icon: 'none', duration: 3000 }); |
4825 | + // setTimeout(function () { | ||
4826 | + // ut.wx_back(); | ||
4827 | + // }, 2000) | ||
4828 | + // gnext = 0; | ||
4829 | + th.setData({ show: true }); | ||
4830 | + // return false; | ||
4807 | } | 4831 | } |
4808 | 4832 | ||
4809 | th.setData({ | 4833 | th.setData({ |
@@ -4838,11 +4862,12 @@ Page({ | @@ -4838,11 +4862,12 @@ Page({ | ||
4838 | } | 4862 | } |
4839 | }) | 4863 | }) |
4840 | if (!pre_arr) { | 4864 | if (!pre_arr) { |
4841 | - wx.showToast({ title: "当前会员身份不符或者时间已过期,无法参与", icon: 'none', duration: 3000 }); | ||
4842 | - setTimeout(function () { | ||
4843 | - ut.wx_back(); | ||
4844 | - }, 2000) | ||
4845 | - return false; | 4865 | + // wx.showToast({ title: "当前会员身份不符或者时间已过期,无法参与", icon: 'none', duration: 3000 }); |
4866 | + // setTimeout(function () { | ||
4867 | + // ut.wx_back(); | ||
4868 | + // }, 2000) | ||
4869 | + th.setData({ show: true }); | ||
4870 | + // return false; | ||
4846 | } | 4871 | } |
4847 | if (func) { | 4872 | if (func) { |
4848 | func(); | 4873 | func(); |
packageC/pages/presell/goodsInfo/goodsInfo.wxml
@@ -74,7 +74,8 @@ | @@ -74,7 +74,8 @@ | ||
74 | <view class="goo"> | 74 | <view class="goo"> |
75 | <view class="pt_view rel"> | 75 | <view class="pt_view rel"> |
76 | <!-- 许程 7. 24 --> | 76 | <!-- 许程 7. 24 --> |
77 | - <image class="secondkill-img" src="{{iurl+'/miniapp/images/red_jx.png'}}"></image> | 77 | + <image wx:if="{{type == 0}}" class="secondkill-img" src="{{iurl?iurl+'miniapp/images/blue_ks.png':''}}" /> |
78 | + <image wx:else class="secondkill-img" src="{{iurl?iurl+'miniapp/images/red_jx.png':''}}" /> | ||
78 | <!-- <view class=""> --> | 79 | <!-- <view class=""> --> |
79 | <!-- <view class="flex" style='height:40rpx; margin-top:5rpx;'> --> | 80 | <!-- <view class="flex" style='height:40rpx; margin-top:5rpx;'> --> |
80 | <view class="abs xc-qt-price fs28 xc-qtsign">预售价</view> | 81 | <view class="abs xc-qt-price fs28 xc-qtsign">预售价</view> |
@@ -88,28 +89,28 @@ | @@ -88,28 +89,28 @@ | ||
88 | 89 | ||
89 | <block> | 90 | <block> |
90 | <!-- </view> --> | 91 | <!-- </view> --> |
91 | - <view class="hy-stop word-color fs26 abs">距活动结束还有</view> | 92 | + <view class="hy-stop word-color fs26 abs cl_r {{type==0?'pre_cl':''}}">距活动{{type==0?'开始':'结束'}}还有</view> |
92 | <view class="secview flex abs fs24 " style="color: black;right: 3px; top:46rpx;"> | 93 | <view class="secview flex abs fs24 " style="color: black;right: 3px; top:46rpx;"> |
93 | <block wx:if="djs.day"> | 94 | <block wx:if="djs.day"> |
94 | - <view class='day-val' style="color:#d40022;margin-top:-34rpx;"> | 95 | + <view class="day-val cl_r {{type==0?'pre_cl':''}}" style="margin-top:-34rpx;"> |
95 | {{djs.day}} | 96 | {{djs.day}} |
96 | </view> | 97 | </view> |
97 | - <view class="day white" style="margin-top:-34rpx;margin-right:10rpx;color:#d40022"> | 98 | + <view class="day cl_r {{type==0?'pre_cl':''}}" style="margin-top:-34rpx;margin-right:10rpx;"> |
98 | 天 | 99 | 天 |
99 | </view> | 100 | </view> |
100 | </block> | 101 | </block> |
101 | - <view class='xc-time-val white t-c' style="background:#d40022"> | 102 | + <view class="xc-time-val white t-c {{type==0?'pre_ba':''}}" > |
102 | {{djs.hou}} | 103 | {{djs.hou}} |
103 | </view> | 104 | </view> |
104 | - <view class="xc-time" style="color:#d40022">时</view> | ||
105 | - <view class='xc-time-val white t-c' style="background:#d40022"> | 105 | + <view class="xc-time {{type==0?'pre_cl':''}}">时</view> |
106 | + <view class="xc-time-val white t-c {{type==0?'pre_ba':''}}" > | ||
106 | {{djs.min}} | 107 | {{djs.min}} |
107 | </view> | 108 | </view> |
108 | - <view class="xc-time" style="color:#d40022">分</view> | ||
109 | - <view class='xc-time-val white t-c' style=";background:#d40022"> | 109 | + <view class="xc-time {{type==0?'pre_cl':''}}">分</view> |
110 | + <view class="xc-time-val white t-c {{type==0?'pre_ba':''}}" > | ||
110 | {{djs.sec}} | 111 | {{djs.sec}} |
111 | </view> | 112 | </view> |
112 | - <view class="xc-time" style="color:#d40022">秒</view> | 113 | + <view class="xc-time {{type==0?'pre_cl':''}}">秒</view> |
113 | </view> | 114 | </view> |
114 | </block> | 115 | </block> |
115 | </view> | 116 | </view> |
@@ -128,11 +129,11 @@ | @@ -128,11 +129,11 @@ | ||
128 | </view> | 129 | </view> |
129 | </view> | 130 | </view> |
130 | <view wx:if="{{presellForm.presell_type==0}}" class="fs24" style="padding-bottom:20rpx"> | 131 | <view wx:if="{{presellForm.presell_type==0}}" class="fs24" style="padding-bottom:20rpx"> |
131 | - <view class="stock" style="color:#999">尾款:{{filters.format_time(presellForm.pay_begindate,1)}}-{{filters.format_time(presellForm.pay_enddate,1)}}</view> | 132 | + <view class="stock" style="color:#999">尾款:{{filters.format_time(presellForm.pay_begindate,1)}}-{{filters.format_time(presellForm.pay_enddate,1)}}</view> |
132 | </view> | 133 | </view> |
133 | <view class="goods-num"> | 134 | <view class="goods-num"> |
134 | <block wx:if="{{presellList.virtual_qty}}"> | 135 | <block wx:if="{{presellList.virtual_qty}}"> |
135 | - <view class="stock">总数量:{{presellList.presell_sumqty+presellList.virtual_qty}}件</view> | 136 | + <view class="stock">总数量:{{presellList.presell_sumqty+presellList.virtual_qty}}件</view> |
136 | <view class="stock" wx:if="{{presellList.vip_butyqty}}">限购:{{presellList.vip_butyqty}}件</view> | 137 | <view class="stock" wx:if="{{presellList.vip_butyqty}}">限购:{{presellList.vip_butyqty}}件</view> |
137 | <view class="stock" wx:else>限购:不限</view> | 138 | <view class="stock" wx:else>限购:不限</view> |
138 | <view class="sales">已购:{{presellList.buy_goodnum+presellList.virtual_qty}}件</view> | 139 | <view class="sales">已购:{{presellList.buy_goodnum+presellList.virtual_qty}}件</view> |
@@ -209,7 +210,7 @@ | @@ -209,7 +210,7 @@ | ||
209 | </view> | 210 | </view> |
210 | <scroll-view scroll-x="true" class="pj_scroll"> | 211 | <scroll-view scroll-x="true" class="pj_scroll"> |
211 | <view class="flex"> | 212 | <view class="flex"> |
212 | - <view class="xc_comment-detail" style="" wx:for="{{fir_comments}}" wx:key="fir_comments"> | 213 | + <view class="xc_comment-detail" wx:for="{{fir_comments}}" wx:key="fir_comments"> |
213 | <view class="xc_comment-left"> | 214 | <view class="xc_comment-left"> |
214 | <view class="xc_comment-user"> | 215 | <view class="xc_comment-user"> |
215 | <view class="xc_user-img"> | 216 | <view class="xc_user-img"> |
@@ -219,7 +220,7 @@ | @@ -219,7 +220,7 @@ | ||
219 | <view class="xc_user-name five-level-word"> | 220 | <view class="xc_user-name five-level-word"> |
220 | {{item.is_anonymous!=1?item.username:'匿名'}} | 221 | {{item.is_anonymous!=1?item.username:'匿名'}} |
221 | </view> | 222 | </view> |
222 | - <image class="xc_comment-img" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image> | 223 | + <image class="xc_comment-img" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="rank"></image> |
223 | </view> | 224 | </view> |
224 | </view> | 225 | </view> |
225 | <view class="xc_comment-font pj_word_size ellipsis-1 pdt12"> | 226 | <view class="xc_comment-font pj_word_size ellipsis-1 pdt12"> |
@@ -434,7 +435,7 @@ | @@ -434,7 +435,7 @@ | ||
434 | <view class="middle-user"> | 435 | <view class="middle-user"> |
435 | {{item.username==''||item.is_anonymous==1 ?'匿名用户':item.username}} | 436 | {{item.username==''||item.is_anonymous==1 ?'匿名用户':item.username}} |
436 | </view> | 437 | </view> |
437 | - <image class="star" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image> | 438 | + <image class="star" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="index"></image> |
438 | </view> | 439 | </view> |
439 | </view> | 440 | </view> |
440 | <view class="xc-pirces"> | 441 | <view class="xc-pirces"> |
@@ -450,12 +451,12 @@ | @@ -450,12 +451,12 @@ | ||
450 | </view> | 451 | </view> |
451 | <view class="img-ul"> | 452 | <view class="img-ul"> |
452 | <block wx:if="{{item.source_type==0}}"> | 453 | <block wx:if="{{item.source_type==0}}"> |
453 | - <view class="img-li" wx:for="{{item.img}}" wx:key="{{index}}"> | 454 | + <view class="img-li" wx:for="{{item.img}}" wx:key="index"> |
454 | <image bindtap="previewCommentImgs" class="wh100" data-cidx="{{cIdx}}" data-img="{{iurl}}{{item}}" data-id="{{index}}" src="{{iurl}}{{item}}"></image> | 455 | <image bindtap="previewCommentImgs" class="wh100" data-cidx="{{cIdx}}" data-img="{{iurl}}{{item}}" data-id="{{index}}" src="{{iurl}}{{item}}"></image> |
455 | </view> | 456 | </view> |
456 | </block> | 457 | </block> |
457 | <block wx:if="{{item.source_type==1}}"> | 458 | <block wx:if="{{item.source_type==1}}"> |
458 | - <view class="img-li" wx:for="{{item.weapp_img}}" wx:if="{{aitem.length>10}}" wx:key="{{index}}" wx:for-item="aitem"> | 459 | + <view class="img-li" wx:for="{{item.weapp_img}}" wx:if="{{aitem.length>10}}" wx:key="index" wx:for-item="aitem"> |
459 | <image bindtap="previewCommentImgs_w" class="wh100" data-cidx="{{cIdx}}" data-img="{{aitem}}" data-id="{{index}}" src="{{aitem}}"></image> | 460 | <image bindtap="previewCommentImgs_w" class="wh100" data-cidx="{{cIdx}}" data-img="{{aitem}}" data-id="{{index}}" src="{{aitem}}"></image> |
460 | </view> | 461 | </view> |
461 | </block> | 462 | </block> |
@@ -474,7 +475,7 @@ | @@ -474,7 +475,7 @@ | ||
474 | <view class="reply rel" wx:if="{{item.replay_list}}"> | 475 | <view class="reply rel" wx:if="{{item.replay_list}}"> |
475 | <view class="line_bulge"></view> | 476 | <view class="line_bulge"></view> |
476 | <view class="shop-reply">店家回复:</view> | 477 | <view class="shop-reply">店家回复:</view> |
477 | - <view class="shop-font" wx:for="{{item.replay_list}}" wx:for-item="r_item" wx:key="{{index}}"> | 478 | + <view class="shop-font" wx:for="{{item.replay_list}}" wx:for-item="r_item" wx:key="index"> |
478 | {{r_item.content}} | 479 | {{r_item.content}} |
479 | </view> | 480 | </view> |
480 | </view> | 481 | </view> |
@@ -529,7 +530,8 @@ | @@ -529,7 +530,8 @@ | ||
529 | </navigator> | 530 | </navigator> |
530 | </view> | 531 | </view> |
531 | 532 | ||
532 | - <view class="fs24 f1 flex ai-center bg-FF4732 t-c white" style="border-radius:10rpx;justify-content: center"> | 533 | + <view wx:if="{{type == 0}}" class="buy-btn cart-btn cart-btn-lg lanse set_width" style="border-radius: 56rpx;">即将开始</view> |
534 | + <view wx:else class="fs24 f1 flex ai-center bg-FF4732 t-c white" style="border-radius:10rpx;justify-content: center"> | ||
533 | <view style="padding: 0 6rpx"> | 535 | <view style="padding: 0 6rpx"> |
534 | <view class="">{{filters.format_time(presellForm.end_time,2)}} 预售结束</view> | 536 | <view class="">{{filters.format_time(presellForm.end_time,2)}} 预售结束</view> |
535 | <!-- <view class="">08.30 23:59:59 开始发货</view> --> | 537 | <!-- <view class="">08.30 23:59:59 开始发货</view> --> |
@@ -721,7 +723,7 @@ | @@ -721,7 +723,7 @@ | ||
721 | {{sec_sto.name}} | 723 | {{sec_sto.name}} |
722 | </view> | 724 | </view> |
723 | <view class="itemlists" hidden="{{is_sec_mend==0}}"> | 725 | <view class="itemlists" hidden="{{is_sec_mend==0}}"> |
724 | - <view wx:for="{{sec_sto.s_arr}}" wx:key="{{index}}" class="item" bindtap="hidemend" data-p_id="{{item.pickup_id}}" data-p_name="{{item.pickup_name}}" data-p_dis="{{item.distr_type}}"> | 726 | + <view wx:for="{{sec_sto.s_arr}}" wx:key="index" class="item" bindtap="hidemend" data-p_id="{{item.pickup_id}}" data-p_name="{{item.pickup_name}}" data-p_dis="{{item.distr_type}}"> |
725 | {{item.pickup_name}} | 727 | {{item.pickup_name}} |
726 | </view> | 728 | </view> |
727 | </view> | 729 | </view> |
@@ -735,7 +737,7 @@ | @@ -735,7 +737,7 @@ | ||
735 | <view class="prom-model"> | 737 | <view class="prom-model"> |
736 | <icon bindtap="closePromModal" class="modal-close" color="gray" size="22" type="cancel"></icon> | 738 | <icon bindtap="closePromModal" class="modal-close" color="gray" size="22" type="cancel"></icon> |
737 | <view class="prom-title">优惠信息</view> | 739 | <view class="prom-title">优惠信息</view> |
738 | - <view class="logistics-item" wx:for="{{select.activity.data}}" wx:key="{{index}}"> | 740 | + <view class="logistics-item" wx:for="{{select.activity.data}}" wx:key="index"> |
739 | <view class="item-title"> | 741 | <view class="item-title"> |
740 | <text class="prom-item">{{item.title}}</text> | 742 | <text class="prom-item">{{item.title}}</text> |
741 | </view> | 743 | </view> |
@@ -759,7 +761,7 @@ | @@ -759,7 +761,7 @@ | ||
759 | <view class="top-frame"> | 761 | <view class="top-frame"> |
760 | <view class="xc-coupon-frame "> | 762 | <view class="xc-coupon-frame "> |
761 | <!-- -单张的券- --> | 763 | <!-- -单张的券- --> |
762 | - <view class="rel" wx:for="{{quan_list}}" wx:key="{{index}}"> | 764 | + <view class="rel" wx:for="{{quan_list}}" wx:key="index"> |
763 | <view class="coupon flex"> | 765 | <view class="coupon flex"> |
764 | <view class="circle xc-circular-one"></view> | 766 | <view class="circle xc-circular-one"></view> |
765 | <view class="xc-coupon-left "> | 767 | <view class="xc-coupon-left "> |
@@ -817,7 +819,7 @@ | @@ -817,7 +819,7 @@ | ||
817 | <block wx:if="{{choice_sort_store==0}}"> | 819 | <block wx:if="{{choice_sort_store==0}}"> |
818 | <!-- 需要for循环 --> | 820 | <!-- 需要for循环 --> |
819 | <block wx:if="{{is_show_sto_cat==1}}"> | 821 | <block wx:if="{{is_show_sto_cat==1}}"> |
820 | - <view class="store_choose flex" wx:for="{{def_pickpu_list}}" bindtap="choose_for_store_fir" data-ind="{{index}}"> | 822 | + <view class="store_choose flex" wx:for="{{def_pickpu_list}}" wx:key="dpl" bindtap="choose_for_store_fir" data-ind="{{index}}"> |
821 | <view class="store flex-vertical"> | 823 | <view class="store flex-vertical"> |
822 | <!-- 需要点击事件 --> | 824 | <!-- 需要点击事件 --> |
823 | <block wx:if="{{index==fir_pick_index}}"> | 825 | <block wx:if="{{index==fir_pick_index}}"> |
@@ -843,7 +845,7 @@ | @@ -843,7 +845,7 @@ | ||
843 | </view> | 845 | </view> |
844 | </block> | 846 | </block> |
845 | <block wx:else> | 847 | <block wx:else> |
846 | - <view class="store_choose flex" wx:for="{{only_pk}}" bindtap="choose_for_store_fir" data-ind="{{index}}"> | 848 | + <view class="store_choose flex" wx:for="{{only_pk}}" wx:key="olpk" bindtap="choose_for_store_fir" data-ind="{{index}}"> |
847 | <view class="store flex-vertical"> | 849 | <view class="store flex-vertical"> |
848 | <!-- 需要点击事件 --> | 850 | <!-- 需要点击事件 --> |
849 | <block wx:if="{{index==fir_pick_index}}"> | 851 | <block wx:if="{{index==fir_pick_index}}"> |
@@ -871,7 +873,7 @@ | @@ -871,7 +873,7 @@ | ||
871 | </block> | 873 | </block> |
872 | <block wx:else> | 874 | <block wx:else> |
873 | <!-- 如果是点击选择门店分类后显示分类下的门店 --> | 875 | <!-- 如果是点击选择门店分类后显示分类下的门店 --> |
874 | - <view class="store_choose flex" wx:for="{{sec_sto.s_arr}}" data-ind="{{index}}" bindtap="choose_for_store"> | 876 | + <view class="store_choose flex" wx:for="{{sec_sto.s_arr}}" wx:key="sec_arr" data-ind="{{index}}" bindtap="choose_for_store"> |
875 | <view class="store flex-vertical"> | 877 | <view class="store flex-vertical"> |
876 | <!-- 需要点击事件 --> | 878 | <!-- 需要点击事件 --> |
877 | <block wx:if="{{index==sec_pick_index}}"> | 879 | <block wx:if="{{index==sec_pick_index}}"> |
@@ -922,7 +924,7 @@ | @@ -922,7 +924,7 @@ | ||
922 | </view> | 924 | </view> |
923 | </view> | 925 | </view> |
924 | <view class="sort_store_list"> | 926 | <view class="sort_store_list"> |
925 | - <view class="sort-store-frame" wx:for="{{all_sto}}" data-index="{{index}}" bindtap="choice_sort_store" data-region="{{item.name}}"> | 927 | + <view class="sort-store-frame" wx:for="{{all_sto}}" wx:key="all_sto" data-index="{{index}}" bindtap="choice_sort_store" data-region="{{item.name}}"> |
926 | <view class="sort-store flex-vertical-between"> | 928 | <view class="sort-store flex-vertical-between"> |
927 | <view class="fs30" di>{{item.name}}</view> | 929 | <view class="fs30" di>{{item.name}}</view> |
928 | <view class="black_rights-frame"> | 930 | <view class="black_rights-frame"> |
packageC/pages/presell/goodsInfo/goodsInfo.wxss
@@ -2361,8 +2361,30 @@ margin-top:5rpx; | @@ -2361,8 +2361,30 @@ margin-top:5rpx; | ||
2361 | top: -23rpx; | 2361 | top: -23rpx; |
2362 | right: 56rpx; | 2362 | right: 56rpx; |
2363 | } | 2363 | } |
2364 | -.xc-time-val{width:36rpx;height:36rpx;border-radius:7rpx; line-height: 36rpx;} | ||
2365 | -.xc-time{margin-right:10rpx; margin-left:10rpx; margin-top:-32rpx; | 2364 | +.xc-time-val{ |
2365 | + width:36rpx; | ||
2366 | + height:36rpx; | ||
2367 | + border-radius:7rpx; | ||
2368 | + line-height: 36rpx; | ||
2369 | + background:#d40022; | ||
2370 | +} | ||
2371 | +.xc-time{ | ||
2372 | + margin-right:10rpx; | ||
2373 | + margin-left:10rpx; | ||
2374 | + margin-top:-32rpx; | ||
2375 | + color: #d40022; | ||
2376 | +} | ||
2377 | +.ba_r { | ||
2378 | + background:#d40022; | ||
2379 | +} | ||
2380 | +.cl_r { | ||
2381 | + color: #d40022; | ||
2382 | +} | ||
2383 | +.pre_ba { | ||
2384 | + background:#0097e0; | ||
2385 | +} | ||
2386 | +.pre_cl { | ||
2387 | + color: #0097e0; | ||
2366 | } | 2388 | } |
2367 | .xc-goods-explain{ | 2389 | .xc-goods-explain{ |
2368 | width:100%; | 2390 | width:100%; |
@@ -2947,7 +2969,7 @@ button.custom-service::after{ | @@ -2947,7 +2969,7 @@ button.custom-service::after{ | ||
2947 | /* position: absolute; */ | 2969 | /* position: absolute; */ |
2948 | display: flex; | 2970 | display: flex; |
2949 | align-items: center; | 2971 | align-items: center; |
2950 | - /* justify-content: center; */ | 2972 | + justify-content: center; |
2951 | border-radius: 60rpx; | 2973 | border-radius: 60rpx; |
2952 | background-color: rgba(0,0,0,.4); | 2974 | background-color: rgba(0,0,0,.4); |
2953 | /* position: absolute; */ | 2975 | /* position: absolute; */ |
packageC/pages/presell/list/list.js
@@ -11,7 +11,7 @@ Page({ | @@ -11,7 +11,7 @@ Page({ | ||
11 | isshow: 0, | 11 | isshow: 0, |
12 | ad_data: null, | 12 | ad_data: null, |
13 | max_sw_height: 200, | 13 | max_sw_height: 200, |
14 | - type: 1, | 14 | + type: 0, |
15 | }, | 15 | }, |
16 | 16 | ||
17 | //------初始化加载---------- | 17 | //------初始化加载---------- |
@@ -136,7 +136,7 @@ Page({ | @@ -136,7 +136,7 @@ Page({ | ||
136 | store_id: os.stoid, | 136 | store_id: os.stoid, |
137 | page: this.data.page, | 137 | page: this.data.page, |
138 | pageSize: 10, | 138 | pageSize: 10, |
139 | - timetype: self.data.type, | 139 | + // timetype: self.data.type, |
140 | isuse:1 | 140 | isuse:1 |
141 | } | 141 | } |
142 | if(getApp().globalData.userInfo){ | 142 | if(getApp().globalData.userInfo){ |
@@ -150,12 +150,20 @@ Page({ | @@ -150,12 +150,20 @@ Page({ | ||
150 | getApp().request.get("/api/weshop/marketing/marketingPresellList/page", { | 150 | getApp().request.get("/api/weshop/marketing/marketingPresellList/page", { |
151 | data: req, | 151 | data: req, |
152 | success: function (res) { | 152 | success: function (res) { |
153 | + let now = ut.gettimestamp(); | ||
153 | self.data.loading = 0; | 154 | self.data.loading = 0; |
154 | if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length > 0) { | 155 | if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length > 0) { |
155 | var list = self.data.goodlist ? self.data.goodlist : []; | 156 | var list = self.data.goodlist ? self.data.goodlist : []; |
156 | var arr = res.data.data.pageData; | 157 | var arr = res.data.data.pageData; |
157 | //数组合起来 | 158 | //数组合起来 |
158 | for (var i in arr) { | 159 | for (var i in arr) { |
160 | + arr[i].type = arr[i].show_time&&(now>=arr[i].show_time&&now<arr[i].start_time)?0:(now>arr[i].start_time&&now<arr[i].end_time)?1:2; | ||
161 | + arr[i].djs = { | ||
162 | + day: '00', | ||
163 | + hou: '00', | ||
164 | + min: '00', | ||
165 | + sec: '00', | ||
166 | + }; | ||
159 | list.push(arr[i]); | 167 | list.push(arr[i]); |
160 | } | 168 | } |
161 | self.data.page++; | 169 | self.data.page++; |
@@ -215,36 +223,49 @@ Page({ | @@ -215,36 +223,49 @@ Page({ | ||
215 | if(endTimeList==null) return null | 223 | if(endTimeList==null) return null |
216 | // 对结束时间进行处理渲染到页面 | 224 | // 对结束时间进行处理渲染到页面 |
217 | for (var i = 0; i < endTimeList.length; i++){ | 225 | for (var i = 0; i < endTimeList.length; i++){ |
218 | - var o = endTimeList[i]; | ||
219 | - var endTime = o.start_time; | ||
220 | - let obj = null; | ||
221 | - // 如果活动未结束,对时间进行处理 | ||
222 | - if (endTime - newTime > 0){ | ||
223 | - let time = (endTime - newTime); | ||
224 | - // 获取天、时、分、秒 | ||
225 | - let day = parseInt(time / (60 * 60 * 24)); | ||
226 | - let hou = parseInt(time % (60 * 60 * 24) / 3600); | ||
227 | - let min = parseInt(time % (60 * 60 * 24) % 3600 / 60); | ||
228 | - let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60); | ||
229 | - obj = { | ||
230 | - day: this.timeFormat(day), | ||
231 | - hou: this.timeFormat(hou), | ||
232 | - min: this.timeFormat(min), | ||
233 | - sec: this.timeFormat(sec), | ||
234 | - hide: 1 | ||
235 | - } | ||
236 | - }else{ | ||
237 | - //活动已结束,全部设置为'00' | ||
238 | - obj = { | ||
239 | - day: '00', | ||
240 | - hou: '00', | ||
241 | - min: '00', | ||
242 | - sec: '00' | 226 | + var o = endTimeList[i]; |
227 | + var endTime = o.start_time; | ||
228 | + let obj = null; | ||
229 | + var type = 1; | ||
230 | + var tend = false; | ||
231 | + // if (o.show_time && newTime < endTime && newTime >= o.show_time) { | ||
232 | + // type = 0; | ||
233 | + // } | ||
234 | + // 如果活动未结束,对时间进行处理 | ||
235 | + if (o.show_time && newTime < endTime && newTime > o.show_time){ | ||
236 | + let time = (endTime - newTime); | ||
237 | + // 获取天、时、分、秒 | ||
238 | + let day = parseInt(time / (60 * 60 * 24)); | ||
239 | + let hou = parseInt(time % (60 * 60 * 24) / 3600); | ||
240 | + let min = parseInt(time % (60 * 60 * 24) % 3600 / 60); | ||
241 | + let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60); | ||
242 | + obj = { | ||
243 | + day: this.timeFormat(day), | ||
244 | + hou: this.timeFormat(hou), | ||
245 | + min: this.timeFormat(min), | ||
246 | + sec: this.timeFormat(sec), | ||
247 | + hide: 1 | ||
243 | } | 248 | } |
249 | + type = 0; | ||
250 | + }else{ | ||
251 | + //活动已结束,全部设置为'00' | ||
252 | + obj = { | ||
253 | + day: '00', | ||
254 | + hou: '00', | ||
255 | + min: '00', | ||
256 | + sec: '00' | ||
244 | } | 257 | } |
245 | - var txt ="goodlist["+i+"].djs"; | ||
246 | - th.setData({ [txt]: obj}); | 258 | + tend = true |
247 | } | 259 | } |
260 | + var txt ="goodlist["+i+"].djs"; | ||
261 | + var typ ="goodlist["+i+"].type"; | ||
262 | + var end ="goodlist["+i+"].end"; | ||
263 | + th.setData({ | ||
264 | + [txt]: obj, | ||
265 | + [typ]: type, | ||
266 | + [end]: tend, | ||
267 | + }); | ||
268 | + } | ||
248 | }, | 269 | }, |
249 | go_url(e){ | 270 | go_url(e){ |
250 | let url=e.currentTarget.dataset.url; | 271 | let url=e.currentTarget.dataset.url; |
packageC/pages/presell/list/list.wxml
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | 6 | ||
7 | <swiper class="swiper" circular="true" autoplay="true" | 7 | <swiper class="swiper" circular="true" autoplay="true" |
8 | indicator-dots="true" interval="2500" style="height:{{max_sw_height}}rpx" > | 8 | indicator-dots="true" interval="2500" style="height:{{max_sw_height}}rpx" > |
9 | - <block wx:for="{{ad_data}}"> | 9 | + <block wx:for="{{ad_data}}" wx:key="as"> |
10 | 10 | ||
11 | <navigator url="{{item.ad_weapplink}}" class="s1_gk_a1" wx:if="{{g_filter.has_char(item.ad_weapplink,'plugin')>=0}}"> | 11 | <navigator url="{{item.ad_weapplink}}" class="s1_gk_a1" wx:if="{{g_filter.has_char(item.ad_weapplink,'plugin')>=0}}"> |
12 | <swiper-item> | 12 | <swiper-item> |
@@ -26,7 +26,7 @@ | @@ -26,7 +26,7 @@ | ||
26 | 26 | ||
27 | 27 | ||
28 | <view class="kill-list seckill_list"> | 28 | <view class="kill-list seckill_list"> |
29 | - <view class="kill-item" wx:for="{{goodlist}}"> | 29 | + <view class="kill-item" wx:for="{{goodlist}}" wx:key="gs"> |
30 | <navigator class="kill-pic rel" url="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&pre_id={{item.id}}"> | 30 | <navigator class="kill-pic rel" url="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&pre_id={{item.id}}"> |
31 | <image class="wh100" src="{{url+item.original_img}}" data-val="{{item.original_img}}" | 31 | <image class="wh100" src="{{url+item.original_img}}" data-val="{{item.original_img}}" |
32 | data-errorimg="goodlist[{{index}}].original_img" binderror="bind_bnerr2" lazy-load="true"></image> | 32 | data-errorimg="goodlist[{{index}}].original_img" binderror="bind_bnerr2" lazy-load="true"></image> |
@@ -37,9 +37,10 @@ | @@ -37,9 +37,10 @@ | ||
37 | <view class="flex-vertical xc-strip-frame"> | 37 | <view class="flex-vertical xc-strip-frame"> |
38 | <view class="xc-strip-blank rel"> | 38 | <view class="xc-strip-blank rel"> |
39 | 39 | ||
40 | - <view class="flex-vertical rel total" style="background-color: {{type == 0 ? '#059de5' : ''}};"> | ||
41 | - <view class="t-c abs xc-fill" ></view> | ||
42 | - <text class="fs20 white abs xc-fill-text">已预售0%</text> | 40 | + <view class="flex-vertical rel total" style="background-color: {{item.type == 0 ? '#059de5' : item.type == 1 ? '#ffe3e2' : ''}};"> |
41 | + <view wx:if="{{item.type == 1}}" class="t-c abs xc-fill" style="background: #e4374d;width: calc({{filters.toFix(100-(item.buy_goodnum+item.virtual_qty)/(item.presell_sumqty+item.virtual_qty)*100,0)||100}} * 1%);"></view> | ||
42 | + <text wx:if="{{item.type == 1}}" class="fs20 white abs xc-fill-text">剩余{{filters.toFix(100-(item.buy_goodnum+item.virtual_qty)/(item.presell_sumqty+item.virtual_qty)*100,0)||100}}%</text> | ||
43 | + <text wx:else class="fs20 white abs xc-fill-text">已预售{{filters.toFix((item.buy_goodnum+item.virtual_qty)/(item.presell_sumqty+item.virtual_qty)*100,0)||0}}%</text> | ||
43 | </view> | 44 | </view> |
44 | 45 | ||
45 | </view> | 46 | </view> |
@@ -48,23 +49,24 @@ | @@ -48,23 +49,24 @@ | ||
48 | 49 | ||
49 | <view class="goods-num"> | 50 | <view class="goods-num"> |
50 | <view> | 51 | <view> |
51 | - <view class="blue_c" wx:if="{{type == 0}}"> | ||
52 | - <text>剩余:</text> | ||
53 | - <text class='tui-conutdown-box'> {{item.djs.day}}</text>天 | 52 | + <view class="blue_c" wx:if="{{item.type == 0 && false}}" style="display: none;position: absolute;margin-top: -40rpx;"> |
53 | + <text>剩余:</text> | ||
54 | + <text class='tui-conutdown-box'>{{item.djs.day}}</text>天 | ||
54 | <text class='tui-conutdown-box'>{{item.djs.hou}}</text>时 | 55 | <text class='tui-conutdown-box'>{{item.djs.hou}}</text>时 |
55 | <text class='tui-conutdown-box'>{{item.djs.min}}</text>分 | 56 | <text class='tui-conutdown-box'>{{item.djs.min}}</text>分 |
56 | <text class='tui-conutdown-box tui-countdown-bg'>{{item.djs.sec}}</text>秒 | 57 | <text class='tui-conutdown-box tui-countdown-bg'>{{item.djs.sec}}</text>秒 |
57 | </view> | 58 | </view> |
58 | 59 | ||
59 | - <view class="fs40 flex xc-buttom-money {{type==1?'xc-wc':'blue_c'}}" > | 60 | + <view class="fs40 flex xc-buttom-money {{item.type==1?'xc-wc':'blue_c'}}" > |
60 | <view class="fs28" style="line-height: 16px;">¥{{item.presell_price}}</view> | 61 | <view class="fs28" style="line-height: 16px;">¥{{item.presell_price}}</view> |
61 | <text>{{item.price}}</text> | 62 | <text>{{item.price}}</text> |
62 | <!-- <span class="underline fs20">零售价¥{{item.market_price}}</span>--> | 63 | <!-- <span class="underline fs20">零售价¥{{item.market_price}}</span>--> |
63 | </view> | 64 | </view> |
64 | </view> | 65 | </view> |
65 | <view class="kill-btn "> | 66 | <view class="kill-btn "> |
66 | - <navigator wx:if="{{type==1}}" url="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&pre_id={{item.id}}">去抢购</navigator> | ||
67 | - <navigator wx:else url="/packageC/pages/presell/pregoodsInfo/goodsInfo?goods_id={{item.goods_id}}&pre_id={{item.id}}" style="background:#059de5;"><view style="color:#fff;">即将开始</view></navigator> | 67 | + <navigator wx:if="{{item.type==1}}" url="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&pre_id={{item.id}}">去抢购</navigator> |
68 | + <!-- <navigator wx:else url="/packageC/pages/presell/pregoodsInfo/goodsInfo?goods_id={{item.goods_id}}&pre_id={{item.id}}" style="background:#059de5;"><view style="color:#fff;">即将开始</view></navigator> --> | ||
69 | + <navigator wx:else url="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&pre_id={{item.id}}" style="background:#059de5;"><view style="color:#fff;">即将开始</view></navigator> | ||
68 | </view> | 70 | </view> |
69 | 71 | ||
70 | </view> | 72 | </view> |
packageC/pages/presell/pregoodsInfo/goodsInfo.js
@@ -3694,7 +3694,7 @@ Page({ | @@ -3694,7 +3694,7 @@ Page({ | ||
3694 | getApp().goto("/pages/user/plus/plus"); | 3694 | getApp().goto("/pages/user/plus/plus"); |
3695 | }, | 3695 | }, |
3696 | go_card_info: function () { | 3696 | go_card_info: function () { |
3697 | - getApp().goto("/pages/user/cardinfo/cardinfo"); | 3697 | + getApp().goto("/packageE/pages/user/cardinfo/cardinfo"); |
3698 | }, | 3698 | }, |
3699 | //-- 根据ID拿出门店 -- | 3699 | //-- 根据ID拿出门店 -- |
3700 | get_pick_from_list(pid) { | 3700 | get_pick_from_list(pid) { |
pages/user/cardinfo/cardinfo.js renamed to packageE/pages/user/cardinfo/cardinfo.js
@@ -2,11 +2,11 @@ var t = getApp(), | @@ -2,11 +2,11 @@ var t = getApp(), | ||
2 | a = t.request, | 2 | a = t.request, |
3 | o = t.globalData.setting, | 3 | o = t.globalData.setting, |
4 | os = o, | 4 | os = o, |
5 | - i = require("../../../utils/util.js"), | 5 | + i = require("../../../../utils/util.js"), |
6 | ut = i, | 6 | ut = i, |
7 | - s = require("../../../utils/common.js"),t_pay = require("../../../utils/pay2.js"), | ||
8 | - w = require("../../../utils/wxParse/wxParse.js"); | ||
9 | -var regeneratorRuntime = require('../../../utils/runtime.js'); | 7 | + s = require("../../../../utils/common.js"),t_pay = require("../../../../utils/pay2.js"), |
8 | + w = require("../../../../utils/wxParse/wxParse.js"); | ||
9 | +var regeneratorRuntime = require('../../../../utils/runtime.js'); | ||
10 | //wx.downloadFile把线上地址设为本地地址 | 10 | //wx.downloadFile把线上地址设为本地地址 |
11 | Page({ | 11 | Page({ |
12 | 12 |
pages/user/cardinfo/cardinfo.json renamed to packageE/pages/user/cardinfo/cardinfo.json
pages/user/cardinfo/cardinfo.wxml renamed to packageE/pages/user/cardinfo/cardinfo.wxml
1 | -<import src="../../../utils/wxParse/wxParse.wxml"></import> | ||
2 | -<wxs module="filters" src="../../../utils/filter.wxs"></wxs> | 1 | +<import src="../../../../utils/wxParse/wxParse.wxml"></import> |
2 | +<wxs module="filters" src="../../../../utils/filter.wxs"></wxs> | ||
3 | 3 | ||
4 | <view> | 4 | <view> |
5 | <image class="Member_bk" src="{{url}}/miniapp/images/plus/page_bk.png"></image> | 5 | <image class="Member_bk" src="{{url}}/miniapp/images/plus/page_bk.png"></image> |
pages/user/cardinfo/cardinfo.wxss renamed to packageE/pages/user/cardinfo/cardinfo.wxss
pages/activity/pind_list/pind_list.js
@@ -18,6 +18,7 @@ Page({ | @@ -18,6 +18,7 @@ Page({ | ||
18 | iurl: os.imghost, | 18 | iurl: os.imghost, |
19 | ad_data: null, | 19 | ad_data: null, |
20 | max_sw_height: 200, | 20 | max_sw_height: 200, |
21 | + is_retail_price:0 | ||
21 | }, | 22 | }, |
22 | 23 | ||
23 | //------初始化加载---------- | 24 | //------初始化加载---------- |
@@ -29,6 +30,16 @@ Page({ | @@ -29,6 +30,16 @@ Page({ | ||
29 | var th = this; | 30 | var th = this; |
30 | getApp().getConfig(); | 31 | getApp().getConfig(); |
31 | 32 | ||
33 | + var th=this; | ||
34 | + getApp().getConfig2(function (e) { | ||
35 | + var swithc_list = e.switch_list; | ||
36 | + var sw_arr = JSON.parse(swithc_list); | ||
37 | + if(sw_arr.is_retail_price){ | ||
38 | + th.setData({is_retail_price:1}); | ||
39 | + } | ||
40 | + },1); | ||
41 | + | ||
42 | + | ||
32 | if (first_leader) { | 43 | if (first_leader) { |
33 | getApp().globalData.first_leader = first_leader; | 44 | getApp().globalData.first_leader = first_leader; |
34 | //调用接口判断是不是会员 | 45 | //调用接口判断是不是会员 |
pages/activity/pind_list/pind_list.wxml
@@ -43,7 +43,7 @@ | @@ -43,7 +43,7 @@ | ||
43 | <view class="fs20 flex xc-people-val-frame" | 43 | <view class="fs20 flex xc-people-val-frame" |
44 | style="border-color:{{type==1?'#d60021':'#059de5'}};margin-left:{{type==1?'15rpx':'0rpx'}}"> | 44 | style="border-color:{{type==1?'#d60021':'#059de5'}};margin-left:{{type==1?'15rpx':'0rpx'}}"> |
45 | <view class=" flex-center val-img {{type==1?'red-b':'blue_b'}}"> | 45 | <view class=" flex-center val-img {{type==1?'red-b':'blue_b'}}"> |
46 | - <image class="people-img"src="{{iurl}}/miniapp/images/bai-ren.png"></image> | 46 | + <image class="people-img" src="{{iurl}}/miniapp/images/bai-ren.png"></image> |
47 | </view> | 47 | </view> |
48 | <text class="{{type==1?'red-co':'blue_c ai-bas'}}" style="margin-left:8rpx; margin-right:8rpx">{{item.ct_num}}人团</text> | 48 | <text class="{{type==1?'red-co':'blue_c ai-bas'}}" style="margin-left:8rpx; margin-right:8rpx">{{item.ct_num}}人团</text> |
49 | </view> | 49 | </view> |
@@ -63,20 +63,20 @@ | @@ -63,20 +63,20 @@ | ||
63 | <text class='tui-conutdown-box'>{{item.djs.min}}</text>分 | 63 | <text class='tui-conutdown-box'>{{item.djs.min}}</text>分 |
64 | <text class='tui-conutdown-box tui-countdown-bg'>{{item.djs.sec}}</text>秒 | 64 | <text class='tui-conutdown-box tui-countdown-bg'>{{item.djs.sec}}</text>秒 |
65 | </view> | 65 | </view> |
66 | - <view class="goods-num"style="margin-top:{{type==0?'42rpx':'18rpx'}}"> | 66 | + <view class="goods-num" style="margin-top:{{type==0?'42rpx':'18rpx'}}"> |
67 | <view> | 67 | <view> |
68 | 68 | ||
69 | <view class="fs40 flex xc-top15 {{type==1?'red-co ai-bas':'blue_c xc-lihe42 ai-bas'}}"> | 69 | <view class="fs40 flex xc-top15 {{type==1?'red-co ai-bas':'blue_c xc-lihe42 ai-bas'}}"> |
70 | <text class="fs28 {{type==0?'martop13':''}}">¥</text> | 70 | <text class="fs28 {{type==0?'martop13':''}}">¥</text> |
71 | <text style="margin-left:-5rpx">{{item.price}}</text> | 71 | <text style="margin-left:-5rpx">{{item.price}}</text> |
72 | -<!-- <span class="underline {{type==0?'martop18':''}}">¥{{item.shop_price}}</span>--> | 72 | + <text wx:if="{{is_retail_price}}" class="underline {{type==0?'martop18':''}}">¥{{item.shop_price}}</text> |
73 | </view> | 73 | </view> |
74 | 74 | ||
75 | </view> | 75 | </view> |
76 | <view class="kill-btn"> | 76 | <view class="kill-btn"> |
77 | - <navigator class="huise"style="background-color: #059de5;" url="{{!item.goods_type ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + item.goods_id):('/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo?prom_type=6&goods_id=' + item.goods_id + '&prom_id=' + item.id)}}" wx:if="{{type==0 && item.kttype==1 }}">即将开始</navigator> | ||
78 | - <navigator class="huise"style="background-color: #059de5;" url="{{!item.goods_type ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + item.goods_id):('/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo?prom_type=6&goods_id=' + item.goods_id + '&prom_id=' + item.id)}}" wx:if="{{type==0 && item.kttype==2 }}" >即将开始</navigator> | ||
79 | - <navigator class="huise"style="background-color: #059de5;" url="{{!item.goods_type ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + item.goods_id):('/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo?prom_type=6&goods_id=' + item.goods_id + '&prom_id=' + item.id)}}" wx:if="{{type==0 && item.kttype==3 }}" >即将开始</navigator> | 77 | + <navigator class="huise" style="background-color: #059de5;" url="{{!item.goods_type ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + item.goods_id):('/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo?prom_type=6&goods_id=' + item.goods_id + '&prom_id=' + item.id)}}" wx:if="{{type==0 && item.kttype==1 }}">即将开始</navigator> |
78 | + <navigator class="huise" style="background-color: #059de5;" url="{{!item.goods_type ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + item.goods_id):('/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo?prom_type=6&goods_id=' + item.goods_id + '&prom_id=' + item.id)}}" wx:if="{{type==0 && item.kttype==2 }}" >即将开始</navigator> | ||
79 | + <navigator class="huise" style="background-color: #059de5;" url="{{!item.goods_type ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + item.goods_id):('/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo?prom_type=6&goods_id=' + item.goods_id + '&prom_id=' + item.id)}}" wx:if="{{type==0 && item.kttype==3 }}" >即将开始</navigator> | ||
80 | 80 | ||
81 | <navigator class="blue_b" url="{{!item.goods_type ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + item.goods_id):('/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo?prom_type=6&goods_id=' + item.goods_id + '&prom_id=' + item.id)}}" wx:if="{{item.status==1 && type==1 && item.kttype==1}}">去参团</navigator> | 81 | <navigator class="blue_b" url="{{!item.goods_type ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + item.goods_id):('/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo?prom_type=6&goods_id=' + item.goods_id + '&prom_id=' + item.id)}}" wx:if="{{item.status==1 && type==1 && item.kttype==1}}">去参团</navigator> |
82 | <navigator url="{{!item.goods_type ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + item.goods_id):('/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo?prom_type=6&goods_id=' + item.goods_id + '&prom_id=' + item.id)}}" wx:if="{{item.status==1 && type==1 && item.kttype==2}}">去开团</navigator> | 82 | <navigator url="{{!item.goods_type ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + item.goods_id):('/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo?prom_type=6&goods_id=' + item.goods_id + '&prom_id=' + item.id)}}" wx:if="{{item.status==1 && type==1 && item.kttype==2}}">去开团</navigator> |
@@ -94,11 +94,11 @@ | @@ -94,11 +94,11 @@ | ||
94 | <view class="theader" > | 94 | <view class="theader" > |
95 | <view bindtap='tip' data-ty="1" class="xc-border-right flex-center timeac left {{type==1?'active':''}}"> | 95 | <view bindtap='tip' data-ty="1" class="xc-border-right flex-center timeac left {{type==1?'active':''}}"> |
96 | <image class="xc-bottom" | 96 | <image class="xc-bottom" |
97 | - src="{{type==1?'{{url}}/miniapp/images/fire-red.png':'{{url}}/miniapp/images/fire-black.png'}}"></image> | 97 | + src="{{type==1?url+'/miniapp/images/fire-red.png':url+'/miniapp/images/fire-black.png'}}"></image> |
98 | 火热进行中</view> | 98 | 火热进行中</view> |
99 | <view bindtap='tip' data-ty="0" class=" flex-center timeac right {{type==0?'active':''}}"> | 99 | <view bindtap='tip' data-ty="0" class=" flex-center timeac right {{type==0?'active':''}}"> |
100 | <image class="xc-bottom" | 100 | <image class="xc-bottom" |
101 | - src="{{type==0?'{{url}}/miniapp/images/clock-rad.png':'{{url}}/miniapp/images/clock-black.png'}}"></image> | 101 | + src="{{type==0?url+'/miniapp/images/clock-rad.png':url+'/miniapp/images/clock-black.png'}}"></image> |
102 | 即将开始</view> | 102 | 即将开始</view> |
103 | </view> | 103 | </view> |
104 | 104 |
pages/activity/seckill_list/seckill_list.js
@@ -17,6 +17,7 @@ Page({ | @@ -17,6 +17,7 @@ Page({ | ||
17 | isshow: 0, | 17 | isshow: 0, |
18 | ad_data: null, | 18 | ad_data: null, |
19 | max_sw_height: 200, | 19 | max_sw_height: 200, |
20 | + is_retail_price:0 | ||
20 | }, | 21 | }, |
21 | 22 | ||
22 | //------初始化加载---------- | 23 | //------初始化加载---------- |
@@ -37,6 +38,16 @@ Page({ | @@ -37,6 +38,16 @@ Page({ | ||
37 | console.log(first_leader); | 38 | console.log(first_leader); |
38 | getApp().getConfig(); | 39 | getApp().getConfig(); |
39 | 40 | ||
41 | + var th=this; | ||
42 | + getApp().getConfig2(function (e) { | ||
43 | + var swithc_list = e.switch_list; | ||
44 | + var sw_arr = JSON.parse(swithc_list); | ||
45 | + if(sw_arr.is_retail_price){ | ||
46 | + th.setData({is_retail_price:1}); | ||
47 | + } | ||
48 | + },1); | ||
49 | + | ||
50 | + | ||
40 | if (first_leader) { | 51 | if (first_leader) { |
41 | getApp().globalData.first_leader = first_leader; | 52 | getApp().globalData.first_leader = first_leader; |
42 | //调用接口判断是不是会员 | 53 | //调用接口判断是不是会员 |
pages/activity/seckill_list/seckill_list.wxml
@@ -68,8 +68,8 @@ | @@ -68,8 +68,8 @@ | ||
68 | </view> | 68 | </view> |
69 | <view class="fs40 flex xc-buttom-money {{type==1?'xc-wc':'blue_c'}}" > | 69 | <view class="fs40 flex xc-buttom-money {{type==1?'xc-wc':'blue_c'}}" > |
70 | <view class="fs28" style="line-height: 16px;">¥</view> | 70 | <view class="fs28" style="line-height: 16px;">¥</view> |
71 | - <text>{{item.price}}</text> | ||
72 | -<!-- <span class="underline fs20">零售价¥{{item.market_price}}</span>--> | 71 | + <text>{{item.price}}--{{is_retail_price}}--</text> |
72 | + <span wx:if="{{is_retail_price}}" class="underline fs20">零售价¥{{item.market_price}}</span> | ||
73 | </view> | 73 | </view> |
74 | 74 | ||
75 | </view> | 75 | </view> |
@@ -79,7 +79,7 @@ | @@ -79,7 +79,7 @@ | ||
79 | <navigator class="huise"url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_id={{item.id}}&prom_type=1" wx:if="{{item.status==3 && type==1}}">已抢光</navigator> --> | 79 | <navigator class="huise"url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_id={{item.id}}&prom_type=1" wx:if="{{item.status==3 && type==1}}">已抢光</navigator> --> |
80 | <navigator style="background-color: #059de5;" url="{{item.goods_type == 0 ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_type=1&prom_id=' + item.id):('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_type=1&prom_id=' + item.id )}}" wx:if="{{type==0}}" >即将开始</navigator> | 80 | <navigator style="background-color: #059de5;" url="{{item.goods_type == 0 ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_type=1&prom_id=' + item.id):('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_type=1&prom_id=' + item.id )}}" wx:if="{{type==0}}" >即将开始</navigator> |
81 | <navigator url="{{item.goods_type == 0 ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_type=1&prom_id=' + item.id):('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_type=1&prom_id=' + item.id )}}" wx:if="{{item.status==1 && type==1}}">马上抢</navigator> | 81 | <navigator url="{{item.goods_type == 0 ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_type=1&prom_id=' + item.id):('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_type=1&prom_id=' + item.id )}}" wx:if="{{item.status==1 && type==1}}">马上抢</navigator> |
82 | - <navigator class="huise"url="{{item.goods_type == 0 ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_type=1&prom_id=' + item.id):('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_type=1&prom_id=' + item.id )}}" wx:if="{{item.status==3 && type==1}}">已抢光</navigator> | 82 | + <navigator class="huise" url="{{item.goods_type == 0 ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_type=1&prom_id=' + item.id):('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_type=1&prom_id=' + item.id )}}" wx:if="{{item.status==3 && type==1}}">已抢光</navigator> |
83 | </view> | 83 | </view> |
84 | </view> | 84 | </view> |
85 | </view> | 85 | </view> |
pages/cart/cart2/cart2.js
@@ -137,7 +137,11 @@ Page({ | @@ -137,7 +137,11 @@ Page({ | ||
137 | dis_config:null, | 137 | dis_config:null, |
138 | bn_use_commission:0, //是不是使用佣金 | 138 | bn_use_commission:0, //是不是使用佣金 |
139 | cart_use_commission:0, | 139 | cart_use_commission:0, |
140 | - cart_commission:0 | 140 | + cart_commission:0, |
141 | + | ||
142 | + //订单所有搭配购的 | ||
143 | + all_collocation_list:[] | ||
144 | + | ||
141 | }, | 145 | }, |
142 | onLoad: function (t) { | 146 | onLoad: function (t) { |
143 | wx.setNavigationBarTitle({ title: "填写订单", }) | 147 | wx.setNavigationBarTitle({ title: "填写订单", }) |
@@ -391,7 +395,11 @@ Page({ | @@ -391,7 +395,11 @@ Page({ | ||
391 | //to.get_allsto(function (e) { | 395 | //to.get_allsto(function (e) { |
392 | //th.setData({ allsto: e }); | 396 | //th.setData({ allsto: e }); |
393 | //-------获取购物车已经选择的商品-------- | 397 | //-------获取购物车已经选择的商品-------- |
398 | + if(!th.data.old_cartlist) | ||
394 | th.get_cart(); | 399 | th.get_cart(); |
400 | + else{ | ||
401 | + th.calculatePrice(); | ||
402 | + } | ||
395 | //}) | 403 | //}) |
396 | } | 404 | } |
397 | }); | 405 | }); |
@@ -413,6 +421,72 @@ Page({ | @@ -413,6 +421,72 @@ Page({ | ||
413 | 421 | ||
414 | }, | 422 | }, |
415 | 423 | ||
424 | + //-- 获取搭配购商品 -- | ||
425 | + async set_collection(gd,arr,index){ | ||
426 | + var th=this; | ||
427 | + var user_id=getApp().globalData.user_id; | ||
428 | + var collocation_list=[]; | ||
429 | + var pick=null; | ||
430 | + var distr_t=0; | ||
431 | + | ||
432 | + //如果是购物车的时候, | ||
433 | + if(arr) { | ||
434 | + var idx = th.data.allsto.findIndex(function (e) { | ||
435 | + return e.pickup_id == arr[index].pick_id | ||
436 | + }) | ||
437 | + pick = th.data.allsto[idx]; | ||
438 | + var get_gd=null; | ||
439 | + await getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + gd.goods_id,{ | ||
440 | + | ||
441 | + }).then(res1 => { | ||
442 | + if(res1.data.code==0){ | ||
443 | + get_gd=res.data.data; | ||
444 | + } | ||
445 | + }) | ||
446 | + distr_t=pick.distr_type || get_gd.distr_type; | ||
447 | + | ||
448 | + }else{ | ||
449 | + var gg=to.get_b_now(); | ||
450 | + //---获取门店--- | ||
451 | + await getApp().request.promiseGet("/api/weshop/pickup/get/" + oo.stoid + "/" + gg.pick_id, {}) | ||
452 | + .then(res => { | ||
453 | + pick = res.data.data; | ||
454 | + }); | ||
455 | + distr_t=gd.distr_type || pick.distr_type; | ||
456 | + } | ||
457 | + | ||
458 | + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" | ||
459 | + + os.stoid + "/" + gd.goods_id + "/0/"+user_id, { | ||
460 | + }).then(res => { | ||
461 | + if(res.data.code==0 && res.data.data){ | ||
462 | + var r_data = res.data.data; | ||
463 | + if (r_data.collocationList) { | ||
464 | + collocation_list=r_data.collocationList; | ||
465 | + } | ||
466 | + } | ||
467 | + }) | ||
468 | + | ||
469 | + if(!collocation_list) return null; | ||
470 | + | ||
471 | + var new_arr=[]; | ||
472 | + for (let i = 0; i <collocation_list.length; i++){ | ||
473 | + var item0=collocation_list[i]; | ||
474 | + //判断物流配送一样的 | ||
475 | + if(item0.distr_type==0 || item0.distr_type==distr_t ){ | ||
476 | + new_arr.push(item0); | ||
477 | + } | ||
478 | + } | ||
479 | + | ||
480 | + if(!new_arr.length) return null; | ||
481 | + if(arr) { | ||
482 | + arr[index].collocationList=new_arr; | ||
483 | + | ||
484 | + } | ||
485 | + else th.setData({ | ||
486 | + all_collocation_list:new_arr | ||
487 | + }) | ||
488 | + | ||
489 | + }, | ||
416 | 490 | ||
417 | //-----真的获取购物车,入口-------- | 491 | //-----真的获取购物车,入口-------- |
418 | get_cart: function () { | 492 | get_cart: function () { |
@@ -594,7 +668,10 @@ Page({ | @@ -594,7 +668,10 @@ Page({ | ||
594 | }) | 668 | }) |
595 | } | 669 | } |
596 | } | 670 | } |
597 | - | 671 | + //-- 判断一下,获取搭配购的消息 -- |
672 | + if(item1.prom_type==0 || item1.prom_type==5){ | ||
673 | + await th.set_collection(item1,carr,i); | ||
674 | + } | ||
598 | } | 675 | } |
599 | 676 | ||
600 | //在分组的时候,就不要再调用接口,await | 677 | //在分组的时候,就不要再调用接口,await |
@@ -662,6 +739,17 @@ Page({ | @@ -662,6 +739,17 @@ Page({ | ||
662 | if (car_item.cut_price1) arr[j].card_cut_price += car_item.cut_price1; | 739 | if (car_item.cut_price1) arr[j].card_cut_price += car_item.cut_price1; |
663 | 740 | ||
664 | arr[j].goods.push(car_item); | 741 | arr[j].goods.push(car_item); |
742 | + if(car_item.collocationList){ | ||
743 | + | ||
744 | + if(!arr[j].collocationList) arr[j].collocationList=cart_item.collocationList; | ||
745 | + else{ | ||
746 | + var arr_new=[...arr[j].collocationList,...cart_item.collocationList]; | ||
747 | + arr[j].collocationList=arr_new; | ||
748 | + } | ||
749 | + } | ||
750 | + | ||
751 | + | ||
752 | + | ||
665 | find = 1; | 753 | find = 1; |
666 | break; | 754 | break; |
667 | } | 755 | } |
@@ -715,6 +803,7 @@ Page({ | @@ -715,6 +803,7 @@ Page({ | ||
715 | } | 803 | } |
716 | } | 804 | } |
717 | 805 | ||
806 | + | ||
718 | var ie = { | 807 | var ie = { |
719 | pickup_id: pcid, | 808 | pickup_id: pcid, |
720 | pname: pikname, | 809 | pname: pikname, |
@@ -734,6 +823,13 @@ Page({ | @@ -734,6 +823,13 @@ Page({ | ||
734 | 823 | ||
735 | //-- 把等级卡会优惠多少钱装进去 -- | 824 | //-- 把等级卡会优惠多少钱装进去 -- |
736 | if (car_item.cut_price1) ie.card_cut_price += car_item.cut_price1; | 825 | if (car_item.cut_price1) ie.card_cut_price += car_item.cut_price1; |
826 | + | ||
827 | + if(car_item.collocationList) { | ||
828 | + | ||
829 | + ie.collocationList = car_item.collocationList; | ||
830 | + } | ||
831 | + | ||
832 | + | ||
737 | arr.push(ie); | 833 | arr.push(ie); |
738 | } | 834 | } |
739 | } | 835 | } |
@@ -927,7 +1023,6 @@ Page({ | @@ -927,7 +1023,6 @@ Page({ | ||
927 | wx.navigateBack({delta: 1}) | 1023 | wx.navigateBack({delta: 1}) |
928 | },1000) | 1024 | },1000) |
929 | 1025 | ||
930 | - | ||
931 | return false | 1026 | return false |
932 | } | 1027 | } |
933 | 1028 | ||
@@ -972,6 +1067,8 @@ Page({ | @@ -972,6 +1067,8 @@ Page({ | ||
972 | et = th.data.bn_exp_type; | 1067 | et = th.data.bn_exp_type; |
973 | m_wind = th.data.index; | 1068 | m_wind = th.data.index; |
974 | } | 1069 | } |
1070 | + th.data.m_wind = m_wind; | ||
1071 | + | ||
975 | //---是不是购买等级卡成功的返回---等级卡显示的判断--- | 1072 | //---是不是购买等级卡成功的返回---等级卡显示的判断--- |
976 | var is_card_back = getApp().globalData.is_card_back; | 1073 | var is_card_back = getApp().globalData.is_card_back; |
977 | if (is_card_back) { | 1074 | if (is_card_back) { |
@@ -990,9 +1087,16 @@ Page({ | @@ -990,9 +1087,16 @@ Page({ | ||
990 | } | 1087 | } |
991 | } | 1088 | } |
992 | 1089 | ||
1090 | + //-- 判断是不是可以收藏 -- | ||
1091 | + if(gd.prom_type ==5){ | ||
1092 | + await th.set_collection(gd); | ||
1093 | + } | ||
1094 | + | ||
1095 | + //-- 当是搭配购的时候 -- | ||
993 | gd.prom_type = gg.prom_type ? gg.prom_type : 0; | 1096 | gd.prom_type = gg.prom_type ? gg.prom_type : 0; |
994 | gd.prom_id = gg.prom_id ? gg.prom_id : 0; | 1097 | gd.prom_id = gg.prom_id ? gg.prom_id : 0; |
995 | 1098 | ||
1099 | + | ||
996 | if(gd.whsle_id>0){ | 1100 | if(gd.whsle_id>0){ |
997 | gd.prom_type =gg.prom_type=0; | 1101 | gd.prom_type =gg.prom_type=0; |
998 | gd.prom_id =gg.prom_id=0; | 1102 | gd.prom_id =gg.prom_id=0; |
@@ -1051,6 +1155,7 @@ Page({ | @@ -1051,6 +1155,7 @@ Page({ | ||
1051 | 1155 | ||
1052 | } | 1156 | } |
1053 | 1157 | ||
1158 | + | ||
1054 | //如果立即购买那边过来,就要读取接口,查看活动的优惠内容 | 1159 | //如果立即购买那边过来,就要读取接口,查看活动的优惠内容 |
1055 | if (gg.prom_type == 3) { | 1160 | if (gg.prom_type == 3) { |
1056 | t.data.data.prom_id = gg.prom_id; | 1161 | t.data.data.prom_id = gg.prom_id; |
@@ -1100,10 +1205,12 @@ Page({ | @@ -1100,10 +1205,12 @@ Page({ | ||
1100 | //计算价格 | 1205 | //计算价格 |
1101 | th.calculatePrice2(); | 1206 | th.calculatePrice2(); |
1102 | //获取优惠券 | 1207 | //获取优惠券 |
1103 | - th.get_buy_now_quan(); | 1208 | + th.get_buy_now_quan(); |
1104 | 1209 | ||
1105 | }) | 1210 | }) |
1106 | } else { | 1211 | } else { |
1212 | + | ||
1213 | + | ||
1107 | //--看是不是搭配促销-- | 1214 | //--看是不是搭配促销-- |
1108 | if (gg.prom_type == 5) { | 1215 | if (gg.prom_type == 5) { |
1109 | t.data.data.prom_id = gg.prom_id; | 1216 | t.data.data.prom_id = gg.prom_id; |
@@ -1122,91 +1229,26 @@ Page({ | @@ -1122,91 +1229,26 @@ Page({ | ||
1122 | } | 1229 | } |
1123 | th.setData({ collocation_goods: gg.collocation_goods }); | 1230 | th.setData({ collocation_goods: gg.collocation_goods }); |
1124 | 1231 | ||
1125 | - var cart_arr = new Array(); | ||
1126 | - //var narr=gg.collocation_goods; | ||
1127 | - //修改成深拷贝,确保返回是数据正确 | ||
1128 | - var narr = JSON.parse(JSON.stringify(gg.collocation_goods)); | ||
1129 | - | ||
1130 | - narr.push(t.data.data); | ||
1131 | - | ||
1132 | - //-- 搭配促销的门店配送方式的修复 -- | ||
1133 | - et = 1; | ||
1134 | - distr_t = 0; // 配送方式 0=用户自选 1=自提 2=物流 | ||
1135 | - for (var hi in narr) { | ||
1136 | - var dis_t = narr[hi].distr_type; | ||
1137 | - if (dis_t == 2) { | ||
1138 | - th.setData({ is_all_zt: 0 }); | ||
1139 | - et = 0; | ||
1140 | - } | ||
1141 | - if (dis_t > 0) { | ||
1142 | - distr_t = dis_t; | ||
1143 | - } | ||
1144 | - | ||
1145 | - //-- 如果有一件代发的商品或者不是同城配送的配送 -- | ||
1146 | - if(narr[hi].is_same_city!=1 || narr[hi].whsle_id>0){ | ||
1147 | - th.setData({show_same_city:0}) | ||
1148 | - } | 1232 | + if(th.data.all_collocation_list){ |
1233 | + for(var i = 0; i<th.data.all_collocation_list.length; i++){ | ||
1234 | + var item0=th.data.all_collocation_list[i]; | ||
1235 | + var idx=gg.collocation_goods.findIndex(function(e){ | ||
1236 | + return e.goods_id ==item0.goods_id && e.prom_id==item0.prom_id; | ||
1237 | + }) | ||
1238 | + if(idx!=-1){ | ||
1239 | + var txt='all_collocation_list['+i+'].selected'; | ||
1240 | + th.setData({[txt]:1}); | ||
1241 | + } | ||
1242 | + } | ||
1149 | 1243 | ||
1150 | } | 1244 | } |
1151 | - //自选的时候,系统配置了默认的配送方式是物流的时候 | ||
1152 | - if (distr_t == 0 && th.data.json_d.pickupway && th.data.json_d.pickupway == 1) { | ||
1153 | - et = 0; | ||
1154 | - } | ||
1155 | - | ||
1156 | - var ie = { | ||
1157 | - pickup_id: gg.pick_id, | ||
1158 | - pname: gg.pick_name, | ||
1159 | - goods: narr, | ||
1160 | - exp_type: et, | ||
1161 | - wind: m_wind, | ||
1162 | - distr_t: distr_t, | ||
1163 | - bn_t_exp_t: distr_t, | ||
1164 | - goods_price: 0, | ||
1165 | - shipping_price: 0, | ||
1166 | - user_money: 0, | ||
1167 | - total_amount: 0, | ||
1168 | - order_amount: 0, | ||
1169 | - user_note: "" | ||
1170 | - }; | ||
1171 | - | ||
1172 | - var cart_commission=0; | ||
1173 | - //-- 循环计算一下线下取价 -- | ||
1174 | - //计算佣金的商品 | ||
1175 | - var commission_gds=[]; | ||
1176 | - for (var c = 0; c < narr.length; c++) { | ||
1177 | - | ||
1178 | - var hr={ | ||
1179 | - goods_id:item[c].goods_id, | ||
1180 | - goods_num:item[c].goods_num, | ||
1181 | - prom_type:0, | ||
1182 | - prom_id:0, | ||
1183 | - } | ||
1184 | - commission_gds.push(hr); | ||
1185 | - | ||
1186 | - } | ||
1187 | - //获取购物车的佣金,此处要优化调用接口,获取佣金 | ||
1188 | - var req_d = { | ||
1189 | - user_id:getApp().globalData.user_id,goods_ids:commission_gds,store_id: os.stoid | ||
1190 | - } | ||
1191 | - var back_data=null; | ||
1192 | - await getApp().request.promisePost("/api/weshop/order/getrebateSum", { | ||
1193 | - is_json: 1, data: req_d | ||
1194 | - }).then(rs => { | ||
1195 | - if (rs.data.code == 0) back_data =rs.data.data; | ||
1196 | - }); | ||
1197 | - | ||
1198 | - if(back_data && parseFloat(back_data)) { | ||
1199 | - ie.can_usecommise =parseFloat(back_data); | ||
1200 | - cart_commission = ie.can_usecommise; | ||
1201 | - } | ||
1202 | 1245 | ||
1203 | - cart_arr.push(ie); | ||
1204 | - if(cart_commission){ | ||
1205 | - th.setData({cart_commission}); | ||
1206 | - } | ||
1207 | 1246 | ||
1208 | - | ||
1209 | - th.data.old_cartlist = cart_arr; | 1247 | + //var narr=gg.collocation_goods; |
1248 | + //修改成深拷贝,确保返回是数据正确 | ||
1249 | + var narr = JSON.parse(JSON.stringify(gg.collocation_goods)); | ||
1250 | + narr.push(t.data.data); | ||
1251 | + await th.get_collocation_list(narr); | ||
1210 | } | 1252 | } |
1211 | th.setData({ | 1253 | th.setData({ |
1212 | bn_goods: gd, bn_pickname: gg.pick_name, index: m_wind, | 1254 | bn_goods: gd, bn_pickname: gg.pick_name, index: m_wind, |
@@ -1228,8 +1270,6 @@ Page({ | @@ -1228,8 +1270,6 @@ Page({ | ||
1228 | th.get_cart_quan(); | 1270 | th.get_cart_quan(); |
1229 | }); | 1271 | }); |
1230 | 1272 | ||
1231 | - | ||
1232 | - | ||
1233 | } else { | 1273 | } else { |
1234 | //计算价格 | 1274 | //计算价格 |
1235 | th.calculatePrice2(); | 1275 | th.calculatePrice2(); |
@@ -1540,7 +1580,6 @@ Page({ | @@ -1540,7 +1580,6 @@ Page({ | ||
1540 | } | 1580 | } |
1541 | } | 1581 | } |
1542 | 1582 | ||
1543 | - | ||
1544 | o_price -= (item_map.price - item_map.prom_price); | 1583 | o_price -= (item_map.price - item_map.prom_price); |
1545 | //如果有限制使用优惠券,就要减掉参与的活动商品的钱 | 1584 | //如果有限制使用优惠券,就要减掉参与的活动商品的钱 |
1546 | if (!item_map.is_xz_yh) q_conditin = o_price; | 1585 | if (!item_map.is_xz_yh) q_conditin = o_price; |
@@ -1622,6 +1661,9 @@ Page({ | @@ -1622,6 +1661,9 @@ Page({ | ||
1622 | } | 1661 | } |
1623 | 1662 | ||
1624 | }, | 1663 | }, |
1664 | + | ||
1665 | + | ||
1666 | + | ||
1625 | calclate_lbNum(r_data) { | 1667 | calclate_lbNum(r_data) { |
1626 | let send_lb = this.data.send_lb; | 1668 | let send_lb = this.data.send_lb; |
1627 | //g_lb_num我的礼包 g_zxlb_num专享礼包 | 1669 | //g_lb_num我的礼包 g_zxlb_num专享礼包 |
@@ -3154,10 +3196,17 @@ Page({ | @@ -3154,10 +3196,17 @@ Page({ | ||
3154 | } | 3196 | } |
3155 | 3197 | ||
3156 | //积分购,先要带is_integral_normal=1 | 3198 | //积分购,先要带is_integral_normal=1 |
3157 | - if (gg.is_integral_normal) goods.is_integral_normal = 1; | 3199 | + if (gg.is_integral_normal){ |
3200 | + goods.is_integral_normal = 1; item.is_normal=1; | ||
3201 | + } | ||
3158 | 3202 | ||
3159 | //先要带is_pd_normal=1 | 3203 | //先要带is_pd_normal=1 |
3160 | - if (gg.is_pd_normal) goods.is_pd_normal = 1; | 3204 | + if (gg.is_pd_normal){ |
3205 | + goods.is_pd_normal = 1; item.is_normal=1; | ||
3206 | + } | ||
3207 | + | ||
3208 | + | ||
3209 | + | ||
3161 | 3210 | ||
3162 | //如果不立即购买或者秒杀,如果是线下库存购买的时候 | 3211 | //如果不立即购买或者秒杀,如果是线下库存购买的时候 |
3163 | if (goods.prom_type != 1 && goods.prom_type != 6 && goods.prom_type != 2 && th.data.sales_rules == 2 && !th.data.bn_goods.whsle_id) { | 3212 | if (goods.prom_type != 1 && goods.prom_type != 6 && goods.prom_type != 2 && th.data.sales_rules == 2 && !th.data.bn_goods.whsle_id) { |
@@ -4307,6 +4356,13 @@ Page({ | @@ -4307,6 +4356,13 @@ Page({ | ||
4307 | ob[txt] = this.data.imgUrl + "/miniapp/images/default_g_img.gif"; | 4356 | ob[txt] = this.data.imgUrl + "/miniapp/images/default_g_img.gif"; |
4308 | this.setData(ob); | 4357 | this.setData(ob); |
4309 | }, | 4358 | }, |
4359 | + cart_set_err1: function (e) { | ||
4360 | + var txt = e.currentTarget.dataset.err; | ||
4361 | + var ob = {}; | ||
4362 | + ob[txt] = "/miniapp/images/default_g_img.gif"; | ||
4363 | + this.setData(ob); | ||
4364 | + }, | ||
4365 | + | ||
4310 | //--验证是否已经冻结-- | 4366 | //--验证是否已经冻结-- |
4311 | check_is_frozenQuan: function (quanlist, frozenQuan, isby) { | 4367 | check_is_frozenQuan: function (quanlist, frozenQuan, isby) { |
4312 | console.log("券列表", quanlist); | 4368 | console.log("券列表", quanlist); |
@@ -5400,10 +5456,9 @@ Page({ | @@ -5400,10 +5456,9 @@ Page({ | ||
5400 | th.setData({ [txt9]: new_pk_list_goods, send_gf: this.data.send_gf }); | 5456 | th.setData({ [txt9]: new_pk_list_goods, send_gf: this.data.send_gf }); |
5401 | this.data.old_cartlist[index].goods = new_pk_list_goods; | 5457 | this.data.old_cartlist[index].goods = new_pk_list_goods; |
5402 | 5458 | ||
5403 | - | ||
5404 | console.log(this.data.send_gf, "----"); | 5459 | console.log(this.data.send_gf, "----"); |
5405 | - | ||
5406 | th.calculatePrice(); | 5460 | th.calculatePrice(); |
5461 | + | ||
5407 | } else { | 5462 | } else { |
5408 | var new_pk_list_goods = []; | 5463 | var new_pk_list_goods = []; |
5409 | //-- 当是立即购买的时候 -- | 5464 | //-- 当是立即购买的时候 -- |
@@ -5552,6 +5607,206 @@ Page({ | @@ -5552,6 +5607,206 @@ Page({ | ||
5552 | } else { | 5607 | } else { |
5553 | func(); | 5608 | func(); |
5554 | } | 5609 | } |
5610 | + }, | ||
5611 | + | ||
5612 | + //子组件返回的优化 | ||
5613 | + select_coll(e){ | ||
5614 | + console.log("--1111--aaa--"); | ||
5615 | + console.log(e); | ||
5616 | + //-- 如果是购物车的选择添加搭配商品 -- | ||
5617 | + if(e.detail.is_cart==1){ | ||
5618 | + this.select_coll_buy_cart(e.detail); | ||
5619 | + }else{ | ||
5620 | + this.select_coll_buy_now(e.detail); | ||
5621 | + } | ||
5622 | + }, | ||
5623 | + | ||
5624 | + //立即购买的时候,选中和不选中搭配商品 | ||
5625 | + async select_coll_buy_now(e){ | ||
5626 | + var th=this; | ||
5627 | + //--按钮变灰色 -- | ||
5628 | + th.setData({submit:1}); | ||
5629 | + //如果是选中 | ||
5630 | + if(e.selected){ | ||
5631 | + var item=this.data.all_collocation_list[e.index]; | ||
5632 | + item.goods_num=1; | ||
5633 | + item.goods_price=item.price; | ||
5634 | + item.is_collocation=1; | ||
5635 | + | ||
5636 | + var coll_arr=[]; | ||
5637 | + if(this.data.collocation_goods && this.data.collocation_goods.length){ | ||
5638 | + coll_arr=this.data.collocation_goods; | ||
5639 | + } | ||
5640 | + coll_arr.push(item); | ||
5641 | + this.setData({collocation_goods:coll_arr}); | ||
5642 | + //让主商品的活动变成5,搭配购 | ||
5643 | + this.setData({'bn_goods.prom_type':5, 'bn_goods.prom_id':coll_arr[0].prom_id }); | ||
5644 | + | ||
5645 | + var is_has_main=coll_arr.findIndex(function(e){ | ||
5646 | + return e.goods_id==th.data.bn_goods.goods_id; | ||
5647 | + }) | ||
5648 | + | ||
5649 | + //要进行深拷贝 | ||
5650 | + var coll_arr_new=JSON.parse(JSON.stringify(coll_arr)); | ||
5651 | + coll_arr_new.unshift(this.data.bn_goods); | ||
5652 | + | ||
5653 | + await th.get_collocation_list(coll_arr_new); | ||
5654 | + //计算价格 | ||
5655 | + th.calculatePrice2(); | ||
5656 | + th.get_cart_quan(); | ||
5657 | + | ||
5658 | + }else{ | ||
5659 | + var item=this.data.all_collocation_list[e.index]; | ||
5660 | + var coll_arr=this.data.collocation_goods; | ||
5661 | + var find=coll_arr.findIndex(function (e){ | ||
5662 | + return e.goods_id==item.goods_id; | ||
5663 | + }) | ||
5664 | + coll_arr.splice(find,1); | ||
5665 | + | ||
5666 | + //当coll_arr的长度等于1的时候,说明没有选中搭配商品,只有主商品了 | ||
5667 | + if(!coll_arr || coll_arr.length<1){ | ||
5668 | + //让主商品的活动变成0,取消搭配购 | ||
5669 | + this.setData({'bn_goods.prom_type':0, 'bn_goods.prom_id':0,collocation_goods:[] }); | ||
5670 | + //计算价格 | ||
5671 | + th.calculatePrice2(); | ||
5672 | + //获取优惠券 | ||
5673 | + th.get_buy_now_quan(); | ||
5674 | + | ||
5675 | + }else{ | ||
5676 | + this.setData({collocation_goods:coll_arr}); | ||
5677 | + //要进行深拷贝 | ||
5678 | + var coll_arr_new=JSON.parse(JSON.stringify(coll_arr)); | ||
5679 | + coll_arr_new.unshift(this.data.bn_goods); | ||
5680 | + await th.get_collocation_list(coll_arr); | ||
5681 | + //计算价格 | ||
5682 | + th.calculatePrice2(); | ||
5683 | + th.get_cart_quan(); | ||
5684 | + } | ||
5685 | + } | ||
5686 | + }, | ||
5687 | + //购物车购买的时候,选中和不选中搭配商品 | ||
5688 | + async select_coll_buy_cart(e){ | ||
5689 | + var th=this; | ||
5690 | + var cart_index=e.cart_index; | ||
5691 | + var index=e.index; | ||
5692 | + | ||
5693 | + var collocationList=this.data.cartlist[cart_index].collocationList; | ||
5694 | + var item=collocationList[cart_index]; | ||
5695 | + var goods=this.data.cartlist[cart_index].goods; | ||
5696 | + var txt='cartlist['+cart_index+'].goods'; | ||
5697 | + var txt2='cartlist['+cart_index+'].collocationList['+index+'].selected'; | ||
5698 | + | ||
5699 | + //-- 如果是选中 -- | ||
5700 | + if(e.selected){ | ||
5701 | + item.goods_num=1; | ||
5702 | + item.goods_price=item.price; | ||
5703 | + item.prom_type=5; | ||
5704 | + item.is_collocation=1; | ||
5705 | + | ||
5706 | + goods.push(item); | ||
5707 | + | ||
5708 | + th.setData({[txt]:goods,[txt2]:1}); | ||
5709 | + | ||
5710 | + th.data.old_cartlist=JSON.parse(JSON.stringify(this.data.cartlist)); | ||
5711 | + th.calculatePrice(); | ||
5712 | + //th.get_cart_quan(); | ||
5713 | + | ||
5714 | + }else{ | ||
5715 | + var fd=goods.findIndex(function (e){ | ||
5716 | + return e.goods_id ==item.goods_id && e.prom_type ==5; | ||
5717 | + }) | ||
5718 | + | ||
5719 | + goods.splice(fd,1); | ||
5720 | + th.setData({[txt]:goods,[txt2]:0}); | ||
5721 | + th.data.old_cartlist=JSON.parse(JSON.stringify(this.data.cartlist)); | ||
5722 | + | ||
5723 | + th.calculatePrice(); | ||
5724 | + //th.get_cart_quan(); | ||
5725 | + } | ||
5726 | + }, | ||
5727 | + | ||
5728 | + //-- 搭配购的获取搭配商品的购物车计算价格的数组格式 -- | ||
5729 | + async get_collocation_list(narr){ | ||
5730 | + var gg = to.get_b_now(); | ||
5731 | + var th=this; | ||
5732 | + var cart_arr = new Array(); | ||
5733 | + //-- 搭配促销的门店配送方式的修复 -- | ||
5734 | + var et = 1; | ||
5735 | + var distr_t = 0; // 配送方式 0=用户自选 1=自提 2=物流 | ||
5736 | + for (var hi in narr) { | ||
5737 | + var dis_t = narr[hi].distr_type; | ||
5738 | + if (dis_t == 2) { | ||
5739 | + th.setData({ is_all_zt: 0 }); | ||
5740 | + et = 0; | ||
5741 | + } | ||
5742 | + if (dis_t > 0) { | ||
5743 | + distr_t = dis_t; | ||
5744 | + } | ||
5745 | + | ||
5746 | + //-- 如果有一件代发的商品或者不是同城配送的配送 -- | ||
5747 | + if(narr[hi].is_same_city!=1 || narr[hi].whsle_id>0){ | ||
5748 | + th.setData({show_same_city:0}) | ||
5749 | + } | ||
5750 | + } | ||
5751 | + //自选的时候,系统配置了默认的配送方式是物流的时候 | ||
5752 | + if (distr_t == 0 && th.data.json_d.pickupway && th.data.json_d.pickupway == 1) { | ||
5753 | + et = 0; th.setData({ is_all_zt: 0 }); | ||
5754 | + } | ||
5755 | + | ||
5756 | + var m_wind=th.data.m_wind; | ||
5757 | + var ie = { | ||
5758 | + pickup_id: gg.pick_id, | ||
5759 | + pname: gg.pick_name, | ||
5760 | + goods: narr, | ||
5761 | + exp_type: et, | ||
5762 | + wind: m_wind, | ||
5763 | + distr_t: distr_t, | ||
5764 | + bn_t_exp_t: distr_t, | ||
5765 | + goods_price: 0, | ||
5766 | + shipping_price: 0, | ||
5767 | + user_money: 0, | ||
5768 | + total_amount: 0, | ||
5769 | + order_amount: 0, | ||
5770 | + user_note: "" | ||
5771 | + }; | ||
5772 | + | ||
5773 | + var cart_commission=0; | ||
5774 | + //-- 循环计算一下线下取价 -- | ||
5775 | + //计算佣金的商品 | ||
5776 | + var commission_gds=[]; | ||
5777 | + for (var c = 0; c < narr.length; c++) { | ||
5778 | + var hr={ | ||
5779 | + goods_id:narr[c].goods_id, | ||
5780 | + goods_num:narr[c].goods_num, | ||
5781 | + prom_type:0, | ||
5782 | + prom_id:0, | ||
5783 | + } | ||
5784 | + commission_gds.push(hr); | ||
5785 | + | ||
5786 | + } | ||
5787 | + | ||
5788 | + //获取购物车的佣金,此处要优化调用接口,获取佣金 | ||
5789 | + var req_d = { | ||
5790 | + user_id:getApp().globalData.user_id,goods_ids:commission_gds,store_id: os.stoid | ||
5791 | + } | ||
5792 | + var back_data=null; | ||
5793 | + await getApp().request.promisePost("/api/weshop/order/getrebateSum", { | ||
5794 | + is_json: 1, data: req_d | ||
5795 | + }).then(rs => { | ||
5796 | + if (rs.data.code == 0) back_data =rs.data.data; | ||
5797 | + }); | ||
5798 | + | ||
5799 | + if(back_data && parseFloat(back_data)) { | ||
5800 | + ie.can_usecommise =parseFloat(back_data); | ||
5801 | + cart_commission = ie.can_usecommise; | ||
5802 | + } | ||
5803 | + | ||
5804 | + cart_arr.push(ie); | ||
5805 | + if(cart_commission){ | ||
5806 | + th.setData({cart_commission}); | ||
5807 | + } | ||
5808 | + | ||
5809 | + th.data.old_cartlist = cart_arr; | ||
5555 | } | 5810 | } |
5556 | 5811 | ||
5557 | 5812 |
pages/cart/cart2/cart2.json
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | "navigationBarTitleText": "填写订单", | 2 | "navigationBarTitleText": "填写订单", |
3 | "enablePullDownRefresh": false, | 3 | "enablePullDownRefresh": false, |
4 | "usingComponents": { | 4 | "usingComponents": { |
5 | - "warn": "/components/long_warn/long_warn" | 5 | + "warn": "/components/long_warn/long_warn", |
6 | + "cart_collect_temp": "/components/cart_collect_temp/cart_collect_temp" | ||
6 | } | 7 | } |
7 | } | 8 | } |
8 | \ No newline at end of file | 9 | \ No newline at end of file |
pages/cart/cart2/cart2.wxml
@@ -108,6 +108,11 @@ | @@ -108,6 +108,11 @@ | ||
108 | </navigator> | 108 | </navigator> |
109 | </view> | 109 | </view> |
110 | 110 | ||
111 | + <!-- 使用搭配 --> | ||
112 | + <cart_collect_temp bind:childFun="select_coll" | ||
113 | + is_cart="1" cart_index="{{index}}" | ||
114 | + all_collocation_list="{{item.collocationList}}" /> | ||
115 | + | ||
111 | <!-- 如果是等级卡的商品,会员没有注册,要提醒注册 --> | 116 | <!-- 如果是等级卡的商品,会员没有注册,要提醒注册 --> |
112 | <view class="plus_buy fs28" wx:if="{{item.card_cut_price>0}}"> | 117 | <view class="plus_buy fs28" wx:if="{{item.card_cut_price>0}}"> |
113 | <view class="flex"> | 118 | <view class="flex"> |
@@ -127,10 +132,6 @@ | @@ -127,10 +132,6 @@ | ||
127 | <view bindtap="buycard" class="card_op">立即开通</view> | 132 | <view bindtap="buycard" class="card_op">立即开通</view> |
128 | </view> | 133 | </view> |
129 | 134 | ||
130 | - | ||
131 | - | ||
132 | - | ||
133 | - | ||
134 | <view class="set-mes bdr_b-14"> | 135 | <view class="set-mes bdr_b-14"> |
135 | <view wx:if="{{order.store_prom}}"> | 136 | <view wx:if="{{order.store_prom}}"> |
136 | <icon color="#f23030" size="16" type="info"></icon> | 137 | <icon color="#f23030" size="16" type="info"></icon> |
@@ -217,7 +218,6 @@ | @@ -217,7 +218,6 @@ | ||
217 | </view> | 218 | </view> |
218 | </block> | 219 | </block> |
219 | </view> | 220 | </view> |
220 | - | ||
221 | <!-- 赠品的显示 --> | 221 | <!-- 赠品的显示 --> |
222 | <view wx:if="{{send_gf[item.pickup_id]}}"> | 222 | <view wx:if="{{send_gf[item.pickup_id]}}"> |
223 | <block wx:for="{{send_gf[item.pickup_id]}}" wx:for-item="iter"> | 223 | <block wx:for="{{send_gf[item.pickup_id]}}" wx:for-item="iter"> |
@@ -252,6 +252,7 @@ | @@ -252,6 +252,7 @@ | ||
252 | </view> | 252 | </view> |
253 | 253 | ||
254 | 254 | ||
255 | + | ||
255 | <!-- 留言 --> | 256 | <!-- 留言 --> |
256 | <view class="coupon-mes flex-vertical"> | 257 | <view class="coupon-mes flex-vertical"> |
257 | <view>留言</view> | 258 | <view>留言</view> |
@@ -332,7 +333,7 @@ | @@ -332,7 +333,7 @@ | ||
332 | <view class="goods-img" style="position: relative"> | 333 | <view class="goods-img" style="position: relative"> |
333 | <image src="{{imgUrl}}/miniapp/images/giveaway.png" class="gift_image"></image> | 334 | <image src="{{imgUrl}}/miniapp/images/giveaway.png" class="gift_image"></image> |
334 | 335 | ||
335 | - <image class="wh100 bdr14" src="{{item.original_img}}" binderror='cart_set_err' data-err="item.original_img"></image> | 336 | + <image class="wh100 bdr14" src="{{item.original_img}}" binderror='cart_set_err' data-err="buy_now_gift_goods[{{index}}].original_img"></image> |
336 | </view> | 337 | </view> |
337 | <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> | 338 | <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> |
338 | <view class="goods-name ellipsis-2">{{item.goods_name}}</view> | 339 | <view class="goods-name ellipsis-2">{{item.goods_name}}</view> |
@@ -356,7 +357,7 @@ | @@ -356,7 +357,7 @@ | ||
356 | <!-- 搭配购买的功能实现 --> | 357 | <!-- 搭配购买的功能实现 --> |
357 | <view class="order-detail" wx:for="{{collocation_goods}}"> | 358 | <view class="order-detail" wx:for="{{collocation_goods}}"> |
358 | <view class="goods-img"> | 359 | <view class="goods-img"> |
359 | - <image class="wh100 bdr14" src="{{imgUrl+item.original_img}}" binderror='err_img_collocation' data-err="item.original_img"></image> | 360 | + <image class="wh100 bdr14" src="{{imgUrl+item.original_img}}" binderror='cart_set_err1' data-err="collocation_goods[{{index}}].original_img"></image> |
360 | </view> | 361 | </view> |
361 | <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> | 362 | <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> |
362 | <view class="goods-name ellipsis-2">{{item.goods_name}}</view> | 363 | <view class="goods-name ellipsis-2">{{item.goods_name}}</view> |
@@ -375,6 +376,10 @@ | @@ -375,6 +376,10 @@ | ||
375 | </view> | 376 | </view> |
376 | </block> | 377 | </block> |
377 | 378 | ||
379 | + <!-- 使用搭配 --> | ||
380 | + <cart_collect_temp bind:childFun="select_coll" all_collocation_list="{{all_collocation_list}}" /> | ||
381 | + | ||
382 | + | ||
378 | <!-- 如果是等级卡的商品,会员没有注册,要提醒注册 --> | 383 | <!-- 如果是等级卡的商品,会员没有注册,要提醒注册 --> |
379 | <view class="plus_buy fs28" wx:if="{{card_cut_price>0}}"> | 384 | <view class="plus_buy fs28" wx:if="{{card_cut_price>0}}"> |
380 | <view class="flex"> | 385 | <view class="flex"> |
@@ -441,8 +446,6 @@ | @@ -441,8 +446,6 @@ | ||
441 | </view> | 446 | </view> |
442 | 447 | ||
443 | 448 | ||
444 | - | ||
445 | - | ||
446 | <view class="set-mes bdr_b-14"> | 449 | <view class="set-mes bdr_b-14"> |
447 | 450 | ||
448 | <view wx:if="{{order.store_prom}}"> | 451 | <view wx:if="{{order.store_prom}}"> |
@@ -478,8 +481,6 @@ | @@ -478,8 +481,6 @@ | ||
478 | </view> | 481 | </view> |
479 | </view> | 482 | </view> |
480 | 483 | ||
481 | - | ||
482 | - | ||
483 | <!-- 留言 --> | 484 | <!-- 留言 --> |
484 | <view class="coupon-mes flex-vertical"> | 485 | <view class="coupon-mes flex-vertical"> |
485 | <view>留言</view> | 486 | <view>留言</view> |
pages/distribution/distribution.wxml
@@ -95,7 +95,7 @@ | @@ -95,7 +95,7 @@ | ||
95 | <view class="left f1"> | 95 | <view class="left f1"> |
96 | <view class="icon-container"><text class="iconfont icon-huiyuan1"></text></view> | 96 | <view class="icon-container"><text class="iconfont icon-huiyuan1"></text></view> |
97 | <view>仅限PLUS卡({{item.conditonRemark}})的会员, | 97 | <view>仅限PLUS卡({{item.conditonRemark}})的会员, |
98 | - <text wx:if="{{item.pass}}" class="c-red" bindtap="goto" data-url="/pages/user/cardinfo/cardinfo">PLUS详情</text> | 98 | + <text wx:if="{{item.pass}}" class="c-red" bindtap="goto" data-url="/packageE/pages/user/cardinfo/cardinfo">PLUS详情</text> |
99 | <text wx:else class="c-red" bindtap="goto" data-url="/pages/user/plus/plus">立即升级</text> | 99 | <text wx:else class="c-red" bindtap="goto" data-url="/pages/user/plus/plus">立即升级</text> |
100 | </view> | 100 | </view> |
101 | </view> | 101 | </view> |
pages/giftpack/buygiftpack/giftpackbuy.wxml
@@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
24 | <!--<block wx:for="{{wareCard}}" wx:if="{{now > filter.gettimestamp(items.starTime) || (items.is_show && now > items.show_time)}}" wx:for-item="items" wx:for-index="index" wx:key="index">--> | 24 | <!--<block wx:for="{{wareCard}}" wx:if="{{now > filter.gettimestamp(items.starTime) || (items.is_show && now > items.show_time)}}" wx:for-item="items" wx:for-index="index" wx:key="index">--> |
25 | <block wx:for="{{wareCard}}" wx:for-item="items" wx:for-index="index" wx:key="index"> | 25 | <block wx:for="{{wareCard}}" wx:for-item="items" wx:for-index="index" wx:key="index"> |
26 | <view class="content_box"> | 26 | <view class="content_box"> |
27 | - <view class="content_box_ware" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=1&lbId={{items.lbId}}&orderSn=''"> | 27 | + <view class="content_box_ware" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=1&lbId={{items.lbId}}&cover_img={{items.cover_img}}&orderSn=''"> |
28 | <view class="content_box_img"> | 28 | <view class="content_box_img"> |
29 | <image src="{{iurl+items.cover_img}}" lazy-load="true" binderror="bind_bnerr2" wx:if="{{items.cover_img}}" data-errorimg="wareCard[{{index}}].cover_img"></image> | 29 | <image src="{{iurl+items.cover_img}}" lazy-load="true" binderror="bind_bnerr2" wx:if="{{items.cover_img}}" data-errorimg="wareCard[{{index}}].cover_img"></image> |
30 | <image src="{{iurl+items.lbUrl}}" lazy-load="true" binderror="bind_bnerr2" wx:else data-errorimg="wareCard[{{index}}].lbUrl"></image> | 30 | <image src="{{iurl+items.lbUrl}}" lazy-load="true" binderror="bind_bnerr2" wx:else data-errorimg="wareCard[{{index}}].lbUrl"></image> |
pages/giftpack/giftpacklist/giftpacklist.js
@@ -71,6 +71,7 @@ Page({ | @@ -71,6 +71,7 @@ Page({ | ||
71 | 71 | ||
72 | sto_sele_name_1: '', | 72 | sto_sele_name_1: '', |
73 | share_goods_img:'', //礼包的分享图 | 73 | share_goods_img:'', //礼包的分享图 |
74 | + giftImageCover:null, | ||
74 | canvasHidden:true, | 75 | canvasHidden:true, |
75 | 76 | ||
76 | screenWidth: 0 | 77 | screenWidth: 0 |
@@ -251,8 +252,11 @@ Page({ | @@ -251,8 +252,11 @@ Page({ | ||
251 | }, | 252 | }, |
252 | success: function (res) { | 253 | success: function (res) { |
253 | if (res.data.code == 0) { | 254 | if (res.data.code == 0) { |
255 | + console.log('商品------++') | ||
256 | + console.log(res) | ||
254 | th.setData({ | 257 | th.setData({ |
255 | - giftImage: th.data.iurl + res.data.data.lbUrl, | 258 | + giftImage: th.data.iurl + res.data.data.lbUrl, |
259 | + giftImageCover: th.data.iurl + (th.data.params.cover_img ? th.data.params.cover_img: res.data.data.lbUrl), | ||
256 | giftTitle: res.data.data.giftTitle, | 260 | giftTitle: res.data.data.giftTitle, |
257 | default_color: res.data.data.bgcolor | 261 | default_color: res.data.data.bgcolor |
258 | }) | 262 | }) |
@@ -346,7 +350,8 @@ Page({ | @@ -346,7 +350,8 @@ Page({ | ||
346 | success: function success(res) { | 350 | success: function success(res) { |
347 | if (res.data.code == 0) { | 351 | if (res.data.code == 0) { |
348 | _this2.setData({ | 352 | _this2.setData({ |
349 | - giftImage: th.iurl + res.data.data.lbUrl, | 353 | + giftImage: th.iurl + res.data.data.lbUrl, |
354 | + giftImageCover: th.iurl + (_this2.data.params.cover_img ? _this2.data.params.cover_img: res.data.data.lbUrl), | ||
350 | giftTitle: res.data.data.giftTitle, | 355 | giftTitle: res.data.data.giftTitle, |
351 | default_color: res.data.data.bgcolor | 356 | default_color: res.data.data.bgcolor |
352 | }) | 357 | }) |
@@ -419,6 +424,7 @@ Page({ | @@ -419,6 +424,7 @@ Page({ | ||
419 | if (res.data.code == 0) { | 424 | if (res.data.code == 0) { |
420 | th.setData({ | 425 | th.setData({ |
421 | giftImage: th.data.iurl + res.data.data.lbUrl, | 426 | giftImage: th.data.iurl + res.data.data.lbUrl, |
427 | + giftImageCover: th.data.iurl + (th.data.params.cover_img ? th.data.params.cover_img: res.data.data.lbUrl), | ||
422 | giftTitle: res.data.data.lbTitle, | 428 | giftTitle: res.data.data.lbTitle, |
423 | default_color: res.data.data.bgcolor | 429 | default_color: res.data.data.bgcolor |
424 | }) | 430 | }) |
@@ -964,6 +970,7 @@ Page({ | @@ -964,6 +970,7 @@ Page({ | ||
964 | th.get_goods_temp(function () { | 970 | th.get_goods_temp(function () { |
965 | var vpath = res.path; | 971 | var vpath = res.path; |
966 | var context = wx.createCanvasContext('share'); | 972 | var context = wx.createCanvasContext('share'); |
973 | + // let share_goods_img = th.params.cover_img | ||
967 | th.drawPoster(context, unit, th.data.share_goods_img, vpath, 0); | 974 | th.drawPoster(context, unit, th.data.share_goods_img, vpath, 0); |
968 | 975 | ||
969 | //把画板内容绘制成图片,并回调 画板图片路径 | 976 | //把画板内容绘制成图片,并回调 画板图片路径 |
@@ -1116,7 +1123,7 @@ Page({ | @@ -1116,7 +1123,7 @@ Page({ | ||
1116 | tt(); | 1123 | tt(); |
1117 | return false; | 1124 | return false; |
1118 | } | 1125 | } |
1119 | - var img_url = ee.data.giftImage; | 1126 | + var img_url = ee.data.giftImageCover ? ee.data.giftImageCover : ee.data.giftImage; |
1120 | //获取商品是分享图信息 | 1127 | //获取商品是分享图信息 |
1121 | wx.getImageInfo({ | 1128 | wx.getImageInfo({ |
1122 | src: img_url, | 1129 | src: img_url, |
pages/giftpack/mygiftpack/mygiftpack.wxml
@@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
23 | </view> | 23 | </view> |
24 | <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="index"> | 24 | <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="index"> |
25 | <view class="content_box"> | 25 | <view class="content_box"> |
26 | - <view class="content_box_ware" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=0&lbId={{item.lbId}}&orderSn={{item.orderSn}}"> | 26 | + <view class="content_box_ware" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=0&lbId={{item.lbId}}&cover_img={{item.cover_img}}&orderSn={{item.orderSn}}"> |
27 | <view class="content_box_img"> | 27 | <view class="content_box_img"> |
28 | <!-- <image src="{{$GetInfo.imgHttp+item.$orig.lbUrl}}"></image> --> | 28 | <!-- <image src="{{$GetInfo.imgHttp+item.$orig.lbUrl}}"></image> --> |
29 | <image wx:if="{{item.cover_img}}" src="{{iurl+item.cover_img}}" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].cover_img"></image> | 29 | <image wx:if="{{item.cover_img}}" src="{{iurl+item.cover_img}}" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].cover_img"></image> |
@@ -93,7 +93,7 @@ | @@ -93,7 +93,7 @@ | ||
93 | 93 | ||
94 | </view> | 94 | </view> |
95 | </view> | 95 | </view> |
96 | - <view class="content_box_button" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=0&lbId={{item.lbId}}&orderSn={{item.orderSn}}"> | 96 | + <view class="content_box_button" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=0&lbId={{item.lbId}}&cover_img={{item.cover_img}}&orderSn={{item.orderSn}}"> |
97 | <button>立即使用</button> | 97 | <button>立即使用</button> |
98 | </view> | 98 | </view> |
99 | </view> | 99 | </view> |
pages/goods/categoryList/categoryList.js
@@ -75,6 +75,8 @@ Page({ | @@ -75,6 +75,8 @@ Page({ | ||
75 | load: 0, | 75 | load: 0, |
76 | xmlist: null, | 76 | xmlist: null, |
77 | 77 | ||
78 | + is_retail_price:0 //是否显示零售价 | ||
79 | + | ||
78 | 80 | ||
79 | }, | 81 | }, |
80 | 82 | ||
@@ -166,32 +168,11 @@ Page({ | @@ -166,32 +168,11 @@ Page({ | ||
166 | //计算等级价相关 | 168 | //计算等级价相关 |
167 | var swithc_list = rs.switch_list; | 169 | var swithc_list = rs.switch_list; |
168 | var sw_arr = JSON.parse(swithc_list); | 170 | var sw_arr = JSON.parse(swithc_list); |
169 | - //---如果后台又开等级卡的开关--- | ||
170 | - if (sw_arr.rank_switch && sw_arr.rank_switch == "2") { | ||
171 | - th.setData({ rank_switch: true }); | ||
172 | - var user = getApp().globalData.userInfo; | ||
173 | - var ti = setInterval(function () { | ||
174 | - if (!user) return false; | ||
175 | - clearInterval(ti); | ||
176 | - //---回调卡的列表--- | ||
177 | - th.getPlusCardType(function (ob) { | ||
178 | - th.setData({ card_list: ob.card_list }); | ||
179 | - if (user.card_field && user['card_expiredate']) { | ||
180 | - var str = user['card_expiredate'].replace(/-/g, '/'); | ||
181 | - var end = new Date(str); | ||
182 | - end = Date.parse(end) / 1000; | ||
183 | - var now = ut.gettimestamp(); | ||
184 | - | ||
185 | - //--- 判断是等级会员,且在有效期范围内 --- | ||
186 | - if (user.card_field && now < end) { | ||
187 | - var card_name = ob.name_map.get(user.card_field); | ||
188 | - //if (card_name.length > 4) card_name = card_name.substring(0, 4); | ||
189 | - th.setData({ card_field: user.card_field, card_name: card_name, card_list: ob.card_list }); | ||
190 | - } | ||
191 | - } | ||
192 | - }) | ||
193 | - }, 500) | 171 | + |
172 | + if(sw_arr.is_retail_price){ | ||
173 | + th.setData({is_retail_price:1}); | ||
194 | } | 174 | } |
175 | + | ||
195 | }); | 176 | }); |
196 | }, | 177 | }, |
197 | onShow: function () { | 178 | onShow: function () { |
@@ -221,6 +202,11 @@ Page({ | @@ -221,6 +202,11 @@ Page({ | ||
221 | var data = e; | 202 | var data = e; |
222 | var switch_list_data = data.switch_list; | 203 | var switch_list_data = data.switch_list; |
223 | var switch_list = JSON.parse(switch_list_data); | 204 | var switch_list = JSON.parse(switch_list_data); |
205 | + | ||
206 | + //---如果后台又开等级卡的开关--- | ||
207 | + ut.get_plus_name_price(switch_list,that); | ||
208 | + | ||
209 | + | ||
224 | var is_newsgoodstype = switch_list.is_newsgoodstype; | 210 | var is_newsgoodstype = switch_list.is_newsgoodstype; |
225 | if (is_newsgoodstype == undefined) { | 211 | if (is_newsgoodstype == undefined) { |
226 | is_newsgoodstype = 0; | 212 | is_newsgoodstype = 0; |
pages/goods/categoryList/categoryList.wxml
@@ -584,7 +584,8 @@ | @@ -584,7 +584,8 @@ | ||
584 | <view class="item-cont"> | 584 | <view class="item-cont"> |
585 | <view class="title">{{item.goods_name}}</view> | 585 | <view class="title">{{item.goods_name}}</view> |
586 | <!-- 判断是否有活动价 --> | 586 | <!-- 判断是否有活动价 --> |
587 | - <block wx:if="{{item.prom_price>0 || item.prom_integral}}"> | 587 | + <block wx:if="{{(item.prom_price>0 || item.prom_integral) && item.prom_id>0 && item.prom_type!=7 && item.prom_type!=10}}"> |
588 | + | ||
588 | <view class="flex ai-center"> | 589 | <view class="flex ai-center"> |
589 | <!-- 活动价 --> | 590 | <!-- 活动价 --> |
590 | <view class="price"> | 591 | <view class="price"> |
@@ -592,7 +593,7 @@ | @@ -592,7 +593,7 @@ | ||
592 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> | 593 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> |
593 | <text wx:if="{{item.prom_price}}" class="rmb">{{item.prom_price}}</text> | 594 | <text wx:if="{{item.prom_price}}" class="rmb">{{item.prom_price}}</text> |
594 | </view> | 595 | </view> |
595 | - <!-- <view class="word-line xc-ash rmb mgl10 fs24">{{item.market_price}}</view>--> | 596 | + <view wx:if="{{is_retail_price}}" class="word-line xc-ash rmb mgl10 fs24">{{item.market_price}}</view> |
596 | </view> | 597 | </view> |
597 | 598 | ||
598 | <view class="comment"> | 599 | <view class="comment"> |
@@ -605,12 +606,14 @@ | @@ -605,12 +606,14 @@ | ||
605 | </block> | 606 | </block> |
606 | <block wx:else> | 607 | <block wx:else> |
607 | 608 | ||
609 | + | ||
608 | <!-- 商品价格,先判断下是后又等级价--> | 610 | <!-- 商品价格,先判断下是后又等级价--> |
609 | <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}"> | 611 | <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}"> |
610 | 612 | ||
611 | 613 | ||
612 | <!-- 当会员是等级卡的时候 --> | 614 | <!-- 当会员是等级卡的时候 --> |
613 | <block wx:if="{{card_field}}"> | 615 | <block wx:if="{{card_field}}"> |
616 | + | ||
614 | <!-- 等级价>0 --> | 617 | <!-- 等级价>0 --> |
615 | <block wx:if="{{item[card_field]>0}}"> | 618 | <block wx:if="{{item[card_field]>0}}"> |
616 | <view class="flex ai_and"> | 619 | <view class="flex ai_and"> |
@@ -621,7 +624,7 @@ | @@ -621,7 +624,7 @@ | ||
621 | </view> | 624 | </view> |
622 | </view> | 625 | </view> |
623 | <view class="comment flex jc_sb"> | 626 | <view class="comment flex jc_sb"> |
624 | - <!-- <view class="word-line xc-ash rmb fs24">{{item.market_price}}</view>--> | 627 | + <view wx:if="{{is_retail_price}}" class="word-line xc-ash rmb fs24">{{item.market_price}}</view> |
625 | <view class="fs22 pdt10 t-r"> | 628 | <view class="fs22 pdt10 t-r"> |
626 | <span>评论{{item.comment_count}}</span> | 629 | <span>评论{{item.comment_count}}</span> |
627 | <span class="pdl30">已售{{item.sales_sum}}</span> | 630 | <span class="pdl30">已售{{item.sales_sum}}</span> |
@@ -631,7 +634,7 @@ | @@ -631,7 +634,7 @@ | ||
631 | <block wx:else> | 634 | <block wx:else> |
632 | <view class="flex ai-center"> | 635 | <view class="flex ai-center"> |
633 | <view class="price rmb">{{item.shop_price}}</view> | 636 | <view class="price rmb">{{item.shop_price}}</view> |
634 | - <!-- <view class="word-line xc-ash rmb fs24 mgl10">{{item.market_price}}</view>--> | 637 | + <view wx:if="{{is_retail_price}}" class="word-line xc-ash rmb fs24 mgl10">{{item.market_price}}</view> |
635 | </view> | 638 | </view> |
636 | 639 | ||
637 | <view class="comment"> | 640 | <view class="comment"> |
@@ -647,7 +650,7 @@ | @@ -647,7 +650,7 @@ | ||
647 | <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}"> | 650 | <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}"> |
648 | <view class="flex ai-center"> | 651 | <view class="flex ai-center"> |
649 | <view class="price rmb">{{item.shop_price}}</view> | 652 | <view class="price rmb">{{item.shop_price}}</view> |
650 | - <!-- <view class="word-line xc-ash mk_price rmb fs24 mgl10">{{item.market_price}}</view>--> | 653 | + <view wx:if="{{is_retail_price}}" class="word-line xc-ash mk_price rmb fs24 mgl10">{{item.market_price}}</view> |
651 | </view> | 654 | </view> |
652 | <view class="comment"> | 655 | <view class="comment"> |
653 | <view class="flex ai-center"> | 656 | <view class="flex ai-center"> |
@@ -668,8 +671,8 @@ | @@ -668,8 +671,8 @@ | ||
668 | </block> | 671 | </block> |
669 | <block wx:else> | 672 | <block wx:else> |
670 | <view class="flex ai-center"> | 673 | <view class="flex ai-center"> |
671 | - <view class="price rmb">{{item.shop_price}}</view> | ||
672 | - <!-- <view class="word-line xc-ash rmb fs24 mgl10">{{item.market_price}}</view>--> | 674 | + <view class="price rmb">{{item.shop_price}}</view> |
675 | + <view wx:if="{{is_retail_price}}" class="word-line xc-ash rmb fs24 mgl10">{{item.market_price}}</view> | ||
673 | </view> | 676 | </view> |
674 | <!-- <view class="price">¥{{item.shop_price}}</view> --> | 677 | <!-- <view class="price">¥{{item.shop_price}}</view> --> |
675 | <view class="comment"> | 678 | <view class="comment"> |
@@ -683,9 +686,10 @@ | @@ -683,9 +686,10 @@ | ||
683 | </block> | 686 | </block> |
684 | </block> | 687 | </block> |
685 | <block wx:else> | 688 | <block wx:else> |
689 | + | ||
686 | <view class="flex ai-center"> | 690 | <view class="flex ai-center"> |
687 | <view class="price rmb">{{item.shop_price}}</view> | 691 | <view class="price rmb">{{item.shop_price}}</view> |
688 | - <!-- <view class="word-line xc-ash rmb fs24 mgl10">{{item.market_price}}</view>--> | 692 | + <view wx:if="{{is_retail_price}}" class="word-line xc-ash rmb fs24 mgl10">{{item.market_price}}</view> |
689 | </view> | 693 | </view> |
690 | <!-- <view class="price">¥{{item.shop_price}}</view> --> | 694 | <!-- <view class="price">¥{{item.shop_price}}</view> --> |
691 | <view class="comment"> | 695 | <view class="comment"> |
pages/goods/com_screen.js
0 → 100644
1 | +const ut = require("../../utils/util.js"); | ||
2 | +var regeneratorRuntime = require('../../utils/runtime.js'); | ||
3 | +var oo = getApp().globalData.setting; | ||
4 | +module.exports = { | ||
5 | + //下拉排序 | ||
6 | + bind_pk_sort:function (e,th){ | ||
7 | + var index=e.detail.value; | ||
8 | + var ob=th.data.more_sort_arr[index]; | ||
9 | + | ||
10 | + var url = th.data.requestUrl; | ||
11 | + if (th.data.tabname!=ob.value){ | ||
12 | + th.setData({ tabname: ob.value, adname: "desc" }); | ||
13 | + } | ||
14 | + th.resetData(), th.requestGoodsList(url); | ||
15 | + }, | ||
16 | + | ||
17 | + //-- 获取列表 -- | ||
18 | + set_screen:async function (url,th){ | ||
19 | + if(!url) url=th.data.requestUrl; | ||
20 | + | ||
21 | + var arr=url.split('1=1&'); | ||
22 | + url='/api/weshop/goods/goodsBrandGroup?'+arr[1]; | ||
23 | + | ||
24 | + var screen_brand=null; | ||
25 | + var screen_nation=null; | ||
26 | + var screen_price=null; | ||
27 | + var screen_cate=null; | ||
28 | + //如果有分类的话 | ||
29 | + if( th.data.cat_id && !th.data.screen_cate){ | ||
30 | + var c_url="/api/weshop/goodscategory/get/"+oo.stoid+"/"+ th.data.cat_id; | ||
31 | + var f_cate=null; | ||
32 | + await getApp().request.promiseGet(c_url,{ | ||
33 | + }).then(res=>{ | ||
34 | + if(res.data.code==0 && res.data.data){ | ||
35 | + f_cate=res.data.data; | ||
36 | + } | ||
37 | + }) | ||
38 | + | ||
39 | + //分类必须有parent_id_path值 | ||
40 | + if(f_cate && f_cate['parent_id_path']){ | ||
41 | + var new_arr=f_cate['parent_id_path'].split('_'); | ||
42 | + c_url='/api/weshop/goodscategory/page?store_id='+oo.stoid+'&parent_id_path='+(new_arr[0]+"_"+new_arr['1']); | ||
43 | + await getApp().request.promiseGet(c_url,{ | ||
44 | + data:{level:2,pageSize:1000} | ||
45 | + }).then(res=>{ | ||
46 | + if(ut.ajax_ok(res) ){ | ||
47 | + screen_cate=res.data.data.pageData.filter(function(e){ | ||
48 | + return e.name | ||
49 | + }); | ||
50 | + } | ||
51 | + }) | ||
52 | + } | ||
53 | + | ||
54 | + } | ||
55 | + | ||
56 | + | ||
57 | + if(url.indexOf('brand_id')==-1) { | ||
58 | + var url1 = url + "&grouptype=1"; | ||
59 | + await getApp().request.promiseGet(url1, { | ||
60 | + data: {is_mainshow: 1, isonsale: 1, store_id: oo.stoid} | ||
61 | + }).then(res => { | ||
62 | + if (res.data.code == 0 && res.data.data && res.data.data.length) { | ||
63 | + screen_brand = res.data.data.filter(function(e){ | ||
64 | + return e.name | ||
65 | + }); | ||
66 | + } | ||
67 | + }) | ||
68 | + } | ||
69 | + | ||
70 | + if(url.indexOf('nation_id')==-1) { | ||
71 | + url1 = url + "&grouptype=2"; | ||
72 | + await getApp().request.promiseGet(url1, { | ||
73 | + data: {is_mainshow: 1, isonsale: 1, store_id: oo.stoid} | ||
74 | + }).then(res => { | ||
75 | + if (res.data.code == 0 && res.data.data && res.data.data.length) { | ||
76 | + screen_nation = res.data.data.filter(function(e){ | ||
77 | + return e.name; | ||
78 | + }); | ||
79 | + } | ||
80 | + }) | ||
81 | + } | ||
82 | + | ||
83 | + | ||
84 | + if(url.indexOf('startprice')==-1) { | ||
85 | + url1 = url + "&grouptype=3"; | ||
86 | + await getApp().request.promiseGet(url1, { | ||
87 | + data: {is_mainshow: 1, isonsale: 1, store_id: oo.stoid} | ||
88 | + }).then(res => { | ||
89 | + if (res.data.code == 0 && res.data.data && res.data.data.length) { | ||
90 | + var price = res.data.data; | ||
91 | + var max_price = price[0].final_price; | ||
92 | + var psize = Math.ceil(max_price / 5); // 每一段累积的价钱 | ||
93 | + var parr = []; | ||
94 | + for (var i = 0; i < 5; i++) { | ||
95 | + var start = i * psize; | ||
96 | + var end = start + psize; | ||
97 | + // 如果没有这个价格范围的商品则不列出来 | ||
98 | + var ii = false; | ||
99 | + for (var v in price) { | ||
100 | + var item_p = price[v]; | ||
101 | + if (item_p.final_price > start && item_p.final_price <= end) { | ||
102 | + ii = true; | ||
103 | + } | ||
104 | + } | ||
105 | + if (ii == false) continue; | ||
106 | + var obj = {}; | ||
107 | + obj['price'] = start + "-" + end; | ||
108 | + if (i == 0) obj['name'] = end + "元以下"; | ||
109 | + else if (i == 4) obj['name'] = start + "元以上"; | ||
110 | + else obj['name'] = start + "-" + end + '元'; | ||
111 | + parr.push(obj) | ||
112 | + } | ||
113 | + screen_price = parr; | ||
114 | + } | ||
115 | + }) | ||
116 | + } | ||
117 | + | ||
118 | + th.setData({screen_brand,screen_nation,screen_price,screen_cate}) | ||
119 | + | ||
120 | + }, | ||
121 | + | ||
122 | + | ||
123 | + filterGoods:function (e,th){ | ||
124 | + | ||
125 | + var index=e.currentTarget.dataset.index; | ||
126 | + var type=e.currentTarget.dataset.type; | ||
127 | + var url=th.data.requestUrl; | ||
128 | + | ||
129 | + switch (type){ | ||
130 | + case "1"://分类 | ||
131 | + var item=th.data.screen_cate[index]; | ||
132 | + if( th.data.cat_id){ | ||
133 | + var arr_m=url.split("1=1&"); | ||
134 | + var arr_m2=arr_m[1].split('&'); | ||
135 | + var url=""; | ||
136 | + for(var jj in arr_m2){ | ||
137 | + if(arr_m2[jj].indexOf('cat_id')>=-1){ | ||
138 | + url+="&cat_id="+item.id; | ||
139 | + }else if(arr_m2[jj].indexOf('pid')>=-1){ | ||
140 | + url+="&pid="+item.parent_id; | ||
141 | + }else{ | ||
142 | + url+="&"+arr_m2[jj]; | ||
143 | + } | ||
144 | + } | ||
145 | + }else { | ||
146 | + url+="&cat_id="+item.id+"&pid="+item.parent_id; | ||
147 | + } | ||
148 | + url=arr_m[0]+"1=1&"+url; | ||
149 | + break; | ||
150 | + case "2"://国别 | ||
151 | + var item=th.data.screen_nation[index]; | ||
152 | + url+="&nation_id="+item.nation_id; | ||
153 | + break; | ||
154 | + case "3"://品牌 | ||
155 | + var item=th.data.screen_brand[index]; | ||
156 | + url+="&brand_id="+item.brand_id; | ||
157 | + break; | ||
158 | + case "4"://价格 | ||
159 | + var item=th.data.screen_price[index]; | ||
160 | + var p_arr=item.price.split('-'); | ||
161 | + url+="&startprice="+p_arr[0]+"&endprice="+p_arr[1]; | ||
162 | + break; | ||
163 | + } | ||
164 | + | ||
165 | + th.setData({screen_brand:null,screen_nation:null,openFilterModal:0,is_go:0, | ||
166 | + screen_price:null,screen_cate:null,requestData:null}) | ||
167 | + th.data.currentPage=1; | ||
168 | + //进行筛选 | ||
169 | + this.set_screen(url,th); | ||
170 | + | ||
171 | + //开始点击分类 | ||
172 | + if(th.requestGoodsList) { | ||
173 | + //-- 开始点击分类 -- | ||
174 | + th.requestGoodsList(url); | ||
175 | + }else if(th.requestSearch){ | ||
176 | + //-- 重新开始搜索 -- | ||
177 | + th.requestSearch(url); | ||
178 | + } | ||
179 | + }, | ||
180 | + | ||
181 | + //-- 展开和收起的控制 -- | ||
182 | + open_more:function(e,th){ | ||
183 | + var type=e.currentTarget.dataset.type; | ||
184 | + switch(type){ | ||
185 | + case "1": | ||
186 | + if(th.data.fil_cate_state==0 || th.data.fil_cate_state==2) th.setData({fil_cate_state:1}) | ||
187 | + else th.setData({fil_cate_state:2}) | ||
188 | + break; | ||
189 | + case "2": | ||
190 | + if(th.data.fil_nation_state==0 || th.data.fil_nation_state==2) th.setData({fil_nation_state:1}) | ||
191 | + else th.setData({fil_nation_state:2}) | ||
192 | + break; | ||
193 | + case "3": | ||
194 | + if(th.data.fil_brand_state==0 || th.data.fil_brand_state==2) th.setData({fil_brand_state:1}) | ||
195 | + else th.setData({fil_brand_state:2}) | ||
196 | + break; | ||
197 | + case "4": | ||
198 | + if(th.data.fil_price_state==0 || th.data.fil_price_state==2) th.setData({fil_price_state:1}) | ||
199 | + else th.setData({fil_price_state:2}) | ||
200 | + break; | ||
201 | + | ||
202 | + } | ||
203 | + }, | ||
204 | + | ||
205 | + clear_fil(th){ | ||
206 | + var url=th.data.old_req_url; | ||
207 | + th.setData({screen_brand:null,screen_nation:null,openFilterModal:0,is_go:0, | ||
208 | + screen_price:null,screen_cate:null,requestData:null}) | ||
209 | + th.data.currentPage=1; | ||
210 | + | ||
211 | + //进行筛选 | ||
212 | + this.set_screen(url,th); | ||
213 | + if(th.requestGoodsList) { | ||
214 | + //-- 开始点击分类 -- | ||
215 | + th.requestGoodsList(url); | ||
216 | + }else if(th.requestSearch){ | ||
217 | + //-- 重新开始搜索 -- | ||
218 | + th.requestSearch(url); | ||
219 | + } | ||
220 | + } | ||
221 | + | ||
222 | + | ||
223 | +} | ||
0 | \ No newline at end of file | 224 | \ No newline at end of file |
pages/goods/com_screen.wxml
0 → 100644
1 | +<!-- 点击筛选的优化 --> | ||
2 | +<view hidden="{{!openFilterModal}}"> | ||
3 | + <view bindtap="closeFilterModal" class="cover-layer" style="z-index:1000"></view> | ||
4 | + <view class="filter-modal"> | ||
5 | + <!-- 顶部标题 --> | ||
6 | + <view class="flex jc-center ai_c t-c" style="height:80rpx"> | ||
7 | + 筛选 | ||
8 | + <icon bindtap="closeFilterModal" class="modal-close" color="gray" size="22" type="cancel"></icon> | ||
9 | + </view> | ||
10 | + <view class="filter-box" wx:if="{{screen_cate && screen_cate.length > 0}}"> | ||
11 | + <view class="f_cate_item fs28"> | ||
12 | + <text>分类</text> | ||
13 | + <view class="fs24 flex jc-center ai_c" style="color:#666" bindtap="open_more" data-type="1"> | ||
14 | + <block wx:if="{{fil_cate_state==0}}"><text>全部展开</text><text class="iconfont icon-arrow_down"></text></block> | ||
15 | + <block wx:if="{{fil_cate_state==1}}"><text>收起</text><text class="iconfont icon-arrow_down up_ar" ></text></block> | ||
16 | + <block wx:if="{{fil_cate_state==2}}"><text>展开</text><text class="iconfont icon-arrow_down"></text></block> | ||
17 | + </view> | ||
18 | + </view> | ||
19 | + <view class="filter-items fs26 {{fil_cate_state==0?'normal_to':(fil_cate_state==2?'back_to':'') }} " style="padding:0 20rpx"> | ||
20 | + <block wx:for="{{screen_cate}}"> | ||
21 | + <view bindtap="filterGoods" data-type="1" data-index="{{index}}" class="f_cate_item">{{item.name}} | ||
22 | + </view> | ||
23 | + </block> | ||
24 | + </view> | ||
25 | + </view> | ||
26 | + | ||
27 | + <view class="filter-box" wx:if="{{screen_nation && screen_nation.length>0}}"> | ||
28 | + <view class="f_cate_item fs28">国别 | ||
29 | + <view class="fs24 flex jc-center ai_c" style="color:#666" bindtap="open_more" data-type="2"> | ||
30 | + <block wx:if="{{fil_nation_state==0}}"><text>全部展开</text><text class="iconfont icon-arrow_down"></text></block> | ||
31 | + <block wx:if="{{fil_nation_state==1}}"><text>收起</text><text class="iconfont icon-arrow_down up_ar" ></text></block> | ||
32 | + <block wx:if="{{fil_nation_state==2}}"><text>展开</text><text class="iconfont icon-arrow_down"></text></block> | ||
33 | + </view> | ||
34 | + </view> | ||
35 | + <view class="filter-items mgt20 fs26 {{fil_nation_state==0?'normal_to':(fil_nation_state==2?'back_to':'') }} "> | ||
36 | + <block wx:for="{{screen_nation}}"> | ||
37 | + <view wx:if="{{item.name}}" bindtap="filterGoods" data-type="2" data-index="{{index}}" | ||
38 | + class="filter-item">{{item.name}} | ||
39 | + </view> | ||
40 | + </block> | ||
41 | + </view> | ||
42 | + <view style="clear:both"></view> | ||
43 | + </view> | ||
44 | + <view class="filter-box" wx:if="{{screen_brand && screen_brand.length > 0}}"> | ||
45 | + <view class="f_cate_item fs28">品牌 | ||
46 | + <view class="fs24 flex jc-center ai_c" style="color:#666" bindtap="open_more" data-type="3"> | ||
47 | + <block wx:if="{{fil_brand_state==0}}"><text>全部展开</text><text class="iconfont icon-arrow_down"></text></block> | ||
48 | + <block wx:if="{{fil_brand_state==1}}"><text>收起</text><text class="iconfont icon-arrow_down up_ar" ></text></block> | ||
49 | + <block wx:if="{{fil_brand_state==2}}"><text>展开</text><text class="iconfont icon-arrow_down"></text></block> | ||
50 | + </view> | ||
51 | + | ||
52 | + </view> | ||
53 | + <view class="filter-items mgt20 fs26 {{fil_brand_state==0?'normal_to':(fil_brand_state==2?'back_to':'') }} "> | ||
54 | + <block wx:for="{{screen_brand}}"> | ||
55 | + <view wx:if="{{item.name}}" bindtap="filterGoods" data-type="3" data-index="{{index}}" | ||
56 | + class="filter-item">{{item.name}} | ||
57 | + </view> | ||
58 | + </block> | ||
59 | + </view> | ||
60 | + <view style="clear:both"></view> | ||
61 | + </view> | ||
62 | + <view class="filter-box" wx:if="{{screen_price}}"> | ||
63 | + <view class="f_cate_item fs28">价格 | ||
64 | + <view class="fs24 flex jc-center ai_c" style="color:#666" bindtap="open_more" data-type="4"> | ||
65 | + <block wx:if="{{fil_price_state==0}}"><text>全部展开</text><text class="iconfont icon-arrow_down"></text></block> | ||
66 | + <block wx:if="{{fil_price_state==1}}"><text>收起</text><text class="iconfont icon-arrow_down up_ar" ></text></block> | ||
67 | + <block wx:if="{{fil_price_state==2}}"><text>展开</text><text class="iconfont icon-arrow_down"></text></block> | ||
68 | + </view> | ||
69 | + | ||
70 | + </view> | ||
71 | + <view class="filter-items mgt20 fs26 {{fil_price_state==0?'normal_to':(fil_price_state==2?'back_to':'') }} "> | ||
72 | + <block wx:for="{{screen_price}}"> | ||
73 | + <view bindtap="filterGoods" class="filter-item" data-type="4" data-index="{{index}}">{{item.name}} | ||
74 | + </view> | ||
75 | + </block> | ||
76 | + </view> | ||
77 | + <view style="clear:both"></view> | ||
78 | + </view> | ||
79 | + | ||
80 | + <view class="flex jc_sb ai_c" style="padding:0 20rpx"> | ||
81 | + <view bindtap="clear_fil" class="fil_btn fil_cancle">取消筛选</view> | ||
82 | + <view bindtap="closeFilterModal" class="fil_btn fil_sure">确定</view> | ||
83 | + </view> | ||
84 | + | ||
85 | + <view class="filter-box" style="height:30rpx"></view> | ||
86 | + </view> | ||
87 | +</view> | ||
0 | \ No newline at end of file | 88 | \ No newline at end of file |
pages/goods/com_screen.wxss
0 → 100644
1 | +/*--三角形的显示--*/ | ||
2 | +.arrow_down,.arrow_up{ | ||
3 | + width: 0px; | ||
4 | + height: 0px; | ||
5 | + font-size: 0; | ||
6 | + line-height: 0; | ||
7 | + border-right: 5px solid transparent; | ||
8 | + border-left: 5px solid transparent; | ||
9 | +} | ||
10 | + | ||
11 | +.arrow_down { | ||
12 | + border-top: 5px solid #a5a5a5; margin-top: 4rpx; | ||
13 | +} | ||
14 | +.arrow_up{ | ||
15 | + border-bottom: 5px solid #a5a5a5; | ||
16 | +} | ||
17 | + | ||
18 | +.arrow_down.on{ | ||
19 | + border-top: 5px solid #F4281C ; | ||
20 | +} | ||
21 | +.arrow_up.on{ | ||
22 | + border-bottom: 5px solid #F4281C; | ||
23 | +} | ||
24 | + | ||
25 | +.f_cate_item{ height:80rpx; display:flex; justify-content: space-between; align-items: center; border-bottom: 1rpx solid #dcdcdc;} | ||
26 | + | ||
27 | +.filter-items{ color: #666; overflow:hidden} | ||
28 | +.filter-items.normal_to{ max-height: 260rpx} | ||
29 | +.filter-items.back_to{ height: 0rpx} | ||
30 | + | ||
31 | +.up_ar{ transform: rotate(180deg)} | ||
32 | +.fil_btn{ width: 47%; height:80rpx; border-radius:10rpx; display: flex; | ||
33 | + justify-content:center; align-items: center; font-size:28rpx;color:#fff} | ||
34 | +.fil_cancle{ background-color: #25c6fc } | ||
35 | +.fil_sure{ background-color:#dd272c } | ||
36 | + | ||
37 | +.filter-modal { | ||
38 | + position: fixed; | ||
39 | + left: 150rpx; | ||
40 | + top: 0; | ||
41 | + right: 0; | ||
42 | + bottom: 0; | ||
43 | + z-index: 1120; | ||
44 | + background-color: white; | ||
45 | + overflow-x: hidden; | ||
46 | +} | ||
47 | + | ||
48 | +.filter-box { | ||
49 | + box-sizing: border-box; | ||
50 | + width: 100%; | ||
51 | + font-size: 28rpx; | ||
52 | + padding: 20rpx; | ||
53 | +} | ||
54 | + | ||
55 | +.filter-name { | ||
56 | + width: 100%; | ||
57 | + padding: 20rpx 0; | ||
58 | + word-break: keep-all; | ||
59 | + white-space: nowrap; | ||
60 | + text-overflow: ellipsis; | ||
61 | + overflow: hidden; | ||
62 | + font-size: 30rpx; | ||
63 | +} | ||
64 | + | ||
65 | +.filter-item { | ||
66 | + float: left; | ||
67 | + width: fit-content; | ||
68 | + max-width: 500rpx; | ||
69 | + word-break: keep-all; | ||
70 | + white-space: nowrap; | ||
71 | + text-overflow: ellipsis; | ||
72 | + overflow: hidden; | ||
73 | + padding: 10rpx; | ||
74 | + border-radius: 10rpx; | ||
75 | + border: 1rpx #ddd solid; | ||
76 | + margin: 0 10rpx 10rpx 0; | ||
77 | + background-color: #fdfdfd; | ||
78 | + color: #666; | ||
79 | +} | ||
0 | \ No newline at end of file | 80 | \ No newline at end of file |
pages/goods/goodsInfo/buy_com_pop.wxml
0 → 100644
1 | +<view class="spec-goods"> | ||
2 | + <image class="wh100 spec-img xc-distance-bottom" bindtap="previewImage" src="{{sele_g.original_img}}" | ||
3 | + binderror="pop_err_img" data-errorimg="data.original_img"></image> | ||
4 | + <view class="spec-goods-info"> | ||
5 | + <view class="spec-goods-name ellipsis-2">{{sele_g.goods_name}}</view> | ||
6 | + <view class="flex ai_end xc-val-money"> | ||
7 | + <text class="fs20">¥</text> | ||
8 | + <!-- 如果是等级会员,且有等级价 --> | ||
9 | + <block wx:if="{{card_field && sele_g[card_field]>0}}">{{sele_g[card_field]}}</block> | ||
10 | + <block wx:else>{{sele_g.shop_price}}</block> | ||
11 | + </view> | ||
12 | + | ||
13 | + <view class="flex"> | ||
14 | + <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view> | ||
15 | + <block wx:if="{{sales_rules==2}}"> | ||
16 | + <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}"> | ||
17 | + 可售:{{def_pick_store.CanOutQty}} | ||
18 | + </view> | ||
19 | + <view class="spec-goods-stock" wx:else>可售:0</view> | ||
20 | + </block> | ||
21 | + <block wx:else> | ||
22 | + <view class="spec-goods-stock">可售:{{sele_g.store_count}}</view> | ||
23 | + </block> | ||
24 | + </view> | ||
25 | + | ||
26 | + | ||
27 | + </view> | ||
28 | + | ||
29 | + <!-- 选择门店模块 --> | ||
30 | + <view class="flex-space-between address ai_end xc-width "> | ||
31 | + | ||
32 | + <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> | ||
33 | + <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text> | ||
34 | + <view class="distance fs24 xc-ash" wx:if="{{def_pick_store.distance!=null}}"> | ||
35 | + 距离:{{def_pick_store.distance > 1000 ? filters.toFix(def_pick_store.distance / 1000, 2) + "km" : filters.toFix(def_pick_store.distance, 0) + "m"}} | ||
36 | + | ||
37 | + </view> | ||
38 | + </view> | ||
39 | + | ||
40 | + <!-- 没有门店的时候 --> | ||
41 | + <view class="flex" bindtap="choice_store" wx:else> | ||
42 | + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> | ||
43 | + <view class="fs30" style="color:black;">选择门店</view> | ||
44 | + </view> | ||
45 | + | ||
46 | + <view hidden="{{has_def && sys_switch.is_pricing_open_store}}" class="red-co fs28" | ||
47 | + bindtap="choice_store">更多门店<text class="right-arrow"></text> | ||
48 | + </view> | ||
49 | + </view> | ||
50 | + <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view> | ||
51 | + <block wx:else> | ||
52 | + <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> | ||
53 | + <block wx:else> | ||
54 | + <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> | ||
55 | + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}"> | ||
56 | + (库存不足) | ||
57 | + </view> | ||
58 | + </block> | ||
59 | + </block> | ||
60 | + <view class="fs24 xc-ash-9f xc-distance-top " wx:if="{{def_pick_store && def_pick_store.fulladdress}}"> | ||
61 | + 地址:{{def_pick_store.fulladdress}} | ||
62 | + </view> | ||
63 | + | ||
64 | + | ||
65 | + <!--商品的属性项目--> | ||
66 | + <view class="xc-goods-attribute"> | ||
67 | + <view hidden="{{ismend==1}}" class="spec-name">商品规格</view> | ||
68 | + <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;"> | ||
69 | + <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-nor="1" | ||
70 | + data-gid='{{item.goods_id}}' wx:for="{{sku_g_pt}}" wx:key="sku_g"> | ||
71 | + {{item.gg}} | ||
72 | + </view> | ||
73 | + </view> | ||
74 | + </view> | ||
75 | + | ||
76 | + <view class="b_num"> | ||
77 | + <view>购买数量</view> | ||
78 | + <view class="count"> | ||
79 | + <view bindtap="{{goodsInputNum <= 1 ? '':'subCartNum'}}" | ||
80 | + class="sub {{goodsInputNum <= 1 ? 'active':''}}">- | ||
81 | + </view> | ||
82 | + <input bindblur="inputCartNum" type="number" value="{{goodsInputNum}}"></input> | ||
83 | + <view bindtap="addCartNum" class="add">+</view> | ||
84 | + </view> | ||
85 | + </view> | ||
86 | +</view> | ||
87 | +<!-- 提示再买多少优惠 --> | ||
88 | +<view style="margin-top: 35rpx;color:#333;font-size:28rpx;" wx:if="{{hui_condition}}"> | ||
89 | + 再买{{hui_condition.need}} | ||
90 | + <text wx:if="{{hui_condition.money}}">,免{{hui_condition.money}}元</text> | ||
91 | + <text wx:if="{{hui_condition.sale}}">,打{{hui_condition.sale}}折</text> | ||
92 | + <text wx:if="{{hui_condition.past==1}}">,包邮</text> | ||
93 | + <text wx:if="{{hui_condition.intValue>0}}">,送{{hui_condition.intValue}}积分</text> | ||
94 | + <text wx:if="{{hui_condition.couponId>0}}">,送优惠券</text> | ||
95 | + <text wx:if="{{hui_condition.gift_id>0}}">,送赠品</text> | ||
96 | + <text wx:if="{{hui_condition.lb_id>0}}">,送礼包</text> | ||
97 | + <text wx:if="{{hui_condition.zxlb_id>0}}">,送专享礼包</text> | ||
98 | +</view> | ||
99 | +<!-- 按钮部分 --> | ||
100 | +<view class="spec-cart-btns"> | ||
101 | + | ||
102 | + <!-- 根本就找不到门店 --> | ||
103 | + <block wx:if="{{def_pick_store && def_pick_store.is_no_dis}}"> | ||
104 | + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;"> | ||
105 | + 配送不匹配 | ||
106 | + </view> | ||
107 | + </block> | ||
108 | + <block wx:else> | ||
109 | + <!-- 根本就找不到门店 --> | ||
110 | + <block wx:if="{{!only_pk && !def_pickpu_list}}"> | ||
111 | + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;"> | ||
112 | + 库存不足 | ||
113 | + </view> | ||
114 | + </block> | ||
115 | + <block wx:else> | ||
116 | + | ||
117 | + | ||
118 | + <block wx:if="{{only_pk.length && !only_pk.length}}"> | ||
119 | + <view class="spec-cart-btn fs32" data-action="add" | ||
120 | + style="background-color: #dcdcdc;color: #999;">库存不足 | ||
121 | + </view> | ||
122 | + </block> | ||
123 | + <block wx:else> | ||
124 | + <block wx:if="{{def_pickpu_list && !def_pickpu_list.length}}"> | ||
125 | + <view class="spec-cart-btn fs32" data-action="add" | ||
126 | + style="background-color: #dcdcdc;color: #999">库存不足 | ||
127 | + </view> | ||
128 | + </block> | ||
129 | + <block wx:else> | ||
130 | + <block wx:if="{{!def_pick_store}}"> | ||
131 | + <view class="spec-cart-btn fs32" data-action="add" | ||
132 | + style="background-color: #dcdcdc;color: #999">请先选择门店 | ||
133 | + </view> | ||
134 | + </block> | ||
135 | + <block wx:else> | ||
136 | + <block wx:if="{{data.store_count<=0}}"> | ||
137 | + <view class="spec-cart-btn fs32" data-action="add" | ||
138 | + style="background-color: #dcdcdc;color: #999">库存不足 | ||
139 | + </view> | ||
140 | + </block> | ||
141 | + <block wx:else> | ||
142 | + <view class="flex jc_sb"> | ||
143 | + <view class="spec-cart-btn spec-buy w40" bindtap="addCart" | ||
144 | + data-action="add" style="background-color: #ffb03f;">加入购物车 | ||
145 | + </view> | ||
146 | + <view class="spec-cart-btn spec-buy w40" bindtap="addCart" | ||
147 | + data-action="buy">立即购买 | ||
148 | + </view> | ||
149 | + </view> | ||
150 | + </block> | ||
151 | + | ||
152 | + </block> | ||
153 | + </block> | ||
154 | + </block> | ||
155 | + </block> | ||
156 | + </block> | ||
157 | +</view> | ||
158 | + |
pages/goods/goodsInfo/buy_flash_normal.wxml
1 | <view bindtap="closeSpecModal_flash_normal" class="cover-layer"></view> | 1 | <view bindtap="closeSpecModal_flash_normal" class="cover-layer"></view> |
2 | - <view class="spec-model"> | ||
3 | - <view class="pding"> | ||
4 | - <icon bindtap="closeSpecModal_flash_normal" class="modal-close" color="black" size="22" type="cancel"></icon> | ||
5 | - <view class="spec-goods"> | ||
6 | - <image class="wh100 spec-img xc-distance-bottom" bindtap="previewImage" src="{{sele_g.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image> | ||
7 | - <view class="spec-goods-info"> | ||
8 | - <view class="spec-goods-name ellipsis-2">{{sele_g.goods_name}}</view> | ||
9 | - <view class="flex ai_end xc-val-money"> | ||
10 | - <text class="fs20">¥</text> | ||
11 | - <!-- 如果是等级会员,且有等级价 --> | ||
12 | - <block wx:if="{{card_field && sele_g[card_field]>0}}">{{sele_g[card_field]}} </block> | ||
13 | - <block wx:else>{{sele_g.shop_price}}</block> | ||
14 | - </view> | ||
15 | - | ||
16 | - <view class="flex"> | ||
17 | - <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view> | ||
18 | - <block wx:if="{{sales_rules==2}}"> | ||
19 | - <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}">可售:{{def_pick_store.CanOutQty}}</view> | ||
20 | - <view class="spec-goods-stock" wx:else>可售:0</view> | ||
21 | - </block> | ||
22 | - <block wx:else><view class="spec-goods-stock">可售:{{sele_g.store_count}}</view></block> | ||
23 | - </view> | ||
24 | - | ||
25 | - | ||
26 | - </view> | ||
27 | - | ||
28 | - <!-- 选择门店模块 --> | ||
29 | - <view class="flex-space-between address ai_end xc-width "> | ||
30 | - | ||
31 | - <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> | ||
32 | - <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text> | ||
33 | - <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}"> | ||
34 | - 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} | ||
35 | - | ||
36 | - </view> | ||
37 | - </view> | ||
38 | - | ||
39 | - <!-- 没有门店的时候 --> | ||
40 | - <view class="flex" bindtap="choice_store" wx:else> | ||
41 | - <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> | ||
42 | - <view class="fs30" style="color:black;">选择门店</view> | ||
43 | - </view> | ||
44 | - | ||
45 | - <view hidden="{{has_def && sys_switch.is_pricing_open_store}}" class="red-co fs28" bindtap="choice_store" >更多门店<text class="right-arrow"></text></view> | ||
46 | - </view> | ||
47 | - <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view> | ||
48 | - <block wx:else> | ||
49 | - <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> | ||
50 | - <block wx:else> | ||
51 | - <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> | ||
52 | - <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view> | ||
53 | - </block> | ||
54 | - </block> | ||
55 | - <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store && def_pick_store.fulladdress}}">地址:{{def_pick_store.fulladdress}}</view> | ||
56 | - | ||
57 | - | ||
58 | - <!--商品的属性项目--> | ||
59 | - <view class="xc-goods-attribute"> | ||
60 | - <view hidden="{{ismend==1}}" class="spec-name">商品规格</view> | ||
61 | - <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;"> | ||
62 | - <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-nor="1" data-gid='{{item.goods_id}}' wx:for="{{sku_g_pt}}" wx:key="sku_g"> | ||
63 | - {{item.gg}} | ||
64 | - </view> | ||
65 | - </view> | ||
66 | - </view> | ||
67 | - | ||
68 | - <view class="b_num"> | ||
69 | - <view>购买数量</view> | ||
70 | - <view class="count"> | ||
71 | - <view bindtap="{{goodsInputNum <= 1 ? '':'subCartNum'}}" class="sub {{goodsInputNum <= 1 ? 'active':''}}">-</view> | ||
72 | - <input bindblur="inputCartNum" type="number" value="{{goodsInputNum}}"></input> | ||
73 | - <view bindtap="addCartNum" class="add">+</view> | ||
74 | - </view> | ||
75 | - </view> | ||
76 | - </view> | ||
77 | - | ||
78 | - | ||
79 | - <!-- 提示再买多少优惠 --> | ||
80 | - <view style="margin-top: 35rpx;color:#333;font-size:28rpx;" wx:if="{{hui_condition}}"> | ||
81 | - 再买{{hui_condition.need}} | ||
82 | - <text wx:if="{{hui_condition.money}}">,免{{hui_condition.money}}元</text> | ||
83 | - <text wx:if="{{hui_condition.sale}}">,打{{hui_condition.sale}}折</text> | ||
84 | - <text wx:if="{{hui_condition.past==1}}">,包邮</text> | ||
85 | - <text wx:if="{{hui_condition.intValue>0}}">,送{{hui_condition.intValue}}积分</text> | ||
86 | - <text wx:if="{{hui_condition.couponId>0}}">,送优惠券</text> | ||
87 | - <text wx:if="{{hui_condition.gift_id>0}}">,送赠品</text> | ||
88 | - <text wx:if="{{hui_condition.lb_id>0}}">,送礼包</text> | ||
89 | - <text wx:if="{{hui_condition.zxlb_id>0}}">,送专享礼包</text> | ||
90 | - </view> | ||
91 | - | ||
92 | - | ||
93 | - <!-- 按钮部分 --> | ||
94 | - <view class="spec-cart-btns"> | ||
95 | - | ||
96 | - <!-- 根本就找不到门店 --> | ||
97 | - <block wx:if="{{def_pick_store && def_pick_store.is_no_dis}}"> | ||
98 | - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">配送不匹配</view> | ||
99 | - </block> | ||
100 | - <block wx:else> | ||
101 | - <!-- 根本就找不到门店 --> | ||
102 | - <block wx:if="{{!only_pk && !def_pickpu_list}}"> | ||
103 | - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view> | ||
104 | - </block> | ||
105 | - <block wx:else> | ||
106 | - | ||
107 | - | ||
108 | - <block wx:if="{{only_pk.length && !only_pk.length}}"> | ||
109 | - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view> | ||
110 | - </block> | ||
111 | - <block wx:else> | ||
112 | - <block wx:if="{{def_pickpu_list && !def_pickpu_list.length}}"> | ||
113 | - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> | ||
114 | - </block> | ||
115 | - <block wx:else> | ||
116 | - <block wx:if="{{!def_pick_store}}"> | ||
117 | - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view> | ||
118 | - </block> | ||
119 | - <block wx:else> | ||
120 | - <block wx:if="{{data.store_count<=0}}"> | ||
121 | - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> | ||
122 | - </block> | ||
123 | - <block wx:else> | ||
124 | - <view class="flex jc_sb"> | ||
125 | - <view class="spec-cart-btn spec-buy w40" bindtap="addCart" | ||
126 | - data-action="add" style="background-color: #ffb03f;">加入购物车</view> | ||
127 | - <view class="spec-cart-btn spec-buy w40" bindtap="addCart" | ||
128 | - data-action="buy">立即购买</view> | ||
129 | - </view> | ||
130 | - </block> | ||
131 | - | ||
132 | - </block> | ||
133 | - </block> | ||
134 | - </block> | ||
135 | - </block> | ||
136 | - </block> | ||
137 | - </view> | ||
138 | - | ||
139 | - </view> | ||
140 | - </view> | ||
141 | - <view class="clear"></view> | ||
142 | \ No newline at end of file | 2 | \ No newline at end of file |
3 | +<view class="spec-model"> | ||
4 | + <view class="pding"> | ||
5 | + <icon bindtap="closeSpecModal_flash_normal" class="modal-close" color="black" size="22" type="cancel"></icon> | ||
6 | + <include src="buy_com_pop.wxml"></include> | ||
7 | + </view> | ||
8 | +</view> | ||
9 | +<view class="clear"></view> | ||
143 | \ No newline at end of file | 10 | \ No newline at end of file |
pages/goods/goodsInfo/buy_integral_normal.wxml
1 | -<view bindtap="closeSpecModal_inte_normal" class="cover-layer"></view> | ||
2 | - <view class="spec-model"> | ||
3 | - <view class="pding"> | ||
4 | - <icon bindtap="closeSpecModal_inte_normal" class="modal-close" color="black" size="22" type="cancel"></icon> | ||
5 | - <view class="spec-goods"> | ||
6 | - <image class="wh100 spec-img xc-distance-bottom" bindtap="previewImage" src="{{sele_g.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image> | ||
7 | - <view class="spec-goods-info"> | ||
8 | - <view class="spec-goods-name ellipsis-2">{{sele_g.goods_name}}</view> | ||
9 | - <view class="flex ai_end xc-val-money"> | ||
10 | - <text class="fs20">¥</text> | ||
11 | - <!-- 如果是等级会员,且有等级价 --> | ||
12 | - <block wx:if="{{card_field && sele_g[card_field]>0}}">{{sele_g[card_field]}} </block> | ||
13 | - <block wx:else>{{sele_g.shop_price}}</block> | ||
14 | - </view> | ||
15 | - | ||
16 | - <view class="flex"> | ||
17 | - <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view> | ||
18 | - <block wx:if="{{sales_rules==2}}"> | ||
19 | - <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}">可售:{{def_pick_store.CanOutQty}}</view> | ||
20 | - <view class="spec-goods-stock" wx:else>可售:0</view> | ||
21 | - </block> | ||
22 | - <block wx:else><view class="spec-goods-stock">可售:{{sele_g.store_count}}</view></block> | ||
23 | - </view> | ||
24 | - | ||
25 | - | ||
26 | - </view> | ||
27 | - | ||
28 | - <!-- 选择门店模块 --> | ||
29 | - <view class="flex-space-between address ai_end xc-width "> | ||
30 | - | ||
31 | - <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> | ||
32 | - <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text> | ||
33 | - <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}"> | ||
34 | - 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} | ||
35 | - | ||
36 | - </view> | ||
37 | - </view> | ||
38 | - | ||
39 | - <!-- 没有门店的时候 --> | ||
40 | - <view class="flex" bindtap="choice_store" wx:else> | ||
41 | - <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> | ||
42 | - <view class="fs30" style="color:black;">选择门店</view> | ||
43 | - </view> | ||
44 | - | ||
45 | - <view hidden="{{has_def && sys_switch.is_pricing_open_store}}" class="red-co fs28" bindtap="choice_store" >更多门店<text class="right-arrow"></text></view> | ||
46 | - </view> | ||
47 | - <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view> | ||
48 | - <block wx:else> | ||
49 | - <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> | ||
50 | - <block wx:else> | ||
51 | - <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> | ||
52 | - <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2}}">(库存不足)</view> | ||
53 | - </block> | ||
54 | - </block> | ||
55 | - <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store && def_pick_store.fulladdress}}">地址:{{def_pick_store.fulladdress}}</view> | ||
56 | - | ||
57 | - | ||
58 | - <!--商品的属性项目--> | ||
59 | - <view class="xc-goods-attribute"> | ||
60 | - <view hidden="{{ismend==1}}" class="spec-name">商品规格</view> | ||
61 | - <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;"> | ||
62 | - <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-nor="1" data-gid='{{item.goods_id}}' wx:for="{{sku_g_pt}}" wx:key="sku_g"> | ||
63 | - {{item.gg}} | ||
64 | - </view> | ||
65 | - </view> | ||
66 | - </view> | ||
67 | - | ||
68 | - <view class="b_num"> | ||
69 | - <view>购买数量</view> | ||
70 | - <view class="count"> | ||
71 | - <view bindtap="{{goodsInputNum <= 1 ? '':'subCartNum'}}" class="sub {{goodsInputNum <= 1 ? 'active':''}}">-</view> | ||
72 | - <input bindblur="inputCartNum" type="number" value="{{goodsInputNum}}"></input> | ||
73 | - <view bindtap="addCartNum" class="add">+</view> | ||
74 | - </view> | ||
75 | - </view> | ||
76 | - </view> | ||
77 | - | ||
78 | - | ||
79 | - <!-- 提示再买多少优惠 --> | ||
80 | - <view style="margin-top: 35rpx;color:#333;font-size:28rpx;" wx:if="{{hui_condition}}"> | ||
81 | - 再买{{hui_condition.need}} | ||
82 | - <text wx:if="{{hui_condition.money}}">,免{{hui_condition.money}}元</text> | ||
83 | - <text wx:if="{{hui_condition.sale}}">,打{{hui_condition.sale}}折</text> | ||
84 | - <text wx:if="{{hui_condition.past==1}}">,包邮</text> | ||
85 | - <text wx:if="{{hui_condition.intValue>0}}">,送{{hui_condition.intValue}}积分</text> | ||
86 | - <text wx:if="{{hui_condition.couponId>0}}">,送优惠券</text> | ||
87 | - <text wx:if="{{hui_condition.gift_id>0}}">,送赠品</text> | ||
88 | - <text wx:if="{{hui_condition.lb_id>0}}">,送礼包</text> | ||
89 | - <text wx:if="{{hui_condition.zxlb_id>0}}">,送专享礼包</text> | ||
90 | - </view> | ||
91 | - | ||
92 | - | ||
93 | - <!-- 按钮部分 --> | ||
94 | - <view class="spec-cart-btns"> | ||
95 | - | ||
96 | - | ||
97 | - <!-- 根本就找不到门店 --> | ||
98 | - <block wx:if="{{def_pick_store && def_pick_store.is_no_dis}}"> | ||
99 | - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">配送不匹配</view> | ||
100 | - </block> | ||
101 | - <block wx:else> | ||
102 | - <!-- 根本就找不到门店 --> | ||
103 | - <block wx:if="{{!only_pk && !def_pickpu_list}}"> | ||
104 | - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view> | ||
105 | - </block> | ||
106 | - <block wx:else> | ||
107 | - | ||
108 | - | ||
109 | - <block wx:if="{{only_pk.length && !only_pk.length}}"> | ||
110 | - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view> | ||
111 | - </block> | ||
112 | - <block wx:else> | ||
113 | - <block wx:if="{{def_pickpu_list && !def_pickpu_list.length}}"> | ||
114 | - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> | ||
115 | - </block> | ||
116 | - <block wx:else> | ||
117 | - <block wx:if="{{!def_pick_store}}"> | ||
118 | - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view> | ||
119 | - </block> | ||
120 | - <block wx:else> | ||
121 | - <!-- 线下库存 --> | ||
122 | - <block wx:if="{{sales_rules==2 && prom_type==0 && !sele_g.whsle_id}}"> | ||
123 | - <block wx:if="{{def_pick_store && !def_pick_store.CanOutQty}}"> | ||
124 | - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> | ||
125 | - </block> | ||
126 | - <block wx:else> | ||
127 | - <view class="flex jc_sb"> | ||
128 | - <view class="spec-cart-btn spec-buy w40" bindtap="addCart" | ||
129 | - data-action="add" style="background-color: #ffb03f;">加入购物车</view> | ||
130 | - <view class="spec-cart-btn spec-buy w40" bindtap="addCart" | ||
131 | - data-action="buy">立即购买</view> | ||
132 | - </view> | ||
133 | - </block> | ||
134 | - </block> | ||
135 | - <!-- 线上库存 --> | ||
136 | - <block wx:else> | ||
137 | - <block wx:if="{{sele_g.store_count<=0}}"> | ||
138 | - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999"> | ||
139 | - 库存不足5 | ||
140 | - </view> | ||
141 | - </block> | ||
142 | - <block wx:else> | ||
143 | - <view class="flex jc_sb"> | ||
144 | - <view class="spec-cart-btn spec-buy w40" bindtap="addCart" | ||
145 | - data-action="add" style="background-color: #ffb03f;">加入购物车</view> | ||
146 | - <view class="spec-cart-btn spec-buy w40" bindtap="addCart" | ||
147 | - data-action="buy">立即购买</view> | ||
148 | - </view> | ||
149 | - </block> | ||
150 | - | ||
151 | - </block> | ||
152 | - | ||
153 | - </block> | ||
154 | - </block> | ||
155 | - </block> | ||
156 | - </block> | ||
157 | - </block> | ||
158 | - </view> | ||
159 | - | ||
160 | - | ||
161 | - </view> | ||
162 | - </view> | ||
163 | - <view class="clear"></view> | ||
164 | \ No newline at end of file | 1 | \ No newline at end of file |
2 | +<view bindtap="closeSpecModal_inte_normal" class="cover-layer"></view> | ||
3 | +<view class="spec-model"> | ||
4 | + <view class="pding"> | ||
5 | + <icon bindtap="closeSpecModal_inte_normal" class="modal-close" color="black" size="22" type="cancel"></icon> | ||
6 | + <include src="buy_com_pop.wxml"></include> | ||
7 | + </view> | ||
8 | +</view> | ||
9 | +<view class="clear"></view> | ||
165 | \ No newline at end of file | 10 | \ No newline at end of file |
pages/goods/goodsInfo/goodsInfo.js
@@ -255,7 +255,9 @@ Page({ | @@ -255,7 +255,9 @@ Page({ | ||
255 | share_hidden: false, | 255 | share_hidden: false, |
256 | all_activity_list: null, //所有活动的列表 | 256 | all_activity_list: null, //所有活动的列表 |
257 | 257 | ||
258 | - hiddenCS: true, | 258 | + hiddenCS: true, |
259 | + | ||
260 | + is_retail_price:0, | ||
259 | }, | 261 | }, |
260 | 262 | ||
261 | //------初始化加载---------- | 263 | //------初始化加载---------- |
@@ -424,7 +426,8 @@ Page({ | @@ -424,7 +426,8 @@ Page({ | ||
424 | store_config: e, | 426 | store_config: e, |
425 | sys_switch: json_d, | 427 | sys_switch: json_d, |
426 | is_closecoupon: json_d.is_closecoupon, | 428 | is_closecoupon: json_d.is_closecoupon, |
427 | - is_newsales_rules: json_d.is_newsales_rules | 429 | + is_newsales_rules: json_d.is_newsales_rules, |
430 | + is_retail_price: json_d.is_retail_price || 0 | ||
428 | }); | 431 | }); |
429 | ee.init(gid); | 432 | ee.init(gid); |
430 | //------几人评价------- | 433 | //------几人评价------- |
@@ -438,38 +441,7 @@ Page({ | @@ -438,38 +441,7 @@ Page({ | ||
438 | var swithc_list = e.switch_list; | 441 | var swithc_list = e.switch_list; |
439 | var sw_arr = JSON.parse(swithc_list); | 442 | var sw_arr = JSON.parse(swithc_list); |
440 | //---如果后台又开等级卡的开关--- | 443 | //---如果后台又开等级卡的开关--- |
441 | - if (sw_arr.rank_switch && sw_arr.rank_switch == "2") { | ||
442 | - th.setData({rank_switch: true}); | ||
443 | - //---回调卡的列表--- | ||
444 | - th.getPlusCardType(function (ob) { | ||
445 | - th.setData({card_list: ob.card_list}); | ||
446 | - var ti = setInterval(function () { | ||
447 | - var user = getApp().globalData.userInfo; | ||
448 | - if (!user) return false; | ||
449 | - clearInterval(ti); | ||
450 | - if (user.card_field && user['card_expiredate']) { | ||
451 | - var str = user['card_expiredate'].replace(/-/g, '/'); | ||
452 | - var end = new Date(str); | ||
453 | - end = Date.parse(end) / 1000; | ||
454 | - var now = ut.gettimestamp(); | ||
455 | - //--- 判断是等级会员,且在有效期范围内 --- | ||
456 | - if (user.card_field && now < end) { | ||
457 | - var card_name = ob.name_map.get(user.card_field); | ||
458 | - //if(card_name.length>6) card_name=card_name.substring(0,6); | ||
459 | - | ||
460 | - var is_near_date = 0; | ||
461 | - if (end - now < 60 * 60 * 30 * 24) is_near_date = 1; //如果小于30天 | ||
462 | - th.setData({ | ||
463 | - card_field: user.card_field, | ||
464 | - card_name: card_name, | ||
465 | - card_list: ob.card_list, | ||
466 | - is_near_date: is_near_date | ||
467 | - }); | ||
468 | - } | ||
469 | - } | ||
470 | - }, 500) | ||
471 | - }) | ||
472 | - } | 444 | + ut.get_plus_name_price(sw_arr,th); |
473 | 445 | ||
474 | }, 1); | 446 | }, 1); |
475 | 447 | ||
@@ -750,8 +722,11 @@ Page({ | @@ -750,8 +722,11 @@ Page({ | ||
750 | fir_quan = res1.data.data.pageData; | 722 | fir_quan = res1.data.data.pageData; |
751 | }) | 723 | }) |
752 | } | 724 | } |
725 | + | ||
726 | + let arr=[] | ||
727 | + | ||
753 | //过滤不是本商品的单品优惠券------------------- | 728 | //过滤不是本商品的单品优惠券------------------- |
754 | - if(fir_quan.length > 0 ){ | 729 | + if(fir_quan && fir_quan.length > 0 ){ |
755 | let goodInfo = ee.data.data | 730 | let goodInfo = ee.data.data |
756 | for (let index = fir_quan.length-1; index >= 0; index--) { | 731 | for (let index = fir_quan.length-1; index >= 0; index--) { |
757 | if (fir_quan[index].useobjecttype==20) { //判断是单品优惠券 | 732 | if (fir_quan[index].useobjecttype==20) { //判断是单品优惠券 |
@@ -759,15 +734,18 @@ Page({ | @@ -759,15 +734,18 @@ Page({ | ||
759 | fir_quan.splice(index,1) | 734 | fir_quan.splice(index,1) |
760 | } | 735 | } |
761 | } | 736 | } |
762 | - } | ||
763 | - } | ||
764 | - let arr=[] | ||
765 | - let length = fir_quan.length | ||
766 | - if (length <= 3) { | ||
767 | - arr=fir_quan | ||
768 | - }else{ | ||
769 | - arr=fir_quan.splice(0,3); | 737 | + } |
738 | + | ||
739 | + let length = fir_quan.length | ||
740 | + if (length <= 3) { | ||
741 | + arr=fir_quan | ||
742 | + }else{ | ||
743 | + arr=fir_quan.splice(0,3); | ||
744 | + } | ||
745 | + | ||
770 | } | 746 | } |
747 | + | ||
748 | + | ||
771 | //--------获取视频图片--------- | 749 | //--------获取视频图片--------- |
772 | await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, { | 750 | await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, { |
773 | 1: 1 | 751 | 1: 1 |
@@ -1418,6 +1396,8 @@ Page({ | @@ -1418,6 +1396,8 @@ Page({ | ||
1418 | }; | 1396 | }; |
1419 | 1397 | ||
1420 | 1398 | ||
1399 | + | ||
1400 | + | ||
1421 | //-- 代发商品不参加优惠 -- | 1401 | //-- 代发商品不参加优惠 -- |
1422 | if(th.data.sele_g.whsle_id && newd.prom_type==3){ | 1402 | if(th.data.sele_g.whsle_id && newd.prom_type==3){ |
1423 | newd.prom_type=0; | 1403 | newd.prom_type=0; |
@@ -1465,6 +1445,7 @@ Page({ | @@ -1465,6 +1445,7 @@ Page({ | ||
1465 | 1445 | ||
1466 | newd.prom_type = 0; | 1446 | newd.prom_type = 0; |
1467 | newd.prom_id = 0; | 1447 | newd.prom_id = 0; |
1448 | + newd.is_pd_normal=1; | ||
1468 | 1449 | ||
1469 | //---如果是线下门店销售的时候--- | 1450 | //---如果是线下门店销售的时候--- |
1470 | if (th.data.sales_rules == 2) { | 1451 | if (th.data.sales_rules == 2) { |
@@ -1788,7 +1769,7 @@ Page({ | @@ -1788,7 +1769,7 @@ Page({ | ||
1788 | add_cart_next(e, t, a, o, newd, CanOutQty) { | 1769 | add_cart_next(e, t, a, o, newd, CanOutQty) { |
1789 | var th = this, i = getApp().request; | 1770 | var th = this, i = getApp().request; |
1790 | //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------ | 1771 | //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------ |
1791 | - if ((o.prom_type != 1 || o.prom_id <= 0) && ((o.prom_type != 6 && o.prom_type != 4 && o.prom_type != 2 ) || th.data.is_normal)) { | 1772 | + if ((o.prom_type != 6 && o.prom_type != 4 && o.prom_type != 2 && o.prom_type != 1 ) || th.data.is_normal) { |
1792 | var conf = th.data.bconfig; | 1773 | var conf = th.data.bconfig; |
1793 | if (conf.switch_list && getApp().globalData.userInfo['card_field'] && getApp().globalData.userInfo['card_expiredate']) { | 1774 | if (conf.switch_list && getApp().globalData.userInfo['card_field'] && getApp().globalData.userInfo['card_expiredate']) { |
1794 | var s_list = JSON.parse(conf.switch_list); | 1775 | var s_list = JSON.parse(conf.switch_list); |
@@ -2007,7 +1988,7 @@ Page({ | @@ -2007,7 +1988,7 @@ Page({ | ||
2007 | getApp().goto(url); | 1988 | getApp().goto(url); |
2008 | } else { | 1989 | } else { |
2009 | //要判断积分购的普通购买有没有参加优惠活动 | 1990 | //要判断积分购的普通购买有没有参加优惠活动 |
2010 | - if (e.is_integral_normal == 1) { | 1991 | + if (e.is_integral_normal == 1 || e.is_pd_normal == 1 ) { |
2011 | this.check_nor_promgood(e.goods_id, function (res) { | 1992 | this.check_nor_promgood(e.goods_id, function (res) { |
2012 | if (res && res.cat_id) { | 1993 | if (res && res.cat_id) { |
2013 | e.prom_type = 3; | 1994 | e.prom_type = 3; |
@@ -6363,7 +6344,7 @@ Page({ | @@ -6363,7 +6344,7 @@ Page({ | ||
6363 | getApp().goto("/pages/user/plus/plus"); | 6344 | getApp().goto("/pages/user/plus/plus"); |
6364 | }, | 6345 | }, |
6365 | go_card_info: function () { | 6346 | go_card_info: function () { |
6366 | - getApp().goto("/pages/user/cardinfo/cardinfo"); | 6347 | + getApp().goto("/packageE/pages/user/cardinfo/cardinfo"); |
6367 | }, | 6348 | }, |
6368 | //-- 根据ID拿出门店 -- | 6349 | //-- 根据ID拿出门店 -- |
6369 | get_pick_from_list(pid) { | 6350 | get_pick_from_list(pid) { |
@@ -6963,7 +6944,28 @@ Page({ | @@ -6963,7 +6944,28 @@ Page({ | ||
6963 | var prom_id=e.currentTarget.dataset.prom; | 6944 | var prom_id=e.currentTarget.dataset.prom; |
6964 | var index=e.currentTarget.dataset.index; | 6945 | var index=e.currentTarget.dataset.index; |
6965 | getApp().goto("/packageD/pages/gift/gift?prom_id="+prom_id+"&index="+index); | 6946 | getApp().goto("/packageD/pages/gift/gift?prom_id="+prom_id+"&index="+index); |
6947 | + }, | ||
6948 | + | ||
6949 | + pre_gallery_img(e){ | ||
6950 | + | ||
6951 | + this.data.show_prew_img=1; | ||
6952 | + | ||
6953 | + var index = e.currentTarget.dataset.index; | ||
6954 | + getApp().globalData.no_clear=1; | ||
6955 | + | ||
6956 | + var url=this.data.gallery[index].image_url; | ||
6957 | + var url_arr=[]; | ||
6958 | + | ||
6959 | + for(var i in this.data.gallery){ | ||
6960 | + url_arr.push(this.data.gallery[i].image_url) | ||
6966 | } | 6961 | } |
6967 | 6962 | ||
6968 | 6963 | ||
6964 | + wx.previewImage({ | ||
6965 | + current: url, // 当前显示图片的http链接 | ||
6966 | + urls: url_arr,// 需要预览的图片http链接列表 | ||
6967 | + }); | ||
6968 | + } | ||
6969 | + | ||
6970 | + | ||
6969 | }) | 6971 | }) |
pages/goods/goodsInfo/goodsInfo.wxml
@@ -45,8 +45,8 @@ | @@ -45,8 +45,8 @@ | ||
45 | <video bindfullscreenchange="screenChange" class="xc-videos" src="{{iurl+mapurl}}" id="{{index}}" wx:if="{{_index == index}}"></video> | 45 | <video bindfullscreenchange="screenChange" class="xc-videos" src="{{iurl+mapurl}}" id="{{index}}" wx:if="{{_index == index}}"></video> |
46 | </view> | 46 | </view> |
47 | </swiper-item> | 47 | </swiper-item> |
48 | - <swiper-item wx:for="{{gallery}}" wx:key="gallery"> | ||
49 | - <view class="wh100 g_img_box" style="background-image:url({{item.image_url}});"></view> | 48 | + <swiper-item wx:for="{{gallery}}" wx:key="gallery" > |
49 | + <view data-index="{{index}}" bindtap='pre_gallery_img' class="wh100 g_img_box" style="background-image:url({{item.image_url}});"></view> | ||
50 | </swiper-item> | 50 | </swiper-item> |
51 | </swiper> | 51 | </swiper> |
52 | <block wx:if="{{mapurl}}"> | 52 | <block wx:if="{{mapurl}}"> |
@@ -124,9 +124,9 @@ | @@ -124,9 +124,9 @@ | ||
124 | <view class="flex fs35 xc-qtsign">¥</view> | 124 | <view class="flex fs35 xc-qtsign">¥</view> |
125 | <view class="fs50 val">{{prom_price}}</view> | 125 | <view class="fs50 val">{{prom_price}}</view> |
126 | </view> | 126 | </view> |
127 | - <view class="word-line fs20 xc-qtunit-price"> | ||
128 | - ¥{{filters.toFix(data.shop_price,2)}} | ||
129 | - </view> | 127 | + |
128 | + <view wx:if="is_retail_price" class="word-line fs20 xc-qtunit-price">¥{{filters.toFix(data.market_price,2)}}</view> | ||
129 | + <view wx:else class="word-line fs20 xc-qtunit-price">¥{{filters.toFix(data.shop_price,2)}}</view> | ||
130 | </view> | 130 | </view> |
131 | 131 | ||
132 | <view class="abs white xc-nanber"> | 132 | <view class="abs white xc-nanber"> |
@@ -260,9 +260,15 @@ | @@ -260,9 +260,15 @@ | ||
260 | <text class="rel_txt" wx:if="{{prom_integral && prom_price}}">+</text> | 260 | <text class="rel_txt" wx:if="{{prom_integral && prom_price}}">+</text> |
261 | <text class="rel_txt" wx:if="{{prom_price}}">{{filters.toFix(prom_price,2)}}元</text> | 261 | <text class="rel_txt" wx:if="{{prom_price}}">{{filters.toFix(prom_price,2)}}元</text> |
262 | <text class="rel_txt" wx:if="{{!prom_integral && !prom_price}}">0积分</text> | 262 | <text class="rel_txt" wx:if="{{!prom_integral && !prom_price}}">0积分</text> |
263 | - <text class="rel_txt fs22" decode="{{true}}" space="{{true}}" style="color: #999; text-decoration: line-through;"> | 263 | + |
264 | + <text wx:if="{{is_retail_price}}" class="rel_txt fs22" decode="{{true}}" space="{{true}}" style="color: #999; text-decoration: line-through;"> | ||
265 | + ¥{{filters.toFix(data.market_price,2)}} | ||
266 | + </text> | ||
267 | + | ||
268 | + <text wx:else class="rel_txt fs22" decode="{{true}}" space="{{true}}" style="color: #999; text-decoration: line-through;"> | ||
264 | ¥{{filters.toFix(data.shop_price,2)}} | 269 | ¥{{filters.toFix(data.shop_price,2)}} |
265 | </text> | 270 | </text> |
271 | + | ||
266 | </view> | 272 | </view> |
267 | <!-- 这个是分享按钮 --> | 273 | <!-- 这个是分享按钮 --> |
268 | <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> --> | 274 | <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> --> |
@@ -302,18 +308,29 @@ | @@ -302,18 +308,29 @@ | ||
302 | </view> | 308 | </view> |
303 | <text class="rel yuan">¥</text> | 309 | <text class="rel yuan">¥</text> |
304 | {{filters.toFix(data[card_field],2)}} | 310 | {{filters.toFix(data[card_field],2)}} |
305 | -<!-- <view class='yj' style="top:35rpx">--> | ||
306 | -<!-- <text>零售价:¥{{filters.toFix(data.market_price,2)}}</text>--> | ||
307 | -<!-- </view>--> | 311 | + |
312 | + <view wx:if="{{is_retail_price}}" class='yj' style="top:35rpx"> | ||
313 | + <text>零售价:¥{{filters.toFix(data.market_price,2)}}</text> | ||
314 | + </view> | ||
315 | + | ||
316 | + <view wx:else class='yj' style="top:35rpx"> | ||
317 | + <text>:¥{{filters.toFix(data.shop_price,2)}}</text> | ||
318 | + </view> | ||
319 | + | ||
308 | </block> | 320 | </block> |
309 | <block wx:elif="{{prom_type!=2}}"> | 321 | <block wx:elif="{{prom_type!=2}}"> |
310 | 322 | ||
311 | 323 | ||
312 | <text class="yuan">¥</text> | 324 | <text class="yuan">¥</text> |
313 | {{filters.toFix(data.shop_price,2)}} | 325 | {{filters.toFix(data.shop_price,2)}} |
314 | -<!-- <view class='yj'>--> | ||
315 | -<!-- <text>零售价:¥{{filters.toFix(data.market_price,2)}}</text>--> | ||
316 | -<!-- </view>--> | 326 | + <view wx:if="{{is_retail_price}}" class='yj'> |
327 | + <text>零售价:¥{{filters.toFix(data.market_price,2)}}</text> | ||
328 | + </view> | ||
329 | + | ||
330 | + <view wx:else class='yj'> | ||
331 | + <text>:¥{{filters.toFix(data.shop_price,2)}}</text> | ||
332 | + </view> | ||
333 | + | ||
317 | </block> | 334 | </block> |
318 | </view> | 335 | </view> |
319 | </view> | 336 | </view> |
@@ -410,7 +427,8 @@ | @@ -410,7 +427,8 @@ | ||
410 | <text class="fs30">¥</text> | 427 | <text class="fs30">¥</text> |
411 | {{prom_price}} | 428 | {{prom_price}} |
412 | </view> | 429 | </view> |
413 | - <view class="word-line fs24">¥{{filters.toFix(data.shop_price,2)}}</view> | 430 | + <view wx:if="{{is_retail_price}}" class="word-line fs24">¥{{filters.toFix(data.market_price,2)}}</view> |
431 | + <view wx:else class="word-line fs24">¥{{filters.toFix(data.shop_price,2)}}</view> | ||
414 | </view> | 432 | </view> |
415 | <!-- 这个是分享按钮 --> | 433 | <!-- 这个是分享按钮 --> |
416 | <view class="xc-share-frame t-c shrink0" bindtap="clickShare"> | 434 | <view class="xc-share-frame t-c shrink0" bindtap="clickShare"> |
@@ -1504,6 +1522,7 @@ | @@ -1504,6 +1522,7 @@ | ||
1504 | </view> | 1522 | </view> |
1505 | </view> | 1523 | </view> |
1506 | <view class="mask" catchtouchmove="true" wx:if="{{showRules}}"></view> | 1524 | <view class="mask" catchtouchmove="true" wx:if="{{showRules}}"></view> |
1525 | + | ||
1507 | <!-- 选择门店的弹框,1.1版最新的 --> | 1526 | <!-- 选择门店的弹框,1.1版最新的 --> |
1508 | <block wx:if="{{store==1}}"> | 1527 | <block wx:if="{{store==1}}"> |
1509 | <view class="mongolia-layer" bindtap="close_popup"></view> | 1528 | <view class="mongolia-layer" bindtap="close_popup"></view> |
pages/goods/goodsList/goodsList.js
@@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
4 | }; | 4 | }; |
5 | }(require("../../../utils/LoadMore.js")), e = getApp(), a = new t.default(), oo = e.globalData.setting, ut = require("../../../utils/util.js"); | 5 | }(require("../../../utils/LoadMore.js")), e = getApp(), a = new t.default(), oo = e.globalData.setting, ut = require("../../../utils/util.js"); |
6 | var regeneratorRuntime = require('../../../utils/runtime.js'); | 6 | var regeneratorRuntime = require('../../../utils/runtime.js'); |
7 | +var com_fil= require('../com_screen.js'); | ||
7 | 8 | ||
8 | Page({ | 9 | Page({ |
9 | data: { | 10 | data: { |
@@ -16,6 +17,8 @@ Page({ | @@ -16,6 +17,8 @@ Page({ | ||
16 | openFilterModal: !1, | 17 | openFilterModal: !1, |
17 | baseUrl: "/api/weshop/goods/page?1=1", | 18 | baseUrl: "/api/weshop/goods/page?1=1", |
18 | requestUrl: "", | 19 | requestUrl: "", |
20 | + old_req_url:'', | ||
21 | + | ||
19 | tabname:"sort", //排序的字段 | 22 | tabname:"sort", //排序的字段 |
20 | adname:"asc", //升降的字段 | 23 | adname:"asc", //升降的字段 |
21 | is_new:0, | 24 | is_new:0, |
@@ -25,6 +28,19 @@ Page({ | @@ -25,6 +28,19 @@ Page({ | ||
25 | rq_data:null, | 28 | rq_data:null, |
26 | isToggle: false, //切换商品视图控制符 | 29 | isToggle: false, //切换商品视图控制符 |
27 | show_all:1, //判断显示 | 30 | show_all:1, //判断显示 |
31 | + | ||
32 | + is_retail_price:0, //是否显示零售价 | ||
33 | + | ||
34 | + more_sort_arr:[ | ||
35 | + {name:'综合',value:'sort'}, | ||
36 | + {name:'新品',value:'on_time'}, | ||
37 | + {name:'评论',value:'comment_count'}, | ||
38 | + ], | ||
39 | + | ||
40 | + fil_cate_state:0, | ||
41 | + fil_nation_state:0, | ||
42 | + fil_brand_state:0, | ||
43 | + fil_price_state:0, | ||
28 | }, | 44 | }, |
29 | 45 | ||
30 | onLoad: function(t) { | 46 | onLoad: function(t) { |
@@ -59,6 +75,7 @@ Page({ | @@ -59,6 +75,7 @@ Page({ | ||
59 | url += "&parent_id="+t.pid; | 75 | url += "&parent_id="+t.pid; |
60 | } | 76 | } |
61 | } | 77 | } |
78 | + this.data.cat_id=t.cat_id; | ||
62 | } | 79 | } |
63 | 80 | ||
64 | if (0 != t.brand_id && t.brand_id != undefined) { url += "&brand_id=" + t.brand_id; } | 81 | if (0 != t.brand_id && t.brand_id != undefined) { url += "&brand_id=" + t.brand_id; } |
@@ -153,7 +170,14 @@ Page({ | @@ -153,7 +170,14 @@ Page({ | ||
153 | } | 170 | } |
154 | }) | 171 | }) |
155 | } | 172 | } |
173 | + | ||
174 | + | ||
175 | + this.data.old_req_url=url; | ||
176 | + //进行筛选 | ||
177 | + this.set_screen(url); | ||
178 | + | ||
156 | this.requestGoodsList(url); | 179 | this.requestGoodsList(url); |
180 | + | ||
157 | getApp().getConfig2(function(rs){ | 181 | getApp().getConfig2(function(rs){ |
158 | //计算等级价相关 | 182 | //计算等级价相关 |
159 | var swithc_list=rs.switch_list; | 183 | var swithc_list=rs.switch_list; |
@@ -184,6 +208,11 @@ Page({ | @@ -184,6 +208,11 @@ Page({ | ||
184 | }) | 208 | }) |
185 | },500) | 209 | },500) |
186 | } | 210 | } |
211 | + | ||
212 | + if(sw_arr.is_retail_price){ | ||
213 | + th.setData({is_retail_price:1}); | ||
214 | + } | ||
215 | + | ||
187 | }); | 216 | }); |
188 | 217 | ||
189 | //调用接口判断商家plus有没有过期 | 218 | //调用接口判断商家plus有没有过期 |
@@ -250,6 +279,7 @@ Page({ | @@ -250,6 +279,7 @@ Page({ | ||
250 | } | 279 | } |
251 | this.resetData(), this.requestGoodsList(url); | 280 | this.resetData(), this.requestGoodsList(url); |
252 | }, | 281 | }, |
282 | + | ||
253 | requestGoodsList:function(t) { | 283 | requestGoodsList:function(t) { |
254 | if(this.data.loading) return false; | 284 | if(this.data.loading) return false; |
255 | this.data.loading=1; | 285 | this.data.loading=1; |
@@ -259,6 +289,7 @@ Page({ | @@ -259,6 +289,7 @@ Page({ | ||
259 | 289 | ||
260 | var user_id=getApp().globalData.user_id; | 290 | var user_id=getApp().globalData.user_id; |
261 | if(!user_id) user_id=0; | 291 | if(!user_id) user_id=0; |
292 | + | ||
262 | //不是商品分组的,不是默认排序的 | 293 | //不是商品分组的,不是默认排序的 |
263 | if(t.indexOf("group_id")==-1 || e.data.tabname!="sort" ){ | 294 | if(t.indexOf("group_id")==-1 || e.data.tabname!="sort" ){ |
264 | t += "&orderField=" + e.data.tabname; | 295 | t += "&orderField=" + e.data.tabname; |
@@ -266,8 +297,13 @@ Page({ | @@ -266,8 +297,13 @@ Page({ | ||
266 | } | 297 | } |
267 | 298 | ||
268 | t +="&page=" + e.data.currentPage; | 299 | t +="&page=" + e.data.currentPage; |
300 | + | ||
301 | + wx.showLoading({}); | ||
302 | + | ||
269 | getApp().request.promiseGet(t, {data:{is_mainshow: 1, isonsale: 1, store_id: oo.stoid}}).then(async res=>{ | 303 | getApp().request.promiseGet(t, {data:{is_mainshow: 1, isonsale: 1, store_id: oo.stoid}}).then(async res=>{ |
270 | th.data.loading=0; | 304 | th.data.loading=0; |
305 | + wx.hideLoading(); | ||
306 | + | ||
271 | e.setData({is_go:1}); | 307 | e.setData({is_go:1}); |
272 | if(ut.ajax_ok(res)){ | 308 | if(ut.ajax_ok(res)){ |
273 | e.data.currentPage++; | 309 | e.data.currentPage++; |
@@ -322,7 +358,7 @@ Page({ | @@ -322,7 +358,7 @@ Page({ | ||
322 | if (res.data.code == 0 && res.data.data && res.data.data.length > 0) { | 358 | if (res.data.code == 0 && res.data.data && res.data.data.length > 0) { |
323 | var arr = res.data.data[0]; | 359 | var arr = res.data.data[0]; |
324 | item.prom_price = arr.luck_goods_price; | 360 | item.prom_price = arr.luck_goods_price; |
325 | - item.sales_sum=arr.buy_goodnum+(arr.virtual_qty?arr.virtual_qty:0); | 361 | + // item.sales_sum=arr.buy_goodnum+(arr.virtual_qty?arr.virtual_qty:0); |
326 | } | 362 | } |
327 | }) | 363 | }) |
328 | break; | 364 | break; |
@@ -336,10 +372,10 @@ Page({ | @@ -336,10 +372,10 @@ Page({ | ||
336 | if (prom != null && prom.is_end==0 && prom.end_time>now && (prom.start_time<now || (prom_type!=2 && prom.show_time && prom.show_time<now)) ) { | 372 | if (prom != null && prom.is_end==0 && prom.end_time>now && (prom.start_time<now || (prom_type!=2 && prom.show_time && prom.show_time<now)) ) { |
337 | item.prom_price = res.data.data.price; | 373 | item.prom_price = res.data.data.price; |
338 | if(res.data.data.user_price) item.prom_price=res.data.data.user_price; | 374 | if(res.data.data.user_price) item.prom_price=res.data.data.user_price; |
339 | - var vNum=res.data.data.virtual_num?res.data.data.virtual_num:0; | ||
340 | - var vNum1=res.data.data.virtualNum?res.data.data.virtualNum:0; | ||
341 | - var vNum2=res.data.data.virtual?res.data.data.virtual:0; | ||
342 | - item.sales_sum=res.data.data.buy_num+(vNum+vNum1+vNum2); | 375 | + // var vNum=res.data.data.virtual_num?res.data.data.virtual_num:0; |
376 | + // var vNum1=res.data.data.virtualNum?res.data.data.virtualNum:0; | ||
377 | + // var vNum2=res.data.data.virtual?res.data.data.virtual:0; | ||
378 | + // item.sales_sum=res.data.data.buy_num+(vNum+vNum1+vNum2); | ||
343 | }else{ | 379 | }else{ |
344 | item.prom_type=0; | 380 | item.prom_type=0; |
345 | item.prom_id=0; | 381 | item.prom_id=0; |
@@ -450,8 +486,7 @@ Page({ | @@ -450,8 +486,7 @@ Page({ | ||
450 | }) | 486 | }) |
451 | }, | 487 | }, |
452 | 488 | ||
453 | - | ||
454 | - | 489 | + |
455 | // 切换显示 | 490 | // 切换显示 |
456 | bindToggleDisplay() { | 491 | bindToggleDisplay() { |
457 | this.setData({ | 492 | this.setData({ |
@@ -459,14 +494,20 @@ Page({ | @@ -459,14 +494,20 @@ Page({ | ||
459 | }); | 494 | }); |
460 | }, | 495 | }, |
461 | 496 | ||
462 | - | ||
463 | go_url:function (e) { | 497 | go_url:function (e) { |
464 | var url = e.currentTarget.dataset.url; | 498 | var url = e.currentTarget.dataset.url; |
465 | //var rq_data = JSON.stringify(this.data.rq_data); | 499 | //var rq_data = JSON.stringify(this.data.rq_data); |
466 | //url += `&o=${rq_data}`; | 500 | //url += `&o=${rq_data}`; |
467 | // console.log('url!!!=======<<<<', url); | 501 | // console.log('url!!!=======<<<<', url); |
468 | getApp().goto(url); | 502 | getApp().goto(url); |
469 | - } | 503 | + }, |
504 | + | ||
505 | + /*-- 和筛选相关的 --*/ | ||
506 | + bind_pk_sort(e){ com_fil.bind_pk_sort(e,this); }, | ||
507 | + set_screen(url){ com_fil.set_screen(url,this); }, | ||
508 | + filterGoods(e){ com_fil.filterGoods(e,this); }, | ||
509 | + open_more(e){ com_fil.open_more(e,this); }, | ||
510 | + clear_fil(){ com_fil.clear_fil(this); } | ||
470 | 511 | ||
471 | 512 | ||
472 | }); | 513 | }); |
473 | \ No newline at end of file | 514 | \ No newline at end of file |
pages/goods/goodsList/goodsList.wxml
@@ -27,30 +27,46 @@ | @@ -27,30 +27,46 @@ | ||
27 | 27 | ||
28 | <view class="nav-box"> | 28 | <view class="nav-box"> |
29 | <view class="nav"> | 29 | <view class="nav"> |
30 | - <navigator bindtap="changeTab" class="nav-item" data-href="sort" data-ad="{{adname}}">综合 | ||
31 | - <view class="ico-dg" wx:if="{{tabname=='sort'}}"> | ||
32 | - <image class="wh100" src="{{iurl}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image> | ||
33 | - <image class="wh100" src="{{iurl}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image> | ||
34 | - </view> | 30 | + |
31 | + | ||
32 | + <navigator class="nav-item"> | ||
33 | + <picker bindchange="bind_pk_sort" value="{{index}}" range="{{more_sort_arr}}" range-key="name"> | ||
34 | + <text bindtap="changeTab" wx:if="{{tabname=='on_time'}}">新品</text> | ||
35 | + <text wx:elif="{{tabname=='comment_count'}}">评论</text> | ||
36 | + <text wx:else>综合</text> | ||
37 | + </picker> | ||
38 | + <view class="arrow_down"></view> | ||
39 | + | ||
35 | </navigator> | 40 | </navigator> |
41 | + | ||
42 | + | ||
36 | <navigator bindtap="changeTab" class="nav-item" data-href="sales_sum" data-ad="{{adname}}">销量 | 43 | <navigator bindtap="changeTab" class="nav-item" data-href="sales_sum" data-ad="{{adname}}">销量 |
37 | - <view class="ico-dg" wx:if="{{tabname=='sales_sum'}}"> | ||
38 | - <image class="wh100" src="{{iurl}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image> | ||
39 | - <image class="wh100" src="{{iurl}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image> | 44 | +<!-- <view class="ico-dg" wx:if="{{tabname=='sales_sum'}}">--> |
45 | +<!-- <image class="wh100" src="{{iurl}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image>--> | ||
46 | +<!-- <image class="wh100" src="{{iurl}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image>--> | ||
47 | +<!-- </view>--> | ||
48 | + <view> | ||
49 | + <view class="arrow_up {{tabname=='sales_sum' && adname=='asc'?'on':'' }} "></view> | ||
50 | + <view class="arrow_down {{tabname=='sales_sum' && adname=='desc'?'on':'' }} "></view> | ||
40 | </view> | 51 | </view> |
41 | 52 | ||
42 | </navigator> | 53 | </navigator> |
43 | <navigator bindtap="changeTab" class="nav-item" data-href="final_price" data-ad="{{adname}}"> | 54 | <navigator bindtap="changeTab" class="nav-item" data-href="final_price" data-ad="{{adname}}"> |
44 | 价格 | 55 | 价格 |
45 | - <view class="ico-dg" wx:if="{{tabname=='final_price'}}"> | ||
46 | - <image class="wh100" src="{{iurl}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image> | ||
47 | - <image class="wh100" src="{{iurl}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image> | 56 | +<!-- <view class="ico-dg" wx:if="{{tabname=='final_price'}}">--> |
57 | +<!-- <image class="wh100" src="{{iurl}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image>--> | ||
58 | +<!-- <image class="wh100" src="{{iurl}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image>--> | ||
59 | +<!-- </view>--> | ||
60 | + <view> | ||
61 | + <view class="arrow_up {{tabname=='final_price' && adname=='asc'?'on':'' }} "></view> | ||
62 | + <view class="arrow_down {{tabname=='final_price' && adname=='desc'?'on':'' }} "></view> | ||
48 | </view> | 63 | </view> |
49 | </navigator> | 64 | </navigator> |
50 | - <!-- <navigator bindtap="openFilterModal" class="nav-item">筛选<view class="ico-filter"> | ||
51 | - <image class="wh100" src="{{iurl}}/miniapp/images/xx.png"></image> | ||
52 | - </view> | ||
53 | - </navigator> --> | 65 | + <navigator bindtap="openFilterModal" class="nav-item"> |
66 | + 筛选<view class="ico-filter"> | ||
67 | + <image class="wh100" src="{{iurl}}/miniapp/images/xx.png"></image> | ||
68 | + </view> | ||
69 | + </navigator> | ||
54 | 70 | ||
55 | <!-- <navigator class="nav-item search" url="/pages/goods/search/search"> | 71 | <!-- <navigator class="nav-item search" url="/pages/goods/search/search"> |
56 | <image class="wh100 search-img" src="{{iurl}}/miniapp/images/search.png"></image> | 72 | <image class="wh100 search-img" src="{{iurl}}/miniapp/images/search.png"></image> |
@@ -66,7 +82,7 @@ | @@ -66,7 +82,7 @@ | ||
66 | <view class="item-cont"> | 82 | <view class="item-cont"> |
67 | <view class="title ellipsis-2">{{item.goods_name}}</view> | 83 | <view class="title ellipsis-2">{{item.goods_name}}</view> |
68 | <!-- 判断是否有活动价 --> | 84 | <!-- 判断是否有活动价 --> |
69 | - <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_id>0 && item.prom_type!=7 }}"> | 85 | + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_id>0 && item.prom_type!=7 && item.prom_type!=10 }}"> |
70 | <view class="flex on"> | 86 | <view class="flex on"> |
71 | <!-- 活动价 --> | 87 | <!-- 活动价 --> |
72 | <view class="price"> | 88 | <view class="price"> |
@@ -74,7 +90,7 @@ | @@ -74,7 +90,7 @@ | ||
74 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> | 90 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> |
75 | <text wx:if="{{item.prom_price}}" class="rmb">{{item.prom_price}}</text> | 91 | <text wx:if="{{item.prom_price}}" class="rmb">{{item.prom_price}}</text> |
76 | </view> | 92 | </view> |
77 | -<!-- <view class="word-line xc-ash mgl10 rmb fs24">{{item.market_price}}</view>--> | 93 | + <view wx:if="{{is_retail_price}}" class="word-line xc-ash mgl10 rmb fs24">{{item.market_price}}</view> |
78 | </view> | 94 | </view> |
79 | 95 | ||
80 | 96 | ||
@@ -101,7 +117,7 @@ | @@ -101,7 +117,7 @@ | ||
101 | </view> | 117 | </view> |
102 | </view> | 118 | </view> |
103 | <view class="comment"> | 119 | <view class="comment"> |
104 | -<!-- <view class="word-line xc-ash rmb">{{item.market_price}}</view>--> | 120 | + <view wx:if="{{is_retail_price}}" class="word-line xc-ash rmb">{{item.market_price}}</view> |
105 | <view class="fs24 t-r"> | 121 | <view class="fs24 t-r"> |
106 | <span>评论{{item.comment_count}}</span> | 122 | <span>评论{{item.comment_count}}</span> |
107 | <span class="pdl30">已售{{item.sales_sum}}</span> | 123 | <span class="pdl30">已售{{item.sales_sum}}</span> |
@@ -123,7 +139,7 @@ | @@ -123,7 +139,7 @@ | ||
123 | <view wx:if="{{g_filter.get_card_price(item,card_list,0) && is_no_plus}}"> | 139 | <view wx:if="{{g_filter.get_card_price(item,card_list,0) && is_no_plus}}"> |
124 | <view class="flex ai-center"> | 140 | <view class="flex ai-center"> |
125 | <view class="price rmb">{{item.shop_price}}</view> | 141 | <view class="price rmb">{{item.shop_price}}</view> |
126 | -<!-- <view class="word-line xc-ash mk_price rmb">{{item.market_price}}</view>--> | 142 | + <view wx:if="{{is_retail_price}}" class="word-line xc-ash mk_price rmb">{{item.market_price}}</view> |
127 | </view> | 143 | </view> |
128 | <view class="comment"> | 144 | <view class="comment"> |
129 | <view class="flex ai-center"> | 145 | <view class="flex ai-center"> |
@@ -142,7 +158,7 @@ | @@ -142,7 +158,7 @@ | ||
142 | <block wx:else> | 158 | <block wx:else> |
143 | <view> | 159 | <view> |
144 | <view class="price rmb">{{item.shop_price}}</view> | 160 | <view class="price rmb">{{item.shop_price}}</view> |
145 | -<!-- <view class="word-line xc-ash rmb">{{item.market_price}}</view>--> | 161 | + <view wx:if="{{is_retail_price}}" class="word-line xc-ash rmb">{{item.market_price}}</view> |
146 | </view> | 162 | </view> |
147 | <!-- <view class="price">¥{{item.shop_price}}</view> --> | 163 | <!-- <view class="price">¥{{item.shop_price}}</view> --> |
148 | <view class="comment pdt10"> | 164 | <view class="comment pdt10"> |
@@ -157,7 +173,7 @@ | @@ -157,7 +173,7 @@ | ||
157 | <view wx:else> | 173 | <view wx:else> |
158 | <view class="flex ai-center"> | 174 | <view class="flex ai-center"> |
159 | <view class="price rmb">{{item.shop_price}}</view> | 175 | <view class="price rmb">{{item.shop_price}}</view> |
160 | -<!-- <view class="word-line xc-ash rmb fs24 mgl10">{{item.market_price}}</view>--> | 176 | + <view wx:if="{{is_retail_price}}" class="word-line xc-ash rmb fs24 mgl10">{{item.market_price}}</view> |
161 | </view> | 177 | </view> |
162 | 178 | ||
163 | <view class="comment pdt10"> | 179 | <view class="comment pdt10"> |
@@ -189,12 +205,12 @@ | @@ -189,12 +205,12 @@ | ||
189 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> | 205 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> |
190 | <text wx:if="{{item.prom_price}}" class="rmb">{{item.prom_price}}</text> | 206 | <text wx:if="{{item.prom_price}}" class="rmb">{{item.prom_price}}</text> |
191 | </view> | 207 | </view> |
192 | -<!-- <view class="word-line xc-ash mgl10 rmb fs24">{{item.market_price}}</view>--> | 208 | + <view wx:if="{{is_retail_price}}" class="word-line xc-ash mgl10 rmb fs24">{{item.market_price}}</view> |
193 | </view> | 209 | </view> |
194 | 210 | ||
195 | 211 | ||
196 | <view class="comment pdt10"> | 212 | <view class="comment pdt10"> |
197 | - <!-- <view class="word-line xc-ash">¥{{item.market_price}}</view> --> | 213 | +<!-- <view class="word-line xc-ash">¥{{item.market_price}}</view>--> |
198 | <view class="fs24 t-r"> | 214 | <view class="fs24 t-r"> |
199 | <span>评论{{item.comment_count}}</span> | 215 | <span>评论{{item.comment_count}}</span> |
200 | <span class="pdl30">已售{{item.sales_sum}}</span> | 216 | <span class="pdl30">已售{{item.sales_sum}}</span> |
@@ -216,7 +232,7 @@ | @@ -216,7 +232,7 @@ | ||
216 | </view> | 232 | </view> |
217 | </view> | 233 | </view> |
218 | <view class="comment"> | 234 | <view class="comment"> |
219 | -<!-- <view class="word-line xc-ash rmb">{{item.market_price}}</view>--> | 235 | + <view wx:if="{{is_retail_price}}" class="word-line xc-ash rmb">{{item.market_price}}</view> |
220 | <view class="fs24 t-r"> | 236 | <view class="fs24 t-r"> |
221 | <span>评论{{item.comment_count}}</span> | 237 | <span>评论{{item.comment_count}}</span> |
222 | <span class="pdl30">已售{{item.sales_sum}}</span> | 238 | <span class="pdl30">已售{{item.sales_sum}}</span> |
@@ -226,7 +242,7 @@ | @@ -226,7 +242,7 @@ | ||
226 | <block wx:else> | 242 | <block wx:else> |
227 | <view class="price rmb">{{item.shop_price}}</view> | 243 | <view class="price rmb">{{item.shop_price}}</view> |
228 | <view class="comment"> | 244 | <view class="comment"> |
229 | -<!-- <view class="word-line xc-ash rmb">{{item.market_price}}</view>--> | 245 | + <view wx:if="{{is_retail_price}}" class="word-line xc-ash rmb">{{item.market_price}}</view> |
230 | <view class="fs24 t-r"> | 246 | <view class="fs24 t-r"> |
231 | <span>评论{{item.comment_count}}</span> | 247 | <span>评论{{item.comment_count}}</span> |
232 | <span class="pdl30">已售{{item.sales_sum}}</span> | 248 | <span class="pdl30">已售{{item.sales_sum}}</span> |
@@ -238,7 +254,7 @@ | @@ -238,7 +254,7 @@ | ||
238 | <view wx:if="{{g_filter.get_card_price(item,card_list,0) && is_no_plus}}"> | 254 | <view wx:if="{{g_filter.get_card_price(item,card_list,0) && is_no_plus}}"> |
239 | <view class="flex ai-center"> | 255 | <view class="flex ai-center"> |
240 | <view class="price rmb">{{item.shop_price}}</view> | 256 | <view class="price rmb">{{item.shop_price}}</view> |
241 | -<!-- <view class="word-line xc-ash mk_price rmb">{{item.market_price}}</view>--> | 257 | + <view wx:if="{{is_retail_price}}" class="word-line xc-ash mk_price rmb">{{item.market_price}}</view> |
242 | </view> | 258 | </view> |
243 | <view class="comment"> | 259 | <view class="comment"> |
244 | <view class="flex ai-center"> | 260 | <view class="flex ai-center"> |
@@ -257,7 +273,7 @@ | @@ -257,7 +273,7 @@ | ||
257 | <block wx:else> | 273 | <block wx:else> |
258 | <view> | 274 | <view> |
259 | <view class="price rmb">{{item.shop_price}}</view> | 275 | <view class="price rmb">{{item.shop_price}}</view> |
260 | -<!-- <view class="word-line xc-ash rmb">{{item.market_price}}</view>--> | 276 | + <view wx:if="{{is_retail_price}}" class="word-line xc-ash rmb">{{item.market_price}}</view> |
261 | </view> | 277 | </view> |
262 | <!-- <view class="price">¥{{item.shop_price}}</view> --> | 278 | <!-- <view class="price">¥{{item.shop_price}}</view> --> |
263 | <view class="comment pdt10"> | 279 | <view class="comment pdt10"> |
@@ -272,7 +288,7 @@ | @@ -272,7 +288,7 @@ | ||
272 | <view wx:else> | 288 | <view wx:else> |
273 | <view class=""> | 289 | <view class=""> |
274 | <view class="price rmb">{{item.shop_price}}</view> | 290 | <view class="price rmb">{{item.shop_price}}</view> |
275 | -<!-- <view class="word-line xc-ash rmb fs24 mgl10">{{item.market_price}}</view>--> | 291 | + <view wx:if="{{is_retail_price}}" class="word-line xc-ash rmb fs24 mgl10">{{item.market_price}}</view> |
276 | </view> | 292 | </view> |
277 | 293 | ||
278 | <view class="comment pdt10"> | 294 | <view class="comment pdt10"> |
@@ -297,42 +313,8 @@ | @@ -297,42 +313,8 @@ | ||
297 | <navigator bindtap="go_url" class="lookat" data-url="/pages/index/index/index">回到首页</navigator> | 313 | <navigator bindtap="go_url" class="lookat" data-url="/pages/index/index/index">回到首页</navigator> |
298 | </view> | 314 | </view> |
299 | </view> | 315 | </view> |
300 | -<view hidden="{{!openFilterModal}}"> | ||
301 | - <view bindtap="closeFilterModal" class="cover-layer"></view> | ||
302 | - <view class="filter-modal"> | ||
303 | - <icon bindtap="closeFilterModal" class="modal-close" color="gray" size="22" type="cancel"></icon> | ||
304 | - <button bindtap="restoreData" class="viewall-btn">显示全部分类</button> | ||
305 | - <view class="filter-box" wx:for="{{requestData.filter_spec}}" wx:key="{{index}}"> | ||
306 | - <view class="filter-name">{{item.name}}</view> | ||
307 | - <view class="filter-items"> | ||
308 | - <view bindtap="filterGoods" class="filter-item" data-href="{{item.href}}" wx:for="{{item.item}}" wx:key="{{index}}"> | ||
309 | - {{item.name}}</view> | ||
310 | - </view> | ||
311 | - </view> | ||
312 | 316 | ||
313 | - <view class="filter-box" wx:for="{{requestData.filter_attr}}" wx:key="{{index}}"> | ||
314 | - <view class="filter-name">{{item.name}}</view> | ||
315 | - <view class="filter-items"> | ||
316 | - <view bindtap="filterGoods" class="filter-item" data-href="{{item.href}}" wx:for="{{item.item}}" wx:key="{{index}}"> | ||
317 | - {{item.name}}</view> | ||
318 | - </view> | ||
319 | - </view> | ||
320 | - <view class="filter-box" wx:if="{{requestData.filter_brand.length>0}}"> | ||
321 | - <view class="filter-name">相关品牌</view> | ||
322 | - <view class="filter-items"> | ||
323 | - <view bindtap="filterGoods" class="filter-item" data-href="{{item.href}}" wx:for="{{requestData.filter_brand}}" wx:key="{{index}}"> | ||
324 | - {{item.name}}</view> | ||
325 | - </view> | ||
326 | - </view> | ||
327 | - <view class="filter-box" wx:if="{{requestData.filter_price.length>0}}"> | ||
328 | - <view class="filter-name">价格区间</view> | ||
329 | - <view class="filter-items"> | ||
330 | - <view bindtap="filterGoods" class="filter-item" data-href="{{item.href}}" wx:for="{{requestData.filter_price}}" wx:key="{{index}}"> | ||
331 | - {{item.name}}</view> | ||
332 | - </view> | ||
333 | - </view> | ||
334 | - </view> | ||
335 | - </view> | 317 | +<include src="../com_screen.wxml" /> |
336 | 318 | ||
337 | <share_box id="share"></share_box> | 319 | <share_box id="share"></share_box> |
338 | <view class="t-c fs32" wx:if="{{err_txt}}"> | 320 | <view class="t-c fs32" wx:if="{{err_txt}}"> |
pages/goods/goodsList/goodsList.wxss
@@ -165,54 +165,6 @@ page { | @@ -165,54 +165,6 @@ page { | ||
165 | /* padding-right: 30rpx; */ | 165 | /* padding-right: 30rpx; */ |
166 | } | 166 | } |
167 | 167 | ||
168 | -.filter-modal { | ||
169 | - position: fixed; | ||
170 | - left: 150rpx; | ||
171 | - top: 0; | ||
172 | - right: 0; | ||
173 | - bottom: 0; | ||
174 | - z-index: 20; | ||
175 | - background-color: white; | ||
176 | - overflow-x: hidden; | ||
177 | - padding-bottom: 30rpx; | ||
178 | -} | ||
179 | - | ||
180 | -.filter-box { | ||
181 | - box-sizing: border-box; | ||
182 | - width: 100%; | ||
183 | - font-size: 28rpx; | ||
184 | - padding: 20rpx; | ||
185 | -} | ||
186 | - | ||
187 | -.filter-name { | ||
188 | - width: 100%; | ||
189 | - padding: 20rpx 0; | ||
190 | - word-break: keep-all; | ||
191 | - white-space: nowrap; | ||
192 | - text-overflow: ellipsis; | ||
193 | - overflow: hidden; | ||
194 | - font-size: 30rpx; | ||
195 | -} | ||
196 | - | ||
197 | -.filter-items { | ||
198 | - width: 100%; | ||
199 | -} | ||
200 | - | ||
201 | -.filter-item { | ||
202 | - float: left; | ||
203 | - width: fit-content; | ||
204 | - max-width: 500rpx; | ||
205 | - word-break: keep-all; | ||
206 | - white-space: nowrap; | ||
207 | - text-overflow: ellipsis; | ||
208 | - overflow: hidden; | ||
209 | - padding: 10rpx; | ||
210 | - border-radius: 10rpx; | ||
211 | - border: 1rpx #ddd solid; | ||
212 | - margin: 0 10rpx 10rpx 0; | ||
213 | - background-color: #fdfdfd; | ||
214 | - color: #666; | ||
215 | -} | ||
216 | 168 | ||
217 | .viewall-btn { | 169 | .viewall-btn { |
218 | margin-top: 20rpx; | 170 | margin-top: 20rpx; |
@@ -342,3 +294,5 @@ page { | @@ -342,3 +294,5 @@ page { | ||
342 | color: white; | 294 | color: white; |
343 | padding: 20rpx 50rpx; | 295 | padding: 20rpx 50rpx; |
344 | } | 296 | } |
297 | + | ||
298 | +@import '../com_screen.wxss'; | ||
345 | \ No newline at end of file | 299 | \ No newline at end of file |
pages/goods/search/search.js
@@ -4,6 +4,7 @@ var t = function (t) { | @@ -4,6 +4,7 @@ var t = function (t) { | ||
4 | }; | 4 | }; |
5 | }(require("../../../utils/LoadMore.js")), ut = require("../../../utils/util.js"), | 5 | }(require("../../../utils/LoadMore.js")), ut = require("../../../utils/util.js"), |
6 | a = getApp(), e = new t.default(), rq = a.request, oo = a.globalData.setting; | 6 | a = getApp(), e = new t.default(), rq = a.request, oo = a.globalData.setting; |
7 | +const com_fil = require("../com_screen.js"); | ||
7 | 8 | ||
8 | Page({ | 9 | Page({ |
9 | data: { | 10 | data: { |
@@ -16,6 +17,7 @@ Page({ | @@ -16,6 +17,7 @@ Page({ | ||
16 | openSearchModal: !1, | 17 | openSearchModal: !1, |
17 | baseUrl: "/api/weshop/goods/page?1=1", | 18 | baseUrl: "/api/weshop/goods/page?1=1", |
18 | requestUrl: "", | 19 | requestUrl: "", |
20 | + old_req_url:'', | ||
19 | //hotWords: [ [ "手机", "小米", "iphone" ], [ "三星", "华为", "冰箱" ] ] | 21 | //hotWords: [ [ "手机", "小米", "iphone" ], [ "三星", "华为", "冰箱" ] ] |
20 | hotWords: null, | 22 | hotWords: null, |
21 | is_no_plus: 1, | 23 | is_no_plus: 1, |
@@ -27,6 +29,17 @@ Page({ | @@ -27,6 +29,17 @@ Page({ | ||
27 | is_his: 0, | 29 | is_his: 0, |
28 | hiddenClear: true, | 30 | hiddenClear: true, |
29 | fliter_flag: false, | 31 | fliter_flag: false, |
32 | + | ||
33 | + more_sort_arr:[ | ||
34 | + {name:'综合',value:'sort'}, | ||
35 | + {name:'新品',value:'on_time'}, | ||
36 | + {name:'评论',value:'comment_count'}, | ||
37 | + ], | ||
38 | + | ||
39 | + fil_cate_state:0, | ||
40 | + fil_nation_state:0, | ||
41 | + fil_brand_state:0, | ||
42 | + fil_price_state:0, | ||
30 | }, | 43 | }, |
31 | 44 | ||
32 | onLoad: function (t) { | 45 | onLoad: function (t) { |
@@ -86,34 +99,11 @@ Page({ | @@ -86,34 +99,11 @@ Page({ | ||
86 | var swithc_list = rs.switch_list; | 99 | var swithc_list = rs.switch_list; |
87 | var sw_arr = JSON.parse(swithc_list); | 100 | var sw_arr = JSON.parse(swithc_list); |
88 | //---如果后台又开等级卡的开关--- | 101 | //---如果后台又开等级卡的开关--- |
89 | - if (sw_arr.rank_switch && sw_arr.rank_switch == "2") { | ||
90 | - th.setData({ rank_switch: true }); | ||
91 | - var user = getApp().globalData.userInfo; | ||
92 | - var ti = setInterval(function () { | ||
93 | - if (!user) return false; | ||
94 | - clearInterval(ti); | ||
95 | - //---回调卡的列表--- | ||
96 | - th.getPlusCardType(function (ob) { | ||
97 | - th.setData({ card_list: ob.card_list }); | ||
98 | - if (user.card_field) { | ||
99 | - var str = user['card_expiredate'].replace(/-/g, '/'); | ||
100 | - var end = new Date(str); | ||
101 | - end = Date.parse(end) / 1000; | ||
102 | - var now = ut.gettimestamp(); | ||
103 | - | ||
104 | - //--- 判断是等级会员,且在有效期范围内 --- | ||
105 | - if (user.card_field && now < end) { | ||
106 | - var card_name = ob.name_map.get(user.card_field); | ||
107 | - if (card_name && card_name.length > 7) card_name = card_name.substring(0, 8); | ||
108 | - th.setData({ card_field: user.card_field, card_name: card_name, card_list: ob.card_list }); | ||
109 | - } | ||
110 | - } | ||
111 | - }) | ||
112 | - }, 500) | 102 | + ut.get_plus_name_price(sw_arr,th); |
103 | + if(sw_arr.is_retail_price){ | ||
104 | + th.setData({is_retail_price:1}); | ||
113 | } | 105 | } |
114 | 106 | ||
115 | - | ||
116 | - | ||
117 | }) | 107 | }) |
118 | //e.init(this, "", "requestData"); | 108 | //e.init(this, "", "requestData"); |
119 | var url = this.data.baseUrl; | 109 | var url = this.data.baseUrl; |
@@ -387,6 +377,10 @@ Page({ | @@ -387,6 +377,10 @@ Page({ | ||
387 | if ("string" != typeof t || "" == t) return a.showWarning("请输入关键词"); | 377 | if ("string" != typeof t || "" == t) return a.showWarning("请输入关键词"); |
388 | this.data.key_str = t; | 378 | this.data.key_str = t; |
389 | this.resetData(); | 379 | this.resetData(); |
380 | + | ||
381 | + this.data.old_req_url=this.data.baseUrl + "&key_str=" + encodeURIComponent(t); | ||
382 | + | ||
383 | + this.set_screen(this.data.baseUrl + "&key_str=" + encodeURIComponent(t)) | ||
390 | this.requestSearch(this.data.baseUrl + "&key_str=" + encodeURIComponent(t)); | 384 | this.requestSearch(this.data.baseUrl + "&key_str=" + encodeURIComponent(t)); |
391 | this.historyRecord(); | 385 | this.historyRecord(); |
392 | }, | 386 | }, |
@@ -571,4 +565,13 @@ Page({ | @@ -571,4 +565,13 @@ Page({ | ||
571 | openSearchModal: true, | 565 | openSearchModal: true, |
572 | }); | 566 | }); |
573 | }, | 567 | }, |
568 | + | ||
569 | + /*-- 和筛选相关的 --*/ | ||
570 | + bind_pk_sort(e){ com_fil.bind_pk_sort(e,this); }, | ||
571 | + set_screen(url){ com_fil.set_screen(url,this); }, | ||
572 | + filterGoods(e){ com_fil.filterGoods(e,this); }, | ||
573 | + open_more(e){ com_fil.open_more(e,this); }, | ||
574 | + clear_fil(){ com_fil.clear_fil(this); } | ||
575 | + | ||
576 | + | ||
574 | }); | 577 | }); |
575 | \ No newline at end of file | 578 | \ No newline at end of file |
pages/goods/search/search.wxml
@@ -46,28 +46,32 @@ | @@ -46,28 +46,32 @@ | ||
46 | <block wx:if="{{!openSearchModal}}"> | 46 | <block wx:if="{{!openSearchModal}}"> |
47 | 47 | ||
48 | <view class="nav flex"> | 48 | <view class="nav flex"> |
49 | - <navigator bindtap="changeTab" class="nav-item f1" data-href="sort" data-ad="{{adname}}">综合 | ||
50 | - <view class="ico-dg" wx:if="{{tabname=='sort'}}"> | ||
51 | - <image class="wh100" src="{{url}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image> | ||
52 | - <image class="wh100" src="{{url}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image> | ||
53 | - </view> | 49 | + <navigator bindtap="changeTab" class="nav-item f1" > |
50 | + <picker bindchange="bind_pk_sort" value="{{index}}" range="{{more_sort_arr}}" range-key="name"> | ||
51 | + <text bindtap="changeTab" wx:if="{{tabname=='on_time'}}">新品</text> | ||
52 | + <text wx:elif="{{tabname=='comment_count'}}">评论</text> | ||
53 | + <text wx:else>综合</text> | ||
54 | + </picker> | ||
55 | + <view class="arrow_down"></view> | ||
54 | </navigator> | 56 | </navigator> |
57 | + | ||
58 | + | ||
55 | <navigator bindtap="changeTab" class="nav-item f1" data-href="sales_sum" data-ad="{{adname}}">销量 | 59 | <navigator bindtap="changeTab" class="nav-item f1" data-href="sales_sum" data-ad="{{adname}}">销量 |
56 | - <view class="ico-dg" wx:if="{{tabname=='sales_sum'}}"> | ||
57 | - <image class="wh100" src="{{url}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image> | ||
58 | - <image class="wh100" src="{{url}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image> | ||
59 | - </view> | 60 | + <view> |
61 | + <view class="arrow_up {{tabname=='sales_sum' && adname=='asc'?'on':'' }} "></view> | ||
62 | + <view class="arrow_down {{tabname=='sales_sum' && adname=='desc'?'on':'' }} "></view> | ||
63 | + </view> | ||
60 | </navigator> | 64 | </navigator> |
61 | <navigator bindtap="changeTab" class="nav-item f1" data-href="final_price" data-ad="{{adname}}">价格 | 65 | <navigator bindtap="changeTab" class="nav-item f1" data-href="final_price" data-ad="{{adname}}">价格 |
62 | - <view class="ico-dg" wx:if="{{tabname=='final_price'}}"> | ||
63 | - <image class="wh100" src="{{url}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image> | ||
64 | - <image class="wh100" src="{{url}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image> | ||
65 | - </view> | 66 | + <view> |
67 | + <view class="arrow_up {{tabname=='final_price' && adname=='asc'?'on':'' }} "></view> | ||
68 | + <view class="arrow_down {{tabname=='final_price' && adname=='desc'?'on':'' }} "></view> | ||
69 | + </view> | ||
66 | </navigator> | 70 | </navigator> |
67 | - <!-- <navigator bindtap="openFilterModal" class="nav-item">筛选<view class="ico-filter"> | 71 | + <navigator bindtap="openFilterModal" class="nav-item f1">筛选<view class="ico-filter"> |
68 | <image class="wh100" src="{{url}}/miniapp/images/xx.png"></image> | 72 | <image class="wh100" src="{{url}}/miniapp/images/xx.png"></image> |
69 | </view> | 73 | </view> |
70 | - </navigator> --> | 74 | + </navigator> |
71 | <!-- <navigator bindtap="openSearchModal" class="nav-item nav-search"> | 75 | <!-- <navigator bindtap="openSearchModal" class="nav-item nav-search"> |
72 | <image class="wh100 search-img" src="{{url}}/miniapp/images/search.png"></image> | 76 | <image class="wh100 search-img" src="{{url}}/miniapp/images/search.png"></image> |
73 | </navigator> --> | 77 | </navigator> --> |
@@ -83,7 +87,7 @@ | @@ -83,7 +87,7 @@ | ||
83 | <view class="item-cont"> | 87 | <view class="item-cont"> |
84 | <view class="title ellipsis-2">{{item.goods_name}}</view> | 88 | <view class="title ellipsis-2">{{item.goods_name}}</view> |
85 | <!-- 判断是否有活动价,小程序没有有团购和拼单 --> | 89 | <!-- 判断是否有活动价,小程序没有有团购和拼单 --> |
86 | - <block wx:if="{{(item.prom_price>0 || item.prom_integral) && item.prom_id>0 && item.prom_type!=7}}"> | 90 | + <block wx:if="{{(item.prom_price>0 || item.prom_integral) && item.prom_id>0 && item.prom_type!=7 && item.prom_type!=10}}"> |
87 | <!-- 活动价 --> | 91 | <!-- 活动价 --> |
88 | <view class="price"> | 92 | <view class="price"> |
89 | <text wx:if="{{item.prom_integral}}">{{item.prom_integral}}积分</text> | 93 | <text wx:if="{{item.prom_integral}}">{{item.prom_integral}}积分</text> |
@@ -111,14 +115,14 @@ | @@ -111,14 +115,14 @@ | ||
111 | </view> | 115 | </view> |
112 | </view> | 116 | </view> |
113 | <view class="comment flex jc_sb"> | 117 | <view class="comment flex jc_sb"> |
114 | -<!-- <view class="word-line xc-ash">¥{{item.market_price}}</view>--> | 118 | + <view wx:if="{{is_retail_price}}" class="word-line xc-ash">¥{{item.market_price}}</view> |
115 | <view>评论{{item.comment_count}} 已售{{item.sales_sum}}</view> | 119 | <view>评论{{item.comment_count}} 已售{{item.sales_sum}}</view> |
116 | </view> | 120 | </view> |
117 | </block> | 121 | </block> |
118 | <block wx:else> | 122 | <block wx:else> |
119 | <view class="price">¥{{item.shop_price}}</view> | 123 | <view class="price">¥{{item.shop_price}}</view> |
120 | <view class="comment flex jc_sb"> | 124 | <view class="comment flex jc_sb"> |
121 | -<!-- <view class="word-line xc-ash">¥{{item.market_price}}</view>--> | 125 | + <view wx:if="{{is_retail_price}}" class="word-line xc-ash">¥{{item.market_price}}</view> |
122 | <view>评论{{item.comment_count}} 已售{{item.sales_sum}}</view> | 126 | <view>评论{{item.comment_count}} 已售{{item.sales_sum}}</view> |
123 | </view> | 127 | </view> |
124 | </block> | 128 | </block> |
@@ -127,7 +131,7 @@ | @@ -127,7 +131,7 @@ | ||
127 | <block wx:if="{{g_filter.get_card_price(item,card_list,0) && is_no_plus}}"> | 131 | <block wx:if="{{g_filter.get_card_price(item,card_list,0) && is_no_plus}}"> |
128 | <view class="flex ai-center"> | 132 | <view class="flex ai-center"> |
129 | <view class="price">¥{{item.shop_price}}</view> | 133 | <view class="price">¥{{item.shop_price}}</view> |
130 | -<!-- <view class="word-line xc-ash mk_price">¥{{item.market_price}}</view>--> | 134 | + <view wx:if="{{is_retail_price}}" class="word-line xc-ash mk_price">¥{{item.market_price}}</view> |
131 | </view> | 135 | </view> |
132 | <view class="comment flex jc_sb"> | 136 | <view class="comment flex jc_sb"> |
133 | <view class="flex ai_center"> | 137 | <view class="flex ai_center"> |
@@ -145,7 +149,7 @@ | @@ -145,7 +149,7 @@ | ||
145 | <block wx:else> | 149 | <block wx:else> |
146 | <view class="price">¥{{item.shop_price}}</view> | 150 | <view class="price">¥{{item.shop_price}}</view> |
147 | <view class="comment flex jc_sb"> | 151 | <view class="comment flex jc_sb"> |
148 | -<!-- <view class="word-line xc-ash">¥{{item.market_price}}</view>--> | 152 | + <view wx:if="{{is_retail_price}}" class="word-line xc-ash">¥{{item.market_price}}</view> |
149 | <view>评论{{item.comment_count}} 已售{{item.sales_sum}}</view> | 153 | <view>评论{{item.comment_count}} 已售{{item.sales_sum}}</view> |
150 | </view> | 154 | </view> |
151 | </block> | 155 | </block> |
@@ -154,7 +158,7 @@ | @@ -154,7 +158,7 @@ | ||
154 | <block wx:else> | 158 | <block wx:else> |
155 | <view class="price">¥{{item.shop_price}}</view> | 159 | <view class="price">¥{{item.shop_price}}</view> |
156 | <view class="comment flex jc_sb"> | 160 | <view class="comment flex jc_sb"> |
157 | -<!-- <view class="word-line xc-ash">¥{{item.market_price}}</view>--> | 161 | + <view wx:if="{{is_retail_price}}" class="word-line xc-ash">¥{{item.market_price}}</view> |
158 | <view>评论{{item.comment_count}} 已售{{item.sales_sum}}</view> | 162 | <view>评论{{item.comment_count}} 已售{{item.sales_sum}}</view> |
159 | </view> | 163 | </view> |
160 | </block> | 164 | </block> |
@@ -173,38 +177,5 @@ | @@ -173,38 +177,5 @@ | ||
173 | 177 | ||
174 | </block> | 178 | </block> |
175 | </view> | 179 | </view> |
176 | -<view hidden="{{!openFilterModal}}"> | ||
177 | - <view bindtap="closeFilterModal" class="cover-layer"></view> | ||
178 | - <view class="filter-modal"> | ||
179 | - <icon bindtap="closeFilterModal" class="modal-close" color="gray" size="22" type="cancel"></icon> | ||
180 | - <button bindtap="restoreData" class="viewall-btn">显示全部分类</button> | ||
181 | - <view class="filter-box" wx:for="{{requestData.filter_spec}}" wx:key="{{index}}"> | ||
182 | - <view class="filter-name">{{item.name}}</view> | ||
183 | - <view class="filter-items"> | ||
184 | - <view bindtap="filterGoods" class="filter-item" data-href="{{item.href}}" wx:for="{{item.item}}" wx:key="{{index}}"> | ||
185 | - {{item.name}}</view> | ||
186 | - </view> | ||
187 | - </view> | ||
188 | - <view class="filter-box" wx:for="{{requestData.filter_attr}}" wx:key="{{index}}"> | ||
189 | - <view class="filter-name">{{item.name}}</view> | ||
190 | - <view class="filter-items"> | ||
191 | - <view bindtap="filterGoods" class="filter-item" data-href="{{item.href}}" wx:for="{{item.item}}" wx:key="{{index}}"> | ||
192 | - {{item.name}}</view> | ||
193 | - </view> | ||
194 | - </view> | ||
195 | - <view class="filter-box" wx:if="{{requestData.filter_brand.length>0}}"> | ||
196 | - <view class="filter-name">相关品牌</view> | ||
197 | - <view class="filter-items"> | ||
198 | - <view bindtap="filterGoods" class="filter-item" data-href="{{item.href}}" wx:for="{{requestData.filter_brand}}" wx:key="{{index}}"> | ||
199 | - {{item.name}}</view> | ||
200 | - </view> | ||
201 | - </view> | ||
202 | - <view class="filter-box" wx:if="{{requestData.filter_price.length>0}}"> | ||
203 | - <view class="filter-name">价格区间</view> | ||
204 | - <view class="filter-items"> | ||
205 | - <view bindtap="filterGoods" class="filter-item" data-href="{{item.href}}" wx:for="{{requestData.filter_price}}" wx:key="{{index}}"> | ||
206 | - {{item.name}}</view> | ||
207 | - </view> | ||
208 | - </view> | ||
209 | - </view> | ||
210 | -</view> | ||
211 | \ No newline at end of file | 180 | \ No newline at end of file |
181 | + | ||
182 | +<include src="../com_screen.wxml" /> | ||
212 | \ No newline at end of file | 183 | \ No newline at end of file |
pages/goods/search/search.wxss
@@ -114,54 +114,6 @@ | @@ -114,54 +114,6 @@ | ||
114 | margin-top: 4rpx; | 114 | margin-top: 4rpx; |
115 | } | 115 | } |
116 | 116 | ||
117 | -.filter-modal { | ||
118 | - position: fixed; | ||
119 | - left: 150rpx; | ||
120 | - top: 0; | ||
121 | - right: 0; | ||
122 | - bottom: 0; | ||
123 | - z-index: 20; | ||
124 | - background-color: white; | ||
125 | - overflow-x: hidden; | ||
126 | - padding-bottom: 30rpx; | ||
127 | -} | ||
128 | - | ||
129 | -.filter-box { | ||
130 | - box-sizing: border-box; | ||
131 | - width: 100%; | ||
132 | - font-size: 28rpx; | ||
133 | - padding: 20rpx; | ||
134 | -} | ||
135 | - | ||
136 | -.filter-name { | ||
137 | - width: 100%; | ||
138 | - padding: 20rpx 0; | ||
139 | - word-break: keep-all; | ||
140 | - white-space: nowrap; | ||
141 | - text-overflow: ellipsis; | ||
142 | - overflow: hidden; | ||
143 | - font-size: 30rpx; | ||
144 | -} | ||
145 | - | ||
146 | -.filter-items { | ||
147 | - width: 100%; | ||
148 | -} | ||
149 | - | ||
150 | -.filter-item { | ||
151 | - float: left; | ||
152 | - width: fit-content; | ||
153 | - max-width: 500rpx; | ||
154 | - word-break: keep-all; | ||
155 | - white-space: nowrap; | ||
156 | - text-overflow: ellipsis; | ||
157 | - overflow: hidden; | ||
158 | - padding: 10rpx; | ||
159 | - border-radius: 10rpx; | ||
160 | - border: 1rpx #ddd solid; | ||
161 | - margin: 0 10rpx 10rpx 0; | ||
162 | - background-color: #fdfdfd; | ||
163 | - color: #666; | ||
164 | -} | ||
165 | 117 | ||
166 | .viewall-btn { | 118 | .viewall-btn { |
167 | margin-top: 20rpx; | 119 | margin-top: 20rpx; |
@@ -439,4 +391,7 @@ | @@ -439,4 +391,7 @@ | ||
439 | width: 80%; | 391 | width: 80%; |
440 | z-index: 1000; | 392 | z-index: 1000; |
441 | transition: all .5s; | 393 | transition: all .5s; |
442 | -} | ||
443 | \ No newline at end of file | 394 | \ No newline at end of file |
395 | +} | ||
396 | + | ||
397 | + | ||
398 | +@import '../com_screen.wxss'; | ||
444 | \ No newline at end of file | 399 | \ No newline at end of file |
pages/index/index/index.js
@@ -86,6 +86,7 @@ Page({ | @@ -86,6 +86,7 @@ Page({ | ||
86 | is_ok_h5: 0, //判断要不要显示关注二维码 | 86 | is_ok_h5: 0, //判断要不要显示关注二维码 |
87 | 87 | ||
88 | container: null, | 88 | container: null, |
89 | + is_retail_price:0, | ||
89 | }, | 90 | }, |
90 | 91 | ||
91 | 92 | ||
@@ -125,6 +126,12 @@ Page({ | @@ -125,6 +126,12 @@ Page({ | ||
125 | 126 | ||
126 | var th = this; | 127 | var th = this; |
127 | getApp().getConfig2(function (config2) { | 128 | getApp().getConfig2(function (config2) { |
129 | + var swithc_list = config2.switch_list; | ||
130 | + var sw_arr = JSON.parse(swithc_list); | ||
131 | + if(sw_arr.is_retail_price){ | ||
132 | + th.setData({is_retail_price:1}); | ||
133 | + } | ||
134 | + | ||
128 | if (config2 && config2.is_overdue == 1) { | 135 | if (config2 && config2.is_overdue == 1) { |
129 | getApp().promiseGet("/store/storemoduleendtime/page?store_id=" + os.stoid + "&type=5", {}).then(res => { | 136 | getApp().promiseGet("/store/storemoduleendtime/page?store_id=" + os.stoid + "&type=5", {}).then(res => { |
130 | var o = res; | 137 | var o = res; |
@@ -361,7 +368,8 @@ Page({ | @@ -361,7 +368,8 @@ Page({ | ||
361 | console.log(this.data.isTemplate, '首页'); | 368 | console.log(this.data.isTemplate, '首页'); |
362 | 369 | ||
363 | if (!this.data.isTemplate) { | 370 | if (!this.data.isTemplate) { |
364 | - var pre_data = { store_id: os.stoid, is_end: 0, timetype: 1, isuse: 1 }; | 371 | + // timetype: 1 仅查询已预售 置空查询全部, |
372 | + var pre_data = { store_id: os.stoid, is_end: 0, isuse: 1 }; | ||
365 | if (user_id) { | 373 | if (user_id) { |
366 | pre_data.user_id = user_id; | 374 | pre_data.user_id = user_id; |
367 | } | 375 | } |
@@ -370,7 +378,25 @@ Page({ | @@ -370,7 +378,25 @@ Page({ | ||
370 | data: pre_data, | 378 | data: pre_data, |
371 | success: function (e) { | 379 | success: function (e) { |
372 | if (e.data.code == 0 && e.data.data.pageData && e.data.data.pageData.length > 0) { | 380 | if (e.data.code == 0 && e.data.data.pageData && e.data.data.pageData.length > 0) { |
373 | - var pre_data = e.data.data.pageData; | 381 | + var pre_data = e.data.data.pageData; |
382 | + //当前时间戳 | ||
383 | + var st = ut.gettimestamp(); | ||
384 | + | ||
385 | + pre_data.forEach(function (val, ind) { | ||
386 | + | ||
387 | + if (val.user_price) val.price = val.user_price; | ||
388 | + if (val.start_time > st) { | ||
389 | + pre_data[ind].status = 0; | ||
390 | + } else if (val.end_time > st) { | ||
391 | + pre_data[ind].status = 1; | ||
392 | + } else { | ||
393 | + pre_data[ind].status = 2; | ||
394 | + } | ||
395 | + | ||
396 | + // if (val.buy_num >= val.goods_num) { | ||
397 | + // pre_data[ind].status = 2; | ||
398 | + // } | ||
399 | + }); | ||
374 | var arr = new Array(); | 400 | var arr = new Array(); |
375 | //--三个三个一组--- | 401 | //--三个三个一组--- |
376 | for (var i = 0; i < pre_data.length; i += 3) { | 402 | for (var i = 0; i < pre_data.length; i += 3) { |
@@ -770,7 +796,7 @@ Page({ | @@ -770,7 +796,7 @@ Page({ | ||
770 | let goodsGroupArr = this.data.goodsGroupArr | 796 | let goodsGroupArr = this.data.goodsGroupArr |
771 | if (this.data.isTemplate && goodsGroupArr.length >0) { | 797 | if (this.data.isTemplate && goodsGroupArr.length >0) { |
772 | goodsGroupArr.map(item=>{ | 798 | goodsGroupArr.map(item=>{ |
773 | - this[item].automore() | 799 | + if(this[item]) this[item].automore() |
774 | }) | 800 | }) |
775 | } | 801 | } |
776 | 802 |
pages/index/index/index.wxml
@@ -145,7 +145,7 @@ | @@ -145,7 +145,7 @@ | ||
145 | </navigator> | 145 | </navigator> |
146 | <view class="seckill-list"> | 146 | <view class="seckill-list"> |
147 | <swiper class="s_prom" indicator-dots="{{false}}" bindchange="flashSwiperChange"> | 147 | <swiper class="s_prom" indicator-dots="{{false}}" bindchange="flashSwiperChange"> |
148 | - <swiper-item wx:for="{{saleGoods}}" wx:key="{{index}}" class="p_swiper" wx:key="saleGoods" style="padding: 0; margin-left: 10rpx"> | 148 | + <swiper-item wx:for="{{saleGoods}}" class="p_swiper" wx:key="saleGoods" style="padding: 0; margin-left: 10rpx"> |
149 | <navigator style="flex-shrink: 0;width: 247rpx" class="nav" hover-class="none" url="{{aitem.goods_type == 0 ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id):('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id )}}" wx:for="{{item}}" wx:key="item" wx:for-item="aitem" wx:for-index="aind"> | 149 | <navigator style="flex-shrink: 0;width: 247rpx" class="nav" hover-class="none" url="{{aitem.goods_type == 0 ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id):('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id )}}" wx:for="{{item}}" wx:key="item" wx:for-item="aitem" wx:for-index="aind"> |
150 | <view class="imgview"> | 150 | <view class="imgview"> |
151 | <image src="{{url+aitem.original_img}}" mode="aspectFill" lazy-load="true" data-errorimg="saleGoods[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3" data-img="{{aitem.original_img}}"></image> | 151 | <image src="{{url+aitem.original_img}}" mode="aspectFill" lazy-load="true" data-errorimg="saleGoods[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3" data-img="{{aitem.original_img}}"></image> |
@@ -158,6 +158,7 @@ | @@ -158,6 +158,7 @@ | ||
158 | <!-- <view class="red-co mar-top10 is_seckill_height"> --> | 158 | <!-- <view class="red-co mar-top10 is_seckill_height"> --> |
159 | <view class="co-red mar-top10"> | 159 | <view class="co-red mar-top10"> |
160 | <text class="fs20">¥</text>{{aitem.price}} | 160 | <text class="fs20">¥</text>{{aitem.price}} |
161 | + <text wx:if="{{is_retail_price}}" class="un_line">¥{{aitem.market_price}}</text> | ||
161 | </view> | 162 | </view> |
162 | </navigator> | 163 | </navigator> |
163 | 164 | ||
@@ -189,14 +190,19 @@ | @@ -189,14 +190,19 @@ | ||
189 | <navigator bindtap="go_pre" class="nav" hover-class="none" | 190 | <navigator bindtap="go_pre" class="nav" hover-class="none" |
190 | data-url="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&pre_id={{aitem.id}}" | 191 | data-url="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&pre_id={{aitem.id}}" |
191 | wx:for="{{item}}" wx:key="item" wx:for-item="aitem" wx:for-index="aind"> | 192 | wx:for="{{item}}" wx:key="item" wx:for-item="aitem" wx:for-index="aind"> |
192 | - <view class="imgview presell"> | 193 | + <!-- <view class="imgview presell"> --> |
194 | + <view class="imgview"> | ||
193 | <image src="{{url+aitem.original_img}}" mode="aspectFill" lazy-load="true" data-errorimg="preGoods[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3" data-img="{{aitem.original_img}}"></image> | 195 | <image src="{{url+aitem.original_img}}" mode="aspectFill" lazy-load="true" data-errorimg="preGoods[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3" data-img="{{aitem.original_img}}"></image> |
196 | + | ||
197 | + <image wx:if="{{aitem.status==0}}" class="status_img" src="{{url}}/miniapp/images/miao/yure.png"/> | ||
198 | + <image wx:elif="{{aitem.status==1}}" class="status_img" src="{{url}}/miniapp/images/miao/going.png"/> | ||
199 | + <image wx:else="{{aitem.status==2}}" class="status_img" src="{{url}}/miniapp/images/miao/mend.png"/> | ||
194 | </view> | 200 | </view> |
195 | <view class="ellipsis-2 mar-top10" style="height: 75rpx; width: 200rpx">{{aitem.act_name}}</view> | 201 | <view class="ellipsis-2 mar-top10" style="height: 75rpx; width: 200rpx">{{aitem.act_name}}</view> |
196 | <view class="co-red mar-top10 flex jc_sb ali-c"> | 202 | <view class="co-red mar-top10 flex jc_sb ali-c"> |
197 | <view> | 203 | <view> |
198 | <text><text class="fs20">¥</text>{{aitem.presell_price}}</text> | 204 | <text><text class="fs20">¥</text>{{aitem.presell_price}}</text> |
199 | -<!-- <text class="un_line">¥{{aitem.shop_price}}</text>--> | 205 | + <text wx:if="{{is_retail_price}}" class="un_line">¥{{aitem.market_price}}</text> |
200 | </view> | 206 | </view> |
201 | <view class="btn-buy">去抢购</view> | 207 | <view class="btn-buy">去抢购</view> |
202 | </view> | 208 | </view> |
@@ -233,7 +239,7 @@ | @@ -233,7 +239,7 @@ | ||
233 | <view> | 239 | <view> |
234 | <view class="flex ai-center"> | 240 | <view class="flex ai-center"> |
235 | <text class="rmb c-red">{{filter.price(item.group_price)}}</text> | 241 | <text class="rmb c-red">{{filter.price(item.group_price)}}</text> |
236 | -<!-- <view class="del fs22 c-a pdl10"><text class="rmb">{{item.shop_price}}</text></view>--> | 242 | + <view wx:if="{{is_retail_price}}" class="del fs22 c-a pdl10"><text class="rmb">{{item.market_price}}</text></view> |
237 | </view> | 243 | </view> |
238 | <view class="flex jc_sb"> | 244 | <view class="flex jc_sb"> |
239 | <progress class="pdr20 f1 progress" percent="{{filter.percent(item.num, item.group_num)}}" activeColor="#FF6768" backgroundColor="#d0d0d0" border-radius="12" stroke-width="12" data-content="{{item.num}}人已参团"></progress> | 245 | <progress class="pdr20 f1 progress" percent="{{filter.percent(item.num, item.group_num)}}" activeColor="#FF6768" backgroundColor="#d0d0d0" border-radius="12" stroke-width="12" data-content="{{item.num}}人已参团"></progress> |
@@ -319,7 +325,7 @@ | @@ -319,7 +325,7 @@ | ||
319 | <view class="fs40 flex xc-top15 {{aitem.is_team_tepy==0?'blue_c ai-bas':' red-co ai-bas'}}"> | 325 | <view class="fs40 flex xc-top15 {{aitem.is_team_tepy==0?'blue_c ai-bas':' red-co ai-bas'}}"> |
320 | <text class="fs28 {{aitem.is_team_tepy==0?'martop4':''}}">¥</text> | 326 | <text class="fs28 {{aitem.is_team_tepy==0?'martop4':''}}">¥</text> |
321 | <text style="margin-left:-5rpx">{{aitem.price}}</text> | 327 | <text style="margin-left:-5rpx">{{aitem.price}}</text> |
322 | -<!-- <span class="underline {{type==0?'martop18':''}}">¥{{aitem.shop_price}}</span>--> | 328 | + <span wx:if="{{is_retail_price}}" class="underline {{type==0?'martop18':''}}">¥{{aitem.market_price}}</span> |
323 | </view> | 329 | </view> |
324 | 330 | ||
325 | </view> | 331 | </view> |
@@ -395,13 +401,13 @@ | @@ -395,13 +401,13 @@ | ||
395 | <view> | 401 | <view> |
396 | <block wx:for="{{template_arr}}" > | 402 | <block wx:for="{{template_arr}}" > |
397 | <block wx:if="{{item.content.is_top==1}}"> | 403 | <block wx:if="{{item.content.is_top==1}}"> |
398 | - <view style="height:100rpx"></view> | 404 | + <view style="height:91rpx"></view> |
399 | </block> | 405 | </block> |
400 | </block> | 406 | </block> |
401 | 407 | ||
402 | </view> | 408 | </view> |
403 | 409 | ||
404 | - <block wx:for="{{template_arr}}" wx:key="{{index}}"> | 410 | + <block wx:for="{{template_arr}}" wx:key="index"> |
405 | <view> | 411 | <view> |
406 | <!--导航--> | 412 | <!--导航--> |
407 | <block wx:if="{{item.ename=='nav'}}"> | 413 | <block wx:if="{{item.ename=='nav'}}"> |
pages/user/assistance/friend_assistance.js
@@ -21,14 +21,16 @@ Page({ | @@ -21,14 +21,16 @@ Page({ | ||
21 | userId: 0, //任务用户的ID | 21 | userId: 0, //任务用户的ID |
22 | s_num: 0, //分享的人数 | 22 | s_num: 0, //分享的人数 |
23 | taskId:0, //活动从表ID | 23 | taskId:0, //活动从表ID |
24 | - helpId:0, | 24 | + helpId:0, |
25 | + invalidTime:0, //任务失效时间戳 | ||
25 | }, | 26 | }, |
26 | 27 | ||
27 | /** | 28 | /** |
28 | * 生命周期函数--监听页面加载 | 29 | * 生命周期函数--监听页面加载 |
29 | */ | 30 | */ |
30 | onLoad: function(options) { | 31 | onLoad: function(options) { |
31 | - | 32 | + console.log('助力——————————————————————————————'); |
33 | + console.log(options); | ||
32 | var th = this; | 34 | var th = this; |
33 | 35 | ||
34 | var nav_b = th.selectComponent("#nav_b"); //组件的id | 36 | var nav_b = th.selectComponent("#nav_b"); //组件的id |
@@ -38,7 +40,7 @@ Page({ | @@ -38,7 +40,7 @@ Page({ | ||
38 | if (options.userId) this.data.userId = options.userId; | 40 | if (options.userId) this.data.userId = options.userId; |
39 | //任务是不是为空 | 41 | //任务是不是为空 |
40 | if (this.data.tasking == 0 || this.data.tasking == undefined) { | 42 | if (this.data.tasking == 0 || this.data.tasking == undefined) { |
41 | - this.data.tasking = decodeURIComponent(options.scene); | 43 | + this.data.tasking = decodeURIComponent(options.scene); |
42 | } | 44 | } |
43 | 45 | ||
44 | }, | 46 | }, |
@@ -73,10 +75,19 @@ Page({ | @@ -73,10 +75,19 @@ Page({ | ||
73 | storeId: os.stoid | 75 | storeId: os.stoid |
74 | } | 76 | } |
75 | }).then(res => { | 77 | }).then(res => { |
78 | + console.log('任务时间-------------------------'); | ||
79 | + console.log(res); | ||
76 | if (res.data.code == 0) { | 80 | if (res.data.code == 0) { |
81 | + | ||
77 | th.data.userId = res.data.data.userId; | 82 | th.data.userId = res.data.data.userId; |
78 | th.data.taskId = res.data.data.helpTaskId; | 83 | th.data.taskId = res.data.data.helpTaskId; |
79 | - th.data.helpId=res.data.data.helpFormId; | 84 | + th.data.helpId=res.data.data.helpFormId; |
85 | + // th.invalidTime = res.data.data.invalidTime | ||
86 | + // th.setData({ | ||
87 | + // invalidTime:1662138310 | ||
88 | + // }) | ||
89 | + let openTime = res.data.data.openTime | ||
90 | + th.getInvalidTime(openTime) | ||
80 | //获取活动的时间 | 91 | //获取活动的时间 |
81 | return getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", { | 92 | return getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", { |
82 | data: { | 93 | data: { |
@@ -110,9 +121,45 @@ Page({ | @@ -110,9 +121,45 @@ Page({ | ||
110 | }) | 121 | }) |
111 | 122 | ||
112 | } | 123 | } |
113 | - }, | 124 | + }, |
125 | + getInvalidTime(openTime=0){ | ||
126 | + let th = this | ||
127 | + rq.get("/api/weshop/marketing/giftbag/helpinfo/get", { | ||
128 | + data: { | ||
129 | + storeId: os.stoid, | ||
130 | + // userId: user_id, | ||
131 | + taskId: th.data.taskId, | ||
132 | + helpId:th.data.helpId | ||
133 | + }, | ||
134 | + success: function (res) { | ||
135 | + console.log('获取失效时间------'); | ||
136 | + console.log(res); | ||
137 | + if (res.data.code == 0) { | ||
138 | + let validTime=res.data.data.validTime | ||
139 | + let invalidTime =0 | ||
140 | + if (openTime && validTime > 0) { | ||
141 | + invalidTime = openTime*1 + validTime*60*60 | ||
142 | + } | ||
143 | + th.setData({ | ||
144 | + invalidTime | ||
145 | + }); | ||
146 | + } | ||
147 | + } | ||
148 | + }) | ||
149 | + }, | ||
114 | //点击开启礼盒 | 150 | //点击开启礼盒 |
115 | cklie_button: function() { | 151 | cklie_button: function() { |
152 | + //判断任务是否失效 | ||
153 | + let invalidTime = this.data.invalidTime | ||
154 | + let nowTime = parseInt((new Date().getTime())/1000) | ||
155 | + if (invalidTime > 0) { | ||
156 | + let disTime = invalidTime - nowTime | ||
157 | + if (disTime <=0) { | ||
158 | + getApp().showWarning("该任务已失效"); | ||
159 | + return | ||
160 | + } | ||
161 | + } | ||
162 | + | ||
116 | var th = this; | 163 | var th = this; |
117 | //--先判断会员状态-- | 164 | //--先判断会员状态-- |
118 | var user_info = getApp().globalData.userInfo; | 165 | var user_info = getApp().globalData.userInfo; |
pages/user/assistance/task_assistance.js
@@ -7,6 +7,7 @@ var e = getApp(), | @@ -7,6 +7,7 @@ var e = getApp(), | ||
7 | s = e.globalData.setting, | 7 | s = e.globalData.setting, |
8 | os = s, | 8 | os = s, |
9 | app_d = e.globalData; | 9 | app_d = e.globalData; |
10 | + var invalidSetTime = null | ||
10 | var regeneratorRuntime = require('../../../utils/runtime.js'); | 11 | var regeneratorRuntime = require('../../../utils/runtime.js'); |
11 | Page({ | 12 | Page({ |
12 | /** | 13 | /** |
@@ -65,7 +66,15 @@ Page({ | @@ -65,7 +66,15 @@ Page({ | ||
65 | zltime: "", //助力时间 | 66 | zltime: "", //助力时间 |
66 | djs: "", //定时器的显示 | 67 | djs: "", //定时器的显示 |
67 | //*********************************************end | 68 | //*********************************************end |
68 | - | 69 | + //距离失效------ |
70 | + invalidTime:0, | ||
71 | + invalidState:true, | ||
72 | + invalidObj:{ | ||
73 | + h:'00', | ||
74 | + m:'00', | ||
75 | + s:'00' | ||
76 | + }, | ||
77 | + //-------------- | ||
69 | // Hei: 0, | 78 | // Hei: 0, |
70 | max_sw_height: 0, | 79 | max_sw_height: 0, |
71 | 80 | ||
@@ -76,7 +85,7 @@ Page({ | @@ -76,7 +85,7 @@ Page({ | ||
76 | font_color:'', | 85 | font_color:'', |
77 | }, | 86 | }, |
78 | 87 | ||
79 | - /** | 88 | + /** |
80 | * 生命周期函数--监听页面加载 | 89 | * 生命周期函数--监听页面加载 |
81 | */ | 90 | */ |
82 | onLoad: function (options) { | 91 | onLoad: function (options) { |
@@ -443,6 +452,12 @@ Page({ | @@ -443,6 +452,12 @@ Page({ | ||
443 | }, | 452 | }, |
444 | //判断是否有领取任务 获取正在进行中的任务 | 453 | //判断是否有领取任务 获取正在进行中的任务 |
445 | get_user_task: function () { | 454 | get_user_task: function () { |
455 | + invalidSetTime ? clearTimeout(invalidSetTime) :'' | ||
456 | + this.setData({ | ||
457 | + invalidObj:{ h:'00', m:'00',s:'00'}, | ||
458 | + invalidState:true, | ||
459 | + invalidTime:0 | ||
460 | + }) | ||
446 | var user_id = getApp().globalData.user_id; | 461 | var user_id = getApp().globalData.user_id; |
447 | var th = this; | 462 | var th = this; |
448 | var aitem = th.data.aitem; | 463 | var aitem = th.data.aitem; |
@@ -452,18 +467,83 @@ Page({ | @@ -452,18 +467,83 @@ Page({ | ||
452 | data: { | 467 | data: { |
453 | storeId: os.stoid, | 468 | storeId: os.stoid, |
454 | userId: user_id, | 469 | userId: user_id, |
455 | - taskId: taskid | 470 | + taskId: taskid |
456 | }, | 471 | }, |
457 | success: function (res) { | 472 | success: function (res) { |
473 | + console.log('任务---------------------------------------'); | ||
474 | + console.log(res); | ||
458 | if (res.data.code == 0) { | 475 | if (res.data.code == 0) { |
459 | var is_usertask = res.data.data; | 476 | var is_usertask = res.data.data; |
460 | th.setData({ | 477 | th.setData({ |
461 | - is_user_task: is_usertask | 478 | + is_user_task: is_usertask, |
462 | }); | 479 | }); |
480 | + th.getInvalidTime(taskid) | ||
463 | } | 481 | } |
464 | } | 482 | } |
465 | }) | 483 | }) |
466 | }, | 484 | }, |
485 | + //获取失效时间 | ||
486 | + getInvalidTime(taskid){ | ||
487 | + let th = this | ||
488 | + rq.get("/api/weshop/marketing/giftbag/helpinfo/get", { | ||
489 | + data: { | ||
490 | + storeId: os.stoid, | ||
491 | + // userId: user_id, | ||
492 | + taskId: taskid, | ||
493 | + helpId:th.data.help_id | ||
494 | + }, | ||
495 | + success: function (res) { | ||
496 | + console.log('获取失效时间------'); | ||
497 | + console.log(res); | ||
498 | + if (res.data.code == 0) { | ||
499 | + let openTime =th.data.is_user_task ? th.data.is_user_task.openTime : 0 | ||
500 | + let validTime=res.data.data.validTime | ||
501 | + let invalidTime =0 | ||
502 | + if (openTime && validTime > 0) { | ||
503 | + invalidTime = openTime*1 + validTime*60*60 | ||
504 | + } | ||
505 | + th.setData({ | ||
506 | + invalidTime | ||
507 | + }); | ||
508 | + | ||
509 | + th.invalid_count_down() //失效倒计时 | ||
510 | + } | ||
511 | + } | ||
512 | + }) | ||
513 | + }, | ||
514 | + // 距离失效倒计时 | ||
515 | + invalid_count_down(){ | ||
516 | + | ||
517 | + let invalidTime = this.data.invalidTime | ||
518 | + let nowTime = parseInt((new Date().getTime())/1000) | ||
519 | + if (invalidTime) { | ||
520 | + let disTime = invalidTime - nowTime | ||
521 | + if (disTime>0) { | ||
522 | + let h = parseInt(disTime/(60*60)) | ||
523 | + h = h*1 < 10 ? '0'+ h : h | ||
524 | + let m= parseInt((disTime/60)%60) | ||
525 | + m = m*1 < 10 ? '0' + m : m | ||
526 | + let s = disTime % 60 | ||
527 | + s = s*1 < 10 ? '0'+s : s | ||
528 | + this.setData({ | ||
529 | + 'invalidObj.h':h, | ||
530 | + 'invalidObj.m':m, | ||
531 | + 'invalidObj.s':s, | ||
532 | + }) | ||
533 | + invalidSetTime=setTimeout(this.invalid_count_down,1000) | ||
534 | + }else{ | ||
535 | + this.setData({ | ||
536 | + invalidObj:{ h:'00', m:'00',s:'00'}, | ||
537 | + invalidState:false | ||
538 | + }) | ||
539 | + } | ||
540 | + }else{ | ||
541 | + this.setData({ | ||
542 | + invalidObj:{h:'00', m:'00',s:'00'} | ||
543 | + }) | ||
544 | + } | ||
545 | + }, | ||
546 | + | ||
467 | //获取助力活动参与的人数 | 547 | //获取助力活动参与的人数 |
468 | get_user_task_num: function () { | 548 | get_user_task_num: function () { |
469 | var th = this; | 549 | var th = this; |
@@ -686,11 +766,13 @@ Page({ | @@ -686,11 +766,13 @@ Page({ | ||
686 | ///二微码 | 766 | ///二微码 |
687 | var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + | 767 | var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + |
688 | os.stoid + "?sceneValue=" + scene + "&pageValue=pages/user/assistance/friend_assistance"; | 768 | os.stoid + "?sceneValue=" + scene + "&pageValue=pages/user/assistance/friend_assistance"; |
689 | - //读取文件成功则OK-- | 769 | + console.log('二维码路径'); |
770 | + console.log(path3); | ||
771 | + //读取文件成功则OK-- | ||
690 | wx.getImageInfo({ | 772 | wx.getImageInfo({ |
691 | src: path3, | 773 | src: path3, |
692 | success: function (res) { | 774 | success: function (res) { |
693 | - | 775 | + |
694 | var ewm_path = res.path; // | 776 | var ewm_path = res.path; // |
695 | //var act_time="2019.06.26 - 2019.07.02"; //活动的时间 | 777 | //var act_time="2019.06.26 - 2019.07.02"; //活动的时间 |
696 | var bg_time = ut.formar_no_full(th.data.dynamic.beginDate,'.'); | 778 | var bg_time = ut.formar_no_full(th.data.dynamic.beginDate,'.'); |
@@ -939,6 +1021,10 @@ Page({ | @@ -939,6 +1021,10 @@ Page({ | ||
939 | 1021 | ||
940 | //好友猜一猜 | 1022 | //好友猜一猜 |
941 | save_share: function (e) { | 1023 | save_share: function (e) { |
1024 | + if (!this.data.invalidState) { | ||
1025 | + getApp().showWarning("该任务已失效"); | ||
1026 | + return | ||
1027 | + } | ||
942 | var th = this; | 1028 | var th = this; |
943 | var aitem = this.data.aitem; //任务的数据集 | 1029 | var aitem = this.data.aitem; //任务的数据集 |
944 | var sw_index = this.data.sw_index; //轮播的下标 | 1030 | var sw_index = this.data.sw_index; //轮播的下标 |
@@ -987,7 +1073,7 @@ Page({ | @@ -987,7 +1073,7 @@ Page({ | ||
987 | var block = th.data.block; | 1073 | var block = th.data.block; |
988 | if (images) { | 1074 | if (images) { |
989 | th.data.head_pic_arr.length = 0; | 1075 | th.data.head_pic_arr.length = 0; |
990 | - for (var i in images) {s | 1076 | + for (var i in images) { |
991 | var img_path = images[i].headPic; | 1077 | var img_path = images[i].headPic; |
992 | img_path=img_path.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); | 1078 | img_path=img_path.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); |
993 | img_path=img_path.replace("https://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); | 1079 | img_path=img_path.replace("https://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); |
pages/user/assistance/task_assistance.wxml
@@ -60,10 +60,11 @@ | @@ -60,10 +60,11 @@ | ||
60 | 好友拆一拆 | 60 | 好友拆一拆 |
61 | </view> | 61 | </view> |
62 | <!-- 任务超时失效 --> | 62 | <!-- 任务超时失效 --> |
63 | - <!-- <view wx:if="{{is_user_task!=null&&is_user_task.status==0}}"> | ||
64 | - <text>距离失效</text> | ||
65 | - <view><text>15</text>:<text>45</text>:<text>10</text></view> | ||
66 | - </view> --> | 63 | + <view class="invalid" wx:if="{{ is_user_task!=null && is_user_task.status==0 && invalidTime !=0}}"> |
64 | + <text>距离失效:</text> | ||
65 | + <view class="invalid_info" wx:if="{{invalidState}}"><text>{{invalidObj.h}}</text>:<text>{{invalidObj.m}}</text>:<text>{{invalidObj.s}}</text></view> | ||
66 | + <view class="invalid_info" wx:else>该任务已失效</view> | ||
67 | + </view> | ||
67 | 68 | ||
68 | <view wx:if="{{is_user_task!=null&&is_user_task.status==1}}" class="task_clike fs40 t-c flex-center" data-libaoid="{{is_user_task.helpListGiftBagId}}"data-taskingid="{{is_user_task.id}}" bindtap="redeem_now" | 69 | <view wx:if="{{is_user_task!=null&&is_user_task.status==1}}" class="task_clike fs40 t-c flex-center" data-libaoid="{{is_user_task.helpListGiftBagId}}"data-taskingid="{{is_user_task.id}}" bindtap="redeem_now" |
69 | style="background-color:#{{btn_color ? btn_color:'fbda0e'}};color:{{font_color?('#'+font_color):'white'}};"> | 70 | style="background-color:#{{btn_color ? btn_color:'fbda0e'}};color:{{font_color?('#'+font_color):'white'}};"> |
pages/user/assistance/task_assistance.wxss
@@ -256,3 +256,25 @@ line-height: 48rpx; | @@ -256,3 +256,25 @@ line-height: 48rpx; | ||
256 | image{ | 256 | image{ |
257 | -webkit-touch-callout:none | 257 | -webkit-touch-callout:none |
258 | } | 258 | } |
259 | +.invalid{ | ||
260 | + width: 100%; | ||
261 | + height: 80rpx; | ||
262 | + margin: 20rpx 0; | ||
263 | + display: flex; | ||
264 | + justify-content: center; | ||
265 | + align-items: center; | ||
266 | + color: #fff; | ||
267 | + | ||
268 | +} | ||
269 | +.invalid_info{ | ||
270 | + width: 180rpx; | ||
271 | + padding: 10rpx; | ||
272 | + color: #000; | ||
273 | + background-color: #fff; | ||
274 | + margin-left: 20rpx; | ||
275 | + border: 1rpx solid #fff; | ||
276 | + border-radius: 10rpx; | ||
277 | + display: flex; | ||
278 | + align-items: center; | ||
279 | + justify-content: space-around; | ||
280 | +} | ||
259 | \ No newline at end of file | 281 | \ No newline at end of file |
pages/user/index/index.wxml
@@ -90,7 +90,7 @@ | @@ -90,7 +90,7 @@ | ||
90 | <image class="xc-icon" src="{{iurl}}/miniapp/images/user/user_vip.png"></image> | 90 | <image class="xc-icon" src="{{iurl}}/miniapp/images/user/user_vip.png"></image> |
91 | <view class="member fs28 "> 加入plus会员预计可省3031元</view> | 91 | <view class="member fs28 "> 加入plus会员预计可省3031元</view> |
92 | </view> | 92 | </view> |
93 | - <view class="xc-opening-button t-c" data-url="/pages/user/cardinfo/cardinfo" bindtap="goto"> | 93 | + <view class="xc-opening-button t-c" data-url="/packageE/pages/user/cardinfo/cardinfo" bindtap="goto"> |
94 | <view class="xc-opening fs28">立即续费</view> | 94 | <view class="xc-opening fs28">立即续费</view> |
95 | </view> | 95 | </view> |
96 | </view> | 96 | </view> |
pages/user/plus/plus.js
@@ -64,10 +64,27 @@ Page({ | @@ -64,10 +64,27 @@ Page({ | ||
64 | }) | 64 | }) |
65 | } | 65 | } |
66 | }) | 66 | }) |
67 | + | ||
68 | + | ||
69 | + //二维码的带入 | ||
67 | var fir_leader = options.scene; | 70 | var fir_leader = options.scene; |
68 | - if (fir_leader) that.setData({ | ||
69 | - fir_leader: fir_leader | ||
70 | - }) | 71 | + if (fir_leader){ |
72 | + | ||
73 | + that.setData({ | ||
74 | + fir_leader: fir_leader | ||
75 | + }) | ||
76 | + | ||
77 | + //-- user_id代过来免登录 -- | ||
78 | + getApp().globalData.first_leader = fir_leader; | ||
79 | + //调用接口判断是不是会员 | ||
80 | + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + fir_leader, {}).then(res => { | ||
81 | + if (res.data.code == 0) { | ||
82 | + getApp().globalData.guide_id = res.data.data.id; | ||
83 | + } | ||
84 | + }) | ||
85 | + } | ||
86 | + | ||
87 | + | ||
71 | //--先判断会员状态-- | 88 | //--先判断会员状态-- |
72 | var user_info = getApp().globalData.userInfo; | 89 | var user_info = getApp().globalData.userInfo; |
73 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | 90 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { |
@@ -157,7 +174,7 @@ Page({ | @@ -157,7 +174,7 @@ Page({ | ||
157 | success: function (e) { | 174 | success: function (e) { |
158 | var userInfo = e.data.data; | 175 | var userInfo = e.data.data; |
159 | if (userInfo['card_field'] && !getApp().globalData.is_card_back) { | 176 | if (userInfo['card_field'] && !getApp().globalData.is_card_back) { |
160 | - var u_url = "/pages/user/cardinfo/cardinfo"; | 177 | + var u_url = "/packageE/pages/user/cardinfo/cardinfo"; |
161 | wx.reLaunch({ | 178 | wx.reLaunch({ |
162 | url: u_url | 179 | url: u_url |
163 | }) | 180 | }) |
@@ -484,7 +501,7 @@ Page({ | @@ -484,7 +501,7 @@ Page({ | ||
484 | }); | 501 | }); |
485 | return false; | 502 | return false; |
486 | } else { | 503 | } else { |
487 | - var u_url = "/pages/user/cardinfo/cardinfo"; | 504 | + var u_url = "/packageE/pages/user/cardinfo/cardinfo"; |
488 | wx.reLaunch({ | 505 | wx.reLaunch({ |
489 | url: u_url | 506 | url: u_url |
490 | }) | 507 | }) |
utils/barcode.js
@@ -197,7 +197,7 @@ function stringToCode128(text) { | @@ -197,7 +197,7 @@ function stringToCode128(text) { | ||
197 | //ok some type of shift is nessecary | 197 | //ok some type of shift is nessecary |
198 | if (shifter != -1) { | 198 | if (shifter != -1) { |
199 | result.push(shifter); | 199 | result.push(shifter); |
200 | - result.push(codeValue(chr2)); | 200 | + result.push(codeValue(chr1)); |
201 | } | 201 | } |
202 | else { | 202 | else { |
203 | if (currcs == CODESET.C) { | 203 | if (currcs == CODESET.C) { |
utils/util.js
@@ -697,7 +697,52 @@ module.exports = { | @@ -697,7 +697,52 @@ module.exports = { | ||
697 | } | 697 | } |
698 | }) | 698 | }) |
699 | }, | 699 | }, |
700 | + //检验等级价格 | ||
701 | + get_plus_name_price:function(sw_arr,th){ | ||
702 | + var that=this; | ||
703 | + //---如果后台又开等级卡的开关--- | ||
704 | + if (sw_arr.rank_switch && sw_arr.rank_switch == "2") { | ||
705 | + th.setData({ | ||
706 | + rank_switch: true | ||
707 | + }); | ||
708 | + //---回调卡的列表--- | ||
709 | + th.getPlusCardType(function (ob) { | ||
710 | + th.setData({ | ||
711 | + card_list: ob.card_list | ||
712 | + }); | ||
713 | + var ti = setInterval(function () { | ||
714 | + var user = getApp().globalData.userInfo; | ||
715 | + if (!user) return false; | ||
716 | + clearInterval(ti); | ||
717 | + | ||
718 | + if (user.card_field && user['card_expiredate']) { | ||
719 | + var str = user['card_expiredate'].replace(/-/g, '/'); | ||
720 | + var end = new Date(str); | ||
721 | + end = Date.parse(end) / 1000; | ||
722 | + var now = that.gettimestamp(); | ||
723 | + | ||
724 | + //--- 判断是等级会员,且在有效期范围内 --- | ||
725 | + if (user.card_field && now < end) { | ||
726 | + var card_name = ob.name_map.get(user.card_field); | ||
727 | + if (card_name && card_name.length > 6) card_name = card_name.substring(0, 6); | ||
728 | + var is_near_date = 0; | ||
729 | + if (end - now < 60 * 60 * 30 * 24) is_near_date = 1; //如果小于30天 | ||
730 | + | ||
731 | + th.setData({ | ||
732 | + card_field: user.card_field, | ||
733 | + card_name: card_name, | ||
734 | + card_list: ob.card_list, | ||
735 | + is_near_date:is_near_date | ||
736 | + }); | ||
737 | + } | ||
738 | + | ||
739 | + } | ||
740 | + | ||
741 | + }, 500) | ||
742 | + }) | ||
700 | 743 | ||
744 | + } | ||
745 | + }, | ||
701 | 746 | ||
702 | unserialize: unserialize, | 747 | unserialize: unserialize, |
703 | _throttle:_throttle, | 748 | _throttle:_throttle, |