Commit 33d5eb9b8f37e5cf1781b88873ef45c626292f4a

Authored by 后端研发-苏明海
2 parents 72a4209b 1f50def2

Merge branch 'test' into 'qa'

Test

See merge request !1126
Showing 75 changed files with 4503 additions and 2253 deletions
@@ -52,6 +52,8 @@ App({ @@ -52,6 +52,8 @@ App({
52 config2: null, //门店配置 52 config2: null, //门店配置
53 code: null, 53 code: null,
54 user_id:null,// qa-6519858,// 54 user_id:null,// qa-6519858,//
  55 + // user_id:6520314,// qa-6519858,//
  56 + // user_id:14148118,// qa-6519858,//
55 buy_now: null, 57 buy_now: null,
56 picklist: null, //门店列表 58 picklist: null, //门店列表
57 wuliuprice: null, //物流价格表 59 wuliuprice: null, //物流价格表
@@ -1197,5 +1199,66 @@ App({ @@ -1197,5 +1199,66 @@ App({
1197 }; 1199 };
1198 }, 1200 },
1199 1201
  1202 + //跳转视频号
  1203 + openChannelsActivity(obj){
  1204 + if (!obj.finderUserName) {
  1205 + wx.showToast({
  1206 + title: '参数缺少,跳转失败',
  1207 + duration: 2000,
  1208 + });
  1209 + }
  1210 + console.log('视频号参数:')
  1211 + console.log(obj)
  1212 + if (obj.video_type==1) { //1是直播 2 是 视频
  1213 + wx.getChannelsLiveInfo({
  1214 + finderUserName:obj.finderUserName,
  1215 + success:(res)=>{
  1216 + let {feedId ,status,nonceId} = res
  1217 + if (true || status == 2) {
  1218 + wx.openChannelsLive({
  1219 + finderUserName:obj.finderUserName,
  1220 + feedId,
  1221 + nonceId,
  1222 + success:()=>{
  1223 + console.log('进入直播间成功')
  1224 + },
  1225 + fail:(error)=>{
  1226 + console.log('进入直播间失败')
  1227 + console.log(error)
  1228 + }
  1229 + })
  1230 + }
  1231 + },
  1232 + fail:(error)=>{
  1233 + console.log('跳转失败1')
  1234 + console.log(error)
  1235 + wx.showModal({
  1236 + title: '提示',
  1237 + content: '获取直播失败:'+error.err_code,
  1238 + showCancel:false,
  1239 + success (res) {
  1240 + if (res.confirm) {
  1241 + console.log('用户点击确定')
  1242 + } else if (res.cancel) {
  1243 + console.log('用户点击取消')
  1244 + }
  1245 + }
  1246 + })
  1247 + }
  1248 + })
  1249 + }else{
  1250 + wx.openChannelsActivity({
  1251 + finderUserName:obj.finderUserName,
  1252 + feedId:obj.feedId,
  1253 + success:()=>{
  1254 + console.log('跳转成功')
  1255 + },
  1256 + fail:(error)=>{
  1257 + console.log('跳转失败')
  1258 + console.log(error)
  1259 + }
  1260 + })
  1261 + }
  1262 + },
1200 1263
1201 }); 1264 });
app.json
@@ -22,7 +22,6 @@ @@ -22,7 +22,6 @@
22 "pages/user/return_goods_info/return_goods_info", 22 "pages/user/return_goods_info/return_goods_info",
23 "pages/user/return_goods/return_goods", 23 "pages/user/return_goods/return_goods",
24 "pages/user/express/express", 24 "pages/user/express/express",
25 - "pages/user/get_user_info/get_user_info",  
26 "pages/activity/seckill_list/seckill_list", 25 "pages/activity/seckill_list/seckill_list",
27 "pages/activity/pind_list/pind_list", 26 "pages/activity/pind_list/pind_list",
28 "pages/team/team_success/team_success", 27 "pages/team/team_success/team_success",
@@ -34,12 +33,11 @@ @@ -34,12 +33,11 @@
34 33
35 "pages/user/userqy/userqy", 34 "pages/user/userqy/userqy",
36 "pages/user/user_spsy/user_spsy", 35 "pages/user/user_spsy/user_spsy",
37 - "pages/user/user_fw/user_fw", 36 +
38 "pages/user/grow_value/grow_value", 37 "pages/user/grow_value/grow_value",
39 "pages/payment/pay_success/pay_success", 38 "pages/payment/pay_success/pay_success",
40 "pages/user/plus/plus", 39 "pages/user/plus/plus",
41 "pages/user/cardinfo/cardinfo", 40 "pages/user/cardinfo/cardinfo",
42 - "pages/user/Detailed/Detailed",  
43 "pages/user/my_service/appment_main", 41 "pages/user/my_service/appment_main",
44 "pages/user/my_service/i_service", 42 "pages/user/my_service/i_service",
45 "pages/user/my_service/cosmetology_list", 43 "pages/user/my_service/cosmetology_list",
@@ -209,7 +207,9 @@ @@ -209,7 +207,9 @@
209 "root": "packageE/", 207 "root": "packageE/",
210 "name": "pack5", 208 "name": "pack5",
211 "pages": [ 209 "pages": [
212 - "pages/togoin/togoin" 210 + "pages/togoin/togoin",
  211 + "pages/user/Detailed/Detailed",
  212 + "pages/user/user_fw/user_fw"
213 ] 213 ]
214 } 214 }
215 215
components/diy_advertising/diy_advertising.js
@@ -43,7 +43,16 @@ Component({ @@ -43,7 +43,16 @@ Component({
43 var url=e.currentTarget.dataset.url; 43 var url=e.currentTarget.dataset.url;
44 getApp().goto(url); 44 getApp().goto(url);
45 }, 45 },
46 - 46 + nv_void(e){
  47 + var feedId=e.currentTarget.dataset.feedid;
  48 + var finderUserName=e.currentTarget.dataset.finderusername;
  49 + var video_type=e.currentTarget.dataset.video_type;
  50 + getApp().openChannelsActivity({
  51 + feedId,
  52 + finderUserName,
  53 + video_type
  54 + })
  55 + },
47 imageLoad:function(e){ 56 imageLoad:function(e){
48 var imgwidth = e.detail.width; 57 var imgwidth = e.detail.width;
49 var imgheight = e.detail.height; 58 var imgheight = e.detail.height;
components/diy_advertising/diy_advertising.wxml
@@ -19,6 +19,11 @@ @@ -19,6 +19,11 @@
19 <image src="{{item.src}}" mode="widthFix" lazy-load="true"></image> 19 <image src="{{item.src}}" mode="widthFix" lazy-load="true"></image>
20 </navigator> 20 </navigator>
21 </block> 21 </block>
  22 + <block wx:elif="{{item.finderUserName && item.video_type}}">
  23 + <view bindtap="nv_void" data-feedId="{{item.feedId}}" data-video_type="{{item.video_type}}" data-finderUserName="{{item.finderUserName}}" class="s1_gk_a1" >
  24 + <image src="{{item.src}}" mode="widthFix" lazy-load="true"></image>
  25 + </view>
  26 + </block>
22 <block wx:else> 27 <block wx:else>
23 <view data-url="{{item.wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url"> 28 <view data-url="{{item.wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url">
24 <image src="{{item.src}}" mode="widthFix" lazy-load="true"></image> 29 <image src="{{item.src}}" mode="widthFix" lazy-load="true"></image>
@@ -53,6 +58,11 @@ @@ -53,6 +58,11 @@
53 </navigator> 58 </navigator>
54 </block> 59 </block>
55 60
  61 + <block wx:elif="{{item.finderUserName && item.video_type}}">
  62 + <view class="s1_gk_a1" bindtap="nv_void" data-feedId="{{item.feedId}}" data-video_type="{{item.video_type}}" data-finderUserName="{{item.finderUserName}}">
  63 + <image src="{{item.src}}" mode="widthFix" lazy-load="true"></image>
  64 + </view>
  65 + </block>
56 <block wx:else> 66 <block wx:else>
57 <view data-url="{{item.wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url"> 67 <view data-url="{{item.wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url">
58 <image src="{{item.src}}" mode="widthFix" lazy-load="true"></image> 68 <image src="{{item.src}}" mode="widthFix" lazy-load="true"></image>
@@ -97,6 +107,12 @@ @@ -97,6 +107,12 @@
97 </navigator> 107 </navigator>
98 </block> 108 </block>
99 109
  110 + <block wx:elif="{{item.finderUserName && item.video_type}}">
  111 + <view bindtap="nv_void" data-feedId="{{item.feedId}}" data-video_type="{{item.video_type}}" data-finderUserName="{{item.finderUserName}}" class="s1_gk_a1" >
  112 + <image src="{{item.src}}" mode="widthFix" lazy-load="true"></image>
  113 + </view>
  114 + </block>
  115 +
100 <block wx:else> 116 <block wx:else>
101 <view data-url="{{item.wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url"> 117 <view data-url="{{item.wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url">
102 <image src="{{item.src}}" mode="widthFix" lazy-load="true"></image> 118 <image src="{{item.src}}" mode="widthFix" lazy-load="true"></image>
@@ -140,6 +156,11 @@ @@ -140,6 +156,11 @@
140 </navigator> 156 </navigator>
141 </block> 157 </block>
142 158
  159 + <block wx:elif="{{item.finderUserName && item.video_type}}">
  160 + <view bindtap="nv_void" data-feedId="{{item.feedId}}" data-video_type="{{item.video_type}}" data-finderUserName="{{item.finderUserName}}" class="s1_gk_a1" >
  161 + <image src="{{item.src}}" mode="widthFix" lazy-load="true"></image>
  162 + </view>
  163 + </block>
143 <block wx:else> 164 <block wx:else>
144 <view data-url="{{item.wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url"> 165 <view data-url="{{item.wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url">
145 <image src="{{item.src}}" mode="widthFix" lazy-load="true"></image> 166 <image src="{{item.src}}" mode="widthFix" lazy-load="true"></image>
@@ -171,6 +192,12 @@ @@ -171,6 +192,12 @@
171 </navigator> 192 </navigator>
172 </block> 193 </block>
173 194
  195 + <block wx:elif="{{item.finderUserName && item.video_type}}">
  196 + <view bindtap="nv_void" data-feedId="{{item.feedId}}" data-video_type="{{item.video_type}}" data-finderUserName="{{item.finderUserName}}" class="s1_gk_a1" >
  197 + <image src="{{item.src}}" mode="widthFix" lazy-load="true"></image>
  198 + </view>
  199 + </block>
  200 +
174 <block wx:else> 201 <block wx:else>
175 <view data-url="{{item.wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url"> 202 <view data-url="{{item.wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url">
176 <image src="{{item.src}}" mode="widthFix" lazy-load="true"></image> 203 <image src="{{item.src}}" mode="widthFix" lazy-load="true"></image>
@@ -202,6 +229,11 @@ @@ -202,6 +229,11 @@
202 <image src="{{object.data[0].src}}" lazy-load="true"></image> 229 <image src="{{object.data[0].src}}" lazy-load="true"></image>
203 </navigator> 230 </navigator>
204 </block> 231 </block>
  232 + <block wx:elif="{{object.data[0].finderUserName && object.data[0].feedId}}">
  233 + <view bindtap="nv_void" data-feedId="{{object.data[0].feedId}}" data-finderUserName="{{object.data[0].finderUserName}}" class="s1_gk_a1" >
  234 + <image src="{{object.data[0].src}}" lazy-load="true"></image>
  235 + </view>
  236 + </block>
205 <block wx:else> 237 <block wx:else>
206 <view data-url="{{object.data[0].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url"> 238 <view data-url="{{object.data[0].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url">
207 <image src="{{object.data[0].src}}" lazy-load="true"></image> 239 <image src="{{object.data[0].src}}" lazy-load="true"></image>
@@ -234,6 +266,11 @@ @@ -234,6 +266,11 @@
234 <image src="{{object.data[1].src}}" lazy-load="true"></image> 266 <image src="{{object.data[1].src}}" lazy-load="true"></image>
235 </navigator> 267 </navigator>
236 </block> 268 </block>
  269 + <block wx:elif="{{object.data[1].finderUserName && object.data[1].feedId}}">
  270 + <view bindtap="nv_void" data-feedId="{{object.data[1].feedId}}" data-finderUserName="{{object.data[1].finderUserName}}" class="s1_gk_a1" >
  271 + <image src="{{object.data[1].src}}" lazy-load="true"></image>
  272 + </view>
  273 + </block>
237 <block wx:else> 274 <block wx:else>
238 <view data-url="{{object.data[1].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url"> 275 <view data-url="{{object.data[1].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url">
239 <image src="{{object.data[1].src}}" lazy-load="true"></image> 276 <image src="{{object.data[1].src}}" lazy-load="true"></image>
@@ -265,6 +302,11 @@ @@ -265,6 +302,11 @@
265 <image src="{{object.data[2].src}}" lazy-load="true"></image> 302 <image src="{{object.data[2].src}}" lazy-load="true"></image>
266 </navigator> 303 </navigator>
267 </block> 304 </block>
  305 + <block wx:elif="{{object.data[2].finderUserName && object.data[2].feedId}}">
  306 + <view bindtap="nv_void" data-feedId="{{object.data[2].feedId}}" data-finderUserName="{{object.data[2].finderUserName}}" class="s1_gk_a1" >
  307 + <image src="{{object.data[2].src}}" lazy-load="true"></image>
  308 + </view>
  309 + </block>
268 <block wx:else> 310 <block wx:else>
269 <view data-url="{{object.data[2].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url"> 311 <view data-url="{{object.data[2].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url">
270 <image src="{{object.data[2].src}}" lazy-load="true"></image> 312 <image src="{{object.data[2].src}}" lazy-load="true"></image>
@@ -304,6 +346,11 @@ @@ -304,6 +346,11 @@
304 <image src="{{object.data[0].src}}" lazy-load="true"></image> 346 <image src="{{object.data[0].src}}" lazy-load="true"></image>
305 </navigator> 347 </navigator>
306 </block> 348 </block>
  349 + <block wx:elif="{{object.data[0].finderUserName && object.data[0].feedId}}">
  350 + <view bindtap="nv_void" data-feedId="{{object.data[0].feedId}}" data-finderUserName="{{object.data[0].finderUserName}}" class="s1_gk_a1" >
  351 + <image src="{{object.data[0].src}}" lazy-load="true"></image>
  352 + </view>
  353 + </block>
307 <block wx:else> 354 <block wx:else>
308 <view data-url="{{object.data[0].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url"> 355 <view data-url="{{object.data[0].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url">
309 <image src="{{object.data[0].src}}" lazy-load="true"></image> 356 <image src="{{object.data[0].src}}" lazy-load="true"></image>
@@ -334,6 +381,11 @@ @@ -334,6 +381,11 @@
334 <image src="{{object.data[1].src}}" lazy-load="true"></image> 381 <image src="{{object.data[1].src}}" lazy-load="true"></image>
335 </navigator> 382 </navigator>
336 </block> 383 </block>
  384 + <block wx:elif="{{object.data[1].finderUserName && object.data[1].feedId}}">
  385 + <view bindtap="nv_void" data-feedId="{{object.data[1].feedId}}" data-finderUserName="{{object.data[1].finderUserName}}" class="s1_gk_a1" >
  386 + <image src="{{object.data[1].src}}" lazy-load="true"></image>
  387 + </view>
  388 + </block>
337 <block wx:else> 389 <block wx:else>
338 <view data-url="{{object.data[1].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url"> 390 <view data-url="{{object.data[1].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url">
339 <image src="{{object.data[1].src}}" lazy-load="true"></image> 391 <image src="{{object.data[1].src}}" lazy-load="true"></image>
@@ -367,6 +419,11 @@ @@ -367,6 +419,11 @@
367 <image src="{{object.data[2].src}}" lazy-load="true"></image> 419 <image src="{{object.data[2].src}}" lazy-load="true"></image>
368 </navigator> 420 </navigator>
369 </block> 421 </block>
  422 + <block wx:elif="{{object.data[2].finderUserName && object.data[2].feedId}}">
  423 + <view bindtap="nv_void" data-feedId="{{object.data[2].feedId}}" data-finderUserName="{{object.data[2].finderUserName}}" class="s1_gk_a1" >
  424 + <image src="{{object.data[2].src}}" lazy-load="true"></image>
  425 + </view>
  426 + </block>
370 <block wx:else> 427 <block wx:else>
371 <view data-url="{{object.data[2].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url"> 428 <view data-url="{{object.data[2].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url">
372 <image src="{{object.data[2].src}}" lazy-load="true"></image> 429 <image src="{{object.data[2].src}}" lazy-load="true"></image>
@@ -397,6 +454,11 @@ @@ -397,6 +454,11 @@
397 <image src="{{object.data[3].src}}" lazy-load="true"></image> 454 <image src="{{object.data[3].src}}" lazy-load="true"></image>
398 </navigator> 455 </navigator>
399 </block> 456 </block>
  457 + <block wx:elif="{{object.data[3].finderUserName && object.data[3].feedId}}">
  458 + <view bindtap="nv_void" data-feedId="{{object.data[3].feedId}}" data-finderUserName="{{object.data[3].finderUserName}}" class="s1_gk_a1" >
  459 + <image src="{{object.data[3].src}}" lazy-load="true"></image>
  460 + </view>
  461 + </block>
400 <block wx:else> 462 <block wx:else>
401 <view data-url="{{object.data[3].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url"> 463 <view data-url="{{object.data[3].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url">
402 <image src="{{object.data[3].src}}" lazy-load="true"></image> 464 <image src="{{object.data[3].src}}" lazy-load="true"></image>
@@ -434,6 +496,11 @@ @@ -434,6 +496,11 @@
434 <image src="{{object.data[0].src}}" lazy-load="true"></image> 496 <image src="{{object.data[0].src}}" lazy-load="true"></image>
435 </navigator> 497 </navigator>
436 </block> 498 </block>
  499 + <block wx:elif="{{object.data[0].finderUserName && object.data[0].feedId}}">
  500 + <view bindtap="nv_void" data-feedId="{{object.data[0].feedId}}" data-finderUserName="{{object.data[0].finderUserName}}" class="s1_gk_a1" >
  501 + <image src="{{object.data[0].src}}" lazy-load="true"></image>
  502 + </view>
  503 + </block>
437 <block wx:else> 504 <block wx:else>
438 <view data-url="{{object.data[0].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url"> 505 <view data-url="{{object.data[0].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url">
439 <image src="{{object.data[0].src}}" lazy-load="true"></image> 506 <image src="{{object.data[0].src}}" lazy-load="true"></image>
@@ -464,6 +531,11 @@ @@ -464,6 +531,11 @@
464 <image src="{{object.data[1].src}}" lazy-load="true"></image> 531 <image src="{{object.data[1].src}}" lazy-load="true"></image>
465 </navigator> 532 </navigator>
466 </block> 533 </block>
  534 + <block wx:elif="{{object.data[1].finderUserName && object.data[1].feedId}}">
  535 + <view bindtap="nv_void" data-feedId="{{object.data[1].feedId}}" data-finderUserName="{{object.data[1].finderUserName}}" class="s1_gk_a1" >
  536 + <image src="{{object.data[1].src}}" lazy-load="true"></image>
  537 + </view>
  538 + </block>
467 <block wx:else> 539 <block wx:else>
468 <view data-url="{{object.data[1].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url"> 540 <view data-url="{{object.data[1].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url">
469 <image src="{{object.data[1].src}}" lazy-load="true"></image> 541 <image src="{{object.data[1].src}}" lazy-load="true"></image>
@@ -498,6 +570,11 @@ @@ -498,6 +570,11 @@
498 <image src="{{object.data[2].src}}" lazy-load="true"></image> 570 <image src="{{object.data[2].src}}" lazy-load="true"></image>
499 </navigator> 571 </navigator>
500 </block> 572 </block>
  573 + <block wx:elif="{{object.data[2].finderUserName && object.data[2].feedId}}">
  574 + <view bindtap="nv_void" data-feedId="{{object.data[2].feedId}}" data-finderUserName="{{object.data[2].finderUserName}}" class="s1_gk_a1" >
  575 + <image src="{{object.data[2].src}}" lazy-load="true"></image>
  576 + </view>
  577 + </block>
501 <block wx:else> 578 <block wx:else>
502 <view data-url="{{object.data[2].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url"> 579 <view data-url="{{object.data[2].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url">
503 <image src="{{object.data[2].src}}" lazy-load="true"></image> 580 <image src="{{object.data[2].src}}" lazy-load="true"></image>
@@ -528,6 +605,11 @@ @@ -528,6 +605,11 @@
528 <image src="{{object.data[3].src}}" lazy-load="true"></image> 605 <image src="{{object.data[3].src}}" lazy-load="true"></image>
529 </navigator> 606 </navigator>
530 </block> 607 </block>
  608 + <block wx:elif="{{object.data[3].finderUserName && object.data[3].feedId}}">
  609 + <view bindtap="nv_void" data-feedId="{{object.data[3].feedId}}" data-finderUserName="{{object.data[3].finderUserName}}" class="s1_gk_a1" >
  610 + <image src="{{object.data[3].src}}" lazy-load="true"></image>
  611 + </view>
  612 + </block>
531 <block wx:else> 613 <block wx:else>
532 <view data-url="{{object.data[3].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url"> 614 <view data-url="{{object.data[3].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url">
533 <image src="{{object.data[3].src}}" lazy-load="true"></image> 615 <image src="{{object.data[3].src}}" lazy-load="true"></image>
@@ -567,6 +649,11 @@ @@ -567,6 +649,11 @@
567 <image src="{{object.data[0].src}}" lazy-load="true"></image> 649 <image src="{{object.data[0].src}}" lazy-load="true"></image>
568 </navigator> 650 </navigator>
569 </block> 651 </block>
  652 + <block wx:elif="{{object.data[0].finderUserName && object.data[0].feedId}}">
  653 + <view bindtap="nv_void" data-feedId="{{object.data[0].feedId}}" data-finderUserName="{{object.data[0].finderUserName}}" class="s1_gk_a1">
  654 + <image src="{{object.data[0].src}}" lazy-load="true"></image>
  655 + </view>
  656 + </block>
570 <block wx:else> 657 <block wx:else>
571 <view data-url="{{object.data[0].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url"> 658 <view data-url="{{object.data[0].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url">
572 <image src="{{object.data[0].src}}" lazy-load="true"></image> 659 <image src="{{object.data[0].src}}" lazy-load="true"></image>
@@ -597,6 +684,11 @@ @@ -597,6 +684,11 @@
597 <image src="{{object.data[1].src}}" lazy-load="true"></image> 684 <image src="{{object.data[1].src}}" lazy-load="true"></image>
598 </navigator> 685 </navigator>
599 </block> 686 </block>
  687 + <block wx:elif="{{object.data[1].finderUserName && object.data[1].feedId}}">
  688 + <view bindtap="nv_void" data-feedId="{{object.data[1].feedId}}" data-finderUserName="{{object.data[1].finderUserName}}" class="s1_gk_a1">
  689 + <image src="{{object.data[1].src}}" lazy-load="true"></image>
  690 + </view>
  691 + </block>
600 <block wx:else> 692 <block wx:else>
601 <view data-url="{{object.data[1].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url"> 693 <view data-url="{{object.data[1].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url">
602 <image src="{{object.data[1].src}}" lazy-load="true"></image> 694 <image src="{{object.data[1].src}}" lazy-load="true"></image>
@@ -631,6 +723,11 @@ @@ -631,6 +723,11 @@
631 <image src="{{object.data[2].src}}" lazy-load="true"></image> 723 <image src="{{object.data[2].src}}" lazy-load="true"></image>
632 </navigator> 724 </navigator>
633 </block> 725 </block>
  726 + <block wx:elif="{{object.data[2].finderUserName && object.data[2].feedId}}">
  727 + <view bindtap="nv_void" data-feedId="{{object.data[2].feedId}}" data-finderUserName="{{object.data[2].finderUserName}}" class="s1_gk_a1">
  728 + <image src="{{object.data[2].src}}" lazy-load="true"></image>
  729 + </view>
  730 + </block>
634 <block wx:else> 731 <block wx:else>
635 <view data-url="{{object.data[2].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url"> 732 <view data-url="{{object.data[2].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url">
636 <image src="{{object.data[2].src}}" lazy-load="true"></image> 733 <image src="{{object.data[2].src}}" lazy-load="true"></image>
@@ -655,6 +752,11 @@ @@ -655,6 +752,11 @@
655 <image src="{{object.data[3].src}}" lazy-load="true"></image> 752 <image src="{{object.data[3].src}}" lazy-load="true"></image>
656 </navigator> 753 </navigator>
657 </block> 754 </block>
  755 + <block wx:elif="{{object.data[3].finderUserName && object.data[3].feedId}}">
  756 + <view bindtap="nv_void" data-feedId="{{object.data[3].feedId}}" data-finderUserName="{{object.data[3].finderUserName}}" class="s1_gk_a1">
  757 + <image src="{{object.data[3].src}}" lazy-load="true"></image>
  758 + </view>
  759 + </block>
658 <block wx:else> 760 <block wx:else>
659 <view data-url="{{object.data[3].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url"> 761 <view data-url="{{object.data[3].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url">
660 <image src="{{object.data[3].src}}" lazy-load="true"></image> 762 <image src="{{object.data[3].src}}" lazy-load="true"></image>
@@ -683,6 +785,11 @@ @@ -683,6 +785,11 @@
683 <image src="{{object.data[4].src}}" lazy-load="true"></image> 785 <image src="{{object.data[4].src}}" lazy-load="true"></image>
684 </navigator> 786 </navigator>
685 </block> 787 </block>
  788 + <block wx:elif="{{object.data[4].finderUserName && object.data[4].feedId}}">
  789 + <view bindtap="nv_void" data-feedId="{{object.data[4].feedId}}" data-finderUserName="{{object.data[4].finderUserName}}" class="s1_gk_a1">
  790 + <image src="{{object.data[4].src}}" lazy-load="true"></image>
  791 + </view>
  792 + </block>
686 <block wx:else> 793 <block wx:else>
687 <view data-url="{{object.data[4].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url"> 794 <view data-url="{{object.data[4].wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url">
688 <image src="{{object.data[4].src}}" lazy-load="true"></image> 795 <image src="{{object.data[4].src}}" lazy-load="true"></image>
@@ -721,6 +828,14 @@ @@ -721,6 +828,14 @@
721 </navigator> 828 </navigator>
722 </block> 829 </block>
723 830
  831 + <block wx:elif="{{item.finderUserName && item.video_type}}">
  832 + <view bindtap="nv_void" data-feedId="{{item.feedId}}" data-video_type="{{item.video_type}}" data-finderUserName="{{item.finderUserName}}" class="s1_gk_a1" style="height:{{max_sw_height}}rpx" >
  833 + <swiper-item>
  834 + <image src="{{item.src}}" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" lazy-load="true" />
  835 + <view class="title" wx:if="{{item.title}}">{{item.title}}</view>
  836 + </swiper-item>
  837 + </view>
  838 + </block>
724 <block wx:else> 839 <block wx:else>
725 <view data-url="{{item.wxapp_imgurl}}" class="s1_gk_a1" style="height:{{max_sw_height}}rpx" bindtap="go_url"> 840 <view data-url="{{item.wxapp_imgurl}}" class="s1_gk_a1" style="height:{{max_sw_height}}rpx" bindtap="go_url">
726 <swiper-item> 841 <swiper-item>
components/diy_goodsGroup/diy_goodsGroup.js
@@ -29,7 +29,8 @@ Component({ @@ -29,7 +29,8 @@ Component({
29 imghost: o.imghost, 29 imghost: o.imghost,
30 is_recommend: 0, 30 is_recommend: 0,
31 is_hot: 0, 31 is_hot: 0,
32 - is_new: 0, 32 + is_new: 0,
  33 + isyhgoods:0,
33 baseUrl: "/api/weshop/goods/page", 34 baseUrl: "/api/weshop/goods/page",
34 resourceUrl: t.globalData.setting.resourceUrl, 35 resourceUrl: t.globalData.setting.resourceUrl,
35 url: t.globalData.setting.imghost, 36 url: t.globalData.setting.imghost,
@@ -77,7 +78,7 @@ Component({ @@ -77,7 +78,7 @@ Component({
77 78
78 //最新的版本才有nav_list 79 //最新的版本才有nav_list
79 if (nav_list) { 80 if (nav_list) {
80 - nav_item = nav_list[0]; 81 + nav_item = nav_list[0];
81 //要算一下商品goodsid 82 //要算一下商品goodsid
82 for (var ij in nav_list) { 83 for (var ij in nav_list) {
83 var item = nav_list[ij]; 84 var item = nav_list[ij];
@@ -134,6 +135,9 @@ Component({ @@ -134,6 +135,9 @@ Component({
134 if (nav_item && nav_item.goodsclass == 3) { 135 if (nav_item && nav_item.goodsclass == 3) {
135 this.data.is_new = 1 136 this.data.is_new = 1
136 } 137 }
  138 + if (nav_item && nav_item.goodsclass == 4) {
  139 + this.data.isyhgoods = 1
  140 + }
137 141
138 this.data.requestData = new Array(); 142 this.data.requestData = new Array();
139 this.data.g_id = nav_item.data; 143 this.data.g_id = nav_item.data;
@@ -225,6 +229,7 @@ Component({ @@ -225,6 +229,7 @@ Component({
225 if (th.data.is_recommend) r_data.is_recommend = th.data.is_recommend; 229 if (th.data.is_recommend) r_data.is_recommend = th.data.is_recommend;
226 if (th.data.is_hot) r_data.is_hot = th.data.is_hot; 230 if (th.data.is_hot) r_data.is_hot = th.data.is_hot;
227 if (th.data.is_new) r_data.is_new = th.data.is_new; 231 if (th.data.is_new) r_data.is_new = th.data.is_new;
  232 + if (th.data.isyhgoods) r_data.isyhgoods = th.data.isyhgoods;
228 233
229 var user_id = getApp().globalData.user_id; 234 var user_id = getApp().globalData.user_id;
230 if (!user_id) user_id = 0; 235 if (!user_id) user_id = 0;
@@ -239,7 +244,7 @@ Component({ @@ -239,7 +244,7 @@ Component({
239 th.setData({ 244 th.setData({
240 goods_btn: res.data.data.pageData, 245 goods_btn: res.data.data.pageData,
241 total: res.data.data.total 246 total: res.data.data.total
242 - }) 247 + })
243 th.data.currentPage++; 248 th.data.currentPage++;
244 //设置商品熏染 249 //设置商品熏染
245 th.set_good(goods); 250 th.set_good(goods);
@@ -277,12 +282,20 @@ Component({ @@ -277,12 +282,20 @@ Component({
277 }, 282 },
278 283
279 setLoading: function () { 284 setLoading: function () {
280 - var that = this;  
281 - if (this.data.loading) return false;  
282 - this.data.loading = 1;  
283 - that.init(that.data.classstyle_id, that.data.wgroup); 285 + if(this.data.object.column==5){return}
  286 + if( this.data.goods_btn.length!=0 || this.data.object.goodscount*this.data.page <this.data.total ){
  287 + var that = this;
  288 + if (this.data.loading) return false;
  289 + this.data.loading = 1;
  290 + that.init(that.data.classstyle_id, that.data.wgroup);
  291 + }
284 }, 292 },
285 - 293 + automore(){
  294 + let is_automore = this.data.object.is_automore
  295 + if (is_automore==1) {
  296 + this.setLoading()
  297 + }
  298 + },
286 //图片失败,默认图片 299 //图片失败,默认图片
287 bind_bnerr3: function (e) { 300 bind_bnerr3: function (e) {
288 var _errImg = e.target.dataset.errorimg; 301 var _errImg = e.target.dataset.errorimg;
@@ -420,7 +433,7 @@ Component({ @@ -420,7 +433,7 @@ Component({
420 } 433 }
421 434
422 435
423 - this.data.is_recommend = this.data.is_hot = this.data.is_new = 0; 436 + this.data.isyhgoods = this.data.is_recommend = this.data.is_hot = this.data.is_new = 0;
424 //推荐,热卖,新品 437 //推荐,热卖,新品
425 if (nav_item && nav_item.goodsclass == 1) { 438 if (nav_item && nav_item.goodsclass == 1) {
426 this.data.is_recommend = 1 439 this.data.is_recommend = 1
@@ -431,6 +444,9 @@ Component({ @@ -431,6 +444,9 @@ Component({
431 if (nav_item && nav_item.goodsclass == 3) { 444 if (nav_item && nav_item.goodsclass == 3) {
432 this.data.is_new = 1 445 this.data.is_new = 1
433 } 446 }
  447 + if (nav_item && nav_item.goodsclass == 4) {
  448 + this.data.isyhgoods = 1
  449 + }
434 450
435 451
436 this.data.currentPage = 1; 452 this.data.currentPage = 1;
components/diy_goodsGroup/diy_goodsGroup.wxml
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <wxs module="g_filter" src="g_filter.wxs"></wxs> 3 <wxs module="g_filter" src="g_filter.wxs"></wxs>
4 4
5 <!-- 要不要顶部标题 --> 5 <!-- 要不要顶部标题 -->
6 -<mp-loading show ="{{goods_array.length== 0}}" type="circle"></mp-loading> 6 +<!-- <mp-loading show ="{{goods_array.length== 0}}" type="circle"></mp-loading> -->
7 7
8 <view id="container"> 8 <view id="container">
9 9
@@ -24,8 +24,8 @@ @@ -24,8 +24,8 @@
24 </view> 24 </view>
25 </block> 25 </block>
26 26
27 -  
28 -<view style="background-color: {{bg_color}};"> 27 +
  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}}">
@@ -898,5 +898,5 @@ @@ -898,5 +898,5 @@
898 </swiper> 898 </swiper>
899 899
900 </view> 900 </view>
901 - 901 +<view class="nodata-title" wx:else>暂无数据</view>
902 </view> 902 </view>
903 \ No newline at end of file 903 \ No newline at end of file
components/diy_goodsGroup/diy_goodsGroup.wxss
@@ -904,7 +904,13 @@ top: 10rpx; @@ -904,7 +904,13 @@ top: 10rpx;
904 .zs_goods_xiao_wai{ padding-top:1rpx } 904 .zs_goods_xiao_wai{ padding-top:1rpx }
905 .s1_gk_a1.list_border{ display: block; border-bottom: 1rpx solid #eee} 905 .s1_gk_a1.list_border{ display: block; border-bottom: 1rpx solid #eee}
906 906
907 - 907 +.nodata-title {
  908 + padding-top: 40rpx;
  909 + padding-bottom: 40rpx;
  910 + color: #bbb;
  911 + font-size: 28rpx;
  912 + text-align: center;
  913 +}
908 914
909 915
910 916
components/diy_live/diy_live.js
@@ -24,7 +24,8 @@ Component({ @@ -24,7 +24,8 @@ Component({
24 data: { 24 data: {
25 // 弹窗显示控制 25 // 弹窗显示控制
26 showHongbao:false, 26 showHongbao:false,
27 - showHongbaoSmall: false, 27 + showHongbaoSmall: false,
  28 + imghost:getApp().globalData.setting.imghost
28 }, 29 },
29 30
30 /** 31 /**
components/diy_live/diy_live.wxml
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <view class="close-box"> 3 <view class="close-box">
4 <text class="iconfont icon-guan"></text> 4 <text class="iconfont icon-guan"></text>
5 </view> 5 </view>
6 - <image class="img" src="../../images/share/default_g_img.gif" mode="aspectFit"></image> 6 + <image class="img" src="{{imghost}}/miniapp/images/default_g_img.gif" mode="aspectFit"></image>
7 <view class="zhibo-box t-c fs26"> 7 <view class="zhibo-box t-c fs26">
8 <text class="iconfont icon-zhibo"></text> 直播 8 <text class="iconfont icon-zhibo"></text> 直播
9 </view> 9 </view>
components/diy_nav/diy_nav.js
@@ -48,6 +48,18 @@ Component({ @@ -48,6 +48,18 @@ Component({
48 var url=e.currentTarget.dataset.url; 48 var url=e.currentTarget.dataset.url;
49 console.log('url==>', url); 49 console.log('url==>', url);
50 getApp().goto(url); 50 getApp().goto(url);
  51 + },
  52 + nv_void(e){
  53 + console.log('导航')
  54 + console.log(e)
  55 + var feedId=e.currentTarget.dataset.feedid;
  56 + var finderUserName=e.currentTarget.dataset.finderusername;
  57 + var video_type=e.currentTarget.dataset.video_type;
  58 + getApp().openChannelsActivity({
  59 + feedId,
  60 + finderUserName,
  61 + video_type
  62 + })
51 } 63 }
52 } 64 }
53 }) 65 })
54 \ No newline at end of file 66 \ No newline at end of file
components/diy_nav/diy_nav.wxml
@@ -13,6 +13,11 @@ @@ -13,6 +13,11 @@
13 <include src="diy_nav_part1.wxml" /> 13 <include src="diy_nav_part1.wxml" />
14 </navigator> 14 </navigator>
15 </block> 15 </block>
  16 + <block wx:elif="{{item.finderUserName && item.video_type}}">
  17 + <view style="width:{{100/nav_list.length}}%;" bindtap="nv_void" data-feedId="{{item.feedId}}" data-video_type="{{item.video_type}}" data-finderUserName="{{item.finderUserName}}">
  18 + <include src="diy_nav_part1.wxml" />
  19 + </view>
  20 + </block>
16 <block wx:else> 21 <block wx:else>
17 <view style="width:{{100/nav_list.length}}%;" data-url="{{item.wxapp_url}}" class="s1_gk_a1" bindtap="go_url"> 22 <view style="width:{{100/nav_list.length}}%;" data-url="{{item.wxapp_url}}" class="s1_gk_a1" bindtap="go_url">
18 <include src="diy_nav_part1.wxml" /> 23 <include src="diy_nav_part1.wxml" />
@@ -36,6 +41,11 @@ @@ -36,6 +41,11 @@
36 <include src="diy_nav_part2.wxml" /> 41 <include src="diy_nav_part2.wxml" />
37 </navigator> 42 </navigator>
38 </block> 43 </block>
  44 + <block wx:elif="{{item.finderUserName && item.video_type}}">
  45 + <view bindtap="nv_void" data-feedId="{{item.feedId}}" data-video_type="{{item.video_type}}" data-finderUserName="{{item.finderUserName}}">
  46 + <include src="diy_nav_part2.wxml" />
  47 + </view>
  48 + </block>
39 <block wx:else> 49 <block wx:else>
40 <view data-url="{{item.wxapp_url}}" class="s1_gk_a1" bindtap="go_url"> 50 <view data-url="{{item.wxapp_url}}" class="s1_gk_a1" bindtap="go_url">
41 <include src="diy_nav_part2.wxml" /> 51 <include src="diy_nav_part2.wxml" />
components/diy_notice/diy_notice.js
@@ -26,5 +26,15 @@ Component({ @@ -26,5 +26,15 @@ Component({
26 var url=e.currentTarget.dataset.url; 26 var url=e.currentTarget.dataset.url;
27 getApp().goto(url); 27 getApp().goto(url);
28 }, 28 },
  29 + nv_void(e){
  30 + var feedId=e.currentTarget.dataset.feedid;
  31 + var finderUserName=e.currentTarget.dataset.finderusername;
  32 + var video_type=e.currentTarget.dataset.video_type;
  33 + getApp().openChannelsActivity({
  34 + feedId,
  35 + finderUserName,
  36 + video_type
  37 + })
  38 + }
29 } 39 }
30 }) 40 })
31 \ No newline at end of file 41 \ No newline at end of file
components/diy_notice/diy_notice.wxml
@@ -32,6 +32,20 @@ @@ -32,6 +32,20 @@
32 </block> 32 </block>
33 33
34 34
  35 + <block wx:elif="{{object.finderUserName && object.video_type}}">
  36 + <view bindtap="nv_void" data-feedId="{{object.feedId}}" data-video_type="{{object.video_type}}" data-finderUserName="{{object.finderUserName}}" class="s1_gk_a1" style="background-color: {{object.notice_bgcolor}}">
  37 + <view class="big_border">
  38 + <image class="image_c" src="{{imghost}}/miniapp/images/notice.png"></image>
  39 + <view class="marquee">
  40 + <view class="content">
  41 + <text style="color: {{object.notice_color}}">{{object.noticetxt}}</text> <text style="display: inline-block; width: 590rpx;line-height:30rpx;"></text>
  42 + <text style="color: {{object.notice_color}}">{{object.noticetxt}}</text> <text style="display: inline-block; width: 590rpx;line-height:30rpx;"></text>
  43 + <text style="color: {{object.notice_color}}">{{object.noticetxt}}</text> <text style="display: inline-block; width: 590rpx;line-height:30rpx;"></text>
  44 + </view>
  45 + </view>
  46 + </view>
  47 + </view>
  48 + </block>
35 <block wx:else> 49 <block wx:else>
36 <view data-url="{{object.wxapp_url}}" class="s1_gk_a1" bindtap="go_url" style="background-color: {{object.notice_bgcolor}}"> 50 <view data-url="{{object.wxapp_url}}" class="s1_gk_a1" bindtap="go_url" style="background-color: {{object.notice_bgcolor}}">
37 <view class="big_border"> 51 <view class="big_border">
components/diy_picMax/diy_picMax.js
@@ -32,7 +32,16 @@ Component({ @@ -32,7 +32,16 @@ Component({
32 var url = e.currentTarget.dataset.url; 32 var url = e.currentTarget.dataset.url;
33 getApp().goto(url); 33 getApp().goto(url);
34 }, 34 },
35 - 35 + nv_void(e){
  36 + var feedId=e.currentTarget.dataset.feedid;
  37 + var finderUserName=e.currentTarget.dataset.finderusername;
  38 + var video_type=e.currentTarget.dataset.video_type;
  39 + getApp().openChannelsActivity({
  40 + feedId,
  41 + finderUserName,
  42 + video_type
  43 + })
  44 + },
36 previewImage(e){ 45 previewImage(e){
37 let src =e.currentTarget.dataset.src; 46 let src =e.currentTarget.dataset.src;
38 wx.previewImage({ 47 wx.previewImage({
components/diy_picMax/diy_picMax.wxml
@@ -14,6 +14,10 @@ @@ -14,6 +14,10 @@
14 <image src="{{item.src}}" mode="widthFix" style="display: block; height: 100%; width: 100%;"></image> 14 <image src="{{item.src}}" mode="widthFix" style="display: block; height: 100%; width: 100%;"></image>
15 </navigator> 15 </navigator>
16 </block> 16 </block>
  17 + <block wx:elif="{{item.finderUserName && item.video_type}}">
  18 + <image bindtap="nv_void" data-feedId="{{item.feedId}}" data-video_type="{{item.video_type}}" data-finderUserName="{{item.finderUserName}}" wx:if="{{item.wxapp_url}}" src="{{item.src}}" style="display: block; height: 100%; width: 100%;"></image>
  19 + <image bindtap="nv_void" data-feedId="{{item.feedId}}" data-video_type="{{item.video_type}}" data-finderUserName="{{item.finderUserName}}" wx:else src="{{item.src}}" style="display: block; height: 100%; width: 100%;"></image>
  20 + </block>
17 <block wx:else> 21 <block wx:else>
18 <image bindtap='gopage' wx:if="{{item.wxapp_url}}" data-url="{{item.wxapp_url}}" src="{{item.src}}" style="display: block; height: 100%; width: 100%;"></image> 22 <image bindtap='gopage' wx:if="{{item.wxapp_url}}" data-url="{{item.wxapp_url}}" src="{{item.src}}" style="display: block; height: 100%; width: 100%;"></image>
19 <image bindtap='previewImage' wx:else data-src="{{item.src}}" src="{{item.src}}" style="display: block; height: 100%; width: 100%;"></image> 23 <image bindtap='previewImage' wx:else data-src="{{item.src}}" src="{{item.src}}" style="display: block; height: 100%; width: 100%;"></image>
@@ -34,6 +38,10 @@ @@ -34,6 +38,10 @@
34 <image src="{{item.src}}" mode="widthFix" style="display: block;"></image> 38 <image src="{{item.src}}" mode="widthFix" style="display: block;"></image>
35 </navigator> 39 </navigator>
36 </block> 40 </block>
  41 + <block wx:elif="{{item.finderUserName && item.video_type}}">
  42 + <image bindtap="nv_void" data-feedId="{{item.feedId}}" data-video_type="{{item.video_type}}" data-finderUserName="{{item.finderUserName}}" wx:if="{{item.wxapp_url}}" src="{{item.src}}" mode="widthFix" style="display: block;"></image>
  43 + <image bindtap="nv_void" data-feedId="{{item.feedId}}" data-video_type="{{item.video_type}}" data-finderUserName="{{item.finderUserName}}" wx:else src="{{item.src}}" style="display: block;" mode="widthFix"></image>
  44 + </block>
37 <block wx:else> 45 <block wx:else>
38 <image bindtap='gopage' wx:if="{{item.wxapp_url}}" data-url="{{item.wxapp_url}}" src="{{item.src}}" mode="widthFix" style="display: block;"></image> 46 <image bindtap='gopage' wx:if="{{item.wxapp_url}}" data-url="{{item.wxapp_url}}" src="{{item.src}}" mode="widthFix" style="display: block;"></image>
39 <image bindtap='previewImage' wx:else data-src="{{item.src}}" src="{{item.src}}" style="display: block;" mode="widthFix"></image> 47 <image bindtap='previewImage' wx:else data-src="{{item.src}}" src="{{item.src}}" style="display: block;" mode="widthFix"></image>
components/diy_title/diy_title.js
@@ -24,6 +24,16 @@ Component({ @@ -24,6 +24,16 @@ Component({
24 var txt="object.title_img"; 24 var txt="object.title_img";
25 ob[txt] = iurl +'/miniapp/images/logo.png?v=1'; 25 ob[txt] = iurl +'/miniapp/images/logo.png?v=1';
26 this.setData(ob); 26 this.setData(ob);
27 - } 27 + },
  28 + nv_void(e){
  29 + var feedId=e.currentTarget.dataset.feedid;
  30 + var finderUserName=e.currentTarget.dataset.finderusername;
  31 + var video_type=e.currentTarget.dataset.video_type;
  32 + getApp().openChannelsActivity({
  33 + feedId,
  34 + finderUserName,
  35 + video_type
  36 + })
  37 + }
28 } 38 }
29 }) 39 })
components/diy_title/diy_title.wxml
@@ -13,6 +13,9 @@ @@ -13,6 +13,9 @@
13 <view class="txet_rim"><view class="text" style='color:{{object.title_namecolor}}'>{{object.title_name}}</view></view> 13 <view class="txet_rim"><view class="text" style='color:{{object.title_namecolor}}'>{{object.title_name}}</view></view>
14 </navigator> 14 </navigator>
15 15
  16 + <view wx:elif="{{object.finderUserName && object.video_type}}" data-url="{{object.wxapp_url}}" bindtap="nv_void" data-feedId="{{object.feedId}}" data-video_type="{{object.video_type}}" data-finderUserName="{{object.finderUserName}}" >
  17 + <view class="txet_rim"><view class="text" style='color:{{object.title_namecolor}}'>{{object.title_name}}</view></view>
  18 + </view>
16 <view data-url="{{object.wxapp_url}}" bindtap="go_url" wx:else> 19 <view data-url="{{object.wxapp_url}}" bindtap="go_url" wx:else>
17 <view class="txet_rim"><view class="text" style='color:{{object.title_namecolor}}'>{{object.title_name}}</view></view> 20 <view class="txet_rim"><view class="text" style='color:{{object.title_namecolor}}'>{{object.title_name}}</view></view>
18 </view> 21 </view>
@@ -38,6 +41,14 @@ @@ -38,6 +41,14 @@
38 </navigator> 41 </navigator>
39 42
40 43
  44 + <view wx:elif="{{object.finderUserName && object.video_type}}" bindtap="nv_void" data-feedId="{{object.feedId}}" data-video_type="{{object.video_type}}" data-finderUserName="{{object.finderUserName}}" >
  45 + <view class="right_rim">
  46 + <view class="font_right_rim">
  47 + <view class="caption" style='color:{{object.title_rightcolor}}'>{{object.title_right}}</view>
  48 + </view>
  49 + <view class="aa"></view>
  50 + </view>
  51 + </view>
41 <view wx:else bindtap="go_url" data-url='{{object.wxapp_url}}'> 52 <view wx:else bindtap="go_url" data-url='{{object.wxapp_url}}'>
42 <view class="right_rim"> 53 <view class="right_rim">
43 <view class="font_right_rim"> 54 <view class="font_right_rim">
custom-tab-bar/index.wxml
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 style="color: {{active==idx?fontcolor_sele:fontcolor}};"> 6 style="color: {{active==idx?fontcolor_sele:fontcolor}};">
7 <view class="{{item.specific ? 'tabbar_item_wrapper':''}}" style="background-color: {{item.specific ? item.button_background:'transparent'}};"> 7 <view class="{{item.specific ? 'tabbar_item_wrapper':''}}" style="background-color: {{item.specific ? item.button_background:'transparent'}};">
8 <view class="tab_img"> 8 <view class="tab_img">
9 - <view wx:if="{{item.nav_name=='购物车' && cartGoodsNum != 0}}" class="cart_num" >{{cartGoodsNum}}</view> 9 + <!-- <view wx:if="{{item.nav_name=='购物车' && cartGoodsNum != 0}}" class="cart_num" >{{cartGoodsNum}}</view> -->
10 <view class="nav_imgage" style="background-image: url({{active==idx?item.src_sele:item.src}});"></view> 10 <view class="nav_imgage" style="background-image: url({{active==idx?item.src_sele:item.src}});"></view>
11 </view> 11 </view>
12 <view>{{item.nav_name}}</view> 12 <view>{{item.nav_name}}</view>
images/gt.png deleted

1.26 KB

images/share/default_g_img.gif deleted

4.23 KB

packageA/pages/activity_share/activity_share.js
@@ -1203,9 +1203,17 @@ Page({ @@ -1203,9 +1203,17 @@ Page({
1203 ee.data.share_goods_img = res.path; 1203 ee.data.share_goods_img = res.path;
1204 tt(); 1204 tt();
1205 }, 1205 },
1206 - fail: function(res) {  
1207 - ee.data.share_goods_img = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的  
1208 - tt(); 1206 + fail: function(res) {
  1207 +
  1208 + //获取默认空白图
  1209 + wx.getImageInfo({
  1210 + src: ee.data.url+'/miniapp/images/default_g_img.gif',
  1211 + success: function(res) {
  1212 + ee.data.share_goods_img = res.path; //分享的图片不能用网络的
  1213 + tt();
  1214 + }
  1215 + })
  1216 +
1209 } 1217 }
1210 }); 1218 });
1211 }, 1219 },
packageA/pages/distribution/order/order.wxml
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 </view> 14 </view>
15 <view class="c-a">{{filter.status(item.status, statusArr)}}</view> 15 <view class="c-a">{{filter.status(item.status, statusArr)}}</view>
16 </view> 16 </view>
17 - <view class="flex jc_sb ai-center pd20" wx:for="{{item.goods}}" wx:for-item="it" bindtap="goto" data-url="{{'/pages/goods/goodsInfo/goodsInfo?goods_id' + item.goods}}"> 17 + <view class="flex jc_sb ai-center pd20" wx:for="{{item.goods}}" wx:for-item="it" bindtap="goto" data-url="{{'/pages/goods/goodsInfo/goodsInfo?goods_id=' + it.goods_id}}">
18 <view class="flex pdr20"> 18 <view class="flex pdr20">
19 <view class="pdr20"><image class="img" src="{{imghost + (it.original_img ? it.original_img : default_img)}}" lazy-load/></view> 19 <view class="pdr20"><image class="img" src="{{imghost + (it.original_img ? it.original_img : default_img)}}" lazy-load/></view>
20 <view class="fs24"> 20 <view class="fs24">
packageA/pages/distribution/shop/shop.js
@@ -84,6 +84,15 @@ Page({ @@ -84,6 +84,15 @@ Page({
84 }) 84 })
85 // this.getData(true, '/api/weshop/users/distribut/pagemyshop', this.data.currentQuery); 85 // this.getData(true, '/api/weshop/users/distribut/pagemyshop', this.data.currentQuery);
86 } 86 }
  87 +
  88 + getApp().promiseGet("/api/weshop/storeDistribut/get/"+os.stoid,{}).then(rs=>{
  89 + var dis=rs.data.data;
  90 + if( dis){
  91 + self.setData({storeDistribut:dis})
  92 + }
  93 + })
  94 +
  95 +
87 }, 96 },
88 97
89 /** 98 /**
@@ -318,10 +327,17 @@ Page({ @@ -318,10 +327,17 @@ Page({
318 * 用户点击右上角分享 327 * 用户点击右上角分享
319 *--点击分享事件--分享我的小店 328 *--点击分享事件--分享我的小店
320 *--*/ 329 *--*/
321 - onShareAppMessage: function (t) { getApp().globalData.no_clear=1; 330 + onShareAppMessage: function (t) {
322 331
  332 + getApp().globalData.no_clear=1;
323 var th = this; 333 var th = this;
324 var title = "我的小店"; 334 var title = "我的小店";
  335 +
  336 + if(this.data.storeDistribut){
  337 + title=this.data.storeDistribut.distributSharetitle;
  338 + title+=" "+this.data.storeDistribut.distributShareremark;
  339 + }
  340 +
325 var user_id = this.data.first_leader; 341 var user_id = this.data.first_leader;
326 if (!user_id) { 342 if (!user_id) {
327 user_id = getApp().globalData.user_id 343 user_id = getApp().globalData.user_id
packageA/pages/goodsInfo/goodsInfo.js
@@ -853,6 +853,13 @@ Page({ @@ -853,6 +853,13 @@ Page({
853 } 853 }
854 854
855 855
  856 + if(this.data.goodsInputNum==0){
  857 + getApp().my_warnning('请输入购买数量', 1, th, 450);
  858 + return false;
  859 + }
  860 +
  861 +
  862 +
856 if(!ind) ind = t.currentTarget.dataset.openspecmodal_ind; 863 if(!ind) ind = t.currentTarget.dataset.openspecmodal_ind;
857 864
858 th.setData({ 865 th.setData({
@@ -870,6 +877,8 @@ Page({ @@ -870,6 +877,8 @@ Page({
870 var limitNum = 0; 877 var limitNum = 0;
871 // 已购买数量 878 // 已购买数量
872 var boughtNum = 0; 879 var boughtNum = 0;
  880 +
  881 + var is_ok=1;
873 882
874 // 秒杀活动 883 // 秒杀活动
875 if(this.data.prom_type == 1) { 884 if(this.data.prom_type == 1) {
@@ -895,6 +904,7 @@ Page({ @@ -895,6 +904,7 @@ Page({
895 // title: '超出活动库存', 904 // title: '超出活动库存',
896 // }); 905 // });
897 getApp().my_warnning('超出活动库存', 0, self); 906 getApp().my_warnning('超出活动库存', 0, self);
  907 + is_ok=0;
898 return false; 908 return false;
899 } else { 909 } else {
900 // 可购买数量>0 910 // 可购买数量>0
@@ -922,8 +932,9 @@ Page({ @@ -922,8 +932,9 @@ Page({
922 // }); 932 // });
923 getApp().my_warnning('超出活动库存', 0, self); 933 getApp().my_warnning('超出活动库存', 0, self);
924 th.setData({ 934 th.setData({
925 - goodsInputNum: res, 935 + goodsInputNum: res || 1
926 }); 936 });
  937 + is_ok=0;
927 return false; 938 return false;
928 }; 939 };
929 }; 940 };
@@ -935,8 +946,9 @@ Page({ @@ -935,8 +946,9 @@ Page({
935 // }); 946 // });
936 getApp().my_warnning('超出限购数量', 0, self); 947 getApp().my_warnning('超出限购数量', 0, self);
937 th.setData({ 948 th.setData({
938 - goodsInputNum: canBuyNum, 949 + goodsInputNum: canBuyNum || 1,
939 }); 950 });
  951 + is_ok=0;
940 return false; 952 return false;
941 }; 953 };
942 }; 954 };
@@ -955,7 +967,10 @@ Page({ @@ -955,7 +967,10 @@ Page({
955 }; 967 };
956 968
957 969
958 - 970 + if(!is_ok) return false;
  971 +
  972 +
  973 +
959 if(action=="buy"){ 974 if(action=="buy"){
960 //--------------此时操作的数据------------ 975 //--------------此时操作的数据------------
961 var newd = { 976 var newd = {
@@ -1243,7 +1258,7 @@ Page({ @@ -1243,7 +1258,7 @@ Page({
1243 // }); 1258 // });
1244 getApp().my_warnning('超出活动库存', 0, self); 1259 getApp().my_warnning('超出活动库存', 0, self);
1245 th.setData({ 1260 th.setData({
1246 - goodsInputNum: res, 1261 + goodsInputNum: res || 1,
1247 }); 1262 });
1248 return false; 1263 return false;
1249 }; 1264 };
@@ -1256,7 +1271,7 @@ Page({ @@ -1256,7 +1271,7 @@ Page({
1256 // }); 1271 // });
1257 getApp().my_warnning('超出限购数量', 0, self); 1272 getApp().my_warnning('超出限购数量', 0, self);
1258 th.setData({ 1273 th.setData({
1259 - goodsInputNum: canBuyNum, 1274 + goodsInputNum: canBuyNum || 1,
1260 }); 1275 });
1261 return false; 1276 return false;
1262 }; 1277 };
@@ -2444,9 +2459,15 @@ Page({ @@ -2444,9 +2459,15 @@ Page({
2444 tt(); 2459 tt();
2445 }, 2460 },
2446 fail: function(res) { 2461 fail: function(res) {
  2462 + //获取默认空白图
  2463 + wx.getImageInfo({
  2464 + src: ee.data.iurl+'/miniapp/images/default_g_img.gif',
  2465 + success: function(res) {
  2466 + ee.data.share_goods_img = res.path; //分享的图片不能用网络的
  2467 + tt();
  2468 + }
  2469 + })
2447 2470
2448 - ee.data.share_goods_img = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的  
2449 - tt();  
2450 } 2471 }
2451 }); 2472 });
2452 }, 2473 },
packageA/pages/goods_share/goods_share.js
@@ -806,8 +806,16 @@ Page({ @@ -806,8 +806,16 @@ Page({
806 tt(); 806 tt();
807 }, 807 },
808 fail: function(res) { 808 fail: function(res) {
809 - ee.data.share_goods_img = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的  
810 - tt(); 809 +
  810 + //获取默认空白图
  811 + wx.getImageInfo({
  812 + src: ee.data.url+'/miniapp/images/default_g_img.gif',
  813 + success: function(res) {
  814 + ee.data.share_goods_img = res.path; //分享的图片不能用网络的
  815 + tt();
  816 + }
  817 + })
  818 +
811 } 819 }
812 }); 820 });
813 }, 821 },
packageA/pages/quan_list/quan_list.js
@@ -32,6 +32,9 @@ Page({ @@ -32,6 +32,9 @@ Page({
32 //---展示--- 32 //---展示---
33 onShow: function () { 33 onShow: function () {
34 34
  35 + //检查能不能分享
  36 + getApp().check_can_share();
  37 +
35 console.log("onShow:1"); 38 console.log("onShow:1");
36 this.data.curpage = 1; 39 this.data.curpage = 1;
37 this.setData({ dataList: null }); 40 this.setData({ dataList: null });
@@ -41,6 +44,8 @@ Page({ @@ -41,6 +44,8 @@ Page({
41 //var data = [{ is_get:0,money:50,condition:500,id:1,name: "券名字", endtype: 0, use_start_time: 1579596090, use_end_time: 1611218490, everyone_num: 2,interval_time:1,color:"red"}]; 44 //var data = [{ is_get:0,money:50,condition:500,id:1,name: "券名字", endtype: 0, use_start_time: 1579596090, use_end_time: 1611218490, everyone_num: 2,interval_time:1,color:"red"}];
42 //th.setData({dataList: data}); 45 //th.setData({dataList: data});
43 this.setData({ getcurday: ut.gettimestamp() }); 46 this.setData({ getcurday: ut.gettimestamp() });
  47 +
  48 +
44 }, 49 },
45 50
46 onHide: function () { 51 onHide: function () {
@@ -184,5 +189,36 @@ Page({ @@ -184,5 +189,36 @@ Page({
184 var index = e.currentTarget.dataset.ind; 189 var index = e.currentTarget.dataset.ind;
185 var item = this.data.dataList[index]; 190 var item = this.data.dataList[index];
186 getApp().goto("/packageA/pages/quan_pro/quan_pro?id=" + item.id); 191 getApp().goto("/packageA/pages/quan_pro/quan_pro?id=" + item.id);
187 - } 192 + },
  193 +
  194 +
  195 + //发送给好友
  196 + onShareAppMessage:async function(e) {
  197 + getApp().globalData.no_clear=1;
  198 + var url= `packageA/pages/quan_list/quan_list`;
  199 + var userInfo = getApp().globalData.userInfo;
  200 + //是分销商才带
  201 + if (userInfo) {
  202 + url += "?first_leader=" + userInfo.user_id;
  203 + }
  204 + var ob = {
  205 + title:"优惠券列表",
  206 + path: url,
  207 + //imageUrl:this.data.url+this.data.store_config.store_logo,
  208 + };
  209 + return ob;
  210 + },
  211 +
  212 + //发送给朋友圈
  213 + onShareTimeline() {
  214 + getApp().globalData.no_clear=1;
  215 + var user_id= getApp().globalData.user_id
  216 + return {
  217 + title:"优惠券列表",
  218 + query: 'first_leader='+user_id
  219 + }
  220 + },
  221 +
  222 +
  223 +
188 }); 224 });
packageA/pages/quan_pro/quan_pro.js
@@ -44,6 +44,10 @@ Page({ @@ -44,6 +44,10 @@ Page({
44 44
45 //---展示,显示券的信息--- 45 //---展示,显示券的信息---
46 onShow: function() { 46 onShow: function() {
  47 +
  48 + //检查能不能分享
  49 + getApp().check_can_share();
  50 +
47 var th=this; 51 var th=this;
48 var user_id=getApp().globalData.user_id; 52 var user_id=getApp().globalData.user_id;
49 getApp().request.promiseGet("/api/weshop/prom/coupon/pageCouponList", { 53 getApp().request.promiseGet("/api/weshop/prom/coupon/pageCouponList", {
@@ -170,4 +174,33 @@ Page({ @@ -170,4 +174,33 @@ Page({
170 show_success:0 174 show_success:0
171 }) 175 })
172 }, 176 },
  177 +
  178 + //发送给好友
  179 + onShareAppMessage:async function(e) {
  180 + getApp().globalData.no_clear=1;
  181 + var url= "packageA/pages/quan_pro/quan_pro?id="+this.data.id;
  182 + var userInfo = getApp().globalData.userInfo;
  183 + //是分销商才带
  184 + if (userInfo) {
  185 + url += "&first_leader=" + userInfo.user_id;
  186 + }
  187 + var ob = {
  188 + title:this.data.q_data.name,
  189 + path: url,
  190 + //imageUrl:this.data.url+this.data.store_config.store_logo,
  191 + };
  192 + return ob;
  193 + },
  194 +
  195 + //发送给朋友圈
  196 + onShareTimeline() {
  197 + getApp().globalData.no_clear=1;
  198 + var user_id= getApp().globalData.user_id
  199 + return {
  200 + title:this.data.q_data.name,
  201 + query: 'id='+this.data.id+'&first_leader='+user_id
  202 + }
  203 + },
  204 +
  205 +
173 }); 206 });
packageA/pages/service_share/service_share.js
@@ -784,9 +784,15 @@ Page({ @@ -784,9 +784,15 @@ Page({
784 ee.data.share_goods_img = res.path; 784 ee.data.share_goods_img = res.path;
785 tt(); 785 tt();
786 }, 786 },
787 - fail: function(res) {  
788 - ee.data.share_goods_img = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的  
789 - tt(); 787 + fail: function(res) {
  788 + //获取默认空白图
  789 + wx.getImageInfo({
  790 + src: ee.data.url+'/miniapp/images/default_g_img.gif',
  791 + success: function(res) {
  792 + ee.data.share_goods_img = res.path; //分享的图片不能用网络的
  793 + tt();
  794 + }
  795 + })
790 } 796 }
791 }); 797 });
792 }, 798 },
packageB/pages/zuhegou/index/index.js
@@ -116,7 +116,9 @@ Page({ @@ -116,7 +116,9 @@ Page({
116 sort_store: 0, //门店分类 116 sort_store: 0, //门店分类
117 choice_sort_store: 0, //选择分类门店 117 choice_sort_store: 0, //选择分类门店
118 fir_pick_index: 0, //门店选择的下标 118 fir_pick_index: 0, //门店选择的下标
119 - sec_pick_index: 0 //门店选择的下标,地区选择之后的内页 119 + sec_pick_index: 0, //门店选择的下标,地区选择之后的内页
  120 +
  121 + sales_map:{}, //线下销售的map
120 }, 122 },
121 123
122 /** 124 /**
@@ -311,7 +313,6 @@ Page({ @@ -311,7 +313,6 @@ Page({
311 getApp().getConfig2(function (e) { 313 getApp().getConfig2(function (e) {
312 ee.setData({ 314 ee.setData({
313 bconfig: e, 315 bconfig: e,
314 - sales_rules: e.sales_rules,  
315 }); 316 });
316 //设置基本参数 317 //设置基本参数
317 th.wait_for_store_config(e); 318 th.wait_for_store_config(e);
@@ -357,12 +358,17 @@ Page({ @@ -357,12 +358,17 @@ Page({
357 } 358 }
358 } 359 }
359 //获取购物车的内容 360 //获取购物车的内容
360 - th.get_cart_val(e); 361 + setTimeout(function(){
  362 + th.get_cart_val(e);
  363 + },1000)
  364 +
361 365
362 }) 366 })
363 } else { 367 } else {
364 //获取购物车的内容 368 //获取购物车的内容
365 - th.get_cart_val(e); 369 + setTimeout(function(){
  370 + th.get_cart_val(e);
  371 + },1000)
366 } 372 }
367 }, 1); 373 }, 1);
368 374
@@ -533,6 +539,9 @@ Page({ @@ -533,6 +539,9 @@ Page({
533 //说明是加入购物车是时候 539 //说明是加入购物车是时候
534 this.data.is_zuhe_addcart = 1; 540 this.data.is_zuhe_addcart = 1;
535 if (!haveAdded) { 541 if (!haveAdded) {
  542 +
  543 +
  544 +
536 th.data.sele_g = this.data.list[index]; 545 th.data.sele_g = this.data.list[index];
537 if (!th.data.sele_g.num) th.data.goodsInputNum = 1; 546 if (!th.data.sele_g.num) th.data.goodsInputNum = 1;
538 547
@@ -567,11 +576,14 @@ Page({ @@ -567,11 +576,14 @@ Page({
567 } 576 }
568 return false; 577 return false;
569 } else { 578 } else {
570 - th.setData({  
571 - is_no_pipei: 0  
572 - });  
573 - th.check_is_in_cart(function () {  
574 - th.add_cart_func(); 579 + //先判断一下线下库存
  580 + th.check_pk_store_conut(function(){
  581 + th.setData({
  582 + is_no_pipei: 0
  583 + });
  584 + th.check_is_in_cart(function () {
  585 + th.add_cart_func();
  586 + })
575 }) 587 })
576 } 588 }
577 } else { 589 } else {
@@ -648,6 +660,110 @@ Page({ @@ -648,6 +660,110 @@ Page({
648 660
649 }, 661 },
650 662
  663 + //在启用线下的时候,要判断一下是不是有库存
  664 + async check_pk_store_conut(func,is_no_msg,gd,by_num){
  665 + var th=this;
  666 + if(this.data.sales_rules!=2){
  667 + if(func) func();
  668 + return false;
  669 + }
  670 + //门店库存no
  671 + var pkno= gd && gd.pickup_no?gd.pickup_no:this.data.def_pick_store.pickup_no;
  672 + var pickup_id=gd && gd.pick_id?gd.pick_id:this.data.def_pick_store.pickup_id;
  673 + var lock = [];
  674 + var plist=null;
  675 + var good=gd || th.data.sele_g;
  676 + var buy_num=by_num || th.data.goodsInputNum;
  677 +
  678 + if(this.data.sales_map[good.goods_id]){
  679 +
  680 + var mp=this.data.sales_map[good.goods_id];
  681 + var lock_num=mp.lock_num;
  682 + var CanOutQty=mp.CanOutQty;
  683 + if (CanOutQty < lock_num +buy_num) {
  684 +
  685 + if(!is_no_msg) {
  686 + wx.showToast({
  687 + title: "门店库存不足",
  688 + icon: 'none',
  689 + duration: 2000
  690 + })
  691 + }
  692 + return false;
  693 + }
  694 + if(is_no_msg) return true;
  695 + func();
  696 +
  697 + }else {
  698 + //先读取门店的lock,采用链式写法,少用await
  699 + await getApp().request.promiseGet("/api/weshop/order/ware/lock/page", {
  700 + data: {store_id: os.stoid, wareId: good.goods_id, pageSize: 1000}
  701 + }).then(res => {
  702 + if (res.data.code == 0 && res.data.data.total > 0) {
  703 + lock = res.data.data.pageData
  704 + }
  705 +
  706 + })
  707 + //---通过接口获取门店的线下库存信息--
  708 + await getApp().request.promiseGet("/api/weshop/goods/getWareStorages", {
  709 + data: {
  710 + storageNos: pkno,
  711 + wareIds: encodeURIComponent(good.erpwareid),
  712 + storeId: os.stoid,
  713 + pageSize: 2000
  714 + }
  715 + }).then(res => {
  716 + if (ut.ajax_ok(res)) {
  717 + plist = res.data.data.pageData[0];
  718 + }
  719 + })
  720 +
  721 + if(!plist){
  722 + if(!is_no_msg) {
  723 + wx.showToast({
  724 + title: "该商品在门店未找到库存",
  725 + icon: 'none',
  726 + duration: 2000
  727 + })
  728 + }
  729 + return false;
  730 + }
  731 +
  732 + var lock_num = th.find_lock_num(pickup_id, lock);
  733 + this.data.sales_map[good.goods_id]={
  734 + CanOutQty:plist.CanOutQty,
  735 + lock_num:lock_num
  736 + }
  737 +
  738 + if (plist.CanOutQty < lock_num + buy_num) {
  739 + if(!is_no_msg) {
  740 + wx.showToast({
  741 + title: "该商品在门店未找到库存",
  742 + icon: 'none',
  743 + duration: 2000
  744 + })
  745 + }
  746 + return false;
  747 + }
  748 + if(is_no_msg) return true;
  749 + func();
  750 + }
  751 +
  752 + },
  753 +
  754 + find_lock_num(pick_id, lock) {
  755 + var lock_num = 0;
  756 + if (!lock) return 0;
  757 + if (lock.length < 0) return 0;
  758 + for (var i in lock) {
  759 + if (pick_id == lock[i].pickupId) {
  760 + lock_num += lock[i].outQty;
  761 + }
  762 + }
  763 + return lock_num;
  764 + },
  765 +
  766 +
651 /** 767 /**
652 * 增加数量 768 * 增加数量
653 */ 769 */
@@ -664,13 +780,17 @@ Page({ @@ -664,13 +780,17 @@ Page({
664 this.data.changing = 1; 780 this.data.changing = 1;
665 781
666 var index = e.currentTarget.dataset.index; 782 var index = e.currentTarget.dataset.index;
667 - this.data.sele_g = this.data.list[index]; 783 + this.data.sele_g = th.data.list[index];
668 this.data.sele_index = index; 784 this.data.sele_index = index;
669 - th.data.goodsInputNum = this.data.sele_g.num + 1;  
670 - if (this.data.sele_g.cart_num) {  
671 - th.data.s_cart_num = this.data.sele_g.cart_num + 1;  
672 - }  
673 - th.add_cart_func(); 785 + th.data.goodsInputNum = th.data.sele_g.num + 1;
  786 +
  787 + th.check_pk_store_conut(function(){
  788 + if (th.data.sele_g.cart_num) {
  789 + th.data.s_cart_num = th.data.sele_g.cart_num + 1;
  790 + }
  791 + th.add_cart_func();
  792 + })
  793 +
674 }, 794 },
675 795
676 /** 796 /**
@@ -1581,11 +1701,19 @@ Page({ @@ -1581,11 +1701,19 @@ Page({
1581 //只是单纯的选择门店 1701 //只是单纯的选择门店
1582 if (this.data.only) { 1702 if (this.data.only) {
1583 this.data.only = 0; 1703 this.data.only = 0;
  1704 + this.data.sales_map={};
  1705 +
1584 return false; 1706 return false;
1585 } 1707 }
1586 - th.check_is_in_cart(function () {  
1587 - th.add_cart_func(); 1708 +
  1709 + //-- 判断一下库存 --
  1710 + th.check_pk_store_conut(function(){
  1711 + th.check_is_in_cart(function () {
  1712 + th.add_cart_func();
  1713 + })
1588 }) 1714 })
  1715 +
  1716 +
1589 }, 1717 },
1590 1718
1591 1719
@@ -2116,17 +2244,23 @@ Page({ @@ -2116,17 +2244,23 @@ Page({
2116 getApp().request.get("/api/weshop/cart/list", { 2244 getApp().request.get("/api/weshop/cart/list", {
2117 data: req, 2245 data: req,
2118 success: async function (e) { 2246 success: async function (e) {
2119 - if (e.data.code == 0 && e.data.data && e.data.data.pageData && e.data.data.pageData.length) { 2247 + if(ut.ajax_ok(e)) {
2120 var map = {}; 2248 var map = {};
2121 var mlist = e.data.data.pageData; 2249 var mlist = e.data.data.pageData;
2122 th.data.cart_list = mlist; 2250 th.data.cart_list = mlist;
2123 -  
2124 for (let i in mlist) { 2251 for (let i in mlist) {
2125 let item = mlist[i]; 2252 let item = mlist[i];
2126 if (item.prom_type != 7) continue; 2253 if (item.prom_type != 7) continue;
2127 if (item.prom_id != th.data.act.id) continue; 2254 if (item.prom_id != th.data.act.id) continue;
  2255 + if(th.data.def_pick_store && th.data.def_pick_store.pickup_id){
  2256 + if(item.pick_id!=th.data.def_pick_store.pickup_id){
  2257 + continue;
  2258 + }
  2259 + }
2128 map[item.goods_id] = item; 2260 map[item.goods_id] = item;
2129 } 2261 }
  2262 +
  2263 + //-- 循环活动的从表 --
2130 for (let j in th.data.list) { 2264 for (let j in th.data.list) {
2131 let item_j = th.data.list[j]; 2265 let item_j = th.data.list[j];
2132 item_j.current_price = item_j.shop_price; 2266 item_j.current_price = item_j.shop_price;
@@ -2144,6 +2278,16 @@ Page({ @@ -2144,6 +2278,16 @@ Page({
2144 if (map[item_j.goods_id]) { 2278 if (map[item_j.goods_id]) {
2145 var cart_num = map[item_j.goods_id].goods_num; 2279 var cart_num = map[item_j.goods_id].goods_num;
2146 item_j.num = cart_num; 2280 item_j.num = cart_num;
  2281 + item_j.pickup_no = map[item_j.goods_id].pickup_no;
  2282 + item_j.pick_id = map[item_j.goods_id].pick_id;
  2283 +
  2284 + //判断库存是不是存在
  2285 + var can_qty=await th.check_pk_store_conut(null,1,item_j,cart_num);
  2286 + if(!can_qty){
  2287 + item_j.num=0;
  2288 + continue;
  2289 + }
  2290 +
2147 item_j.cart_num = cart_num; 2291 item_j.cart_num = cart_num;
2148 item_j.cart_id = map[item_j.goods_id].id; 2292 item_j.cart_id = map[item_j.goods_id].id;
2149 if (item_j.buyqty > 0) { 2293 if (item_j.buyqty > 0) {
packageC/pages/goods/distributionCategoryList/index.js
@@ -143,9 +143,9 @@ Page({ @@ -143,9 +143,9 @@ Page({
143 that.setData({ store_config: e, is_do: 1 }); 143 that.setData({ store_config: e, is_do: 1 });
144 144
145 //---有勾品类--- 145 //---有勾品类---
146 - if (that.data.is_show_pl) {  
147 - that.getGoodsCategoris();  
148 - } 146 + //if (that.data.is_show_pl) {
  147 + // that.getGoodsCategoris();
  148 + //}
149 if (that.data.is_show_gb != 1 && that.data.is_show_pp != 1 && that.data.is_show_pl) { 149 if (that.data.is_show_gb != 1 && that.data.is_show_pp != 1 && that.data.is_show_pl) {
150 that.data.pl_timer = setInterval(function () { 150 that.data.pl_timer = setInterval(function () {
151 if (that.data.catelist.length > 0) { 151 if (that.data.catelist.length > 0) {
@@ -521,6 +521,7 @@ Page({ @@ -521,6 +521,7 @@ Page({
521 let { currentData } = this.data; 521 let { currentData } = this.data;
522 currentData.cat_id = this.data.cat_id; 522 currentData.cat_id = this.data.cat_id;
523 currentData.page = this.data.stylePage; 523 currentData.page = this.data.stylePage;
  524 + currentData.parent_id = 0;
524 525
525 let url = '/api/weshop/users/distribut/pagemyshop'; 526 let url = '/api/weshop/users/distribut/pagemyshop';
526 getApp().promiseGet(url, { 527 getApp().promiseGet(url, {
packageC/pages/goods/distributionCategoryList/index.wxml
@@ -33,7 +33,8 @@ @@ -33,7 +33,8 @@
33 </view> 33 </view>
34 <view wx:if="{{is_show_pl}}"> 34 <view wx:if="{{is_show_pl}}">
35 <scroll-view scroll-y scroll-with-animation class="tab-view" scroll-top="{{scrollTop}}" style="height:88%"> 35 <scroll-view scroll-y scroll-with-animation class="tab-view" scroll-top="{{scrollTop}}" style="height:88%">
36 - <view wx:for="{{catelist}}" class="tab-bar-item {{select_classify_on==index ? 'active' : ''}}" data-current="{{index}}" catchtap="click_classify" data-cid="{{item.id}}" data-index="{{index}}" data-name="{{item.name}}"> 36 + <view wx:for="{{catelist}}" wx:if="{{item}}" class="tab-bar-item {{select_classify_on==index ? 'active' : ''}}"
  37 + data-current="{{index}}" catchtap="click_classify" data-cid="{{item.id}}" data-index="{{index}}" data-name="{{item.name}}">
37 <text>{{item.name}}</text> 38 <text>{{item.name}}</text>
38 </view> 39 </view>
39 </scroll-view> 40 </scroll-view>
packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js
@@ -952,8 +952,14 @@ Page({ @@ -952,8 +952,14 @@ Page({
952 tt(); 952 tt();
953 }, 953 },
954 fail: function (res) { 954 fail: function (res) {
955 - ee.data.share_img_localpath= "../../../../images/share/default_g_img.gif"; //分享的图片不能用网络的  
956 - tt(); 955 + //获取默认空白图
  956 + wx.getImageInfo({
  957 + src: os.imghost+'/miniapp/images/default_g_img.gif',
  958 + success: function(res) {
  959 + ee.data.share_img_localpath = res.path; //分享的图片不能用网络的
  960 + tt();
  961 + }
  962 + })
957 } 963 }
958 }); 964 });
959 }, 965 },
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
@@ -317,6 +317,39 @@ Page({ @@ -317,6 +317,39 @@ Page({
317 //检查测肤 317 //检查测肤
318 getApp().check_skin_face(t,0,gid); 318 getApp().check_skin_face(t,0,gid);
319 319
  320 + //-- 自定义海报 --
  321 + getApp().request.promiseGet("/api/weshop/goods/poster/page", {
  322 + data: {store_id: os.stoid, type: 1, is_use: 1}
  323 + }).then(res => {
  324 + if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData[0]) {
  325 +
  326 + var poster_data = res.data.data.pageData[0];
  327 + var json_str = poster_data.jsonStr;
  328 +
  329 + if (json_str) {
  330 + var json_data = JSON.parse(json_str);
  331 + console.log('自定义海报参数-------');
  332 + console.log(json_data);
  333 + if (json_data.bg_img) {
  334 +
  335 + //-- 把图片那到本地 --
  336 + wx.getImageInfo({
  337 + src: json_data.bg_img,
  338 + success: function (res) {
  339 + var path = res.path;
  340 +
  341 + th.setData({share_b_img: path})
  342 + },
  343 + fail: function (res) {
  344 + }
  345 + });
  346 + }
  347 + th.setData({poster: json_data})
  348 +
  349 + }
  350 + }
  351 + })
  352 +
320 //---获取手机地址坐标-- 353 //---获取手机地址坐标--
321 //--如果tg_id是空的话,分享回来-- 354 //--如果tg_id是空的话,分享回来--
322 // console.log('扫描海报gid'); 355 // console.log('扫描海报gid');
@@ -714,7 +747,7 @@ Page({ @@ -714,7 +747,7 @@ Page({
714 data: { 747 data: {
715 store_id: os.stoid, 748 store_id: os.stoid,
716 type: 1, 749 type: 1,
717 - pageSize: 3, 750 + pageSize: 100,
718 page: 1, 751 page: 1,
719 is_share: 0, 752 is_share: 0,
720 }, 753 },
@@ -722,7 +755,24 @@ Page({ @@ -722,7 +755,24 @@ Page({
722 fir_quan = res1.data.data.pageData; 755 fir_quan = res1.data.data.pageData;
723 }) 756 })
724 } 757 }
725 - 758 + //过滤不是本商品的单品优惠券-------------------
  759 + if(fir_quan.length > 0 ){
  760 + let goodInfo = ee.data.data
  761 + for (let index = fir_quan.length-1; index >= 0; index--) {
  762 + if (fir_quan[index].useobjecttype==20) { //判断是单品优惠券
  763 + if (fir_quan[index].useobjectno != goodInfo.goods_sn) {
  764 + fir_quan.splice(index,1)
  765 + }
  766 + }
  767 + }
  768 + }
  769 + let arr=[]
  770 + let length = fir_quan.length
  771 + if (length <= 3) {
  772 + arr=fir_quan
  773 + }else{
  774 + arr=fir_quan.splice(0,3);
  775 + }
726 //--------获取视频图片--------- 776 //--------获取视频图片---------
727 await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, { 777 await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, {
728 1: 1 778 1: 1
@@ -748,7 +798,7 @@ Page({ @@ -748,7 +798,7 @@ Page({
748 is_collect: is_collect, 798 is_collect: is_collect,
749 collect_id: collect_id, 799 collect_id: collect_id,
750 categories3: categories3, 800 categories3: categories3,
751 - fir_quan: fir_quan, 801 + fir_quan: arr,
752 fir_comments: fir_com, 802 fir_comments: fir_com,
753 mapurl_f_img: mapurl_f_img, 803 mapurl_f_img: mapurl_f_img,
754 mapurl: mapurl, 804 mapurl: mapurl,
@@ -4450,7 +4500,18 @@ Page({ @@ -4450,7 +4500,18 @@ Page({
4450 wx.hideLoading(); 4500 wx.hideLoading();
4451 quan_list = res.data.data.pageData; 4501 quan_list = res.data.data.pageData;
4452 }) 4502 })
4453 - 4503 + //过滤不是本商品的单品优惠券
  4504 + if (quan_list.length > 0) {
  4505 + let goodInfo = th.data.data
  4506 + for (let index = quan_list.length-1; index >= 0; index--) {
  4507 + if (quan_list[index].useobjecttype==20) { //判断是单品优惠券
  4508 + if (quan_list[index].useobjectno != goodInfo.goods_sn) {
  4509 + quan_list.splice(index,1)
  4510 + }
  4511 + }
  4512 + }
  4513 + }
  4514 + //------------------------
4454 if (quan_list) { 4515 if (quan_list) {
4455 for (var ind in quan_list) { 4516 for (var ind in quan_list) {
4456 var ep = quan_list[ind]; 4517 var ep = quan_list[ind];
@@ -4620,7 +4681,7 @@ Page({ @@ -4620,7 +4681,7 @@ Page({
4620 // 8.商品标题 4681 // 8.商品标题
4621 context.setFontSize(20 * unit); 4682 context.setFontSize(20 * unit);
4622 context.setFillStyle('#898989'); 4683 context.setFillStyle('#898989');
4623 - this.draw_Text(context, this.data.data.goods_name, 4684 + getApp().draw_Text(context, this.data.data.goods_name,
4624 54 * unit, 770 * unit, 240 * unit, 240 * unit, unit); 4685 54 * unit, 770 * unit, 240 * unit, 240 * unit, unit);
4625 // 9.小程序码 4686 // 9.小程序码
4626 context.drawImage(vpath, 375 * unit, 660 * unit, 120 * unit, 120 * unit); 4687 context.drawImage(vpath, 375 * unit, 660 * unit, 120 * unit, 120 * unit);
@@ -4717,7 +4778,7 @@ Page({ @@ -4717,7 +4778,7 @@ Page({
4717 // context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); 4778 // context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
4718 4779
4719 4780
4720 - if (type == 0) { // 如果是普通商品,绘制新海报 4781 + if (!th.data.share_b_img && (type == 9)) { // 如果是普通商品,绘制新海报
4721 th.drawPoster(context, unit, th.data.share_goods_img, vpath); 4782 th.drawPoster(context, unit, th.data.share_goods_img, vpath);
4722 } else { 4783 } else {
4723 context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); 4784 context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
@@ -4727,7 +4788,7 @@ Page({ @@ -4727,7 +4788,7 @@ Page({
4727 4788
4728 4789
4729 //-- 是自定义海报的情况下 -- 4790 //-- 是自定义海报的情况下 --
4730 - if (type != 0) { 4791 + if (th.data.share_b_img || type != 0) {
4731 4792
4732 4793
4733 4794
@@ -4758,10 +4819,10 @@ Page({ @@ -4758,10 +4819,10 @@ Page({
4758 } 4819 }
4759 } else { 4820 } else {
4760 //--昵称--- 4821 //--昵称---
4761 - context.setFontSize(24 * unit);  
4762 - context.setFillStyle("black");  
4763 - context.fillText(app.globalData.userInfo.nickname, 152 * unit, 60 * unit);  
4764 - var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit; 4822 + // context.setFontSize(24 * unit);
  4823 + // context.setFillStyle("black");
  4824 + // context.fillText(app.globalData.userInfo.nickname, 152 * unit, 60 * unit);
  4825 + // var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit;
4765 //强烈推荐 改许程 4826 //强烈推荐 改许程
4766 // var tj_path = "../../../../images/share/q_tj.png"; 4827 // var tj_path = "../../../../images/share/q_tj.png";
4767 // let txt_gn = th.data.luckGoInfo.group_num + '人团'; 4828 // let txt_gn = th.data.luckGoInfo.group_num + '人团';
@@ -4772,9 +4833,9 @@ Page({ @@ -4772,9 +4833,9 @@ Page({
4772 // context.setFillStyle("white"); 4833 // context.setFillStyle("white");
4773 // context.fillText(txt_gn, 149 * unit + width + 15 * unit, 75 * unit); 4834 // context.fillText(txt_gn, 149 * unit + width + 15 * unit, 75 * unit);
4774 // 发出幸运购活动邀请 4835 // 发出幸运购活动邀请
4775 - context.setFillStyle("#7f7f7f")  
4776 - context.setFontSize(21.3 * unit)  
4777 - context.fillText("向您发出幸运购邀请", 152 * unit, 90 * unit); 4836 + // context.setFillStyle("#7f7f7f")
  4837 + // context.setFontSize(21.3 * unit)
  4838 + // context.fillText("向您发出幸运购邀请", 152 * unit, 90 * unit);
4778 4839
4779 } 4840 }
4780 4841
@@ -4791,7 +4852,7 @@ Page({ @@ -4791,7 +4852,7 @@ Page({
4791 4852
4792 //---产品名称--- 4853 //---产品名称---
4793 //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 4854 //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
4794 - if (type != 4 && type != 0) { 4855 + if (th.data.share_b_img || (type != 4 && type != 9)) {
4795 context.setFillStyle("black"); 4856 context.setFillStyle("black");
4796 context.setFontSize(21.3 * unit) 4857 context.setFontSize(21.3 * unit)
4797 th.draw_Text(context, share_title, 4858 th.draw_Text(context, share_title,
@@ -4852,11 +4913,29 @@ Page({ @@ -4852,11 +4913,29 @@ Page({
4852 } 4913 }
4853 4914
4854 //---中间大图--- 4915 //---中间大图---
4855 - if (type != 0) { 4916 + if ( th.data.share_b_img || type != 9) {
4856 context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit); 4917 context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit);
4857 }; 4918 };
4858 4919
  4920 + //---自定义海报 产品质量保证
  4921 + if(th.data.share_b_img && th.data.poster.show_quality==1 ){
  4922 + var g_path = "../../../../images/share/s_gou.png";
  4923 + context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit);
  4924 + context.setFillStyle("red")
  4925 + context.setFontSize(18 * unit)
  4926 + context.fillText("正品保证", 84 * unit, 690 * unit);
  4927 +
  4928 + context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit);
  4929 + context.setFillStyle("red")
  4930 + context.setFontSize(18 * unit)
  4931 + context.fillText("纯实体店", 246 * unit, 690 * unit);
4859 4932
  4933 + context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit);
  4934 + context.setFillStyle("red")
  4935 + context.setFontSize(18 * unit)
  4936 + context.fillText("官方验证", 420 * unit, 690 * unit);
  4937 +
  4938 + }
4860 4939
4861 //-------大图后面就不一样了----------- 4940 //-------大图后面就不一样了-----------
4862 switch (type) { 4941 switch (type) {
@@ -5073,74 +5152,76 @@ Page({ @@ -5073,74 +5152,76 @@ Page({
5073 5152
5074 5153
5075 case 9: 5154 case 9:
  5155 + if(th.data.share_b_img){
5076 5156
5077 - //---画线---  
5078 - context.setLineWidth(1 * unit)  
5079 - context.moveTo(32 * unit, 680 * unit)  
5080 - context.lineTo(520 * unit, 680 * unit)  
5081 - context.stroke();  
5082 -  
5083 - //---文字---  
5084 - context.setFillStyle("black")  
5085 - context.setFontSize(24 * unit)  
5086 - context.font = 'normal bold 18px';  
5087 - context.fillText(th.data.sto_sele_name_1, 40 * unit, 720 * unit);  
5088 -  
5089 - //还差N人,即可成团  
5090 - let group_num = th.data.luckGoInfo.group_num;  
5091 - let num_joined = th.data.luckGoInfo.num;  
5092 - let delta1 = group_num - num_joined;  
5093 - let width_delta1 = ut.measureText(delta1, 15);  
5094 - context.setFillStyle("black");  
5095 - context.setFontSize(21.3 * unit);  
5096 - context.fillText(group_num + "人团,还差", 40 * unit, 772 * unit);  
5097 - context.setFillStyle("#FF6768");  
5098 - context.setFontSize(21.3 * unit);  
5099 - context.fillText(delta1, 160 * unit, 772 * unit);  
5100 - context.setFillStyle("black");  
5101 - context.setFontSize(21.3 * unit);  
5102 - context.fillText("人,即可成团", (170 + width_delta1) * unit, 772 * unit);  
5103 -  
5104 - // N人得商品,N人全额退款  
5105 - let group_win = th.data.luckGoInfo.group_win;  
5106 - let delta2 = group_num - group_win;  
5107 - let width_delta2 = ut.measureText(delta2, 16);  
5108 - let width_groupNum = ut.measureText(group_num, 15);  
5109 - let width_groupWin = ut.measureText(group_win, 15);  
5110 - context.setFillStyle("#FF6768");  
5111 - context.setFontSize(21.3 * unit);  
5112 - context.fillText(group_win, 40 * unit, 806 * unit);  
5113 - context.setFillStyle("black");  
5114 - context.setFontSize(21.3 * unit);  
5115 - context.fillText("人得商品,", (54 + width_groupWin) * unit, 806 * unit);  
5116 - context.setFillStyle("#FF6768");  
5117 - context.setFontSize(21.3 * unit);  
5118 - context.fillText(delta2, 160 * unit, 806 * unit);  
5119 - context.setFillStyle("black");  
5120 - context.setFontSize(21.3 * unit);  
5121 - context.fillText("人全额退款", (170 + width_delta2) * unit, 806 * unit);  
5122 -  
5123 - // 并得帮团惊喜礼品  
5124 - context.setFillStyle("black")  
5125 - context.setFontSize(21.3 * unit)  
5126 - context.fillText("并得帮团", 40 * unit, 840 * unit);  
5127 - context.setFillStyle("#FF6768")  
5128 - context.setFontSize(21.3 * unit)  
5129 - context.fillText("惊喜礼品", 130 * unit, 840 * unit);  
5130 - context.setFillStyle("black")  
5131 - context.setFontSize(21.3 * unit)  
5132 - context.fillText("!", 220 * unit, 840 * unit); 5157 +
  5158 + //---画线---
  5159 + context.setLineWidth(1 * unit)
  5160 + context.moveTo(32 * unit, 680 * unit)
  5161 + context.lineTo(520 * unit, 680 * unit)
  5162 + context.stroke();
5133 5163
  5164 + //---文字---
  5165 + context.setFillStyle("black")
  5166 + context.setFontSize(24 * unit)
  5167 + context.font = 'normal bold 18px';
  5168 + context.fillText(th.data.sto_sele_name_1, 40 * unit, 720 * unit);
  5169 +
  5170 + //还差N人,即可成团
  5171 + let group_num = th.data.luckGoInfo.group_num;
  5172 + let num_joined = th.data.luckGoInfo.num;
  5173 + let delta1 = group_num - num_joined;
  5174 + let width_delta1 = ut.measureText(delta1, 15);
  5175 + context.setFillStyle("black");
  5176 + context.setFontSize(21.3 * unit);
  5177 + context.fillText(group_num + "人团,还差", 40 * unit, 772 * unit);
  5178 + context.setFillStyle("#FF6768");
  5179 + context.setFontSize(21.3 * unit);
  5180 + context.fillText(delta1, 160 * unit, 772 * unit);
  5181 + context.setFillStyle("black");
  5182 + context.setFontSize(21.3 * unit);
  5183 + context.fillText("人,即可成团", (170 + width_delta1) * unit, 772 * unit);
  5184 +
  5185 + // N人得商品,N人全额退款
  5186 + let group_win = th.data.luckGoInfo.group_win;
  5187 + let delta2 = group_num - group_win;
  5188 + let width_delta2 = ut.measureText(delta2, 16);
  5189 + let width_groupNum = ut.measureText(group_num, 15);
  5190 + let width_groupWin = ut.measureText(group_win, 15);
  5191 + context.setFillStyle("#FF6768");
  5192 + context.setFontSize(21.3 * unit);
  5193 + context.fillText(group_win, 40 * unit, 806 * unit);
  5194 + context.setFillStyle("black");
  5195 + context.setFontSize(21.3 * unit);
  5196 + context.fillText("人得商品,", (54 + width_groupWin) * unit, 806 * unit);
  5197 + context.setFillStyle("#FF6768");
  5198 + context.setFontSize(21.3 * unit);
  5199 + context.fillText(delta2, 160 * unit, 806 * unit);
  5200 + context.setFillStyle("black");
  5201 + context.setFontSize(21.3 * unit);
  5202 + context.fillText("人全额退款", (170 + width_delta2) * unit, 806 * unit);
  5203 +
  5204 + // 并得帮团惊喜礼品
  5205 + context.setFillStyle("black")
  5206 + context.setFontSize(21.3 * unit)
  5207 + context.fillText("并得帮团", 40 * unit, 840 * unit);
  5208 + context.setFillStyle("#FF6768")
  5209 + context.setFontSize(21.3 * unit)
  5210 + context.fillText("惊喜礼品", 130 * unit, 840 * unit);
  5211 + context.setFillStyle("black")
  5212 + context.setFontSize(21.3 * unit)
  5213 + context.fillText("!", 220 * unit, 840 * unit);
  5214 + }
5134 5215
5135 //---二维吗图--- 5216 //---二维吗图---
5136 //-- 自定义海报 -- 5217 //-- 自定义海报 --
5137 - if (th.data.poster) { 5218 + if (th.data.share_b_img && th.data.poster) {
5138 var erm_x = parseFloat(th.data.poster.ewm_x) * 2; 5219 var erm_x = parseFloat(th.data.poster.ewm_x) * 2;
5139 var erm_y = parseFloat(th.data.poster.ewm_y) * 2; 5220 var erm_y = parseFloat(th.data.poster.ewm_y) * 2;
5140 context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit); 5221 context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit);
5141 } else { 5222 } else {
5142 //---二维吗图--- 5223 //---二维吗图---
5143 - context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit); 5224 + // context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit);
5144 } 5225 }
5145 5226
5146 break; 5227 break;
@@ -5150,7 +5231,7 @@ Page({ @@ -5150,7 +5231,7 @@ Page({
5150 5231
5151 5232
5152 //--- 如果是自定义海报的时候 --- 5233 //--- 如果是自定义海报的时候 ---
5153 - if (type != 0) { 5234 + if ( th.data.share_b_img || type != 9) {
5154 5235
5155 if (th.data.poster && parseInt(th.data.poster.style) == 2) { 5236 if (th.data.poster && parseInt(th.data.poster.style) == 2) {
5156 5237
@@ -5324,7 +5405,7 @@ Page({ @@ -5324,7 +5405,7 @@ Page({
5324 5405
5325 5406
5326 5407
5327 - //--获取头像的本地缓存,回调写法-- 5408 + //--获取头像的本地缓存,回调写法--
5328 get_head_temp: function (tt, func) { 5409 get_head_temp: function (tt, func) {
5329 var ee = this; 5410 var ee = this;
5330 if (ee.data.share_head) { 5411 if (ee.data.share_head) {
@@ -5375,8 +5456,14 @@ Page({ @@ -5375,8 +5456,14 @@ Page({
5375 tt(); 5456 tt();
5376 }, 5457 },
5377 fail: function (res) { 5458 fail: function (res) {
5378 - ee.data.share_goods_img = "../../../../images/share/default_g_img.gif"; //分享的图片不能用网络的  
5379 - tt(); 5459 + //获取默认空白图
  5460 + wx.getImageInfo({
  5461 + src: ee.data.iurl+'/miniapp/images/default_g_img.gif',
  5462 + success: function(res) {
  5463 + ee.data.share_goods_img = res.path; //分享的图片不能用网络的
  5464 + tt();
  5465 + }
  5466 + })
5380 } 5467 }
5381 }); 5468 });
5382 }, 5469 },
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml
@@ -899,7 +899,7 @@ @@ -899,7 +899,7 @@
899 <view class="shopping-cart cart-ico new_split"> 899 <view class="shopping-cart cart-ico new_split">
900 <navigator open-type="switchTab" url="/pages/cart/cart/cart"> 900 <navigator open-type="switchTab" url="/pages/cart/cart/cart">
901 <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image> 901 <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image>
902 - <view class="cart-num ellipsis-1">{{cartGoodsNum}}</view> 902 + <!-- <view class="cart-num ellipsis-1">{{cartGoodsNum}}</view> -->
903 <view>购物车</view> 903 <view>购物车</view>
904 </navigator> 904 </navigator>
905 </view> 905 </view>
packageC/pages/presell/goodsInfo/goodsInfo.js
@@ -7,7 +7,7 @@ var ut = require(&quot;../../../../utils/util.js&quot;), @@ -7,7 +7,7 @@ var ut = require(&quot;../../../../utils/util.js&quot;),
7 oo = s.globalData, 7 oo = s.globalData,
8 o = s.globalData.setting, 8 o = s.globalData.setting,
9 os = o; 9 os = o;
10 -//评价加载更多 10 +//评价加载更多
11 var more = function (e) { 11 var more = function (e) {
12 return e && e.__esModule ? e : { 12 return e && e.__esModule ? e : {
13 default: e 13 default: e
@@ -250,13 +250,13 @@ Page({ @@ -250,13 +250,13 @@ Page({
250 250
251 share_hidden: false, 251 share_hidden: false,
252 pre_arr: null, 252 pre_arr: null,
253 -  
254 - hiddenCS: true, 253 +
  254 + hiddenCS: true,
255 }, 255 },
256 256
257 //------初始化加载---------- 257 //------初始化加载----------
258 onLoad: function (t) { 258 onLoad: function (t) {
259 - self = this; 259 + self = this;
260 var ee = this, that = ee, th = ee, 260 var ee = this, that = ee, th = ee,
261 pre_id = t.pre_id, 261 pre_id = t.pre_id,
262 gid = t.goods_id, 262 gid = t.goods_id,
@@ -264,8 +264,8 @@ Page({ @@ -264,8 +264,8 @@ Page({
264 first_leader = t.first_leader, 264 first_leader = t.first_leader,
265 room_id = t.room_id, 265 room_id = t.room_id,
266 room_user_share = t.room_user_share; //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id 266 room_user_share = t.room_user_share; //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id
267 - //检查测肤  
268 - getApp().check_skin_face(t,0,gid); 267 + //检查测肤
  268 + getApp().check_skin_face(t, 0, gid);
269 269
270 //-- 自定义海报 -- 270 //-- 自定义海报 --
271 getApp().request.promiseGet("/api/weshop/goods/poster/page", { 271 getApp().request.promiseGet("/api/weshop/goods/poster/page", {
@@ -314,7 +314,7 @@ Page({ @@ -314,7 +314,7 @@ Page({
314 } 314 }
315 315
316 this.setData({ 316 this.setData({
317 - gid:gid,pre_id:pre_id,presell_id:presell_id 317 + gid: gid, pre_id: pre_id, presell_id: presell_id
318 }) 318 })
319 319
320 if (first_leader) { 320 if (first_leader) {
@@ -561,7 +561,7 @@ Page({ @@ -561,7 +561,7 @@ Page({
561 data: { 561 data: {
562 store_id: os.stoid, 562 store_id: os.stoid,
563 type: 1, 563 type: 1,
564 - pageSize: 3, 564 + pageSize: 100,
565 page: 1, 565 page: 1,
566 is_share: 0, 566 is_share: 0,
567 }, 567 },
@@ -569,7 +569,24 @@ Page({ @@ -569,7 +569,24 @@ Page({
569 fir_quan = res1.data.data.pageData; 569 fir_quan = res1.data.data.pageData;
570 }) 570 })
571 } 571 }
572 - 572 + //过滤不是本商品的单品优惠券-------------------
  573 + if (fir_quan.length > 0) {
  574 + let goodInfo = ee.data.data || {}
  575 + for (let index = fir_quan.length - 1; index >= 0; index--) {
  576 + if (fir_quan[index].useobjecttype == 20) { //判断是单品优惠券
  577 + if (fir_quan[index].useobjectno != goodInfo.goods_sn) {
  578 + fir_quan.splice(index, 1)
  579 + }
  580 + }
  581 + }
  582 + }
  583 + let arr = []
  584 + let length = fir_quan.length
  585 + if (length <= 3) {
  586 + arr = fir_quan
  587 + } else {
  588 + arr = fir_quan.splice(0, 3);
  589 + }
573 //--------获取视频图片--------- 590 //--------获取视频图片---------
574 await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, { 591 await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, {
575 1: 1 592 1: 1
@@ -587,7 +604,7 @@ Page({ @@ -587,7 +604,7 @@ Page({
587 is_collect: is_collect, 604 is_collect: is_collect,
588 collect_id: collect_id, 605 collect_id: collect_id,
589 categories3: categories3, 606 categories3: categories3,
590 - fir_quan: fir_quan, 607 + fir_quan: arr,
591 fir_comments: fir_com, 608 fir_comments: fir_com,
592 mapurl_f_img: mapurl_f_img, 609 mapurl_f_img: mapurl_f_img,
593 mapurl: mapurl, 610 mapurl: mapurl,
@@ -597,7 +614,7 @@ Page({ @@ -597,7 +614,7 @@ Page({
597 614
598 //---展示--- 615 //---展示---
599 onShow: function () { 616 onShow: function () {
600 - getApp().check_can_share(); 617 + getApp().check_can_share();
601 var goods_list = null, th = this, that = this; 618 var goods_list = null, th = this, that = this;
602 619
603 //-- 如果是预览图片,页面不重新更新 -- 620 //-- 如果是预览图片,页面不重新更新 --
@@ -672,8 +689,8 @@ Page({ @@ -672,8 +689,8 @@ Page({
672 689
673 //-- 把商品的赋值 -- 690 //-- 把商品的赋值 --
674 ee.data.fir_goods = JSON.parse(JSON.stringify(t.data.data)); 691 ee.data.fir_goods = JSON.parse(JSON.stringify(t.data.data));
675 - ee.data.sele_g_id=t.data.data.goods_id;  
676 - ee.data.sele_g=t.data.data; 692 + ee.data.sele_g_id = t.data.data.goods_id;
  693 + ee.data.sele_g = t.data.data;
677 694
678 //获取用户的默认门店 695 //获取用户的默认门店
679 getApp().get_user_store(function (e) { 696 getApp().get_user_store(function (e) {
@@ -681,7 +698,7 @@ Page({ @@ -681,7 +698,7 @@ Page({
681 th.data.fir_def_store = {}; //赋值空对象 698 th.data.fir_def_store = {}; //赋值空对象
682 return false; 699 return false;
683 } 700 }
684 - if(getApp().globalData.is_dj_pk) th.setData({has_def:1}) 701 + if (getApp().globalData.is_dj_pk) th.setData({ has_def: 1 })
685 702
686 var ee = JSON.parse(JSON.stringify(e)); 703 var ee = JSON.parse(JSON.stringify(e));
687 704
@@ -1045,7 +1062,7 @@ Page({ @@ -1045,7 +1062,7 @@ Page({
1045 1062
1046 newd.goods_price = th.data.prom_price; 1063 newd.goods_price = th.data.prom_price;
1047 newd.member_goods_price = th.data.prom_price, 1064 newd.member_goods_price = th.data.prom_price,
1048 - newd.prom_type = 8; 1065 + newd.prom_type = 8;
1049 newd.prom_id = o.prom_id; 1066 newd.prom_id = o.prom_id;
1050 1067
1051 if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); 1068 if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
@@ -1084,8 +1101,8 @@ Page({ @@ -1084,8 +1101,8 @@ Page({
1084 return s.my_warnning("库存不足!", 0, th); 1101 return s.my_warnning("库存不足!", 0, th);
1085 } 1102 }
1086 1103
1087 - if (item.goods_num + th.data.goodsInputNum >th.data.pre_arr.presell_sumqty-th.data.pre_arr.buy_goodnum) {  
1088 - return s.my_warnning("库存不足!", 0, th); 1104 + if (item.goods_num + th.data.goodsInputNum > th.data.pre_arr.presell_sumqty - th.data.pre_arr.buy_goodnum) {
  1105 + return s.my_warnning("库存不足!", 0, th);
1089 } 1106 }
1090 1107
1091 var updata = { 1108 var updata = {
@@ -1156,10 +1173,10 @@ Page({ @@ -1156,10 +1173,10 @@ Page({
1156 app.set_b_now(e); 1173 app.set_b_now(e);
1157 1174
1158 //如果是全额付款的话 1175 //如果是全额付款的话
1159 - if(this.data.presellForm.presell_type==1){  
1160 - getApp().goto("/packageC/pages/presell/cart/cart2")  
1161 - }else{  
1162 - getApp().goto("/packageC/pages/presell/cart/cart2_pre"); 1176 + if (this.data.presellForm.presell_type == 1) {
  1177 + getApp().goto("/packageC/pages/presell/cart/cart2")
  1178 + } else {
  1179 + getApp().goto("/packageC/pages/presell/cart/cart2_pre");
1163 } 1180 }
1164 }, 1181 },
1165 1182
@@ -1213,8 +1230,8 @@ Page({ @@ -1213,8 +1230,8 @@ Page({
1213 } 1230 }
1214 1231
1215 var e = th.data.sele_g.store_count; 1232 var e = th.data.sele_g.store_count;
1216 - var e2=th.data.pre_arr.presell_sumqty-th.data.pre_arr.buy_goodnum;  
1217 - if(e2<e) e=e2; 1233 + var e2 = th.data.pre_arr.presell_sumqty - th.data.pre_arr.buy_goodnum;
  1234 + if (e2 < e) e = e2;
1218 1235
1219 if (!e) e = 0; 1236 if (!e) e = 0;
1220 //库存不足,不增加 1237 //库存不足,不增加
@@ -1280,14 +1297,14 @@ Page({ @@ -1280,14 +1297,14 @@ Page({
1280 1297
1281 //判断是不是优惠促销 1298 //判断是不是优惠促销
1282 check_is_prom_goods: function (callback) { 1299 check_is_prom_goods: function (callback) {
1283 - if(!this.data.sele_g) return false; 1300 + if (!this.data.sele_g) return false;
1284 var th = this; 1301 var th = this;
1285 var usr = getApp().globalData.userInfo; 1302 var usr = getApp().globalData.userInfo;
1286 if (this.data.sele_g.prom_type != 0 && this.data.sele_g.prom_type != 3) { 1303 if (this.data.sele_g.prom_type != 0 && this.data.sele_g.prom_type != 3) {
1287 callback(); 1304 callback();
1288 } else { 1305 } else {
1289 //-- 判断有没有优惠活动 -- 1306 //-- 判断有没有优惠活动 --
1290 - getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + th.data.sele_g.goods_id + "/0"+"/"+getApp().globalData.user_id, {}).then(res => { 1307 + getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + th.data.sele_g.goods_id + "/0" + "/" + getApp().globalData.user_id, {}).then(res => {
1291 if (res.data.code == 0) { 1308 if (res.data.code == 0) {
1292 var r_data = res.data.data; 1309 var r_data = res.data.data;
1293 th.data.prom_goods = r_data.promGoodsLists; 1310 th.data.prom_goods = r_data.promGoodsLists;
@@ -1444,38 +1461,38 @@ Page({ @@ -1444,38 +1461,38 @@ Page({
1444 contactService: function () { 1461 contactService: function () {
1445 getApp().com_call(this); 1462 getApp().com_call(this);
1446 }, 1463 },
1447 -  
1448 - // 获取客服电话  
1449 - getTel() {  
1450 - return new Promise((resolve, reject) => {  
1451 - s.getConfig(function (t) {  
1452 - if (t.store_tel == undefined) {  
1453 - getApp().request.get("/api/weshop/store/get/" + os.stoid, {  
1454 - isShowLoading: 1,  
1455 - data: {},  
1456 - success: function (rs) {  
1457 - getApp().globalData.config = rs.data.data;  
1458 - if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {  
1459 - getApp().my_warnning("商家未设置电话", 0, th);  
1460 - return false;  
1461 - }  
1462 - self.setData({  
1463 - store_tel: rs.data.data.store_tel,  
1464 - });  
1465 - // s.confirmBox("请联系客服:" + rs.data.data.store_tel);  
1466 - }  
1467 - })  
1468 - } else {  
1469 - self.setData({  
1470 - store_tel: t.store_tel,  
1471 - });  
1472 - // s.confirmBox("请联系客服:" + t.store_tel);  
1473 - };  
1474 - resolve();  
1475 - });  
1476 - });  
1477 - },  
1478 - 1464 +
  1465 + // 获取客服电话
  1466 + getTel() {
  1467 + return new Promise((resolve, reject) => {
  1468 + s.getConfig(function (t) {
  1469 + if (t.store_tel == undefined) {
  1470 + getApp().request.get("/api/weshop/store/get/" + os.stoid, {
  1471 + isShowLoading: 1,
  1472 + data: {},
  1473 + success: function (rs) {
  1474 + getApp().globalData.config = rs.data.data;
  1475 + if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
  1476 + getApp().my_warnning("商家未设置电话", 0, th);
  1477 + return false;
  1478 + }
  1479 + self.setData({
  1480 + store_tel: rs.data.data.store_tel,
  1481 + });
  1482 + // s.confirmBox("请联系客服:" + rs.data.data.store_tel);
  1483 + }
  1484 + })
  1485 + } else {
  1486 + self.setData({
  1487 + store_tel: t.store_tel,
  1488 + });
  1489 + // s.confirmBox("请联系客服:" + t.store_tel);
  1490 + };
  1491 + resolve();
  1492 + });
  1493 + });
  1494 + },
  1495 +
1479 //-------获取购物车数量---------- 1496 //-------获取购物车数量----------
1480 requestCardNum: function () { 1497 requestCardNum: function () {
1481 var t = this; 1498 var t = this;
@@ -1515,7 +1532,7 @@ Page({ @@ -1515,7 +1532,7 @@ Page({
1515 b[i] = this.data.iurl + e[i]; 1532 b[i] = this.data.iurl + e[i];
1516 } 1533 }
1517 this.data.show_prew_img = 1; 1534 this.data.show_prew_img = 1;
1518 - getApp().pre_img2(b,t) 1535 + getApp().pre_img2(b, t)
1519 1536
1520 }, 1537 },
1521 1538
@@ -1526,16 +1543,16 @@ Page({ @@ -1526,16 +1543,16 @@ Page({
1526 b[i] = this.data.iurl + e[i]; 1543 b[i] = this.data.iurl + e[i];
1527 } 1544 }
1528 this.data.show_prew_img = 1; 1545 this.data.show_prew_img = 1;
1529 - getApp().pre_img2(b,t) 1546 + getApp().pre_img2(b, t)
1530 }, 1547 },
1531 1548
1532 previewGoodsCommentImgs: function (t) { 1549 previewGoodsCommentImgs: function (t) {
1533 var e = this, 1550 var e = this,
1534 a = this.data.data.comment[t.currentTarget.dataset.cidx].img; 1551 a = this.data.data.comment[t.currentTarget.dataset.cidx].img;
1535 - getApp().globalData.no_clear=1; 1552 + getApp().globalData.no_clear = 1;
1536 a = a.map(function (t) { 1553 a = a.map(function (t) {
1537 return e.data.url + t; 1554 return e.data.url + t;
1538 - }), getApp().pre_img2(a,t); 1555 + }), getApp().pre_img2(a, t);
1539 this.data.show_prew_img = 1; 1556 this.data.show_prew_img = 1;
1540 }, 1557 },
1541 closePromModal: function () { 1558 closePromModal: function () {
@@ -1550,19 +1567,20 @@ Page({ @@ -1550,19 +1567,20 @@ Page({
1550 }, 1567 },
1551 1568
1552 //--点击分享事件--- 1569 //--点击分享事件---
1553 - onShareAppMessage: function (t) { getApp().globalData.no_clear=1; 1570 + onShareAppMessage: function (t) {
  1571 + getApp().globalData.no_clear = 1;
1554 1572
1555 var th = this; 1573 var th = this;
1556 - var price = th.data.pre_arr.presell_price; 1574 + var price = th.data.pre_arr.presell_price;
1557 var img = th.data.data.original_img; 1575 var img = th.data.data.original_img;
1558 - var title = th.data.presellForm.share_title; 1576 + var title = th.data.presellForm.share_title;
1559 if (!title) title = th.data.prom_act.title; 1577 if (!title) title = th.data.prom_act.title;
1560 if (th.data.prom_type == 4) title = th.data.prom_act.name; 1578 if (th.data.prom_type == 4) title = th.data.prom_act.name;
1561 1579
1562 //if (th.data.presellForm.share_img) 1580 //if (th.data.presellForm.share_img)
1563 // img = th.data.iurl + th.data.presellForm.share_img; 1581 // img = th.data.iurl + th.data.presellForm.share_img;
1564 1582
1565 - var url = "/packageC/pages/presell/goodsInfo/goodsInfo?goods_id=" + th.data.gid+"&pre_id="+th.data.pre_arr.id; 1583 + var url = "/packageC/pages/presell/goodsInfo/goodsInfo?goods_id=" + th.data.gid + "&pre_id=" + th.data.pre_arr.id;
1566 if (getApp().globalData.user_id) { 1584 if (getApp().globalData.user_id) {
1567 url += "&first_leader=" + getApp().globalData.user_id; 1585 url += "&first_leader=" + getApp().globalData.user_id;
1568 } 1586 }
@@ -1580,13 +1598,13 @@ Page({ @@ -1580,13 +1598,13 @@ Page({
1580 path: url, 1598 path: url,
1581 imageUrl: img, 1599 imageUrl: img,
1582 }; 1600 };
1583 - 1601 +
1584 ob.title += '\n' + th.data.presellForm.share_remark; 1602 ob.title += '\n' + th.data.presellForm.share_remark;
1585 -  
1586 -  
1587 - console.log(ob,888);  
1588 1603
1589 - 1604 +
  1605 + console.log(ob, 888);
  1606 +
  1607 +
1590 return ob; 1608 return ob;
1591 1609
1592 }, 1610 },
@@ -1609,22 +1627,22 @@ Page({ @@ -1609,22 +1627,22 @@ Page({
1609 1627
1610 //----------装载同一活动中的商品---------- 1628 //----------装载同一活动中的商品----------
1611 async get_sku(stoid, gd, g_id, is_normal, func) { 1629 async get_sku(stoid, gd, g_id, is_normal, func) {
1612 - var tt = this, arrdata = null;  
1613 - var now = ut.gettimestamp();  
1614 - var rq_data={  
1615 - store_id: o.stoid,  
1616 - sku: gd.sku,  
1617 - more_spec: gd.more_spec,  
1618 - isonsale: 1,  
1619 - is_on_sale: 1,  
1620 - pageSize: 500,  
1621 - orderField: 'gg_ordid,goods_spec,sort',  
1622 - prom_type: 8,  
1623 - }; 1630 + var tt = this, arrdata = null;
  1631 + var now = ut.gettimestamp();
  1632 + var rq_data = {
  1633 + store_id: o.stoid,
  1634 + sku: gd.sku,
  1635 + more_spec: gd.more_spec,
  1636 + isonsale: 1,
  1637 + is_on_sale: 1,
  1638 + pageSize: 500,
  1639 + orderField: 'gg_ordid,goods_spec,sort',
  1640 + prom_type: 8,
  1641 + };
1624 1642
1625 - if(tt.data.presellForm && tt.data.presellForm.id){  
1626 - rq_data.prom_id=tt.data.presellForm.id;  
1627 - } 1643 + if (tt.data.presellForm && tt.data.presellForm.id) {
  1644 + rq_data.prom_id = tt.data.presellForm.id;
  1645 + }
1628 1646
1629 await getApp().request.promiseGet("/api/weshop/goods/page", { 1647 await getApp().request.promiseGet("/api/weshop/goods/page", {
1630 data: rq_data 1648 data: rq_data
@@ -1755,31 +1773,31 @@ Page({ @@ -1755,31 +1773,31 @@ Page({
1755 1773
1756 //选择了不同的规格的时候要判断是不是有活动正在进行中 1774 //选择了不同的规格的时候要判断是不是有活动正在进行中
1757 async sele_spec_chech_activity() { 1775 async sele_spec_chech_activity() {
1758 - var prom = null, goodsinfo = this.data.sele_g, th = this;  
1759 -  
1760 - var all_pre_goods=th.data.all_pre_goods;  
1761 - if(all_pre_goods){  
1762 - var userInfo = getApp().globalData.userInfo;  
1763 - var pre_data = { store_id: os.stoid, is_end: 0, timetype: 1, isuse: 1, goods_id: th.data.gid };  
1764 - if (userInfo) {  
1765 - pre_data.user_id = userInfo.user_id;  
1766 - }  
1767 - await getApp().request.promiseGet("/api/weshop/marketing/marketingPresellList/page", {  
1768 - data: pre_data,  
1769 - }).then(e => {  
1770 - if (e.data.code == 0 && e.data.data.pageData && e.data.data.pageData.length > 0) {  
1771 - all_pre_goods=e.data.data.pageData;  
1772 - th.data.all_pre_goods=e.data.data.pageData;  
1773 - }  
1774 - }) 1776 + var prom = null, goodsinfo = this.data.sele_g, th = this;
  1777 +
  1778 + var all_pre_goods = th.data.all_pre_goods;
  1779 + if (all_pre_goods) {
  1780 + var userInfo = getApp().globalData.userInfo;
  1781 + var pre_data = { store_id: os.stoid, is_end: 0, timetype: 1, isuse: 1, goods_id: th.data.gid };
  1782 + if (userInfo) {
  1783 + pre_data.user_id = userInfo.user_id;
1775 } 1784 }
1776 -  
1777 - var idx=all_pre_goods.findIndex(function (ele) {  
1778 - return ele.goods_id==goodsinfo.goods_id; 1785 + await getApp().request.promiseGet("/api/weshop/marketing/marketingPresellList/page", {
  1786 + data: pre_data,
  1787 + }).then(e => {
  1788 + if (e.data.code == 0 && e.data.data.pageData && e.data.data.pageData.length > 0) {
  1789 + all_pre_goods = e.data.data.pageData;
  1790 + th.data.all_pre_goods = e.data.data.pageData;
  1791 + }
1779 }) 1792 })
1780 - var pre_arr =all_pre_goods[idx];  
1781 - th.setData({ pre_arr: pre_arr })  
1782 - th.data.prom_buy_limit=pre_arr.vip_butyqty; 1793 + }
  1794 +
  1795 + var idx = all_pre_goods.findIndex(function (ele) {
  1796 + return ele.goods_id == goodsinfo.goods_id;
  1797 + })
  1798 + var pre_arr = all_pre_goods[idx];
  1799 + th.setData({ pre_arr: pre_arr })
  1800 + th.data.prom_buy_limit = pre_arr.vip_butyqty;
1783 }, 1801 },
1784 1802
1785 1803
@@ -1870,7 +1888,7 @@ Page({ @@ -1870,7 +1888,7 @@ Page({
1870 th.setData({ all_pick_list: e.data.data.pageData }); 1888 th.setData({ all_pick_list: e.data.data.pageData });
1871 1889
1872 //--获取线下库存,而且不是新的门店规则, 同时是普通购买的时候,或者同时不能是活动,秒杀,拼团,积分购 预售-- 1890 //--获取线下库存,而且不是新的门店规则, 同时是普通购买的时候,或者同时不能是活动,秒杀,拼团,积分购 预售--
1873 - if (th.data.sales_rules == 2 && !th.data.is_newsales_rules && ((th.data.prom_type != 1 && th.data.prom_type != 6 && th.data.prom_type != 4 && th.data.prom_type !=8 ) || is_normal == 1)) { 1891 + if (th.data.sales_rules == 2 && !th.data.is_newsales_rules && ((th.data.prom_type != 1 && th.data.prom_type != 6 && th.data.prom_type != 4 && th.data.prom_type != 8) || is_normal == 1)) {
1874 setTimeout(function () { 1892 setTimeout(function () {
1875 th.deal_pickup_dline(e); 1893 th.deal_pickup_dline(e);
1876 }, 800) 1894 }, 800)
@@ -1906,15 +1924,15 @@ Page({ @@ -1906,15 +1924,15 @@ Page({
1906 success: function (ee) { 1924 success: function (ee) {
1907 if (ee.data.code == 0) { 1925 if (ee.data.code == 0) {
1908 1926
1909 - var check_all_cate=0;  
1910 - if (ee.data.data && ee.data.data.pageData && ee.data.data.pageData.length > 0){  
1911 - for(let i in ee.data.data.pageData){  
1912 - let item=ee.data.data.pageData[i];  
1913 - if(item.is_show==1){  
1914 - check_all_cate=1;break  
1915 - }  
1916 - } 1927 + var check_all_cate = 0;
  1928 + if (ee.data.data && ee.data.data.pageData && ee.data.data.pageData.length > 0) {
  1929 + for (let i in ee.data.data.pageData) {
  1930 + let item = ee.data.data.pageData[i];
  1931 + if (item.is_show == 1) {
  1932 + check_all_cate = 1; break
  1933 + }
1917 } 1934 }
  1935 + }
1918 1936
1919 if (check_all_cate) { 1937 if (check_all_cate) {
1920 1938
@@ -1923,29 +1941,29 @@ Page({ @@ -1923,29 +1941,29 @@ Page({
1923 var newarr = new Array(); 1941 var newarr = new Array();
1924 var qita = new Array(); 1942 var qita = new Array();
1925 1943
1926 - var is_del_pk=0; 1944 + var is_del_pk = 0;
1927 //----要进行门店分组-------- 1945 //----要进行门店分组--------
1928 for (var i = 0; i < sto_arr.length; i++) { 1946 for (var i = 0; i < sto_arr.length; i++) {
1929 //找一下这个门店有没有在分类数组内 1947 //找一下这个门店有没有在分类数组内
1930 var find2 = 0, find2name = "", sort = 0; 1948 var find2 = 0, find2name = "", sort = 0;
1931 - is_del_pk=0; 1949 + is_del_pk = 0;
1932 for (var m = 0; m < sto_cate.length; m++) { 1950 for (var m = 0; m < sto_cate.length; m++) {
1933 - if (sto_arr[i].category_id == sto_cate[m].cat_id) {  
1934 - if (sto_cate[m].is_show != 1) {  
1935 - is_del_pk = 1;  
1936 - sto_arr.splice(i, 1);  
1937 - i--;  
1938 - } else {  
1939 - find2 = sto_cate[m].cat_id;  
1940 - find2name = sto_cate[m].cat_name;  
1941 - sort = sto_cate[m].sort;  
1942 - is_del_pk = 0;  
1943 - }  
1944 - break; 1951 + if (sto_arr[i].category_id == sto_cate[m].cat_id) {
  1952 + if (sto_cate[m].is_show != 1) {
  1953 + is_del_pk = 1;
  1954 + sto_arr.splice(i, 1);
  1955 + i--;
  1956 + } else {
  1957 + find2 = sto_cate[m].cat_id;
  1958 + find2name = sto_cate[m].cat_name;
  1959 + sort = sto_cate[m].sort;
  1960 + is_del_pk = 0;
1945 } 1961 }
  1962 + break;
  1963 + }
1946 } 1964 }
1947 1965
1948 - if(is_del_pk) continue; 1966 + if (is_del_pk) continue;
1949 1967
1950 if (newarr.length > 0) { 1968 if (newarr.length > 0) {
1951 var find = 0; 1969 var find = 0;
@@ -1991,17 +2009,17 @@ Page({ @@ -1991,17 +2009,17 @@ Page({
1991 } 2009 }
1992 2010
1993 2011
1994 - var def_arr = new Array();  
1995 - //-- 开始就看10个门店 --  
1996 - for (var k = 0; k < 10; k++) {  
1997 - if (k == sto_arr.length) break;  
1998 - def_arr.push(sto_arr[k]);  
1999 - } 2012 + var def_arr = new Array();
  2013 + //-- 开始就看10个门店 --
  2014 + for (var k = 0; k < 10; k++) {
  2015 + if (k == sto_arr.length) break;
  2016 + def_arr.push(sto_arr[k]);
  2017 + }
2000 2018
2001 - th.setData({  
2002 - def_pickpu_list: def_arr,  
2003 - pickpu_list: ee.data.data.pageData  
2004 - }); 2019 + th.setData({
  2020 + def_pickpu_list: def_arr,
  2021 + pickpu_list: ee.data.data.pageData
  2022 + });
2005 //门店分类要排序下 2023 //门店分类要排序下
2006 function compare(property) { 2024 function compare(property) {
2007 return function (a, b) { 2025 return function (a, b) {
@@ -2025,15 +2043,15 @@ Page({ @@ -2025,15 +2043,15 @@ Page({
2025 } 2043 }
2026 2044
2027 2045
2028 - var sd={  
2029 - all_sto: newarr,  
2030 - is_show_sto_cat:1  
2031 - }  
2032 - if(!sto_arr || sto_arr.length<=10){  
2033 - sd.is_show_sto_cat=-1;  
2034 - sd.only_pk=sto_arr;  
2035 - }  
2036 - th.setData(sd); 2046 + var sd = {
  2047 + all_sto: newarr,
  2048 + is_show_sto_cat: 1
  2049 + }
  2050 + if (!sto_arr || sto_arr.length <= 10) {
  2051 + sd.is_show_sto_cat = -1;
  2052 + sd.only_pk = sto_arr;
  2053 + }
  2054 + th.setData(sd);
2037 2055
2038 } else { 2056 } else {
2039 th.setData({ 2057 th.setData({
@@ -2382,21 +2400,21 @@ Page({ @@ -2382,21 +2400,21 @@ Page({
2382 } 2400 }
2383 } else { 2401 } else {
2384 2402
2385 - //活动已结束,全部设置为'00'  
2386 - obj = {  
2387 - day: '00',  
2388 - hou: '00',  
2389 - min: '00',  
2390 - sec: '00'  
2391 - }  
2392 - th.setData({  
2393 - prom_time_text: '活动已经结束:',  
2394 - prom_st: 3  
2395 - })  
2396 - th.setData({  
2397 - djs: obj  
2398 - });  
2399 - return false; 2403 + //活动已结束,全部设置为'00'
  2404 + obj = {
  2405 + day: '00',
  2406 + hou: '00',
  2407 + min: '00',
  2408 + sec: '00'
  2409 + }
  2410 + th.setData({
  2411 + prom_time_text: '活动已经结束:',
  2412 + prom_st: 3
  2413 + })
  2414 + th.setData({
  2415 + djs: obj
  2416 + });
  2417 + return false;
2400 2418
2401 } 2419 }
2402 2420
@@ -2410,56 +2428,56 @@ Page({ @@ -2410,56 +2428,56 @@ Page({
2410 2428
2411 2429
2412 //-------------获取购买数量的总函数---------------- 2430 //-------------获取购买数量的总函数----------------
2413 - get_buy_num: function (gd, func) {  
2414 - var map = this.data.g_buy_num,  
2415 - th = this,  
2416 - user_id = getApp().globalData.user_id;  
2417 - if (user_id == null) {  
2418 - map.set(gd.goods_id, 0); 2431 + get_buy_num: function (gd, func) {
  2432 + var map = this.data.g_buy_num,
  2433 + th = this,
  2434 + user_id = getApp().globalData.user_id;
  2435 + if (user_id == null) {
  2436 + map.set(gd.goods_id, 0);
  2437 + th.setData({
  2438 + g_buy_num: map,
  2439 + prom_buy_num: 0,
  2440 + });
  2441 + "function" == typeof func && func();
  2442 + return false;
  2443 + }
  2444 +
  2445 + if (map.has(gd.goods_id)) {
  2446 + "function" == typeof func && func();
  2447 + } else {
  2448 + //----获取商品购买数----
  2449 + getApp().request.get("/api/weshop/ordergoods/getUserBuyGoodsNum", {
  2450 + data: {
  2451 + store_id: os.stoid,
  2452 + user_id: user_id,
  2453 + goods_id: gd.goods_id,
  2454 + },
  2455 + success: function (t) {
  2456 + if (t.data.code == 0) {
  2457 + var g_buy_num = t.data.data.goodsbuynum;
  2458 + map.set(gd.goods_id, g_buy_num);
2419 th.setData({ 2459 th.setData({
2420 - g_buy_num: map,  
2421 - prom_buy_num: 0, 2460 + g_buy_num: map,
2422 }); 2461 });
2423 - "function" == typeof func && func();  
2424 - return false;  
2425 - }  
2426 -  
2427 - if (map.has(gd.goods_id)) {  
2428 - "function" == typeof func && func();  
2429 - } else {  
2430 - //----获取商品购买数----  
2431 - getApp().request.get("/api/weshop/ordergoods/getUserBuyGoodsNum", {  
2432 - data: {  
2433 - store_id: os.stoid,  
2434 - user_id: user_id,  
2435 - goods_id: gd.goods_id,  
2436 - },  
2437 - success: function (t) {  
2438 - if (t.data.code == 0) {  
2439 - var g_buy_num = t.data.data.goodsbuynum;  
2440 - map.set(gd.goods_id, g_buy_num);  
2441 - th.setData({  
2442 - g_buy_num: map,  
2443 - });  
2444 - getApp().request.get("/api/weshop/order/orderPresell/countBuyGoodsSum",{  
2445 - data: {store_id: os.stoid, user_id: user_id, goods_id: gd.goods_id, prom_id: gd.prom_id},  
2446 - success: function (e) {  
2447 - if (e.data.code == 0) {  
2448 - th.setData({prom_buy_num: e.data.data.sumgoodsnum})  
2449 - "function" == typeof func && func();  
2450 - } else {  
2451 - th.setData({prom_buy_num: 0,})  
2452 - "function" == typeof func && func();  
2453 - }  
2454 -  
2455 - }  
2456 - });  
2457 -  
2458 - } 2462 + getApp().request.get("/api/weshop/order/orderPresell/countBuyGoodsSum", {
  2463 + data: { store_id: os.stoid, user_id: user_id, goods_id: gd.goods_id, prom_id: gd.prom_id },
  2464 + success: function (e) {
  2465 + if (e.data.code == 0) {
  2466 + th.setData({ prom_buy_num: e.data.data.sumgoodsnum })
  2467 + "function" == typeof func && func();
  2468 + } else {
  2469 + th.setData({ prom_buy_num: 0, })
  2470 + "function" == typeof func && func();
2459 } 2471 }
  2472 +
  2473 + }
2460 }); 2474 });
  2475 +
  2476 + }
2461 } 2477 }
2462 - }, 2478 + });
  2479 + }
  2480 + },
2463 2481
2464 //--拼单推荐的显示--- 2482 //--拼单推荐的显示---
2465 tj_Click: function (e) { 2483 tj_Click: function (e) {
@@ -2471,7 +2489,7 @@ Page({ @@ -2471,7 +2489,7 @@ Page({
2471 2489
2472 //-------跳转pt商品------- 2490 //-------跳转pt商品-------
2473 go_to_nopay: function () { 2491 go_to_nopay: function () {
2474 - var th =this,url = "/pages/user/order_detail/order_detail?order_id=" + th.data.buy_order.order_id; 2492 + var th = this, url = "/pages/user/order_detail/order_detail?order_id=" + th.data.buy_order.order_id;
2475 getApp().goto(url); 2493 getApp().goto(url);
2476 2494
2477 }, 2495 },
@@ -2615,7 +2633,18 @@ Page({ @@ -2615,7 +2633,18 @@ Page({
2615 wx.hideLoading(); 2633 wx.hideLoading();
2616 quan_list = res.data.data.pageData; 2634 quan_list = res.data.data.pageData;
2617 }) 2635 })
2618 - 2636 + //过滤不是本商品的单品优惠券
  2637 + if (quan_list.length > 0) {
  2638 + let goodInfo = th.data.data
  2639 + for (let index = quan_list.length - 1; index >= 0; index--) {
  2640 + if (quan_list[index].useobjecttype == 20) { //判断是单品优惠券
  2641 + if (quan_list[index].useobjectno != goodInfo.goods_sn) {
  2642 + quan_list.splice(index, 1)
  2643 + }
  2644 + }
  2645 + }
  2646 + }
  2647 + //------------------------
2619 if (quan_list) { 2648 if (quan_list) {
2620 for (var ind in quan_list) { 2649 for (var ind in quan_list) {
2621 var ep = quan_list[ind]; 2650 var ep = quan_list[ind];
@@ -2712,7 +2741,13 @@ Page({ @@ -2712,7 +2741,13 @@ Page({
2712 } 2741 }
2713 }) 2742 })
2714 }, 2743 },
2715 - 2744 + saveImageFn(){
  2745 + if(this.data.share_b_img){
  2746 + this.saveImageToPhotosAlbum()
  2747 + }else{
  2748 + this.saveImageToPhotosAlbumDef()
  2749 + }
  2750 + },
2716 //--定义的保存图片方法,分享团--- 2751 //--定义的保存图片方法,分享团---
2717 saveImageToPhotosAlbum: function () { 2752 saveImageToPhotosAlbum: function () {
2718 //--先判断会员状态-- 2753 //--先判断会员状态--
@@ -2894,7 +2929,25 @@ Page({ @@ -2894,7 +2929,25 @@ Page({
2894 //share_goods_img?share_goods_img:th.data.data.share_goods_img; 2929 //share_goods_img?share_goods_img:th.data.data.share_goods_img;
2895 //---中间大图--- 2930 //---中间大图---
2896 context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit); 2931 context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit);
  2932 + //---自定义海报 产品质量保证
  2933 + if(th.data.poster.show_quality==1 ){
  2934 + var g_path = "/images/share/s_gou.png";
  2935 + context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit);
  2936 + context.setFillStyle("red")
  2937 + context.setFontSize(18 * unit)
  2938 + context.fillText("正品保证", 84 * unit, 690 * unit);
  2939 +
  2940 + context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit);
  2941 + context.setFillStyle("red")
  2942 + context.setFontSize(18 * unit)
  2943 + context.fillText("纯实体店", 246 * unit, 690 * unit);
  2944 +
  2945 + context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit);
  2946 + context.setFillStyle("red")
  2947 + context.setFontSize(18 * unit)
  2948 + context.fillText("官方验证", 420 * unit, 690 * unit);
2897 2949
  2950 + }
2898 2951
2899 //---画线--- 2952 //---画线---
2900 context.setLineWidth(1 * unit) 2953 context.setLineWidth(1 * unit)
@@ -3020,8 +3073,609 @@ Page({ @@ -3020,8 +3073,609 @@ Page({
3020 } 3073 }
3021 }); 3074 });
3022 }, 3075 },
  3076 + //--定义的保存图片方法,分享团---
  3077 + saveImageToPhotosAlbumDef: function () {
  3078 + //--先判断会员状态--
  3079 + var user_info = getApp().globalData.userInfo;
  3080 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  3081 + //getApp().my_warnning("请先登录",0,this);
  3082 + wx.navigateTo({url: '/packageE/pages/togoin/togoin',})
  3083 + return false;
  3084 + }
  3085 +
  3086 + if (this.data.share_hidden) {
  3087 + this.setData({share_hidden: false,});
  3088 + };
  3089 +
  3090 + //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 4阶梯团
  3091 + var type = this.data.prom_type;
  3092 + console.log('商品类型-----');
  3093 + console.log(type);
  3094 + // if (type == 2) type = -1;
  3095 + if (type == 4) type = 0;
  3096 + if (type == 8) type = 0;
  3097 + if (type == 2) type = 0;
  3098 + if (type == 6) type = 2; // 6拼团 2团购
  3099 + if (type == 10) type = -1;
  3100 +
  3101 +
  3102 + if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3;
  3103 + console.log('商品类型。。。。。');
  3104 + console.log(type);
  3105 + wx.showLoading({title: '生成中...',})
  3106 + var that = this, th = that;
  3107 + //设置画板显示,才能开始绘图
  3108 + that.setData({
  3109 + canvasHidden: false
  3110 + })
  3111 +
  3112 + var app = getApp();
  3113 + var unit = that.data.screenWidth / 750 * 1.35; //基础单位,
  3114 + var path2 = that.data.data.original_img;
  3115 + var scene = th.data.gid + "";
  3116 + scene += "." + th.data.sele_g.prom_type + "." + th.data.sele_g.prom_id;
  3117 +
  3118 + var user_id = getApp().globalData.user_id ? getApp().globalData.user_id : 0;
  3119 + if (user_id > 0) {
  3120 + scene += "_" + user_id;
  3121 + }
  3122 + //-- 如果不是会员分享过来的要分享给别人 --
  3123 + if (getApp().globalData.room_id && th.data.data.goods_id == getApp().globalData.room_goods_id && !getApp().globalData.room_user_share) {
  3124 + //固定房间是第3个字符
  3125 + if (!user_id) scene += "_0";
  3126 + scene += "_" + getApp().globalData.room_id;
  3127 + }
  3128 +
  3129 + ///二微码
  3130 + var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
  3131 + os.stoid + "?sceneValue=" + scene + "&pageValue=packageC/pages/presell/goodsInfo/goodsInfo";
  3132 +
  3133 + console.log(path3);
3023 3134
3024 3135
  3136 + // 读取文件成功则OK--
  3137 + wx.getImageInfo({
  3138 + src: path3,
  3139 + success: function (res) {
  3140 + // 回调写法
  3141 + th.get_head_temp(th.get_goods_temp, function () {
  3142 + var vpath = res.path;
  3143 + var context = wx.createCanvasContext('share');
  3144 + // 先画背景
  3145 + var pg_path = "../../../../images/share/share_bg.png";
  3146 +
  3147 +
  3148 + //-- 如果有自定义海报的时候,判断背景的图片 --
  3149 + if (th.data.share_b_img) {
  3150 + pg_path = th.data.share_b_img;
  3151 + }
  3152 + // context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
  3153 + console.log('海报类型-----')
  3154 + console.log(type);
  3155 +
  3156 + if ( !th.data.share_b_img && (type == 0 || type == 1 || type == 2 || type == 3 )){ // 如果是普通商品,绘制新海报
  3157 + th.drawPoster(context, unit, th.data.share_goods_img, vpath, type);
  3158 + } else {
  3159 + context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
  3160 + // var erm_x = parseFloat(th.data.poster.ewm_x) * 2;
  3161 + // var erm_y = parseFloat(th.data.poster.ewm_y) * 2;
  3162 + // context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit);
  3163 + // th.drawPoster(context, unit, th.data.share_goods_img, vpath);
  3164 + };
  3165 +
  3166 + // th.drawPoster(context, unit, th.data.share_goods_img, vpath);
  3167 +
  3168 +
  3169 + //-- 是自定义海报的情况下 --
  3170 + if (th.data.share_b_img || (type != 0 && type != 1 && type != 2 && type != 3)) {
  3171 +
  3172 + if (th.data.poster && parseInt(th.data.poster.style) == 2) {
  3173 + //在线上分享人的情况下
  3174 + if (parseInt(th.data.poster.show_headpic)) {
  3175 + //获取坐标
  3176 + var x = parseFloat(th.data.poster.head_x) * 2;
  3177 + var y = parseFloat(th.data.poster.head_y) * 2;
  3178 + var x1 = (x + 90) * unit;
  3179 + var y1 = (y + 50) * unit;
  3180 + //--昵称---
  3181 + context.setFontSize(24 * unit)
  3182 + context.setFillStyle("black")
  3183 + context.fillText(app.globalData.userInfo.nickname, x1, y1);
  3184 + var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit;
  3185 + //强烈推荐 改许程
  3186 + var tj_path = "../../../../images/share/q_tj.png";
  3187 + context.drawImage(tj_path, x1 + width, y1 - 22 * unit, 85 * unit, 30 * unit);
  3188 + context.setFontSize(16 * unit);
  3189 + context.setLineJoin('round'); //交点设置成圆角
  3190 + context.setFillStyle("white");
  3191 + context.fillText('强烈推荐', x1 + width + 8 * unit, y1 - 1 * unit);
  3192 +
  3193 + //context.setFillStyle("black")
  3194 + //context.setFontSize(24 * unit)
  3195 + //context.fillText(getApp().globalData.config.store_name, 40 * unit, 130 * unit);
  3196 + }
  3197 + } else {
  3198 + //--昵称---
  3199 + context.setFontSize(24 * unit);
  3200 + context.setFillStyle("black");
  3201 + context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit);
  3202 + var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit;
  3203 + //强烈推荐 改许程
  3204 + var tj_path = "../../../../images/share/q_tj.png";
  3205 + context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit);
  3206 + context.setFontSize(16 * unit);
  3207 + context.setLineJoin('round'); //交点设置成圆角
  3208 + context.setFillStyle("white");
  3209 + context.fillText('强烈推荐', 149 * unit + width + 15 * unit, 75 * unit);
  3210 + }
  3211 +
  3212 + };
  3213 +
  3214 +
  3215 + var share_title = th.data.data.goods_name;
  3216 + if (th.data.prom_type == 1 || th.data.prom_type == 2 || th.data.prom_type == 6 || th.data.prom_type == 4) {
  3217 + share_title = th.data.prom_act.share_title;
  3218 + if (!share_title) share_title = th.data.prom_act.title;
  3219 + if (th.data.prom_type == 4) share_title = th.data.prom_act.name;
  3220 + }
  3221 +
  3222 + //---产品名称---
  3223 + //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
  3224 + if (th.data.share_b_img || (type != 4 && type != 0 && type != 1 && type != 2 && type != 3)) {
  3225 + context.setFillStyle("black");
  3226 + context.setFontSize(21.3 * unit)
  3227 + getApp().draw_Text(context, share_title,
  3228 + 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit);
  3229 +
  3230 + //------产品的价格-------
  3231 + context.setFontSize(23 * unit)
  3232 + context.setFillStyle("red")
  3233 +
  3234 + var pri0 = th.data.data.shop_price;
  3235 + if (th.data.card_field && th.data.data[th.data.card_field]) {
  3236 + pri0 = th.data.data[th.data.card_field];
  3237 + }
  3238 +
  3239 + if (th.data.prom_act)
  3240 + pri0 = th.data.prom_price;
  3241 + pri0 = parseFloat(pri0).toFixed(2);
  3242 + var wd1 = th.data.screenWidth - ut.measureText(pri0, 31 * unit) - 25;
  3243 + context.fillText("¥", wd1 - 15, 185 * unit);
  3244 + context.setFontSize(31 * unit)
  3245 + context.fillText(pri0, wd1, 185 * unit);
  3246 +
  3247 + //---市场价划掉---
  3248 + /*--
  3249 + context.setFillStyle("gray")
  3250 + context.setFontSize(22 * unit)
  3251 + pri0 = "¥" + th.data.data.market_price.toFixed(2);
  3252 + var wd2 = th.data.screenWidth - ut.measureText(pri0, 22 * unit) - 25;
  3253 + context.fillText(pri0, wd2, 213 * unit);
  3254 +
  3255 + context.setStrokeStyle('gray');
  3256 + context.setLineWidth(1 * unit);
  3257 + context.moveTo(wd2 - 5, 206 * unit);
  3258 + context.lineTo(wd2 + ut.measureText(pri0, 22 * unit) + 5, 206 * unit);
  3259 + context.stroke();--*/
  3260 +
  3261 + } else if ( ( type == 4 && type != 0 && type != 1 && type != 2 && type != 3)) {
  3262 + context.setFillStyle("black");
  3263 + context.setFontSize(21.3 * unit)
  3264 + getApp().draw_Text(context, share_title,
  3265 + 38 * unit, 170 * unit, 20 * unit, 300 * unit, unit);
  3266 + //------ 产品的价格 -----
  3267 + var pri0 = th.data.prom_act.addmoney;
  3268 + var integral = th.data.prom_act.integral;
  3269 + var text = "";
  3270 + if (integral) {
  3271 + text = integral + "积分";
  3272 + }
  3273 + if (pri0 && integral) {
  3274 + text += "+";
  3275 + }
  3276 + if (pri0) {
  3277 + text += "¥" + pri0;
  3278 + }
  3279 +
  3280 + if (!pri0 && !integral) {
  3281 + text = "0积分";
  3282 + }
  3283 + context.setFillStyle("red");
  3284 + context.fillText(text, 38 * unit, 235 * unit);
  3285 +
  3286 + }
  3287 +
  3288 + //---中间大图---
  3289 + if ( th.data.share_b_img || (type != 0 && type != 1 && type != 2 && type != 3)) {
  3290 + context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit);
  3291 + }
  3292 + ;
  3293 +
  3294 + //---自定义海报 产品质量保证
  3295 + if(th.data.share_b_img && th.data.poster.show_quality==1 ){
  3296 + var g_path = "../../../../images/share/s_gou.png";
  3297 + context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit);
  3298 + context.setFillStyle("red")
  3299 + context.setFontSize(18 * unit)
  3300 + context.fillText("正品保证", 84 * unit, 690 * unit);
  3301 +
  3302 + context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit);
  3303 + context.setFillStyle("red")
  3304 + context.setFontSize(18 * unit)
  3305 + context.fillText("纯实体店", 246 * unit, 690 * unit);
  3306 +
  3307 + context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit);
  3308 + context.setFillStyle("red")
  3309 + context.setFontSize(18 * unit)
  3310 + context.fillText("官方验证", 420 * unit, 690 * unit);
  3311 +
  3312 + }
  3313 + //-------大图后面就不一样了-----------
  3314 + switch (type) {
  3315 + case 0:
  3316 + if(!th.data.share_b_img){
  3317 + break
  3318 + }
  3319 + //---画线---
  3320 + context.setLineWidth(1 * unit)
  3321 + context.moveTo(32 * unit, 710 * unit)
  3322 + context.lineTo(520 * unit, 710 * unit)
  3323 + context.stroke();
  3324 + //---文字---
  3325 + context.setFillStyle("black")
  3326 + context.setFontSize(22 * unit)
  3327 + // 原来start --->
  3328 + context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 776 * unit);
  3329 + context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 826 * unit);
  3330 + // <--- 原来end
  3331 + // context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 816 * unit);
  3332 + // context.setFontSize(18 * unit)
  3333 + // context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 850 * unit);
  3334 + //---二维吗图---
  3335 + context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit);
  3336 + break;//普通商品的展示
  3337 + case 4:
  3338 + // 中间的几个字
  3339 + if (th.data.poster && parseInt(th.data.poster.style) == 2) {
  3340 + if (parseInt(th.data.poster.show_quality)) {
  3341 + var g_path = "../../../../images/share/s_gou.png";
  3342 + context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit);
  3343 + context.setFillStyle("red")
  3344 + context.setFontSize(18 * unit)
  3345 + context.fillText("正品保证", 84 * unit, 690 * unit);
  3346 +
  3347 + context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit);
  3348 + context.setFillStyle("red")
  3349 + context.setFontSize(18 * unit)
  3350 + context.fillText("纯实体店", 246 * unit, 690 * unit);
  3351 +
  3352 + context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit);
  3353 + context.setFillStyle("red")
  3354 + context.setFontSize(18 * unit)
  3355 + context.fillText("官方验证", 420 * unit, 690 * unit);
  3356 + }
  3357 +
  3358 + } else {
  3359 + var g_path = "../../../../images/share/s_gou.png";
  3360 + context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit);
  3361 + context.setFillStyle("red")
  3362 + context.setFontSize(18 * unit)
  3363 + context.fillText("正品保证", 84 * unit, 690 * unit);
  3364 +
  3365 + context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit);
  3366 + context.setFillStyle("red")
  3367 + context.setFontSize(18 * unit)
  3368 + context.fillText("纯实体店", 246 * unit, 690 * unit);
  3369 +
  3370 + context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit);
  3371 + context.setFillStyle("red")
  3372 + context.setFontSize(18 * unit)
  3373 + context.fillText("官方验证", 420 * unit, 690 * unit);
  3374 + }
  3375 +
  3376 +
  3377 + //---画线---
  3378 + context.setLineWidth(1 * unit)
  3379 + context.moveTo(32 * unit, 710 * unit)
  3380 + context.lineTo(520 * unit, 710 * unit)
  3381 + context.stroke();
  3382 +
  3383 + //---文字---
  3384 + context.setFillStyle("black")
  3385 + context.setFontSize(22 * unit)
  3386 +
  3387 + if (type == 0 || type == -1) {
  3388 + // 原来start --->
  3389 + context.setFontSize(24 * unit)
  3390 + context.fillText(th.data.sto_sele_name_1, 40 * unit, 766 * unit);
  3391 +
  3392 + context.setFontSize(22 * unit)
  3393 + context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 806 * unit);
  3394 + context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 846 * unit);
  3395 +
  3396 + } else {
  3397 + context.setFontSize(24 * unit)
  3398 + context.fillText(th.data.sto_sele_name_1, 40 * unit, 766 * unit);
  3399 + context.setFontSize(22 * unit)
  3400 + context.fillText("长按识别二维码", 40 * unit, 806 * unit);
  3401 + context.fillText("立即开始兑换", 40 * unit, 846 * unit);
  3402 +
  3403 + }
  3404 +
  3405 + //---二维吗图---
  3406 + //-- 自定义海报 --
  3407 + if (th.data.share_b_img || th.data.poster) {
  3408 + var erm_x = parseFloat(th.data.poster.ewm_x) * 2;
  3409 + var erm_y = parseFloat(th.data.poster.ewm_y) * 2;
  3410 + context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit);
  3411 + } else {
  3412 + //---二维吗图---
  3413 + context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit);
  3414 + }
  3415 + ;
  3416 +
  3417 + break;
  3418 + case 1: //秒杀商品的展示
  3419 + if(!th.data.share_b_img){
  3420 + break
  3421 + }
  3422 + //---画线---
  3423 + context.setLineWidth(1 * unit)
  3424 + context.moveTo(32 * unit, 670 * unit)
  3425 + context.lineTo(520 * unit, 670 * unit)
  3426 + context.stroke();
  3427 +
  3428 + //画秒杀的图片
  3429 + var miaos_path = '../../../../images/share/miao_share.png';
  3430 + context.drawImage(miaos_path, 43 * unit, 700 * unit, 222 * unit, 40 * unit);
  3431 +
  3432 + context.setFillStyle("black")
  3433 + context.setFontSize(24 * unit)
  3434 + context.fillText(th.data.sto_sele_name_1, 40 * unit, 786 * unit);
  3435 + //---文字---
  3436 + context.setFontSize(22 * unit)
  3437 + context.setFillStyle("black")
  3438 + context.fillText("特惠好物,限时秒杀", 40 * unit, 826 * unit);
  3439 + context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 866 * unit);
  3440 +
  3441 +
  3442 + //---二维吗图---
  3443 + //-- 自定义海报 --
  3444 + if (th.data.share_b_img || th.data.poster) {
  3445 + var erm_x = parseFloat(th.data.poster.ewm_x) * 2;
  3446 + var erm_y = parseFloat(th.data.poster.ewm_y) * 2;
  3447 + context.drawImage(vpath, erm_x * unit, erm_y * unit, 135 * unit, 135 * unit);
  3448 + } else {
  3449 + //---二维吗图---
  3450 + context.drawImage(vpath, 390 * unit, 726 * unit, 135 * unit, 135 * unit);
  3451 + }
  3452 + break;
  3453 +
  3454 + case 2: //会员团和商家团的展示
  3455 + if(!th.data.share_b_img){
  3456 + break
  3457 + }
  3458 + //---画线---
  3459 + context.setLineWidth(1 * unit)
  3460 + context.moveTo(32 * unit, 670 * unit)
  3461 + context.lineTo(520 * unit, 670 * unit)
  3462 + context.stroke();
  3463 + //---文字---
  3464 + context.setFillStyle("black")
  3465 + context.setFontSize(24 * unit)
  3466 + context.fillText(th.data.sto_sele_name_1, 40 * unit, 720 * unit);
  3467 +
  3468 + //绘制成团图片
  3469 + var ct_img = "../../../../images/share/ct_num.png";
  3470 + context.drawImage(ct_img, 40 * unit, 740 * unit, 120 * unit, 30 * unit);
  3471 + var ct_num = th.data.prom_act.ct_num;
  3472 + context.setFontSize(14 * unit)
  3473 + context.font = 'normal';
  3474 + context.setFillStyle("red")
  3475 + if (ct_num < 10) {
  3476 + context.fillText(ct_num + "人拼团", 92 * unit, 760 * unit);
  3477 + } else {
  3478 + context.fillText(ct_num + "人拼团", 86 * unit, 760 * unit);
  3479 + }
  3480 + context.setFontSize(22 * unit)
  3481 + context.fillText("已拼" + th.data.prom_act.buy_num + "份", 166 * unit, 763 * unit);
  3482 +
  3483 + context.setFillStyle("gray")
  3484 + context.fillText("快来和我一起拼团吧!", 40 * unit, 806 * unit);
  3485 + context.setFillStyle("black")
  3486 + context.font = 'normal bold 18px sans-serif';
  3487 + context.setFontSize(21.3 * unit)
  3488 + context.fillText("长按识别二维码,立即参团", 40 * unit, 836 * unit);
  3489 +
  3490 +
  3491 + //---二维吗图---
  3492 + //-- 自定义海报 --
  3493 + if (th.data.share_b_img || th.data.poster) {
  3494 + var erm_x = parseFloat(th.data.poster.ewm_x) * 2;
  3495 + var erm_y = parseFloat(th.data.poster.ewm_y) * 2;
  3496 + context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit);
  3497 + } else {
  3498 + //---二维吗图---
  3499 + context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit);
  3500 + }
  3501 + break
  3502 + case 3: //阶梯团的展示
  3503 + if(!th.data.share_b_img){
  3504 + break
  3505 + }
  3506 + //---画线---
  3507 + context.setLineWidth(1 * unit)
  3508 + context.moveTo(32 * unit, 670 * unit)
  3509 + context.lineTo(520 * unit, 670 * unit)
  3510 + context.stroke();
  3511 + //---文字---
  3512 + context.setFillStyle("black")
  3513 + context.setFontSize(24 * unit)
  3514 + context.fillText(th.data.sto_sele_name_1, 40 * unit, 720 * unit);
  3515 +
  3516 + //---绘制中间阶梯的价格---
  3517 + var list = th.data.prom_act.ct_rylist;
  3518 + for (var i = 0; i < list.length; i++) {
  3519 + var item = list[i];
  3520 + var wi = i * 90 * unit;
  3521 + context.font = 'normal';
  3522 + context.setFontSize(16 * unit)
  3523 + context.setFillStyle("red")
  3524 + context.fillText("¥", 40 * unit + wi, 756 * unit);
  3525 + context.setFontSize(22 * unit)
  3526 + var pri = parseFloat(item.price).toFixed(2);
  3527 + context.fillText(pri, 56 * unit + wi, 756 * unit);
  3528 + context.setFillStyle("gray")
  3529 + context.fillText("满" + item.rynum + "人", 40 * unit + wi, 786 * unit);
  3530 + }
  3531 + //----------------下面部分----------------
  3532 +
  3533 + context.setFillStyle("black")
  3534 + context.fillText("快来和我一起拼团吧!", 40 * unit, 820 * unit);
  3535 + //context.font = 'normal bold 18px sans-serif';
  3536 + context.setFontSize(21 * unit)
  3537 + context.fillText("长按识别二维码,立即参团", 40 * unit, 850 * unit);
  3538 +
  3539 +
  3540 + //-- 自定义海报 --
  3541 + if (th.data.share_b_img || th.data.poster) {
  3542 + var erm_x = parseFloat(th.data.poster.ewm_x) * 2;
  3543 + var erm_y = parseFloat(th.data.poster.ewm_y) * 2;
  3544 + context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit);
  3545 + } else {
  3546 + //---二维吗图---
  3547 + context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit);
  3548 + }
  3549 + break
  3550 +
  3551 +
  3552 + case -1: //秒杀商品的展示
  3553 + //---画线---
  3554 + context.setLineWidth(1 * unit)
  3555 + context.moveTo(32 * unit, 670 * unit)
  3556 + context.lineTo(520 * unit, 670 * unit)
  3557 + context.stroke();
  3558 +
  3559 +
  3560 + context.setFillStyle("black")
  3561 + context.setFontSize(24 * unit)
  3562 + context.fillText(th.data.sto_sele_name_1, 40 * unit, 744 * unit);
  3563 + //---文字---
  3564 + context.setFontSize(22 * unit)
  3565 + context.setFillStyle("black")
  3566 + context.fillText("长按识别二维码", 40 * unit, 800 * unit);
  3567 + context.fillText("立即开始抢购", 40 * unit, 846 * unit);
  3568 +
  3569 +
  3570 + //---二维吗图---
  3571 + //-- 自定义海报 --
  3572 + if (th.data.share_b_img || th.data.poster) {
  3573 + var erm_x = parseFloat(th.data.poster.ewm_x) * 2;
  3574 + var erm_y = parseFloat(th.data.poster.ewm_y) * 2;
  3575 + context.drawImage(vpath, erm_x * unit, erm_y * unit, 135 * unit, 135 * unit);
  3576 + } else {
  3577 + //---二维吗图---
  3578 + context.drawImage(vpath, 390 * unit, 726 * unit, 135 * unit, 135 * unit);
  3579 + }
  3580 + break;
  3581 +
  3582 +
  3583 + }
  3584 +
  3585 +
  3586 + //--- 如果是自定义海报的时候 ---
  3587 + if ( th.data.share_b_img || (type != 0 && type != 1 && type != 2 && type != 3)) {
  3588 +
  3589 + if (th.data.poster && parseInt(th.data.poster.style) == 2) {
  3590 +
  3591 + //如果显示会员信息的话
  3592 + if (parseInt(th.data.poster.show_headpic)) {
  3593 + //获取坐标
  3594 + var x = parseFloat(th.data.poster.head_x) * 2;
  3595 + var y = parseFloat(th.data.poster.head_y) * 2;
  3596 + //---绘制圆形要放在最后----
  3597 + context.save();
  3598 + context.beginPath();
  3599 + var h_x = x * unit;
  3600 + var h_y = y * unit;
  3601 + var h_r = 40 * unit;
  3602 + var cx = h_x + h_r;
  3603 + var cy = h_y + h_r;
  3604 + context.arc(cx, cy, h_r, 0, Math.PI * 2, false);
  3605 + context.closePath();
  3606 + context.fill();
  3607 + context.clip();
  3608 + context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);
  3609 + context.restore();
  3610 + }
  3611 +
  3612 + } else {
  3613 + //---绘制圆形要放在最后----
  3614 + context.save();
  3615 + context.beginPath();
  3616 + var h_x = 60 * unit;
  3617 + var h_y = 24 * unit;
  3618 + var h_r = 40 * unit;
  3619 + var cx = h_x + h_r;
  3620 + var cy = h_y + h_r;
  3621 + context.arc(cx, cy, h_r, 0, Math.PI * 2, false);
  3622 + context.closePath();
  3623 + context.fill();
  3624 + context.clip();
  3625 + context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);
  3626 + context.restore();
  3627 + }
  3628 +
  3629 + }
  3630 + ;
  3631 +
  3632 +
  3633 + //把画板内容绘制成图片,并回调 画板图片路径
  3634 + context.draw(false, function () {
  3635 + setTimeout(function () {
  3636 + wx.canvasToTempFilePath({
  3637 + x: 0,
  3638 + y: 0,
  3639 + width: 750,
  3640 + height: 1217,
  3641 + destWidth: 1.2 * 750 * 750 / that.data.screenWidth,
  3642 + destHeight: 1.2 * 1217 * 750 / that.data.screenWidth,
  3643 + canvasId: 'share',
  3644 + success: function (res) {
  3645 +
  3646 + that.setData({
  3647 + shareImgPath: res.tempFilePath,
  3648 + canvasHidden: true
  3649 + })
  3650 +
  3651 + if (!res.tempFilePath) {
  3652 + wx.showModal({
  3653 + title: '提示',
  3654 + content: '图片绘制中,请稍后重试',
  3655 + showCancel: false
  3656 + })
  3657 + return false;
  3658 + }
  3659 +
  3660 + that.setData({
  3661 + showPoster: true,
  3662 + });
  3663 + wx.hideLoading();
  3664 + }
  3665 + })
  3666 + }, 500)
  3667 +
  3668 + });
  3669 + });
  3670 + },
  3671 + fail: function (res) {
  3672 + console.log(res);
  3673 + wx.hideLoading();
  3674 +
  3675 + }
  3676 + });
  3677 + },
  3678 +
3025 //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 3679 //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
3026 draw_Text: function (ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, unit) { 3680 draw_Text: function (ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, unit) {
3027 var lineWidth = 0; 3681 var lineWidth = 0;
@@ -3049,7 +3703,144 @@ Page({ @@ -3049,7 +3703,144 @@ Page({
3049 } 3703 }
3050 } 3704 }
3051 }, 3705 },
  3706 + drawPoster(context, unit, img, vpath, type) {
  3707 + // 1.灰色背景
  3708 + context.setFillStyle('#f2f1f6');
  3709 + context.rect(0, 0, 554 * unit, 899 * unit);
  3710 + context.fill();
  3711 +
  3712 + // 2.商城名称
  3713 + let shopName = this.data.sto_sele_name_1;
  3714 + context.setTextAlign('center');
  3715 + context.setFontSize(26 * unit);
  3716 + context.setFillStyle('black');
  3717 + context.fillText(shopName, 277 * unit, 60 * unit);
  3718 +
  3719 + // 3.推荐来源
  3720 + let fromText = `来自${getApp().globalData.userInfo.nickname}的推荐`;
  3721 + context.setTextAlign('center');
  3722 + context.setFontSize(22 * unit);
  3723 + context.setFillStyle('#96959a');
  3724 + context.fillText(fromText, 277 * unit, 105 * unit);
  3725 +
  3726 + // 4.海报背景
  3727 + context.setFillStyle('white');
  3728 + context.fillRect(37 * unit, 157 * unit, 480 * unit, 673 * unit);
  3729 +
  3730 + // 5.商品图片
  3731 + // 图片的x坐标
  3732 + let bg_x = 37 * unit
  3733 + // 图片的y坐标
  3734 + let bg_y = 157 * unit
  3735 + // 图片宽度
  3736 + let bg_w = 480 * unit
  3737 + // 图片高度
  3738 + let bg_h = 474 * unit
  3739 + // 图片圆角
  3740 + let bg_r = 4
  3741 + // 绘制海报背景图片圆角
  3742 + context.save()
  3743 + context.beginPath()
  3744 + context.arc(bg_x + bg_r, bg_y + bg_r, bg_r, Math.PI, Math.PI * 1.5)
  3745 + context.arc(bg_x + bg_w - bg_r, bg_y + bg_r, bg_r, Math.PI * 1.5, Math.PI * 2)
  3746 + context.arc(bg_x + bg_w, bg_y + bg_h, bg_r, 0, Math.PI * 0.5)
  3747 + context.arc(bg_x, bg_y + bg_h, 0, Math.PI * 0.5, Math.PI)
  3748 + context.clip()
  3749 + context.drawImage(img, bg_x, bg_y, bg_w, bg_h);
  3750 + context.restore();
  3751 +
  3752 + // 6.强烈推荐
  3753 + let src = '';
  3754 + context.beginPath();
  3755 + if(type == 0) { // 普通
  3756 + src = '../../../../images/share/q_tj.png';
  3757 + context.drawImage(src, 54 * unit, 648 * unit, 85 * unit, 30 * unit);
  3758 + context.setFontSize(16 * unit)
  3759 + context.setFillStyle("white")
  3760 + context.setTextAlign('left');
  3761 + context.fillText('强烈推荐', 64 * unit, 668 * unit);
  3762 + };
  3763 + if(type == 1) { // 秒杀
  3764 + src = '../../../images/share/miao_share.png';
  3765 + context.drawImage(src, 54 * unit, 648 * unit, 200 * unit, 36 * unit);
  3766 + context.setTextAlign('left');
  3767 + };
  3768 + if(type == 2) { // 商家和会员团
  3769 + src = '../../../images/share/ct_num.png';
  3770 + context.drawImage(src, 54 * unit, 648 * unit, 120 * unit, 30 * unit);
  3771 + context.setTextAlign('left');
  3772 +
  3773 + let ct_num = self.data.prom_act.ct_num;
  3774 + context.setFontSize(16 * unit)
  3775 + context.font = 'normal';
  3776 + context.setFillStyle("red")
  3777 + if (ct_num < 10) {
  3778 + context.fillText(ct_num + "人拼团", 100 * unit, 670 * unit);
  3779 + } else {
  3780 + context.fillText(ct_num + "人拼团", 96 * unit, 670 * unit);
  3781 + }
  3782 + context.setFontSize(22 * unit)
  3783 + context.fillText("已拼" + self.data.prom_act.buy_num + "份", 186 * unit, 672 * unit);
  3784 + };
  3785 + if(type == 3) { // 阶梯团
  3786 + let list = self.data.prom_act.ct_rylist;
  3787 + for (let i = 0; i < list.length; i++) {
  3788 + let item = list[i];
  3789 + let wi = i * 90 * unit;
  3790 + context.font = 'normal';
  3791 + context.setTextAlign('left');
  3792 + context.setFontSize(16 * unit)
  3793 + context.setFillStyle("red")
  3794 + context.fillText("¥", 50 * unit + wi, 680 * unit);
  3795 + context.setFontSize(22 * unit)
  3796 + let pri = parseFloat(item.price).toFixed(2);
  3797 + context.fillText(pri, 66 * unit + wi, 680 * unit);
  3798 + context.setFillStyle("gray")
  3799 + context.fillText("满" + item.rynum + "人", 50 * unit + wi, 716 * unit);
  3800 + }
  3801 + };
  3802 +
  3803 + // 7.商品价格
  3804 + if(type != 3) {
  3805 + let price = this.data.data.shop_price;
  3806 + if (this.data.card_field && this.data.data[this.data.card_field]) {
  3807 + price = this.data.data[this.data.card_field];
  3808 + }
  3809 + if (this.data.prom_act) price = this.data.prom_price;
  3810 + price = parseFloat(price).toFixed(2);
  3811 + context.setFontSize(32 * unit);
  3812 + context.setFillStyle('#DE1117');
  3813 + if (this.data.prom_type == 4 && this.data.prom_integral){
  3814 + context.fillText(this.data.prom_integral+'积分+¥' + price, 54 * unit, 735 * unit);
  3815 + }else{
  3816 + if(this.data.prom_type ==8){
  3817 + price = this.data.presellList.presell_price
  3818 + context.fillText('¥' + price, 54 * unit, 735 * unit);
  3819 + }else{
  3820 + context.fillText('¥' + price, 54 * unit, 735 * unit);
  3821 + }
  3822 + }
  3823 +
3052 3824
  3825 + };
  3826 +
  3827 + // 8.商品标题
  3828 + context.setFontSize(20 * unit);
  3829 + context.setFillStyle('#898989');
  3830 + getApp().draw_Text(context, this.data.data.goods_name, 54 * unit, 800 * unit, 240 * unit, 280 * unit, unit, 1);
  3831 +
  3832 + // 9.小程序码
  3833 + context.drawImage(vpath, 375 * unit, 660 * unit, 120 * unit, 120 * unit);
  3834 + context.setFontSize(16 * unit);
  3835 + context.setFillStyle('#777');
  3836 + context.fillText('长按识别二维码', 378 * unit, 810 * unit);
  3837 +
  3838 + // 10.竖线
  3839 + context.beginPath();
  3840 + context.setFillStyle('#eee');
  3841 + context.rect(354 * unit, 670 * unit, 1 * unit, 130 * unit);
  3842 + context.fill();
  3843 + },
3053 // ----视频图片---- 3844 // ----视频图片----
3054 // 图片计数器 3845 // 图片计数器
3055 swiperChange: function (e) { 3846 swiperChange: function (e) {
@@ -3135,7 +3926,7 @@ Page({ @@ -3135,7 +3926,7 @@ Page({
3135 tt(); 3926 tt();
3136 return false; 3927 return false;
3137 } 3928 }
3138 - var img_url = ee.data.data.original_img; 3929 + var img_url = ee.data.data.original_img;
3139 //var img_url = ee.data.presellForm.share_img; 3930 //var img_url = ee.data.presellForm.share_img;
3140 //img_url?img_url:ee.data.data.original_img; 3931 //img_url?img_url:ee.data.data.original_img;
3141 3932
@@ -3148,8 +3939,14 @@ Page({ @@ -3148,8 +3939,14 @@ Page({
3148 tt(); 3939 tt();
3149 }, 3940 },
3150 fail: function (res) { 3941 fail: function (res) {
3151 - ee.data.share_goods_img = "../../../../images/share/default_g_img.gif"; //分享的图片不能用网络的  
3152 - tt(); 3942 + //获取默认空白图
  3943 + wx.getImageInfo({
  3944 + src: ee.data.iurl + '/miniapp/images/default_g_img.gif',
  3945 + success: function (res) {
  3946 + ee.data.share_goods_img = res.path; //分享的图片不能用网络的
  3947 + tt();
  3948 + }
  3949 + })
3153 } 3950 }
3154 }); 3951 });
3155 }, 3952 },
@@ -3189,22 +3986,22 @@ Page({ @@ -3189,22 +3986,22 @@ Page({
3189 getHistoryBuy() { 3986 getHistoryBuy() {
3190 let _this = this; 3987 let _this = this;
3191 let req_data = { 3988 let req_data = {
3192 - store_id: os.stoid,  
3193 - goods_id: this.data.gid,  
3194 - pay_status: 1,  
3195 - rndid: 1 3989 + store_id: os.stoid,
  3990 + goods_id: this.data.gid,
  3991 + pay_status: 1,
  3992 + rndid: 1
3196 }; 3993 };
3197 getApp().request.promiseGet('/api/weshop/ordergoods/list', { 3994 getApp().request.promiseGet('/api/weshop/ordergoods/list', {
3198 - data: req_data, 3995 + data: req_data,
3199 }) 3996 })
3200 - .then(res => {  
3201 - if (ut.ajax_ok(res)) {  
3202 - _this.setData({  
3203 - historyBuyInfo: res.data.data.pageData,  
3204 - })  
3205 - }  
3206 - })  
3207 -}, 3997 + .then(res => {
  3998 + if (ut.ajax_ok(res)) {
  3999 + _this.setData({
  4000 + historyBuyInfo: res.data.data.pageData,
  4001 + })
  4002 + }
  4003 + })
  4004 + },
3208 4005
3209 //--调用更新阶梯团的接口-- 4006 //--调用更新阶梯团的接口--
3210 update_jiti: function (id) { 4007 update_jiti: function (id) {
@@ -3232,8 +4029,8 @@ Page({ @@ -3232,8 +4029,8 @@ Page({
3232 var bconfig = th.data.bconfig; 4029 var bconfig = th.data.bconfig;
3233 4030
3234 //如果开启了,则不在选择门店 4031 //如果开启了,则不在选择门店
3235 - if(this.data.sys_switch.is_pricing_open_store && getApp().globalData.pk_store){  
3236 - return false; 4032 + if (this.data.sys_switch.is_pricing_open_store && getApp().globalData.pk_store) {
  4033 + return false;
3237 } 4034 }
3238 4035
3239 if (!th.data.only_pk && !th.data.def_pickpu_list) { 4036 if (!th.data.only_pk && !th.data.def_pickpu_list) {
@@ -3857,7 +4654,7 @@ Page({ @@ -3857,7 +4654,7 @@ Page({
3857 4654
3858 4655
3859 onShareTimeline() { 4656 onShareTimeline() {
3860 - getApp().globalData.no_clear=1; 4657 + getApp().globalData.no_clear = 1;
3861 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : ''; 4658 var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : '';
3862 if (!store_name) 4659 if (!store_name)
3863 store_name = getApp().globalData.setting.appName; 4660 store_name = getApp().globalData.setting.appName;
@@ -3872,10 +4669,10 @@ Page({ @@ -3872,10 +4669,10 @@ Page({
3872 }, 4669 },
3873 4670
3874 clickShare() { 4671 clickShare() {
3875 - if(!getApp().globalData.user_id){  
3876 - getApp().goto("/packageE/pages/togoin/togoin");  
3877 - return false;  
3878 - } 4672 + if (!getApp().globalData.user_id) {
  4673 + getApp().goto("/packageE/pages/togoin/togoin");
  4674 + return false;
  4675 + }
3879 this.setData({ share_hidden: true, }); 4676 this.setData({ share_hidden: true, });
3880 }, 4677 },
3881 4678
@@ -3906,206 +4703,206 @@ Page({ @@ -3906,206 +4703,206 @@ Page({
3906 }, 4703 },
3907 4704
3908 //获取预售的信息 4705 //获取预售的信息
3909 - async get_pre_prom(func) {  
3910 - var th = this;  
3911 - var presell_id = null;  
3912 - var pre_arr = null;  
3913 -  
3914 - if (!th.data.pre_id) {  
3915 - var presell_id = th.data.presell_id;  
3916 - var url = "/api/weshop/marketing/marketingPresellList/list"  
3917 - var rd = {  
3918 - store_id: os.stoid,  
3919 - presell_id: presell_id,  
3920 - goods_id: th.data.gid  
3921 - }  
3922 - //------获取预售从表----------  
3923 - await getApp().request.promiseGet(url, {  
3924 - data: rd  
3925 - }).then(res => {  
3926 - if (res.data.code == 0 && res.data.data && res.data.data.length > 0) {  
3927 - var arr = res.data.data[0];  
3928 - presell_id = arr.presell_id;  
3929 - th.setData({  
3930 - presellList: arr,  
3931 - })  
3932 - }  
3933 - }) 4706 + async get_pre_prom(func) {
  4707 + var th = this;
  4708 + var presell_id = null;
  4709 + var pre_arr = null;
3934 4710
3935 - } else {  
3936 - //------获取预售从表----------  
3937 - await getApp().request.promiseGet("/api/weshop/marketing/marketingPresellList/get/" + os.stoid + "/" + th.data.pre_id, {}).then(res => {  
3938 - if (res.data.code == 0 && res.data.data) {  
3939 - var arr = res.data.data;  
3940 - presell_id = arr.presell_id;  
3941 - th.setData({  
3942 - presellList: arr,  
3943 - })  
3944 - }  
3945 - }) 4711 + if (!th.data.pre_id) {
  4712 + var presell_id = th.data.presell_id;
  4713 + var url = "/api/weshop/marketing/marketingPresellList/list"
  4714 + var rd = {
  4715 + store_id: os.stoid,
  4716 + presell_id: presell_id,
  4717 + goods_id: th.data.gid
  4718 + }
  4719 + //------获取预售从表----------
  4720 + await getApp().request.promiseGet(url, {
  4721 + data: rd
  4722 + }).then(res => {
  4723 + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) {
  4724 + var arr = res.data.data[0];
  4725 + presell_id = arr.presell_id;
  4726 + th.setData({
  4727 + presellList: arr,
  4728 + })
3946 } 4729 }
  4730 + })
3947 4731
3948 - if (!presell_id) {  
3949 - wx.showToast({title: "未找到活动商品", icon: 'none', duration: 3000});  
3950 - ut.wx_back();  
3951 - return false; 4732 + } else {
  4733 + //------获取预售从表----------
  4734 + 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) {
  4736 + var arr = res.data.data;
  4737 + presell_id = arr.presell_id;
  4738 + th.setData({
  4739 + presellList: arr,
  4740 + })
3952 } 4741 }
  4742 + })
  4743 + }
3953 4744
3954 - var gnext=1;  
3955 - //------获取预售主表----------  
3956 - await getApp().request.promiseGet(`/api/weshop/marketing/marketingPresellForm/get/${os.stoid}/${presell_id}`, {}).then(res => {  
3957 - if (res.data.code == 0 && res.data.data) {  
3958 - var act_data = res.data.data;  
3959 - if (act_data.is_end) {  
3960 - wx.showToast({title: "活动已经结束", icon: 'none', duration: 3000});  
3961 - setTimeout(function () {  
3962 - ut.wx_back();  
3963 - }, 2000)  
3964 - gnext=0;  
3965 - return false;  
3966 - }  
3967 - if (act_data.isuse == 0) {  
3968 - wx.showToast({title: "活动未启用", icon: 'none', duration: 3000});  
3969 - setTimeout(function () {  
3970 - ut.wx_back();  
3971 - }, 2000)  
3972 - gnext=0;  
3973 - return false;  
3974 - }  
3975 -  
3976 - var err_txt="活动定金时间已经结束";  
3977 - var end_time = act_data.end_time;  
3978 - if (act_data.presell_type == 1) {  
3979 - err_txt="活动时间已经结束";  
3980 - }  
3981 - if (end_time < ut.gettimestamp()) {  
3982 - wx.showToast({title:err_txt, icon: 'none', duration: 3000});  
3983 - setTimeout(function () {  
3984 - getApp().goto("/pages/index/index/index");  
3985 - }, 2000)  
3986 - gnext=0;  
3987 - return false;  
3988 - }  
3989 -  
3990 - if (act_data.presell_type == 0) {  
3991 - end_time = act_data.pay_enddate;  
3992 - err_txt="活动尾款时间已经结束";  
3993 - }  
3994 - if (end_time < ut.gettimestamp()) {  
3995 - wx.showToast({title:err_txt, icon: 'none', duration: 3000});  
3996 - setTimeout(function () {  
3997 - ut.wx_back();  
3998 - }, 2000)  
3999 - gnext=0;  
4000 - return false;  
4001 - }  
4002 -  
4003 - if (act_data.start_time > ut.gettimestamp()) {  
4004 - wx.showToast({title:"活动还未开始", icon: 'none', duration: 3000});  
4005 - setTimeout(function () {  
4006 - ut.wx_back();  
4007 - }, 2000)  
4008 - gnext=0;  
4009 - return false;  
4010 - } 4745 + if (!presell_id) {
  4746 + wx.showToast({ title: "未找到活动商品", icon: 'none', duration: 3000 });
  4747 + ut.wx_back();
  4748 + return false;
  4749 + }
4011 4750
4012 - th.setData({  
4013 - presellForm: res.data.data,  
4014 - });  
4015 - th.countDown(res.data.data.end_time)  
4016 - }  
4017 - }) 4751 + var gnext = 1;
  4752 + //------获取预售主表----------
  4753 + await getApp().request.promiseGet(`/api/weshop/marketing/marketingPresellForm/get/${os.stoid}/${presell_id}`, {}).then(res => {
  4754 + if (res.data.code == 0 && res.data.data) {
  4755 + var act_data = res.data.data;
  4756 + if (act_data.is_end) {
  4757 + wx.showToast({ title: "活动已经结束", icon: 'none', duration: 3000 });
  4758 + setTimeout(function () {
  4759 + ut.wx_back();
  4760 + }, 2000)
  4761 + gnext = 0;
  4762 + return false;
  4763 + }
  4764 + if (act_data.isuse == 0) {
  4765 + wx.showToast({ title: "活动未启用", icon: 'none', duration: 3000 });
  4766 + setTimeout(function () {
  4767 + ut.wx_back();
  4768 + }, 2000)
  4769 + gnext = 0;
  4770 + return false;
  4771 + }
4018 4772
4019 - if(!gnext){  
4020 - return false; 4773 + var err_txt = "活动定金时间已经结束";
  4774 + var end_time = act_data.end_time;
  4775 + if (act_data.presell_type == 1) {
  4776 + err_txt = "活动时间已经结束";
  4777 + }
  4778 + if (end_time < ut.gettimestamp()) {
  4779 + wx.showToast({ title: err_txt, icon: 'none', duration: 3000 });
  4780 + setTimeout(function () {
  4781 + getApp().goto("/pages/index/index/index");
  4782 + }, 2000)
  4783 + gnext = 0;
  4784 + return false;
4021 } 4785 }
4022 4786
4023 - var userInfo = getApp().globalData.userInfo;  
4024 - var pre_data = {store_id: os.stoid, is_end: 0, timetype: 1, isuse: 1, prom_type: 8, prom_id: presell_id,pageSize:1000};  
4025 - if (userInfo) {  
4026 - pre_data.user_id = userInfo.user_id; 4787 + if (act_data.presell_type == 0) {
  4788 + end_time = act_data.pay_enddate;
  4789 + err_txt = "活动尾款时间已经结束";
4027 } 4790 }
4028 - await getApp().request.promiseGet("/api/weshop/marketing/marketingPresellList/page", {  
4029 - data: pre_data,  
4030 - }).then(e => {  
4031 - if (e.data.code == 0 && e.data.data.pageData && e.data.data.pageData.length > 0) {  
4032 -  
4033 - th.data.all_pre_goods = e.data.data.pageData;  
4034 - var idx = e.data.data.pageData.findIndex(function (ele) {  
4035 - return ele.id == th.data.presellList.id;  
4036 - })  
4037 -  
4038 - pre_arr = e.data.data.pageData[idx];  
4039 - th.setData({pre_arr: pre_arr,show:1})  
4040 - th.data.prom_buy_limit = pre_arr.vip_butyqty;  
4041 - }  
4042 - })  
4043 - if (!pre_arr) {  
4044 - wx.showToast({title: "当前会员身份不符或者时间已过期,无法参与", icon: 'none', duration: 3000});  
4045 - setTimeout(function () {  
4046 - ut.wx_back();  
4047 - }, 2000)  
4048 - return false; 4791 + if (end_time < ut.gettimestamp()) {
  4792 + wx.showToast({ title: err_txt, icon: 'none', duration: 3000 });
  4793 + setTimeout(function () {
  4794 + ut.wx_back();
  4795 + }, 2000)
  4796 + gnext = 0;
  4797 + return false;
4049 } 4798 }
4050 - if (func) {  
4051 - func(); 4799 +
  4800 + 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;
4052 } 4807 }
4053 - },  
4054 4808
4055 - con_weixin:function () {  
4056 - getApp().con_wx(this);  
4057 - },  
4058 -  
4059 - // 预览海报  
4060 - previewPoster() {  
4061 - getApp().globalData.no_clear=1;  
4062 - wx.previewImage({  
4063 - current: this.data.shareImgPath, // 当前显示图片的http链接  
4064 - urls: [this.data.shareImgPath] ,// 需要预览的图片http链接列表  
4065 - });  
4066 - },  
4067 -  
4068 -  
4069 - click_contact:function () {  
4070 - getApp().globalData.no_clear=1;  
4071 - },  
4072 -  
4073 - //打开客服操作菜单  
4074 - openCS() {  
4075 - // 判断会员状态  
4076 - let user_info = getApp().globalData.userInfo;  
4077 - if (user_info == null || user_info.mobile == undefined || user_info.mobile == '' || user_info.mobile == null) {  
4078 - wx.navigateTo({  
4079 - url: '/packageE/pages/togoin/togoin',  
4080 - })  
4081 - return false;  
4082 - };  
4083 - // csType/在线客服设置:  
4084 - // 0关闭(如果有设置热线电话,则显示拨打热线电话)、  
4085 - // 1小程序客服、  
4086 - // 2企业微信客服  
4087 - if(this.data.sys_switch) {  
4088 - let csType = this.data.sys_switch.weapp_customertype;  
4089 - if(csType == 0) {  
4090 - // 拨打电话号码  
4091 - this.contactService();  
4092 - } else {  
4093 - this.getTel()  
4094 - .then(() => {  
4095 - self.setData({  
4096 - hiddenCS: false,  
4097 - });  
4098 - });  
4099 - };  
4100 - };  
4101 -  
4102 - },  
4103 -  
4104 - //关闭客服操作菜单  
4105 - closeCS() {  
4106 - this.setData({  
4107 - hiddenCS: true,  
4108 - });  
4109 - }, 4809 + th.setData({
  4810 + presellForm: res.data.data,
  4811 + });
  4812 + th.countDown(res.data.data.end_time)
  4813 + }
  4814 + })
  4815 +
  4816 + if (!gnext) {
  4817 + return false;
  4818 + }
  4819 +
  4820 + var userInfo = getApp().globalData.userInfo;
  4821 + var pre_data = { store_id: os.stoid, is_end: 0, timetype: 1, isuse: 1, prom_type: 8, prom_id: presell_id, pageSize: 1000 };
  4822 + if (userInfo) {
  4823 + pre_data.user_id = userInfo.user_id;
  4824 + }
  4825 + await getApp().request.promiseGet("/api/weshop/marketing/marketingPresellList/page", {
  4826 + data: pre_data,
  4827 + }).then(e => {
  4828 + if (e.data.code == 0 && e.data.data.pageData && e.data.data.pageData.length > 0) {
  4829 +
  4830 + th.data.all_pre_goods = e.data.data.pageData;
  4831 + var idx = e.data.data.pageData.findIndex(function (ele) {
  4832 + return ele.id == th.data.presellList.id;
  4833 + })
  4834 +
  4835 + pre_arr = e.data.data.pageData[idx];
  4836 + th.setData({ pre_arr: pre_arr, show: 1 })
  4837 + th.data.prom_buy_limit = pre_arr.vip_butyqty;
  4838 + }
  4839 + })
  4840 + if (!pre_arr) {
  4841 + wx.showToast({ title: "当前会员身份不符或者时间已过期,无法参与", icon: 'none', duration: 3000 });
  4842 + setTimeout(function () {
  4843 + ut.wx_back();
  4844 + }, 2000)
  4845 + return false;
  4846 + }
  4847 + if (func) {
  4848 + func();
  4849 + }
  4850 + },
  4851 +
  4852 + con_weixin: function () {
  4853 + getApp().con_wx(this);
  4854 + },
  4855 +
  4856 + // 预览海报
  4857 + previewPoster() {
  4858 + getApp().globalData.no_clear = 1;
  4859 + wx.previewImage({
  4860 + current: this.data.shareImgPath, // 当前显示图片的http链接
  4861 + urls: [this.data.shareImgPath],// 需要预览的图片http链接列表
  4862 + });
  4863 + },
  4864 +
  4865 +
  4866 + click_contact: function () {
  4867 + getApp().globalData.no_clear = 1;
  4868 + },
  4869 +
  4870 + //打开客服操作菜单
  4871 + openCS() {
  4872 + // 判断会员状态
  4873 + let user_info = getApp().globalData.userInfo;
  4874 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == '' || user_info.mobile == null) {
  4875 + wx.navigateTo({
  4876 + url: '/packageE/pages/togoin/togoin',
  4877 + })
  4878 + return false;
  4879 + };
  4880 + // csType/在线客服设置:
  4881 + // 0关闭(如果有设置热线电话,则显示拨打热线电话)、
  4882 + // 1小程序客服、
  4883 + // 2企业微信客服
  4884 + if (this.data.sys_switch) {
  4885 + let csType = this.data.sys_switch.weapp_customertype;
  4886 + if (csType == 0) {
  4887 + // 拨打电话号码
  4888 + this.contactService();
  4889 + } else {
  4890 + this.getTel()
  4891 + .then(() => {
  4892 + self.setData({
  4893 + hiddenCS: false,
  4894 + });
  4895 + });
  4896 + };
  4897 + };
  4898 +
  4899 + },
  4900 +
  4901 + //关闭客服操作菜单
  4902 + closeCS() {
  4903 + this.setData({
  4904 + hiddenCS: true,
  4905 + });
  4906 + },
4110 4907
4111 }); 4908 });
packageC/pages/presell/goodsInfo/goodsInfo.wxml
@@ -524,7 +524,7 @@ @@ -524,7 +524,7 @@
524 <view class="shopping-cart cart-ico new_split"> 524 <view class="shopping-cart cart-ico new_split">
525 <navigator open-type="switchTab" url="/pages/cart/cart/cart"> 525 <navigator open-type="switchTab" url="/pages/cart/cart/cart">
526 <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image> 526 <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image>
527 - <view class="cart-num ellipsis-1">{{cartGoodsNum}}</view> 527 + <!-- <view class="cart-num ellipsis-1">{{cartGoodsNum}}</view> -->
528 <view>购物车</view> 528 <view>购物车</view>
529 </navigator> 529 </navigator>
530 </view> 530 </view>
@@ -939,7 +939,7 @@ @@ -939,7 +939,7 @@
939 <canvas canvas-id='share' style='width:750rpx;height:1217rpx;background-color:white;' wx:if='{{!canvasHidden}}'></canvas> 939 <canvas canvas-id='share' style='width:750rpx;height:1217rpx;background-color:white;' wx:if='{{!canvasHidden}}'></canvas>
940 <warn id="warn"></warn> 940 <warn id="warn"></warn>
941 <!-- 分享控件,底部弹出 --> 941 <!-- 分享控件,底部弹出 -->
942 -<share id="share_button" bind:send="send" bind:cancel="cancel" bind:share_img="saveImageToPhotosAlbum" wx:if="{{share_hidden}}"></share> 942 +<share id="share_button" bind:send="send" bind:cancel="cancel" bind:share_img="saveImageFn" wx:if="{{share_hidden}}"></share>
943 <view wx:if="{{showPoster}}"> 943 <view wx:if="{{showPoster}}">
944 <view class="mask" catchtap="closePoster"></view> 944 <view class="mask" catchtap="closePoster"></view>
945 <view class="poster-container"> 945 <view class="poster-container">
@@ -951,7 +951,10 @@ @@ -951,7 +951,10 @@
951 <text class="iconfont icon-close"></text> 951 <text class="iconfont icon-close"></text>
952 </view> 952 </view>
953 </view> 953 </view>
954 - 954 + <view class="btn-container">
  955 + <!-- <button class="btn-share" open-type="share" bindtap="">微信好友分享</button> -->
  956 + <button class="btn-share" bindtap="savePic">保存到相册</button>
  957 + </view>
955 </view> 958 </view>
956 </view> 959 </view>
957 </view> 960 </view>
packageC/pages/presell/pregoodsInfo/goodsInfo.js
@@ -556,7 +556,7 @@ Page({ @@ -556,7 +556,7 @@ Page({
556 data: { 556 data: {
557 store_id: os.stoid, 557 store_id: os.stoid,
558 type: 1, 558 type: 1,
559 - pageSize: 3, 559 + pageSize: 100,
560 page: 1, 560 page: 1,
561 is_share: 0, 561 is_share: 0,
562 }, 562 },
@@ -564,7 +564,25 @@ Page({ @@ -564,7 +564,25 @@ Page({
564 fir_quan = res1.data.data.pageData; 564 fir_quan = res1.data.data.pageData;
565 }) 565 })
566 } 566 }
567 - 567 + //过滤不是本商品的单品优惠券-------------------
  568 + if(fir_quan.length > 0 ){
  569 + let goodInfo = ee.data.data
  570 + for (let index = fir_quan.length-1; index >= 0; index--) {
  571 + if (fir_quan[index].useobjecttype==20) { //判断是单品优惠券
  572 + if (fir_quan[index].useobjectno != goodInfo.goods_sn) {
  573 + fir_quan.splice(index,1)
  574 + }
  575 + }
  576 + }
  577 + }
  578 + let arr=[]
  579 + let length = fir_quan.length
  580 + if (length <= 3) {
  581 + arr=fir_quan
  582 + }else{
  583 + arr=fir_quan.splice(0,3);
  584 + }
  585 + //--------获取视频图片---------
568 //--------获取视频图片--------- 586 //--------获取视频图片---------
569 await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, { 587 await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, {
570 1: 1 588 1: 1
@@ -580,7 +598,7 @@ Page({ @@ -580,7 +598,7 @@ Page({
580 is_collect: is_collect, 598 is_collect: is_collect,
581 collect_id: collect_id, 599 collect_id: collect_id,
582 categories3: categories3, 600 categories3: categories3,
583 - fir_quan: fir_quan, 601 + fir_quan: arr,
584 fir_comments: fir_com, 602 fir_comments: fir_com,
585 mapurl_f_img: mapurl_f_img, 603 mapurl_f_img: mapurl_f_img,
586 mapurl: mapurl, 604 mapurl: mapurl,
@@ -2578,7 +2596,18 @@ Page({ @@ -2578,7 +2596,18 @@ Page({
2578 wx.hideLoading(); 2596 wx.hideLoading();
2579 quan_list = res.data.data.pageData; 2597 quan_list = res.data.data.pageData;
2580 }) 2598 })
2581 - 2599 + //过滤不是本商品的单品优惠券
  2600 + if (quan_list.length > 0) {
  2601 + let goodInfo = th.data.data
  2602 + for (let index = quan_list.length-1; index >= 0; index--) {
  2603 + if (quan_list[index].useobjecttype==20) { //判断是单品优惠券
  2604 + if (quan_list[index].useobjectno != goodInfo.goods_sn) {
  2605 + quan_list.splice(index,1)
  2606 + }
  2607 + }
  2608 + }
  2609 + }
  2610 + //------------------------
2582 if (quan_list) { 2611 if (quan_list) {
2583 for (var ind in quan_list) { 2612 for (var ind in quan_list) {
2584 var ep = quan_list[ind]; 2613 var ep = quan_list[ind];
@@ -3115,8 +3144,14 @@ Page({ @@ -3115,8 +3144,14 @@ Page({
3115 tt(); 3144 tt();
3116 }, 3145 },
3117 fail: function (res) { 3146 fail: function (res) {
3118 - ee.data.share_goods_img = "../../../../images/share/default_g_img.gif"; //分享的图片不能用网络的  
3119 - tt(); 3147 + //获取默认空白图
  3148 + wx.getImageInfo({
  3149 + src: ee.data.iurl+'/miniapp/images/default_g_img.gif',
  3150 + success: function(res) {
  3151 + ee.data.share_goods_img = res.path; //分享的图片不能用网络的
  3152 + tt();
  3153 + }
  3154 + })
3120 } 3155 }
3121 }); 3156 });
3122 }, 3157 },
packageD/pages/user/coupons/coupons.js
@@ -11,10 +11,10 @@ const { @@ -11,10 +11,10 @@ const {
11 qrcode 11 qrcode
12 } = require('../../../../utils/index.js'); 12 } = require('../../../../utils/index.js');
13 let _this = null; 13 let _this = null;
14 - 14 +
15 Page({ 15 Page({
16 data: { 16 data: {
17 - 17 + iurl: getApp().globalData.setting.imghost,
18 val:false, 18 val:false,
19 datet: "", 19 datet: "",
20 dates: "", 20 dates: "",
@@ -96,9 +96,47 @@ Page({ @@ -96,9 +96,47 @@ Page({
96 96
97 97
98 }, 98 },
99 - 99 + //跳转商品
  100 + nvShop(){
  101 + let url= '/pages/goods/goodsList/goodsList'
  102 + getApp().goto(url)
  103 + },
  104 + //跳转商品详情
  105 + nvShopInfo(e){
  106 + let useobjectid = e.currentTarget.dataset.useobjectid;
  107 + //------------------------------------------------
  108 + getApp().request.get('/api/weshop/goods/list', {
  109 + data: {
  110 + store_id: os.stoid,
  111 + erpwareid: useobjectid,
  112 + },
  113 + success(res) {
  114 + if (res.data.code ==0) {
  115 + let good = res.data.data;
  116 + if (good.length>0) {
  117 + let item = good[0]
  118 + let url = `/pages/goods/goodsInfo/goodsInfo?goods_id=${item.goods_id}&prom_type=${item.prom_type}&prom_id=${item.prom_id}`
  119 + getApp().goto(url)
  120 + }else{
  121 + getApp().showWarning("该商品不存在");
  122 + }
  123 + }
  124 + }
  125 + })
100 126
101 - 127 +
  128 +
  129 + // wx.reLaunch({
  130 + // url: '/pages/goods/goodsInfo/goodsInfo',
  131 + // })
  132 +
  133 +
  134 +
  135 +
  136 +
  137 +
  138 + //------------------------------------------------
  139 + },
102 140
103 // 点击选中二维码 141 // 点击选中二维码
104 click: function (e) { 142 click: function (e) {
packageD/pages/user/coupons/coupons.wxml
@@ -20,11 +20,15 @@ @@ -20,11 +20,15 @@
20 <view class="fs28 ellipsis-1x">包邮券</view> 20 <view class="fs28 ellipsis-1x">包邮券</view>
21 <view class="fs24 c-7b pdt4 ellipsis-1x">微券来源: 微信商城</view> 21 <view class="fs24 c-7b pdt4 ellipsis-1x">微券来源: 微信商城</view>
22 </view> 22 </view>
23 - <view class="shrink0"><text class="btn {{currentIndex != 0 ? 'gray':''}}" bindtap="{{currentIndex == 0 ? 'clickUse':''}}" data-index="{{idx}}" data-cashrepno="{{detail.no}}">{{filter.showBtnText(currentIndex)}}</text></view> 23 + <view class="shrink0"><text class="btn {{currentIndex != 0 ? 'gray':''}}" bindtap="{{currentIndex == 0 ? 'nvShop':''}}" data-index="{{idx}}" data-cashrepno="{{detail.no}}">{{filter.showBtnText(currentIndex)}}</text></view>
24 </view> 24 </view>
25 - <view class="c-time"> 25 + <view class="flex jc_sb ai_c c-time">
26 <text class="ellipsis-1x" wx:if="{{detail.use_end_time!=null}}">有效期:{{detail.use_start_time==null?" " : time.format_time(detail.use_start_time)}} 至 {{time.format_time(detail.use_end_time)}}</text> 26 <text class="ellipsis-1x" wx:if="{{detail.use_end_time!=null}}">有效期:{{detail.use_start_time==null?" " : time.format_time(detail.use_start_time)}} 至 {{time.format_time(detail.use_end_time)}}</text>
27 <text wx:else>有效期:不限</text> 27 <text wx:else>有效期:不限</text>
  28 + <!-- <image bindtap="clickUse" data-index="{{idx}}" data-cashrepno="{{detail.no}}" style="height: 42rpx ;width: 42rpx;border: 2px solid #fe9db5;background: #fe9db5;" src="{{iurl}}/miniapp/images/qrcode1.png"></image> -->
  29 + <image bindtap="clickUse" data-index="{{idx}}" data-cashrepno="{{detail.no}}" style="height: 52rpx ;width: 52rpx;" src="{{iurl}}/miniapp/images/qrcode_img.png"></image>
  30 + <!-- <text class="iconfont icon-erweima" bindtap="clickUse" style="color: black;" data-index="{{idx}}" data-cashrepno="{{detail.no}}" ></text> -->
  31 +
28 </view> 32 </view>
29 </view> 33 </view>
30 </view> 34 </view>
@@ -46,15 +50,17 @@ @@ -46,15 +50,17 @@
46 <view class="fs24 c-7b pdt4 ellipsis-1x">微券来源: {{detail.SendMan==null?'线下发放':detail.SendMan==''?"线下发放":detail.SendMan}}</view> 50 <view class="fs24 c-7b pdt4 ellipsis-1x">微券来源: {{detail.SendMan==null?'线下发放':detail.SendMan==''?"线下发放":detail.SendMan}}</view>
47 </view> 51 </view>
48 <view class="shrink0"> 52 <view class="shrink0">
49 - <text class="btn {{currentIndex != 0 ? 'gray':''}}" bindtap="{{currentIndex == 0 ? 'clickUse':''}}" data-index="{{idx}}" data-cashrepno="{{detail.CashRepNo}}">{{filter.showBtnText(currentIndex)}}</text> 53 + <text class="btn {{currentIndex != 0 ? 'gray':''}}" bindtap="{{currentIndex == 0 ? ( detail.UseObjectID==null || detail.UseObjectID== '' ? 'nvShop' : (detail.UseObjectType==20 ? 'nvShopInfo' :'clickUse') ):''}}" data-index="{{idx}}" data-cashrepno="{{detail.CashRepNo}}" data-useobjectid="{{detail.UseObjectID}}">{{filter.showBtnText(currentIndex)}}</text>
50 </view> 54 </view>
51 </view> 55 </view>
52 - <view class="c-time"> 56 + <view class="c-time flex jc_sb ai_c">
53 <text wx:if="{{detail.ValidDate}}" class="ellipsis-1x">有效期:{{detail.BeginDate==null ? " " : time.replace_time2(detail.BeginDate)}} 至 {{time.replace_time2(detail.ValidDate)}}</text> 57 <text wx:if="{{detail.ValidDate}}" class="ellipsis-1x">有效期:{{detail.BeginDate==null ? " " : time.replace_time2(detail.BeginDate)}} 至 {{time.replace_time2(detail.ValidDate)}}</text>
54 <text wx:else>有效期:不限</text> 58 <text wx:else>有效期:不限</text>
  59 + <!-- <image wx:if="{{detail.UseObjectID==null || detail.UseObjectID=='' || detail.UseObjectType==20}}" bindtap="{{currentIndex == 0 ? 'clickUse':''}}" data-index="{{idx}}" data-cashrepno="{{detail.CashRepNo}}" style="height: 42rpx ;width: 42rpx;border: 2px solid #fe9db5;background: #fe9db5;" src="{{iurl}}/miniapp/images/qrcode1.png"></image> -->
  60 + <image wx:if="{{detail.UseObjectID==null || detail.UseObjectID=='' || detail.UseObjectType==20}}" bindtap="{{currentIndex == 0 ? 'clickUse':''}}" data-index="{{idx}}" data-cashrepno="{{detail.CashRepNo}}" style="height: 52rpx ;width: 52rpx;" src="{{iurl}}/miniapp/images/qrcode_img.png"></image>
55 </view> 61 </view>
56 </view> 62 </view>
57 - </view> 63 + </view>
58 </view> 64 </view>
59 <view class="c-info arrow-down {{detail.isShowDetails ? 'active':''}}" bindtap="clickDetails" data-index="{{idx}}"> 65 <view class="c-info arrow-down {{detail.isShowDetails ? 'active':''}}" bindtap="clickDetails" data-index="{{idx}}">
60 <view class="{{detail.isShowDetails ? '':'ellipsis-1x'}}" wx:if="{{detail.Remark1!=''}}"><text style="margin-right: 15rpx">使用说明:</text>{{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}};{{detail.Remark1}};活动名称:{{detail.ActName}}、活动编号:{{detail.ActNo}}</view> 66 <view class="{{detail.isShowDetails ? '':'ellipsis-1x'}}" wx:if="{{detail.Remark1!=''}}"><text style="margin-right: 15rpx">使用说明:</text>{{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}};{{detail.Remark1}};活动名称:{{detail.ActName}}、活动编号:{{detail.ActNo}}</view>
pages/user/Detailed/Detailed.js renamed to packageE/pages/user/Detailed/Detailed.js
@@ -3,9 +3,9 @@ var t = getApp(), @@ -3,9 +3,9 @@ var t = getApp(),
3 a = t.request, 3 a = t.request,
4 o = t.globalData.setting, 4 o = t.globalData.setting,
5 os = o, 5 os = o,
6 - i = require("../../../utils/util.js"), 6 + i = require("../../../../utils/util.js"),
7 ut = i, 7 ut = i,
8 - s = require("../../../utils/common.js"); 8 + s = require("../../../../utils/common.js");
9 9
10 Page({ 10 Page({
11 /** 11 /**
@@ -222,12 +222,12 @@ Page({ @@ -222,12 +222,12 @@ Page({
222 //开启画布 222 //开启画布
223 const ctx = wx.createCanvasContext('myCanvas'); 223 const ctx = wx.createCanvasContext('myCanvas');
224 //先画背景 224 //先画背景
225 - ctx.drawImage("../../../images/share/mackground.png", 0, 0, 554 * unit, 899 * unit); 225 + ctx.drawImage("../../../../images/share/mackground.png", 0, 0, 554 * unit, 899 * unit);
226 ctx.setFontSize(24 * unit); 226 ctx.setFontSize(24 * unit);
227 ctx.setFillStyle("rgb(0,0,0)"); 227 ctx.setFillStyle("rgb(0,0,0)");
228 ctx.fillText(nickname, 152 * unit, 76 * unit); 228 ctx.fillText(nickname, 152 * unit, 76 * unit);
229 var width = 24 * nickname.length * unit + 2 * unit; 229 var width = 24 * nickname.length * unit + 2 * unit;
230 - var tj_path = "../../../images/share/q_tj.png"; 230 + var tj_path = "../../../../images/share/q_tj.png";
231 ctx.drawImage(tj_path, 152 * unit + width, 54 * unit, 95 * unit, 30 * unit); 231 ctx.drawImage(tj_path, 152 * unit + width, 54 * unit, 95 * unit, 30 * unit);
232 ctx.setFontSize(18 * unit); 232 ctx.setFontSize(18 * unit);
233 ctx.setLineJoin('round'); //交点设置成圆角 233 ctx.setLineJoin('round'); //交点设置成圆角
pages/user/Detailed/Detailed.json renamed to packageE/pages/user/Detailed/Detailed.json
pages/user/Detailed/Detailed.wxml renamed to packageE/pages/user/Detailed/Detailed.wxml
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 5
6 <picker class='pi' mode="date" value='{{datet}}' start="2019/1/1" bindchange='bindDateChenge'> 6 <picker class='pi' mode="date" value='{{datet}}' start="2019/1/1" bindchange='bindDateChenge'>
7 <view class="rq-rim"> 7 <view class="rq-rim">
8 - <view class='kssj'><text class="wz"name="datat"value='{{datet}}'bindinput='watchPassWord'>{{datet}}</text></view> 8 + <view class='kssj'><text class="wz"name="datat" value='{{datet}}' bindinput='watchPassWord'>{{datet}}</text></view>
9 <!-- 清除输入框中的内容--> 9 <!-- 清除输入框中的内容-->
10 <view hidden='{{isBind}}' class="qc-rim"> 10 <view hidden='{{isBind}}' class="qc-rim">
11 <button class="empty" catchtap="eliminate">x</button> 11 <button class="empty" catchtap="eliminate">x</button>
pages/user/Detailed/Detailed.wxss renamed to packageE/pages/user/Detailed/Detailed.wxss
pages/user/user_fw/user_fw.js renamed to packageE/pages/user/user_fw/user_fw.js
1 // pages/user/userfw/userfw.js 1 // pages/user/userfw/userfw.js
2 var e = getApp(),os = e.globalData.setting; 2 var e = getApp(),os = e.globalData.setting;
3 -var utils = require('../../../utils/util.js');  
4 -var regeneratorRuntime = require('../../../utils/runtime.js'); 3 +var utils = require('../../../../utils/util.js');
  4 +var regeneratorRuntime = require('../../../../utils/runtime.js');
5 5
6 Page({ 6 Page({
7 /** 7 /**
pages/user/user_fw/user_fw.json renamed to packageE/pages/user/user_fw/user_fw.json
pages/user/user_fw/user_fw.wxml renamed to packageE/pages/user/user_fw/user_fw.wxml
1 -<wxs module="filter" src="../../../utils/filter.wxs"></wxs> 1 +<wxs module="filter" src="../../../../utils/filter.wxs"></wxs>
2 <view class="xc-page"> 2 <view class="xc-page">
3 <view class="items t-c" bindtap="open_fw" wx:for="{{fw_list}}" 3 <view class="items t-c" bindtap="open_fw" wx:for="{{fw_list}}"
4 data-ind="{{index}}" > 4 data-ind="{{index}}" >
pages/user/user_fw/user_fw.wxss renamed to packageE/pages/user/user_fw/user_fw.wxss
pages/cart/cart/cart.js
@@ -28,6 +28,7 @@ Page({ @@ -28,6 +28,7 @@ Page({
28 up_dating: 0, //更新中 28 up_dating: 0, //更新中
29 isreduce: 0, //商品数量是否可减 29 isreduce: 0, //商品数量是否可减
30 isadd: 0, //是否可以加商品数量 30 isadd: 0, //是否可以加商品数量
  31 + invalidList:[], //失效商品列表
31 32
32 card_field:"", 33 card_field:"",
33 bconf:null, 34 bconf:null,
@@ -48,9 +49,9 @@ Page({ @@ -48,9 +49,9 @@ Page({
48 49
49 }, 50 },
50 onLoad: function () { 51 onLoad: function () {
  52 +
51 var a = this, 53 var a = this,
52 ee = a; 54 ee = a;
53 -  
54 55
55 wx.setNavigationBarTitle({ 56 wx.setNavigationBarTitle({
56 title: "购物车", 57 title: "购物车",
@@ -65,7 +66,9 @@ Page({ @@ -65,7 +66,9 @@ Page({
65 onShow: function () { 66 onShow: function () {
66 //每次显示都清空 67 //每次显示都清空
67 this.data.in_zhact_gdmap = {}; 68 this.data.in_zhact_gdmap = {};
68 - 69 + this.setData({
  70 + invalidList:[]
  71 + });
69 72
70 if (typeof this.getTabBar === 'function' && this.getTabBar()) { 73 if (typeof this.getTabBar === 'function' && this.getTabBar()) {
71 var index = getApp().getPageIndex(this); 74 var index = getApp().getPageIndex(this);
@@ -164,9 +167,39 @@ Page({ @@ -164,9 +167,39 @@ Page({
164 onUnLoad() { 167 onUnLoad() {
165 getApp().globalData.cart_zh_act = null; 168 getApp().globalData.cart_zh_act = null;
166 }, 169 },
  170 +
  171 + //失效商品处理
  172 + // invType 表示失效的原因,classType 表示类别 0 表示商品,1表示服务
  173 + disInvalid(item,invType=0,classType=0){
  174 + let invalidList = this.data.invalidList;
  175 + let off = true;
  176 + console.log('失效商品-----1')
  177 + console.log(item)
  178 + console.log('失效商品-----2')
  179 + invalidList.map(ite=>{
  180 + if(classType ==0 && ite.goods_id == item.goods_id){ //判断该商品是否存在于失效列表中
  181 + off = false;
  182 + }
  183 + if(classType ==1 && ite.service_id == item.service_id){ //判断该商品是否存在于失效列表中
  184 + off = false;
  185 + }
  186 + });
  187 + if(off){
  188 + if(invType==0){
  189 + item.invalid = '商品活动变动';
  190 + }else if(invType ==1){
  191 + item.invalid = '商品已下架';
  192 + }else{
  193 + item.invalid ="商品超出限购"
  194 + }
  195 + item.classType = classType
  196 + invalidList.push(item);
  197 + this.setData({invalidList});
  198 + }
  199 + },
167 //-------------获取购物车列表,要安装门店进行分类订单----------- 200 //-------------获取购物车列表,要安装门店进行分类订单-----------
168 getCardList: function () { 201 getCardList: function () {
169 - 202 + this.setData({invalidList:[]}); //重置失效商品
170 var th = this; 203 var th = this;
171 204
172 //要获取会员是不是等级会员 205 //要获取会员是不是等级会员
@@ -218,6 +251,170 @@ Page({ @@ -218,6 +251,170 @@ Page({
218 }, 800) 251 }, 800)
219 } 252 }
220 }, 253 },
  254 + //失效单选
  255 + inCheck_th_item: async function(e){
  256 + console.log('失效单选');
  257 + console.log(e);
  258 + let i = e.currentTarget.dataset.item;
  259 + let invalidList = this.data.invalidList;
  260 + console.log(i)
  261 + console.log(invalidList[i])
  262 + invalidList[i].selected = invalidList[i].selected == 1 ? 0 : 1;
  263 + console.log(invalidList);
  264 + this.setData({invalidList});
  265 + console.log(this.data.invalidList);
  266 + // this.doCheckAll();
  267 +
  268 + },
  269 + //清空失效宝贝
  270 + delInva(obj=null){
  271 +
  272 + var th = this;
  273 + wx.showModal({
  274 + title: '提示',
  275 + content: '确认要清空全部失效商品吗?',
  276 + success(res) {
  277 + if (res.confirm) {
  278 + let ainvalid='';
  279 + let binvalid='';
  280 + var user_id = getApp().globalData.user_id;
  281 +
  282 + let ab = 0; //选中
  283 + let abc = 0; //
  284 + let arr = obj.id ? [obj] : th.data.invalidList
  285 + console.log('失效-----')
  286 + console.log(arr);
  287 + arr.map(item=>{
  288 + if (item.classType ==0 ) {
  289 + ainvalid+=item.id + ',';
  290 + ab = 1;
  291 + }
  292 + if (item.classType ==1 ) {
  293 + binvalid+=item.id + ',';
  294 + abc = 1;
  295 + }
  296 + });
  297 +
  298 +
  299 + if (ab == 0 && abc == 0 ) {
  300 + t.my_warnning('没有需要清空的失效宝贝', 0, th);
  301 + return false;
  302 + }
  303 + if (ab) {
  304 + ainvalid = ainvalid.substring(0, ainvalid.length - 1);
  305 + //要删除购物车中的商品
  306 + var url = '/api/weshop/cart/delIds/' + oo.stoid + '/' + user_id + '/' + ainvalid;
  307 + getApp().request.delete(url, {
  308 + success: function (t) {
  309 + th.getCardList();
  310 + getApp().requestCardNum(th);
  311 + }
  312 + });
  313 + }
  314 + if (abc) {
  315 + binvalid = binvalid.substring(0, binvalid.length - 1);
  316 + //要删除购物车中的商品
  317 + var url = '/api/weshop/cartService/delIds/' + oo.stoid + '/' + user_id + '/' + binvalid;
  318 + getApp().request.delete(url, {
  319 + success: function (t) {
  320 + th.getCardList();
  321 + getApp().requestCardNum(th);
  322 + }
  323 + });
  324 + }
  325 +
  326 + }
  327 + }
  328 + })
  329 +
  330 +
  331 +
  332 + },
  333 +
  334 + //---------点击收藏------------
  335 + collectGoods: async function () {
  336 +
  337 + let t = this
  338 + let timestamp = Date.parse(new Date());
  339 + timestamp = timestamp / 1000;
  340 + let d = {
  341 + // goods_id: t.data.data.goods_id,
  342 + user_id: app.globalData.user_id,
  343 + store_id: oo.stoid,
  344 + add_time: timestamp,
  345 + };
  346 + //加入收藏夹就是导购的ID
  347 + if (getApp().globalData.guide_id) {
  348 + d.guide_id = getApp().globalData.guide_id;
  349 + d.guide_type = 2;
  350 + }
  351 + let off = false
  352 + let errOff = false
  353 + var invalidList= [...this.data.invalidList]
  354 + var arr=[]
  355 + invalidList.map(async (item,index)=>{
  356 + if (item.selected) {
  357 + off = true
  358 + if(item.classType ==1 ){
  359 + d.goods_id = item.service_id
  360 + d.type = 1
  361 + }else{
  362 + d.goods_id = item.goods_id
  363 + d.type =0
  364 + }
  365 + let is_collect = 0
  366 + //------是否收藏----------
  367 + await getApp().request.promiseGet("/api/weshop/goodscollect/page", {
  368 + data: {
  369 + store_id: oo.stoid,
  370 + goods_id: d.goods_id,
  371 + user_id: app.globalData.user_id,
  372 + }
  373 + }).then(res => {
  374 + let t = res;
  375 + let data = t.data.data.pageData;
  376 + if (data && data.length > 0) {
  377 + is_collect =1
  378 + }
  379 + })
  380 + if (is_collect) {
  381 + t.delInva(item)
  382 + return
  383 + }
  384 + await getApp().request.post("/api/weshop/goodscollect/save", { //添加收藏
  385 + data: d,
  386 + success: function (e) {
  387 + t.data.is_collect_load = 0;
  388 + if (e.data.code == 0) {
  389 + t.delInva(item)
  390 + }else{
  391 + errOff = true
  392 + arr.push(item)
  393 + }
  394 + }
  395 + });
  396 + }else{
  397 + arr.push(item)
  398 + }
  399 + });
  400 + if (off) {
  401 + t.setData({
  402 + invalidList:arr
  403 + })
  404 + if (errOff) {
  405 + getApp().my_warnning('移到收藏夹错误', 0, t);
  406 + }else{
  407 + wx.showToast({
  408 + title: "收藏成功",
  409 + icon: 'none',
  410 + duration: 2000
  411 + })
  412 + }
  413 + console.log('移动成功')
  414 + }else{
  415 + getApp().my_warnning('请先选择失效宝贝', 0, t);
  416 + }
  417 + },
221 418
222 //-----真的获取购物车-------- 419 //-----真的获取购物车--------
223 get_cart: function () { 420 get_cart: function () {
@@ -287,10 +484,11 @@ Page({ @@ -287,10 +484,11 @@ Page({
287 var tt = ut.gettimestamp(); 484 var tt = ut.gettimestamp();
288 //如果商品下架了,或者商品是赠品,一开始都要清除 485 //如果商品下架了,或者商品是赠品,一开始都要清除
289 if ((good.down_time > 0 && good.down_time < tt) || good.is_on_sale == 0) { 486 if ((good.down_time > 0 && good.down_time < tt) || good.is_on_sale == 0) {
290 - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;  
291 - getApp().request.delete(url, {  
292 - success: function (t) {}  
293 - }); 487 + // var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
  488 + // getApp().request.delete(url, {
  489 + // success: function (t) {}
  490 + // });
  491 + th.disInvalid(item,1);
294 //商品已经下架 492 //商品已经下架
295 continue; 493 continue;
296 } 494 }
@@ -307,8 +505,9 @@ Page({ @@ -307,8 +505,9 @@ Page({
307 if (item.goods_num + goodsbuynum > limit && limit > 0) { 505 if (item.goods_num + goodsbuynum > limit && limit > 0) {
308 var cbuy = limit - goodsbuynum; 506 var cbuy = limit - goodsbuynum;
309 if (cbuy <= 0) { 507 if (cbuy <= 0) {
310 - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;  
311 - a.delete(url, {}); 508 + // var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
  509 + // a.delete(url, {});
  510 + th.disInvalid(item,2);
312 continue; 511 continue;
313 } 512 }
314 //-- 购物车更新 -- 513 //-- 购物车更新 --
@@ -323,23 +522,72 @@ Page({ @@ -323,23 +522,72 @@ Page({
323 }) 522 })
324 item.goods_num = cbuy; 523 item.goods_num = cbuy;
325 } 524 }
326 - 525 + //判断如果是普通商品,后面参加活动了,变成失效商品
  526 + if (item.prom_type == 0) {
  527 + var prom = null;
  528 + var now = ut.gettimestamp();
  529 + await getApp().request.promiseGet(`/api/weshop/activitylist/listGoodActInfo2`, {
  530 + data:{
  531 + "store_id": oo.stoid,
  532 + "goods_id": item.goods_id,
  533 + "user_id": user_id,
  534 + }
  535 + }).then(res => {
  536 + if (res.data.code == 0) {
  537 + prom = res.data.data
  538 + }
  539 + })
  540 + let prom_true = 0
  541 + let prom_id=0
  542 + if (prom) {
  543 + prom.map(item=>{
  544 + if (item.prom_type==3 || item.prom_type==7) {
  545 + prom_true = item.prom_type
  546 + prom_id = item.act_id
  547 + }
  548 + })
  549 + }
  550 + if (prom_true) {
  551 + //-- 购物车更新 --
  552 + var updata1 = {
  553 + id: item.id,
  554 + prom_type: prom_true,
  555 + prom_id,
  556 + store_id: os.stoid,
  557 + user_id: getApp().globalData.userInfo.user_id
  558 + };
  559 + item.prom_id = prom_id
  560 + item.prom_type = prom_true
  561 + getApp().request.put("/api/weshop/cart/update", {
  562 + data: updata1,
  563 + })
  564 +
  565 + }else{
  566 + if(prom && !item.is_integral_normal && !item.is_pd_normal){
  567 + th.disInvalid(item);
  568 + continue;
  569 + }
  570 + }
  571 + }
327 //如果秒杀活动都去掉了,或者结束了,那么这个商品也没有必要留着 572 //如果秒杀活动都去掉了,或者结束了,那么这个商品也没有必要留着
328 if (item.prom_type == 1) { 573 if (item.prom_type == 1) {
329 var prom = null; 574 var prom = null;
330 var now = ut.gettimestamp(); 575 var now = ut.gettimestamp();
331 await getApp().request.promiseGet("/api/ms/flash_sale/getNew/" + os.stoid + '/' + user_id + "/" + item.prom_id, {}).then(res => { 576 await getApp().request.promiseGet("/api/ms/flash_sale/getNew/" + os.stoid + '/' + user_id + "/" + item.prom_id, {}).then(res => {
332 - if (res.data.code == 0) { 577 + console.log('活动情况----------------')
  578 + console.log(res)
  579 + if (res.data.code == 0) {
333 prom = res.data.data; 580 prom = res.data.data;
334 prom.price = prom.user_price; 581 prom.price = prom.user_price;
335 } 582 }
336 }) 583 })
337 //---如果互动都已经过期,或者还未开始,或者无活动 584 //---如果互动都已经过期,或者还未开始,或者无活动
338 if (!prom || prom.is_end == 1 || prom.end_time < now || prom.start_time > now) { 585 if (!prom || prom.is_end == 1 || prom.end_time < now || prom.start_time > now) {
339 - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;  
340 - a.delete(url, {  
341 - success: function (t) {}  
342 - }); 586 + // var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
  587 + // a.delete(url, {
  588 + // success: function (t) {}
  589 + // });
  590 + th.disInvalid(item);
343 //商品已经下架 591 //商品已经下架
344 continue; 592 continue;
345 } 593 }
@@ -348,8 +596,9 @@ Page({ @@ -348,8 +596,9 @@ Page({
348 if (item.goods_num + promgoodsbuynum > prom.buy_limit && prom.buy_limit > 0) { 596 if (item.goods_num + promgoodsbuynum > prom.buy_limit && prom.buy_limit > 0) {
349 var cbuy = prom.buy_limit - promgoodsbuynum; 597 var cbuy = prom.buy_limit - promgoodsbuynum;
350 if (cbuy <= 0) { 598 if (cbuy <= 0) {
351 - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;  
352 - a.delete(url, {}); 599 + // var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
  600 + // a.delete(url, {});
  601 + th.disInvalid(item,2);
353 continue; 602 continue;
354 } 603 }
355 //-- 购物车更新 -- 604 //-- 购物车更新 --
@@ -380,6 +629,30 @@ Page({ @@ -380,6 +629,30 @@ Page({
380 }) 629 })
381 } 630 }
382 } 631 }
  632 + // 判断团购活动都去掉了,或者结束了,那么这个商品也没有必要留着
  633 + else if(item.prom_type ==2){
  634 + var prom = null;
  635 + var now = ut.gettimestamp();
  636 + await getApp().request.promiseGet('/api/weshop/goods/groupBuy/getActInfo/'+ oo.stoid + '/' + item.goods_id + '/' + item.prom_id, {}).then(res => {
  637 + if (res.data.code == 0) {
  638 + prom = res.data.data;
  639 + prom.price = prom.user_price;
  640 + }
  641 + });
  642 + //---如果互动都已经过期,或者还未开始,或者无活动
  643 + if (!prom || prom.is_end == 1 || prom.end_time < now || prom.start_time > now) {
  644 + // var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
  645 + // a.delete(url, {
  646 + // success: function (t) {}
  647 + // });
  648 + console.log('团购活动-----');
  649 + th.disInvalid(item);
  650 + //商品已经下架
  651 + continue;
  652 + }
  653 +
  654 +
  655 + }
383 //--判断优惠活动有没有过期,-- 656 //--判断优惠活动有没有过期,--
384 else if (item.prom_type == 3) { 657 else if (item.prom_type == 3) {
385 var isok = 1,is_g_prom=0; 658 var isok = 1,is_g_prom=0;
@@ -405,25 +678,37 @@ Page({ @@ -405,25 +678,37 @@ Page({
405 if (res.data.code == 0) { 678 if (res.data.code == 0) {
406 var r_data = res.data.data; 679 var r_data = res.data.data;
407 if (!r_data.promGoodsLists) { 680 if (!r_data.promGoodsLists) {
408 - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;  
409 - getApp().request.delete(url, {}); 681 + // var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
  682 + // getApp().request.delete(url, {});
410 //商品已经无活动 683 //商品已经无活动
411 - isok = 0; 684 + // th.disInvalid(item);
  685 + // isok = 0;
  686 + item.prom_type = 0
  687 + //购物车更新
  688 + th.cartUpFn(item)
412 } else { 689 } else {
413 //如果活动的ID不一样,说明原先的活动已经没有参与了或者过期了 690 //如果活动的ID不一样,说明原先的活动已经没有参与了或者过期了
414 if (item.prom_id != r_data.promGoodsLists[0].prom_id) { 691 if (item.prom_id != r_data.promGoodsLists[0].prom_id) {
415 - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;  
416 - getApp().request.delete(url, {}); 692 + // var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
  693 + // getApp().request.delete(url, {});
417 //商品已经下架 694 //商品已经下架
418 - isok = 0; 695 + // th.disInvalid(item);
  696 + // isok = 0;
  697 + item.prom_type = 0
  698 + //购物车更新
  699 + th.cartUpFn(item)
419 } 700 }
420 } 701 }
421 702
422 } else { 703 } else {
423 - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;  
424 - getApp().request.delete(url, {});  
425 - //商品已经下架  
426 - isok = 0; 704 + // var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
  705 + // getApp().request.delete(url, {});
  706 + // th.disInvalid(item);
  707 + // //商品已经下架
  708 + // isok = 0;
  709 + item.prom_type = 0
  710 + //购物车更新
  711 + th.cartUpFn(item)
427 } 712 }
428 }) 713 })
429 714
@@ -432,42 +717,53 @@ Page({ @@ -432,42 +717,53 @@ Page({
432 if (res.data.code == 0) { 717 if (res.data.code == 0) {
433 var r_data = res.data.data; 718 var r_data = res.data.data;
434 if (!r_data.promGoodsLists) { 719 if (!r_data.promGoodsLists) {
435 - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;  
436 - getApp().request.delete(url, {});  
437 - //商品已经无活动  
438 - isok = 0; 720 + // var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
  721 + // getApp().request.delete(url, {});
  722 + // th.disInvalid(item);
  723 + // //商品已经无活动
  724 + // isok = 0;
  725 + item.prom_type = 0
  726 + //购物车更新
  727 + th.cartUpFn(item)
439 } else { 728 } else {
440 //如果活动的ID不一样,说明原先的活动已经没有参与了或者过期了 729 //如果活动的ID不一样,说明原先的活动已经没有参与了或者过期了
441 if (item.prom_id != r_data.promGoodsLists[0].prom_id) { 730 if (item.prom_id != r_data.promGoodsLists[0].prom_id) {
442 - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;  
443 - getApp().request.delete(url, {});  
444 - //商品已经下架  
445 - isok = 0; 731 + // var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
  732 + // getApp().request.delete(url, {});
  733 + // th.disInvalid(item);
  734 + // //商品已经下架
  735 + // isok = 0;
  736 + item.prom_type = 0
  737 + //购物车更新
  738 + th.cartUpFn(item)
446 } 739 }
447 } 740 }
448 741
449 } else { 742 } else {
450 - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;  
451 - getApp().request.delete(url, {});  
452 - //商品已经下架  
453 - isok = 0; 743 + // var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
  744 + // getApp().request.delete(url, {});
  745 + // th.disInvalid(item,1);
  746 + // //商品已经下架
  747 + // isok = 0;
  748 + item.prom_type = 0
  749 + //购物车更新
  750 + th.cartUpFn(item)
454 } 751 }
455 }) 752 })
456 -  
457 } 753 }
458 -  
459 - if (!isok) continue; 754 + // if (!isok) continue;
460 } 755 }
461 else if (item.prom_type == 7) { 756 else if (item.prom_type == 7) {
  757 + console.log('组合购------------');
462 if(!th.data.zuhe_map[item.prom_id]){ 758 if(!th.data.zuhe_map[item.prom_id]){
463 - 759 + console.log('组1')
464 //如果有组合购 760 //如果有组合购
465 var isok = 1; 761 var isok = 1;
466 var is_flag = 1; 762 var is_flag = 1;
467 var act = null; 763 var act = null;
468 var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + item.prom_id + "/" + getApp().globalData.user_id; 764 var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + item.prom_id + "/" + getApp().globalData.user_id;
469 await getApp().request.promiseGet(url, {}).then(res => { 765 await getApp().request.promiseGet(url, {}).then(res => {
470 - console.log(res, 1000); 766 + console.log(res);
471 if (res.data.code == 0 && res.data.data) { 767 if (res.data.code == 0 && res.data.data) {
472 if (res.data.data.is_show != 1) { 768 if (res.data.data.is_show != 1) {
473 isok = 0; 769 isok = 0;
@@ -492,52 +788,65 @@ Page({ @@ -492,52 +788,65 @@ Page({
492 } 788 }
493 }) 789 })
494 if (!isok) { 790 if (!isok) {
495 - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;  
496 - getApp().request.delete(url, {});  
497 - th.data.zuhe_map[item.prom_id] = -1;  
498 - continue; 791 + // var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
  792 + // getApp().request.delete(url, {});
  793 + //组合购失效不处理
  794 + // th.disInvalid(item);
  795 + // th.data.zuhe_map[item.prom_id] = -1;
  796 + // continue;
  797 + item.prom_type = 0
  798 + //购物车更新
  799 + th.cartUpFn(item)
  800 + }else{
  801 + th.data.zuhe_map[item.prom_id] = act;
  802 + var url1 = "/api/weshop/prom/zhbuyGoods/page";
  803 + var req_data = {
  804 + page: 1,
  805 + pageSize: 2000,
  806 + store_id: os.stoid,
  807 + zh_id: item.prom_id,
  808 + }
  809 + await getApp().request.promiseGet(url1, {
  810 + data: req_data
  811 + }).then(res => {
  812 + console.log(res, 2000);
  813 + if (ut.ajax_ok(res)) {
  814 + var gdlist = res.data.data.pageData;
  815 + gdlist.forEach(i => {
  816 + if (item.goods_id == i.goods_id && !is_flag) {
  817 + item.prom_type = 0;
  818 + item.prom_type1 = 0;
  819 + item.prom_id = 0;
  820 + item.prom_id1 = 0
  821 + }
  822 + })
  823 + th.data.zuhe_map_good[item.prom_id] = gdlist;
  824 + }
  825 + })
499 } 826 }
500 - th.data.zuhe_map[item.prom_id] = act;  
501 - var url1 = "/api/weshop/prom/zhbuyGoods/page";  
502 - var req_data = {  
503 - page: 1,  
504 - pageSize: 2000,  
505 - store_id: os.stoid,  
506 - zh_id: item.prom_id,  
507 - }  
508 - await getApp().request.promiseGet(url1, {  
509 - data: req_data  
510 - }).then(res => {  
511 - console.log(res, 2000);  
512 - if (ut.ajax_ok(res)) {  
513 - var gdlist = res.data.data.pageData;  
514 - gdlist.forEach(i => {  
515 - if (item.goods_id == i.goods_id && !is_flag) {  
516 - item.prom_type = 0;  
517 - item.prom_type1 = 0;  
518 - item.prom_id = 0;  
519 - item.prom_id1 = 0  
520 - }  
521 - })  
522 - th.data.zuhe_map_good[item.prom_id] = gdlist;  
523 - }  
524 - })  
525 } 827 }
526 - 828 + console.log('组2')
527 if (th.data.zuhe_map[item.prom_id] && th.data.zuhe_map[item.prom_id] != -1) { 829 if (th.data.zuhe_map[item.prom_id] && th.data.zuhe_map[item.prom_id] != -1) {
  830 + console.log('组3')
528 var gdlist = th.data.zuhe_map_good[item.prom_id]; 831 var gdlist = th.data.zuhe_map_good[item.prom_id];
529 var t_item = gdlist.find(function (ele) { 832 var t_item = gdlist.find(function (ele) {
530 return ele.goods_id == item.goods_id 833 return ele.goods_id == item.goods_id
531 }) 834 })
532 if (!t_item) { 835 if (!t_item) {
533 - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;  
534 - getApp().request.delete(url, {});  
535 - th.data.zuhe_map[item.prom_id] = -1;  
536 - continue;  
537 - }  
538 - item.buyqty = t_item.buyqty;  
539 - item.zh_b_num = promgoodsbuynum;  
540 - item.act = th.data.zuhe_map[item.prom_id]; 836 + // var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
  837 + // getApp().request.delete(url, {});
  838 + //组合购不处理
  839 + // th.disInvalid(item,1);
  840 + // th.data.zuhe_map[item.prom_id] = -1;
  841 + // continue;
  842 + item.prom_type = 0
  843 + //购物车更新
  844 + th.cartUpFn(item)
  845 + }else{
  846 + item.buyqty = t_item.buyqty;
  847 + item.zh_b_num = promgoodsbuynum;
  848 + item.act = th.data.zuhe_map[item.prom_id];
  849 + }
541 } //else{ 850 } //else{
542 // var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id; 851 // var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
543 // getApp().request.delete(url, {}); 852 // getApp().request.delete(url, {});
@@ -578,8 +887,9 @@ Page({ @@ -578,8 +887,9 @@ Page({
578 } 887 }
579 }) 888 })
580 if (!isok){ 889 if (!isok){
581 - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;  
582 - getApp().request.delete(url, {}); 890 + // var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
  891 + // getApp().request.delete(url, {});
  892 + th.disInvalid(item,1);
583 th.data.ladder_map[item.prom_id]=-1; 893 th.data.ladder_map[item.prom_id]=-1;
584 continue; 894 continue;
585 } 895 }
@@ -814,10 +1124,23 @@ Page({ @@ -814,10 +1124,23 @@ Page({
814 } 1124 }
815 }); 1125 });
816 }, 1126 },
817 - 1127 + //商品购物车修改
  1128 + cartUpFn(item){
  1129 + let updata1 = {
  1130 + id: item.id,
  1131 + prom_type: 0,
  1132 + prom_id:item.prom_id,
  1133 + store_id: os.stoid,
  1134 + user_id: getApp().globalData.userInfo.user_id
  1135 + };
  1136 + getApp().request.put("/api/weshop/cart/update", {
  1137 + data: updata1,
  1138 + })
  1139 + },
818 //-----真的获取购物车-------- 1140 //-----真的获取购物车--------
819 get_ser_cart: function () { 1141 get_ser_cart: function () {
820 var th = this; 1142 var th = this;
  1143 + var user_id = getApp().globalData.user_id;
821 var rd = Math.random().toString(36).substr(2, 15); 1144 var rd = Math.random().toString(36).substr(2, 15);
822 getApp().request.get("/api/weshop/cartService/page", { 1145 getApp().request.get("/api/weshop/cartService/page", {
823 data: { 1146 data: {
@@ -841,23 +1164,101 @@ Page({ @@ -841,23 +1164,101 @@ Page({
841 good = res.data.data; 1164 good = res.data.data;
842 }) 1165 })
843 if (!good) { 1166 if (!good) {
844 - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;  
845 - getApp().request.delete(url, {  
846 - success: function (t) {}  
847 - }); 1167 + // var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
  1168 + // getApp().request.delete(url, {
  1169 + // success: function (t) {}
  1170 + // });
  1171 + th.disInvalid({
  1172 + ...item,
  1173 + original_img: good.imgUrl
  1174 + },1,1);
848 continue; 1175 continue;
849 } 1176 }
850 - 1177 +
851 //如果商品下架了,或者商品是赠品,一开始都要清除 1178 //如果商品下架了,或者商品是赠品,一开始都要清除
852 if (good.is_show == 0) { 1179 if (good.is_show == 0) {
853 - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;  
854 - getApp().request.delete(url, {  
855 - success: function (t) {}  
856 - }); 1180 + // var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
  1181 + // getApp().request.delete(url, {
  1182 + // success: function (t) {}
  1183 + // });
  1184 + th.disInvalid({
  1185 + ...item,
  1186 + original_img: good.imgUrl
  1187 + },1,1);
857 //商品已经下架 1188 //商品已经下架
858 continue; 1189 continue;
859 } 1190 }
860 1191
  1192 + if(item.prom_type ==0){
  1193 + var prom = null;
  1194 + var now = ut.gettimestamp();
  1195 + await getApp().request.promiseGet(`/api/weshop/activitylist/listGoodActInfo2`, {
  1196 + data:{
  1197 + store_id: oo.stoid,
  1198 + goods_id: item.service_id,
  1199 + user_id: user_id,
  1200 + goods_type: 1,
  1201 + }
  1202 + }).then(res => {
  1203 + console.log('服务卡活动信息')
  1204 + console.log(res)
  1205 + console.log('服务卡活动信息-------------')
  1206 + if (res.data.code == 0) {
  1207 + prom = res.data.data
  1208 + }
  1209 + })
  1210 + if(prom){
  1211 + th.disInvalid({
  1212 + ...item,
  1213 + original_img: good.imgUrl
  1214 + },2,1)
  1215 + continue;
  1216 + }
  1217 + }
  1218 +
  1219 + if (item.prom_type == 1) {
  1220 + var prom = null;
  1221 + var now = ut.gettimestamp();
  1222 + await getApp().request.promiseGet('/api/ms/flash_sale/getNew/' + os.stoid + '/' + user_id + '/' + item.prom_id, {}).then(res => {
  1223 + if (res.data.code == 0) {
  1224 + prom = res.data.data;
  1225 + prom.price = prom.user_price;
  1226 + }
  1227 + });
  1228 + console.log('服务的秒杀信息')
  1229 + console.log(prom)
  1230 + //---如果互动都已经过期,或者还未开始,或者无活动
  1231 + if (!prom || prom.is_end == 1 || prom.end_time < now || prom.start_time > now) {
  1232 + th.disInvalid({
  1233 + ...item,
  1234 + original_img: good.imgUrl
  1235 + },0,1);
  1236 + continue;
  1237 + }
  1238 + //判断秒杀的限购
  1239 + var msNum=0
  1240 + await getApp().request.promiseGet("/api/weshop/rechargeServicelist/getUserBuyGoodsNum", {
  1241 + data: {
  1242 + store_id: os.stoid,
  1243 + user_id: user_id,
  1244 + card_id: prom.goods_id,
  1245 + }
  1246 + }).then(res=>{
  1247 + if (res.data.code==0) {
  1248 + msNum = res.data.data.cardbuynum
  1249 + console.log('秒杀限购:'+msNum)
  1250 + }
  1251 + })
  1252 + }
  1253 + if (msNum && (msNum >= prom.buy_limit) ) {
  1254 + console.log('秒杀限购')
  1255 + th.disInvalid({
  1256 + ...item,
  1257 + original_img: good.imgUrl
  1258 + },2,1)
  1259 + continue;
  1260 + }
  1261 +
861 all_num += item.goods_num; 1262 all_num += item.goods_num;
862 item.img_url = oo.imghost + good.imgUrl; 1263 item.img_url = oo.imghost + good.imgUrl;
863 item.selected = 0; 1264 item.selected = 0;
@@ -912,6 +1313,7 @@ Page({ @@ -912,6 +1313,7 @@ Page({
912 }, 1313 },
913 1314
914 1315
  1316 +
915 //设置莫个门店的所有线下价格 1317 //设置莫个门店的所有线下价格
916 async set_offline(list) { 1318 async set_offline(list) {
917 var th = this; 1319 var th = this;
@@ -1625,6 +2027,11 @@ Page({ @@ -1625,6 +2027,11 @@ Page({
1625 } else { 2027 } else {
1626 if(item[c].prom_type==7){ 2028 if(item[c].prom_type==7){
1627 //先把商品放入组合计算的专用的区域 2029 //先把商品放入组合计算的专用的区域
  2030 + console.log('是组合商品---')
  2031 + console.log(car);
  2032 + console.log(a)
  2033 + console.log(obj)
  2034 + console.log('......................')
1628 zh_calc.add_zhprom(car,a,obj); 2035 zh_calc.add_zhprom(car,a,obj);
1629 }else if(item[c].prom_type==10){ 2036 }else if(item[c].prom_type==10){
1630 ladder_calc.add_ladder_prom(car,a,obj); 2037 ladder_calc.add_ladder_prom(car,a,obj);
@@ -1644,6 +2051,8 @@ Page({ @@ -1644,6 +2051,8 @@ Page({
1644 2051
1645 //总的价格,把组合商品的价格拿出来 2052 //总的价格,把组合商品的价格拿出来
1646 var zh_calc_res=zh_calc.calculate_zh(car,a,th); 2053 var zh_calc_res=zh_calc.calculate_zh(car,a,th);
  2054 + console.log('.组合价-----------')
  2055 + console.log(zh_calc_res)
1647 //总的价格,把阶梯促销商品的价格拿出来 2056 //总的价格,把阶梯促销商品的价格拿出来
1648 var ladder_calc_res=ladder_calc.calculate_ladder(car,a,th); 2057 var ladder_calc_res=ladder_calc.calculate_ladder(car,a,th);
1649 2058
@@ -1725,7 +2134,7 @@ Page({ @@ -1725,7 +2134,7 @@ Page({
1725 2134
1726 function normal_check(store_count, goodsinfo, wareIds) { 2135 function normal_check(store_count, goodsinfo, wareIds) {
1727 //--- 看一下是不是线下库存 --- 2136 //--- 看一下是不是线下库存 ---
1728 - if (th.data.sales_rules == 2 && goodsinfo.prom_type != 7 && !goodsinfo.whsle_id) { 2137 + if (th.data.sales_rules == 2 && !goodsinfo.whsle_id) {
1729 th.check_down_line(t, pitem, item, wareIds); 2138 th.check_down_line(t, pitem, item, wareIds);
1730 } else { 2139 } else {
1731 if (t.goods_num > store_count) { 2140 if (t.goods_num > store_count) {
@@ -2536,6 +2945,23 @@ Page({ @@ -2536,6 +2945,23 @@ Page({
2536 } 2945 }
2537 } 2946 }
2538 } 2947 }
  2948 +
  2949 + //排除失效商品结算
  2950 + this.data.invalidList.map(item=>{
  2951 + if(item.selected && item.classType==0){
  2952 + rq.put('/api/weshop/cart/update', {
  2953 + data: {
  2954 + id: item.id,
  2955 + selected: 0,
  2956 + store_id: oo.stoid
  2957 + },
  2958 + success: function (ee) {
  2959 + console.log(ee);
  2960 + }
  2961 + });
  2962 + }
  2963 + })
  2964 +
2539 if (ab == 0) { 2965 if (ab == 0) {
2540 t.my_warnning("未选择商品", 0, th); 2966 t.my_warnning("未选择商品", 0, th);
2541 wx.hideLoading(); 2967 wx.hideLoading();
@@ -2715,6 +3141,18 @@ Page({ @@ -2715,6 +3141,18 @@ Page({
2715 }); 3141 });
2716 } 3142 }
2717 } 3143 }
  3144 + //排除失效服务结算
  3145 + this.data.invalidList.map(item=>{
  3146 + if(item.selected && item.classType==1){
  3147 + rq.promisePut('/api/weshop/cartService/update', {
  3148 + data: {
  3149 + id: item.id,
  3150 + selected: 0,
  3151 + store_id: oo.stoid
  3152 + }
  3153 + });
  3154 + }
  3155 + })
2718 wx.hideLoading(); 3156 wx.hideLoading();
2719 getApp().goto("/packageA/pages/cart2_ser/cart2_ser?is_cart=1"); 3157 getApp().goto("/packageA/pages/cart2_ser/cart2_ser?is_cart=1");
2720 } 3158 }
@@ -2818,6 +3256,21 @@ Page({ @@ -2818,6 +3256,21 @@ Page({
2818 }); 3256 });
2819 } 3257 }
2820 3258
  3259 + setTimeout(()=>{
  3260 + if ((!th.data.requestData|| th.data.requestData.length==0) && (!th.data.service_data|| th.data.service_data.length==0)){
  3261 +
  3262 + console.log('---1111---bb');
  3263 + var goods_list = th.selectComponent("#goods_list"); //组件的id
  3264 + if (goods_list) {
  3265 + goods_list.init();
  3266 + goods_list.get_list();
  3267 + }
  3268 +
  3269 + }
  3270 +
  3271 + },1200)
  3272 +
  3273 +
2821 }, 3274 },
2822 //跳到首页 3275 //跳到首页
2823 goto: function (e) { 3276 goto: function (e) {
@@ -2923,8 +3376,9 @@ Page({ @@ -2923,8 +3376,9 @@ Page({
2923 var item = list.goods[ii]; 3376 var item = list.goods[ii];
2924 list.goods.splice(ii, 1); 3377 list.goods.splice(ii, 1);
2925 if (item.prom_id == p_item[0] && item.prom_type == 3) { 3378 if (item.prom_id == p_item[0] && item.prom_type == 3) {
2926 - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;  
2927 - getApp().request.delete(url, {}); 3379 + // var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
  3380 + // getApp().request.delete(url, {});
  3381 + th.disInvalid(item);
2928 } 3382 }
2929 } 3383 }
2930 continue; 3384 continue;
@@ -3227,8 +3681,9 @@ Page({ @@ -3227,8 +3681,9 @@ Page({
3227 var item = list.goods[ii]; 3681 var item = list.goods[ii];
3228 list.goods.splice(ii, 1); 3682 list.goods.splice(ii, 1);
3229 if (item.prom_id == p_item[0] && item.prom_type == 3) { 3683 if (item.prom_id == p_item[0] && item.prom_type == 3) {
3230 - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;  
3231 - getApp().request.delete(url, {}); 3684 + // var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
  3685 + // getApp().request.delete(url, {});
  3686 + th.disInvalid(item);
3232 } 3687 }
3233 } 3688 }
3234 continue; 3689 continue;
pages/cart/cart/cart.wxml
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 </block> 23 </block>
24 24
25 25
26 -<view class="container" wx:if="{{(requestData && requestData.length>0) || (service_data && service_data.length>0) }}"> 26 +<view class="container {{(requestData && requestData.length>0) || (service_data && service_data.length>0)?'margin_b':''}} " wx:if="{{(requestData && requestData.length>0) || (service_data && service_data.length>0) || invalidList && invalidList.length }}">
27 <!-- 购物车商品框架 --> 27 <!-- 购物车商品框架 -->
28 <view class="login-in"> 28 <view class="login-in">
29 <!-- 编辑 --> 29 <!-- 编辑 -->
@@ -238,11 +238,45 @@ @@ -238,11 +238,45 @@
238 238
239 239
240 </block> 240 </block>
241 - </block>  
242 - 241 + </block>
  242 + <!-- 失效商品 -->
  243 + <block wx:if="{{invalidList && invalidList.length > 0}}">
  244 + <view class="store" style="border-top: 20rpx solid rgb(245, 245, 245);">
  245 + <view class="shmd_m flex-equality">
  246 + <view class="shmd fs30" >失效宝贝{{invalidList.length}}件</view>
  247 + <view class="flex fs26 ctb">
  248 + <view bindtap="collectGoods">移到收藏夹</view>
  249 + <view class="mgl20" bindtap="delInva">清空失效宝贝</view>
  250 + </view>
  251 + </view>
  252 + <view class="order-item" style="border: none;" data-item="{{idx}}" wx:for="{{invalidList}}" wx:for-item="items" wx:for-index="idx" wx:key="{{index}}">
  253 + <block >
  254 + <view bindtap="inCheck_th_item" class="order-raido flex-vertical " data-check="{{items.selected}}" data-item="{{idx}}" data-pitems="{{pidx}}">
  255 + <icon wx:if="{{items.selected}}" color="red" size="20" type="success"></icon>
  256 + <text wx:else class="icon_no_sele"></text>
  257 + </view>
  258 + </block>
  259 + <view class="goods-img rel" data-gd="{{items.goods_id}}">
  260 + <image class="wh100" src="{{imgUrl + items.original_img}}" binderror="bind_bnerr2" data-errorimg="requestData[{{pidx}}].goods[{{idx}}].original_img" data-url="{{items.original_img}}"></image>
  261 + </view>
  262 + <view class="goods-cont">
  263 + <view class="goods-name">
  264 + <view class="ellipsis-2 fs30" data-gd="{{items.goods_id}}" style="color: #a5a5a5;">{{items.goods_name || items.service_name}}</view>
  265 + </view>
  266 + <block>
  267 + <view class="flex alend jc_sb">
  268 + <view class="goods-price baseline ellipsis-1">
  269 + <view class="fs28">{{items.invalid}}</view>
  270 + </view>
  271 + </view>
  272 + </block>
  273 + </view>
  274 + </view>
  275 + </view>
  276 + </block>
243 277
244 </view> 278 </view>
245 - <view class="pay-for flex-vertical-between"> 279 + <view class="pay-for flex-vertical-between" wx:if="{{(requestData && requestData.length>0) || (service_data && service_data.length>0)}}" >
246 <view class="allradio flex-vertical-between"> 280 <view class="allradio flex-vertical-between">
247 <view class="flex-vertical mlr" bindtap="checkAll"> 281 <view class="flex-vertical mlr" bindtap="checkAll">
248 <!--<radio class="order-raido" color="red" checked="{{checkAllToggle}}"></radio>--> 282 <!--<radio class="order-raido" color="red" checked="{{checkAllToggle}}"></radio>-->
@@ -272,7 +306,7 @@ @@ -272,7 +306,7 @@
272 </view> 306 </view>
273 307
274 <!-- 购物车为空 --> 308 <!-- 购物车为空 -->
275 -<view class="empty_order" wx:if="{{(!requestData|| requestData.length==0) && (!service_data|| service_data.length==0) && is_load}}"> 309 +<view class="empty_order" wx:if="{{(!requestData|| requestData.length==0) && (!service_data|| service_data.length==0) && (!invalidList || invalidList.length==0) && is_load}}">
276 <view class="flex-level"> 310 <view class="flex-level">
277 <image src="{{iurl}}miniapp/images/stores/nocart.png"></image> 311 <image src="{{iurl}}miniapp/images/stores/nocart.png"></image>
278 </view> 312 </view>
pages/cart/cart/cart.wxss
@@ -30,6 +30,9 @@ page { @@ -30,6 +30,9 @@ page {
30 align-items: center; 30 align-items: center;
31 justify-content: center; 31 justify-content: center;
32 background-color: rgb(255, 255, 255); 32 background-color: rgb(255, 255, 255);
  33 + /*margin-bottom: 160rpx;*/
  34 +}
  35 +.container.margin_b{
33 margin-bottom: 160rpx; 36 margin-bottom: 160rpx;
34 } 37 }
35 38
@@ -222,7 +225,7 @@ radio { @@ -222,7 +225,7 @@ radio {
222 } 225 }
223 226
224 .store { 227 .store {
225 - border-bottom: 7rpx solid rgb(245, 245, 245); 228 + /* border-bottom: 7rpx solid rgb(245, 245, 245); */
226 } 229 }
227 .login-in { 230 .login-in {
228 position: relative; 231 position: relative;
pages/giftpack/giftpacklist/giftpacklist.js
@@ -1126,8 +1126,14 @@ Page({ @@ -1126,8 +1126,14 @@ Page({
1126 tt(); 1126 tt();
1127 }, 1127 },
1128 fail: function (res) { 1128 fail: function (res) {
1129 - ee.data.share_goods_img = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的  
1130 - tt(); 1129 + //获取默认空白图
  1130 + wx.getImageInfo({
  1131 + src: ee.data.iurl+'/miniapp/images/default_g_img.gif',
  1132 + success: function(res) {
  1133 + ee.data.share_goods_img = res.path; //分享的图片不能用网络的
  1134 + tt();
  1135 + }
  1136 + })
1131 } 1137 }
1132 }); 1138 });
1133 }, 1139 },
pages/goods/categoryList/categoryList.js
@@ -5,21 +5,26 @@ var i = function (i) { @@ -5,21 +5,26 @@ var i = function (i) {
5 }; 5 };
6 }(require("../../../utils/LoadMore.js")), a = new i.default(), ut = require("../../../utils/util.js"); 6 }(require("../../../utils/LoadMore.js")), a = new i.default(), ut = require("../../../utils/util.js");
7 //t = i,e = t 7 //t = i,e = t
  8 +var nextTimeOff=null
8 Page({ 9 Page({
9 data: { 10 data: {
10 - is_date:true, 11 + is_date: true,
11 scrollHeight: 0, 12 scrollHeight: 0,
12 - currentTab:-1,  
13 - abc:0,  
14 - windowHeight:0, 13 + currentTab: -1,
  14 + abc: 0,
  15 + windowHeight: 0,
15 windowWidth: 0, 16 windowWidth: 0,
16 - eachLetterHeight:0,  
17 - lettersPosition:0,  
18 - catelist:null, //分类读取 17 + eachLetterHeight: 0,
  18 + lettersPosition: 0,
  19 + catelist: null, //分类读取
19 nationlist: null,//国家读取 20 nationlist: null,//国家读取
20 groups: null, //品牌读取 21 groups: null, //品牌读取
21 iurl: oo.imghost,//图片地址 22 iurl: oo.imghost,//图片地址
22 - 23 + nextShow:false, //是否跳转下个类型
  24 + nextShow2:false, //是否跳转下个类型
  25 + toupper:true,
  26 + sClientY:0, //滑动初始值
  27 + eClientY:0, //滑动终值
23 // 当前选择的导航字母 28 // 当前选择的导航字母
24 selected: 0, 29 selected: 0,
25 // 选择字母视图滚动的位置id 30 // 选择字母视图滚动的位置id
@@ -27,55 +32,55 @@ Page({ @@ -27,55 +32,55 @@ Page({
27 // 导航字母 32 // 导航字母
28 letters: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 33 letters: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
29 'U', 'V', 'W', 'X', 'Y', 'Z'], 34 'U', 'V', 'W', 'X', 'Y', 'Z'],
30 - //控制新旧分类版本  
31 - is_used_share:0, 35 + //控制新旧分类版本
  36 + is_used_share: 0,
32 //国家的控制属性 37 //国家的控制属性
33 - is_country:1, 38 + is_country: 1,
34 //品牌的控制属性 39 //品牌的控制属性
35 - is_brand:1, 40 + is_brand: 1,
36 //选择分类的控制属性 41 //选择分类的控制属性
37 - select_classify_on:223,  
38 - index:223,  
39 - classify_name:"国家",//项目类型  
40 - brand_list:null,//品牌列表  
41 -  
42 - one_level_classify:[],// 新的版本左边的边分类1级  
43 - is_level_three:0,//判断有没有3级  
44 - cat_id:0, 42 + select_classify_on: 223,
  43 + index: 223,
  44 + classify_name: "国家",//项目类型
  45 + brand_list: null,//品牌列表
  46 +
  47 + one_level_classify: [],// 新的版本左边的边分类1级
  48 + is_level_three: 0,//判断有没有3级
  49 + cat_id: 0,
45 pl_timer: null,//只有品类的定时器 50 pl_timer: null,//只有品类的定时器
46 - is_pl_time:0,  
47 - requestData:null, //风格三的商品数据列表 分页  
48 - stylePage:1, //商品列表分页标识 51 + is_pl_time: 0,
  52 + requestData: null, //风格三的商品数据列表 分页
  53 + stylePage: 1, //商品列表分页标识
49 54
50 //风格三使用 55 //风格三使用
51 url: t.globalData.setting.imghost, 56 url: t.globalData.setting.imghost,
52 currentPage: 1, 57 currentPage: 1,
53 allData: null, 58 allData: null,
54 openFilterModal: !1, 59 openFilterModal: !1,
55 - baseUrl: "api/weshop/goods/page?1=1&cat_id=1&parent_id=0&orderField=sort&orderType=asc&page=1&is_mainshow=1&isonsale=1&store_id="+oo.stoid+"&is_recommend=1", 60 + baseUrl: "api/weshop/goods/page?1=1&cat_id=1&parent_id=0&orderField=sort&orderType=asc&page=1&is_mainshow=1&isonsale=1&store_id=" + oo.stoid + "&is_recommend=1",
56 requestUrl: "", 61 requestUrl: "",
57 tabname: "goods_id", //排序的字段 62 tabname: "goods_id", //排序的字段
58 adname: "desc", //升降的字段 63 adname: "desc", //升降的字段
59 is_new: 0, 64 is_new: 0,
60 is_hot: 0, 65 is_hot: 0,
61 - msgStatus:false, //页面显示暂无数据状态 66 + msgStatus: false, //页面显示暂无数据状态
62 countDownNum: 3, 67 countDownNum: 3,
63 timer: null, //定时器 68 timer: null, //定时器
64 - lastMsg:false,  
65 - toView:"",  
66 - is_show_class:false,//是否添加新样式  
67 - status_show:0, 69 + lastMsg: false,
  70 + toView: "",
  71 + is_show_class: false,//是否添加新样式
  72 + status_show: 0,
68 currentTab: 0, //预设当前项的值 73 currentTab: 0, //预设当前项的值
69 -  
70 - load:0, 74 +
  75 + load: 0,
71 xmlist: null, 76 xmlist: null,
72 - 77 +
73 78
74 }, 79 },
75 80
76 81
77 //判断当前滚动超过一屏时,设置tab标题滚动条。 82 //判断当前滚动超过一屏时,设置tab标题滚动条。
78 - checkCor: function() { 83 + checkCor: function () {
79 let that = this; 84 let that = this;
80 //这里计算按照实际情况进行修改,动态数据要进行动态分析 85 //这里计算按照实际情况进行修改,动态数据要进行动态分析
81 //思路:窗体高度/单个分类高度 200rpx 转px计算 =>得到一屏幕所显示的个数,结合后台传回分类总数进行计算 86 //思路:窗体高度/单个分类高度 200rpx 转px计算 =>得到一屏幕所显示的个数,结合后台传回分类总数进行计算
@@ -92,413 +97,418 @@ Page({ @@ -92,413 +97,418 @@ Page({
92 }, 97 },
93 98
94 99
95 - onLoad: function(tt) {  
96 - var that = this;  
97 - var first_leader=tt.first_leader;  
98 - if(first_leader){  
99 - //-- user_id代过来免登录 --  
100 - getApp().globalData.first_leader=first_leader;  
101 - } 100 + onLoad: function (tt) {
  101 + // wx.createSelectorQuery().select('#sview').boundingClientRect(function(rect){
  102 + // console.log('显示下滑区域');
  103 + // console.log(rect);
  104 + // }).exec()
102 105
103 - if(tt.type) this.data.type= parseInt(tt.type);  
104 - that.get_brand();  
105 -  
106 - clearInterval(that.data.timer);  
107 - that.setData({ countDownNum: 3, stylePage: 1 }); 106 + var that = this;
  107 + var first_leader = tt.first_leader;
  108 + if (first_leader) {
  109 + //-- user_id代过来免登录 --
  110 + getApp().globalData.first_leader = first_leader;
  111 + }
108 112
109 - const res = wx.getSystemInfoSync(),  
110 - letters = this.data.letters;  
111 - this.setData({  
112 - abc: t.globalData.heigth-88-88-16,  
113 - windowHeight: res.windowHeight,  
114 - windowWidth: res.windowWidth,  
115 -  
116 - }); 113 + if (tt.type) this.data.type = parseInt(tt.type);
  114 + that.get_brand();
117 115
118 - var bli = res.windowWidth/750;  
119 - //--------第一个字母距离顶部高度,单位使用的是rpx,须除以bli------  
120 - //才能与touch事件中的数值相加减,css中定义nav高度为94%,所以 *0.94  
121 - const eachLetterHeight = 35.4*bli,  
122 - comTop = (88+88) * bli,  
123 - temp = []; 116 + clearInterval(that.data.timer);
  117 + that.setData({ countDownNum: 3, stylePage: 1 });
124 118
125 - this.setData({  
126 - eachLetterHeight: eachLetterHeight  
127 - });  
128 - //---------求各字母距离设备左上角所处位置---------  
129 - for (let i = 0, len = letters.length; i < len; i++) {  
130 - const x = (this.data.windowWidth - (30 + 50)) * bli,  
131 - y = comTop + (i * eachLetterHeight);  
132 - temp.push([x, y]); 119 + const res = wx.getSystemInfoSync(),
  120 + letters = this.data.letters;
  121 + this.setData({
  122 + abc: t.globalData.heigth - 88 - 88 - 16,
  123 + windowHeight: res.windowHeight,
  124 + windowWidth: res.windowWidth,
  125 +
  126 + });
  127 +
  128 + var bli = res.windowWidth / 750;
  129 + //--------第一个字母距离顶部高度,单位使用的是rpx,须除以bli------
  130 + //才能与touch事件中的数值相加减,css中定义nav高度为94%,所以 *0.94
  131 + const eachLetterHeight = 35.4 * bli,
  132 + comTop = (88 + 88) * bli,
  133 + temp = [];
  134 +
  135 + this.setData({
  136 + eachLetterHeight: eachLetterHeight
  137 + });
  138 + //---------求各字母距离设备左上角所处位置---------
  139 + for (let i = 0, len = letters.length; i < len; i++) {
  140 + const x = (this.data.windowWidth - (30 + 50)) * bli,
  141 + y = comTop + (i * eachLetterHeight);
  142 + temp.push([x, y]);
  143 + }
  144 + this.setData({
  145 + lettersPosition: temp
  146 + });
  147 +
  148 + if (this.data.is_used_share == 0) {
  149 + this.get_nation();
  150 + this.getServiceCategory();
  151 + }
  152 +
  153 + //风格三
  154 + //t = i,e = t
  155 + var th = this;
  156 + a.init(this, "", "requestData");
  157 + var url = this.data.baseUrl;
  158 + this.data.is_new = i.is_new;
  159 + this.data.is_hot = i.is_hot;
  160 + if (0 != this.data.cat_id) {
  161 + url += "&cat_id=" + this.data.cat_id;
  162 + }
  163 +
  164 + // this.requestGoodsList(url);
  165 + getApp().getConfig2(function (rs) {
  166 + //计算等级价相关
  167 + var swithc_list = rs.switch_list;
  168 + 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)
133 } 194 }
134 - this.setData({  
135 - lettersPosition: temp 195 + });
  196 + },
  197 + onShow: function () {
  198 + getApp().check_can_share();
  199 +
  200 + if (typeof this.getTabBar === 'function' && this.getTabBar()) {
  201 + var index = getApp().getPageIndex(this);
  202 + this.getTabBar().setData({
  203 + active: index //数字是当前页面在tabbar的索引
136 }); 204 });
137 -  
138 - if (this.data.is_used_share==0){  
139 - this.get_nation();  
140 - this.getServiceCategory(); 205 + getApp().requestCardNum(this);
  206 + }
  207 +
  208 +
  209 + var that = this;
  210 + //调用底部导航
  211 + //t.editTabBar(that,getApp().globalData.setting.stoid,getApp().globalData.url);
  212 + //this.requestFirstCategoris();
  213 + setTimeout(function () {
  214 + //if (getApp().globalData.user_id) getApp().requestCardNum(that);
  215 + }, 500)
  216 +
  217 + if (this.data.load) return false;
  218 +
  219 + getApp().getConfig2(function (e) {
  220 + console.log('card------------>>>>', e);
  221 + var data = e;
  222 + var switch_list_data = data.switch_list;
  223 + var switch_list = JSON.parse(switch_list_data);
  224 + var is_newsgoodstype = switch_list.is_newsgoodstype;
  225 + if (is_newsgoodstype == undefined) {
  226 + is_newsgoodstype = 0;
141 } 227 }
142 -  
143 - //风格三  
144 - //t = i,e = t  
145 - var th = this;  
146 - a.init(this, "", "requestData");  
147 - var url = this.data.baseUrl;  
148 - this.data.is_new = i.is_new;  
149 - this.data.is_hot = i.is_hot;  
150 - if (0 != this.data.cat_id) {  
151 - url += "&cat_id=" + this.data.cat_id; 228 + that.setData({ is_used_share: is_newsgoodstype });
  229 + if (e.categoryset.indexOf("," + 1 + ",") != -1) { that.setData({ is_show_pl: 1 }); }
  230 + if (e.categoryset.indexOf("," + 3 + ",") != -1) { that.setData({ is_show_pp: 1 }); }
  231 + if (e.categoryset.indexOf("," + 2 + ",") != -1) { that.setData({ is_show_gb: 1 }); }
  232 + if (e.categoryset.indexOf("," + 4 + ",") != -1) { that.setData({ is_show_xm: 1 }); }
  233 + that.setData({ store_config: e, is_do: 1 });
  234 +
  235 + //---有勾品类---
  236 + if (that.data.is_show_pl) {
  237 + that.requestFirstCategoris();
152 } 238 }
153 -  
154 - // this.requestGoodsList(url);  
155 - getApp().getConfig2(function (rs) {  
156 - //计算等级价相关  
157 - var swithc_list = rs.switch_list;  
158 - var sw_arr = JSON.parse(swithc_list);  
159 - //---如果后台又开等级卡的开关---  
160 - if (sw_arr.rank_switch && sw_arr.rank_switch == "2") {  
161 - th.setData({ rank_switch: true });  
162 - var user = getApp().globalData.userInfo;  
163 - var ti = setInterval(function () {  
164 - if (!user) return false;  
165 - clearInterval(ti);  
166 - //---回调卡的列表---  
167 - th.getPlusCardType(function (ob) {  
168 - th.setData({ card_list: ob.card_list });  
169 - if (user.card_field && user['card_expiredate']) {  
170 - var str = user['card_expiredate'].replace(/-/g, '/');  
171 - var end = new Date(str);  
172 - end = Date.parse(end) / 1000;  
173 - var now = ut.gettimestamp();  
174 -  
175 - //--- 判断是等级会员,且在有效期范围内 ---  
176 - if (user.card_field && now < end) {  
177 - var card_name = ob.name_map.get(user.card_field);  
178 - //if (card_name.length > 4) card_name = card_name.substring(0, 4);  
179 - th.setData({ card_field: user.card_field, card_name: card_name, card_list: ob.card_list });  
180 - } 239 + if (that.data.is_show_xm != 1 && that.data.is_show_gb != 1 && that.data.is_show_pp != 1 && that.data.is_show_pl) {
  240 + that.data.pl_timer = setInterval(function () {
  241 + if (that.data.one_level_classify.length > 0) {
  242 + var item = that.data.one_level_classify[0], arr = item.array;
  243 + //----如果有下级的时候-----
  244 + if (item.array && item.array.length > 0) {
  245 + var is_lev_thr = 0
  246 + for (var i = 0; i < arr.length; i++) {
  247 + if (arr[i].arrays.length > 0) { is_lev_thr = 1; break; }
181 } 248 }
182 - })  
183 - }, 500)  
184 - }  
185 - });  
186 - },  
187 - onShow:function(){  
188 - getApp().check_can_share();  
189 -  
190 - if (typeof this.getTabBar === 'function' && this.getTabBar()) {  
191 - var index=getApp().getPageIndex(this);  
192 - this.getTabBar().setData({  
193 - active: index //数字是当前页面在tabbar的索引  
194 - });  
195 - getApp().requestCardNum(this);  
196 - }  
197 -  
198 -  
199 - var that=this;  
200 - //调用底部导航  
201 - //t.editTabBar(that,getApp().globalData.setting.stoid,getApp().globalData.url);  
202 - //this.requestFirstCategoris();  
203 - setTimeout(function () {  
204 - //if (getApp().globalData.user_id) getApp().requestCardNum(that);  
205 - },500)  
206 -  
207 - if(this.data.load) return false;  
208 -  
209 - getApp().getConfig2(function (e) {  
210 - console.log('card------------>>>>', e);  
211 - var data=e;  
212 - var switch_list_data = data.switch_list;  
213 - var switch_list = JSON.parse(switch_list_data);  
214 - var is_newsgoodstype = switch_list.is_newsgoodstype;  
215 - if (is_newsgoodstype==undefined)  
216 - {  
217 - is_newsgoodstype=0;  
218 - }  
219 - that.setData({ is_used_share :is_newsgoodstype});  
220 - if (e.categoryset.indexOf("," + 1 + ",") != -1) { that.setData({ is_show_pl: 1 }); }  
221 - if (e.categoryset.indexOf("," + 3 + ",") != -1) { that.setData({ is_show_pp: 1 }); }  
222 - if (e.categoryset.indexOf("," + 2 + ",") != -1) { that.setData({ is_show_gb: 1 }); }  
223 - if (e.categoryset.indexOf("," + 4 + ",") != -1) { that.setData({ is_show_xm: 1 }); }  
224 - that.setData({ store_config: e,is_do:1 });  
225 -  
226 - //---有勾品类---  
227 - if (that.data.is_show_pl){  
228 - that.requestFirstCategoris();  
229 - }  
230 - if (that.data.is_show_xm != 1 && that.data.is_show_gb != 1 && that.data.is_show_pp != 1 && that.data.is_show_pl){  
231 - that.data.pl_timer = setInterval(function () {  
232 - if (that.data.one_level_classify.length>0){  
233 - var item=that.data.one_level_classify[0],arr=item.array;  
234 - //----如果有下级的时候-----  
235 - if(item.array && item.array.length>0){  
236 - var is_lev_thr=0  
237 - for(var i=0;i<arr.length;i++){  
238 - if (arr[i].arrays.length>0) {is_lev_thr=1;break; }  
239 - }  
240 - that.setData({ is_level_three: is_lev_thr });  
241 - if (is_lev_thr!=1) {  
242 - that.setData({ select_classify_on: 0, index: 0, classify_name: item.items.name,cat_id: item.items.id,goodslist: item.array });  
243 - console.log("id:="+item.items.id)  
244 - that.style(that.data.stylePage,that.data.cat_id);  
245 - } else {  
246 - that.setData({ select_classify_on: 0, index: 0, classify_name: item.items.name,cat_id: item.items.id,goodslist: arr });  
247 - console.log("id:="+item.items.id)  
248 - that.style(that.data.stylePage,that.data.cat_id);  
249 - }  
250 - }  
251 - else{  
252 - that.setData({ select_classify_on: 0, index: 0, goodslist: null,classify_name:item.items.name,is_level_three: 0});  
253 - }  
254 - clearInterval(that.data.pl_timer);  
255 - }  
256 - },1000);  
257 -  
258 - } else if (that.data.is_show_gb != 1 && that.data.is_show_pp ){  
259 - that.setData({ select_classify_on: 220, classify_name: "品牌" });  
260 - }  
261 -  
262 -  
263 - var one_level_classify = that.data.one_level_classify;  
264 -  
265 - if (that.data.is_show_pl) that.setData({ currentTab: 0 });  
266 - else if (that.data.is_show_gb){ that.setData({ currentTab: 1 });that.get_nation(); }  
267 - else if (that.data.is_show_pp) {that.setData({ currentTab: 2 });that.get_brand(); }  
268 - else if (that.data.is_show_xm) {that.setData({ currentTab: 3 });that.getServiceCategory(); }  
269 -  
270 -  
271 - var t_type=that.data.type;  
272 - //----求传参过来的控制-----  
273 - if (t_type == 1 && that.data.is_show_gb ) {  
274 - that.setData({ currentTab: 1,select_classify_on:223 });  
275 - that.get_nation();  
276 - } else if (t_type == 2 && that.data.is_show_pp ) {  
277 - that.setData({ currentTab: 2,select_classify_on:220});  
278 - that.get_brand();  
279 - } else if (t_type == 3 && that.data.is_show_xm ) {  
280 - that.setData({ currentTab: 3,select_classify_on:221 });  
281 - that.getServiceCategory();  
282 - } else if (that.data.is_show_pl) {  
283 - that.setData({ currentTab: 0,select_classify_on:0 });  
284 - }  
285 - // 获取默认选中的第一个  
286 - if(that.data.is_show_gb && that.data.select_classify_on == 223){  
287 - that.setData({ status_show: 1 });  
288 - }else if(that.data.is_show_pp && that.data.select_classify_on == 220){  
289 - that.setData({ status_show: 2 });  
290 - }  
291 -  
292 - that.data.load=1;  
293 - })  
294 -  
295 - },  
296 -  
297 - //---------------分类请求接口,数据进行拼装------------------  
298 - requestFirstCategoris: function() {  
299 - var t = this;  
300 - e.get("/api/weshop/goodscategory/page", {  
301 - data: { store_id: oo.stoid,pageSize:6600,is_show:1},  
302 - success: function(e) {  
303 - var arr=new Array();  
304 - var dda = e.data.data.pageData;  
305 - if (dda != null && dda !=""&&dda!=undefined){  
306 - t.setData({is_pl_time:1}); 249 + that.setData({ is_level_three: is_lev_thr });
  250 + if (is_lev_thr != 1) {
  251 + that.setData({ select_classify_on: 0, index: 0, classify_name: item.items.name, cat_id: item.items.id, goodslist: item.array });
  252 + console.log("id:=" + item.items.id)
  253 + that.style(that.data.stylePage, that.data.cat_id);
  254 + } else {
  255 + that.setData({ select_classify_on: 0, index: 0, classify_name: item.items.name, cat_id: item.items.id, goodslist: arr });
  256 + console.log("id:=" + item.items.id)
  257 + that.style(that.data.stylePage, that.data.cat_id);
307 } 258 }
308 -  
309 - if (t.data.is_used_share == 0) {//is_used_share控制新旧版本  
310 - for(var i=0;i<dda.length;i++){  
311 - if (parseInt(dda[i].level)==1){  
312 - var item = {items: dda[i], array: new Array()}  
313 - arr.push(item);  
314 - } else if (parseInt(dda[i].level) == 2){  
315 - for (var j = 0; j < arr.length;j++ ){  
316 - if (parseInt(dda[i].parent_id) == parseInt(arr[j].items.id)){  
317 - arr[j].array.push(dda[i]); break;  
318 - }  
319 - }  
320 - }else{  
321 - continue;  
322 - }  
323 - }  
324 - t.setData({ catelist: arr});  
325 - } else if (t.data.is_used_share == 1 || t.data.is_used_share == 2){  
326 -  
327 - //---------新的版本----------------  
328 - for (var i = 0; i < dda.length; i++) {  
329 - //--要排队的元素---  
330 - var need_to_insert=dda[i];  
331 - if (parseInt(need_to_insert.level) == 1) {  
332 - var item = { items: need_to_insert, array: new Array() }//判断数组的长度看看有没有2级菜单  
333 - arr.push(item);  
334 - } else if (parseInt(need_to_insert.level) == 2) {  
335 -  
336 - for (var j = 0; j < arr.length; j++) {  
337 -  
338 -  
339 - if (parseInt(need_to_insert.parent_id) == parseInt(arr[j].items.id)) {  
340 -  
341 - var ishaf_two = { items: need_to_insert, arrays: new Array() };  
342 - arr[j].array.push(ishaf_two); arr.ishaf_two = 0;  
343 - }  
344 - }  
345 - } else if (parseInt(need_to_insert.level) == 3) {//判断有3级的时候在二级里添加一个数组  
346 -  
347 - for (var dd = 0; dd < arr.length; dd++) {  
348 - for (var pp = 0; pp < arr[dd].array.length; pp++) {  
349 - //--判断二级--  
350 - var two_item = arr[dd].array;  
351 -  
352 - if (two_item && two_item.length>0){  
353 -  
354 - if (parseInt(need_to_insert.parent_id) == parseInt(two_item[pp].items.id)) {  
355 -  
356 - arr[dd].array[pp].arrays.push(need_to_insert); arr.ishaf_three = 0; break;  
357 - }  
358 - }  
359 - }  
360 - } 259 + }
  260 + else {
  261 + that.setData({ select_classify_on: 0, index: 0, goodslist: null, classify_name: item.items.name, is_level_three: 0 });
  262 + }
  263 + clearInterval(that.data.pl_timer);
  264 + }
  265 + }, 1000);
  266 +
  267 + } else if (that.data.is_show_gb != 1 && that.data.is_show_pp) {
  268 + that.setData({ select_classify_on: 220, classify_name: "品牌" });
  269 + }
  270 +
  271 +
  272 + var one_level_classify = that.data.one_level_classify;
  273 +
  274 + if (that.data.is_show_pl) that.setData({ currentTab: 0 });
  275 + else if (that.data.is_show_gb) { that.setData({ currentTab: 1 }); that.get_nation(); }
  276 + else if (that.data.is_show_pp) { that.setData({ currentTab: 2 }); that.get_brand(); }
  277 + else if (that.data.is_show_xm) { that.setData({ currentTab: 3 }); that.getServiceCategory(); }
  278 +
  279 +
  280 + var t_type = that.data.type;
  281 + //----求传参过来的控制-----
  282 + if (t_type == 1 && that.data.is_show_gb) {
  283 + that.setData({ currentTab: 1, select_classify_on: 223 });
  284 + that.get_nation();
  285 + } else if (t_type == 2 && that.data.is_show_pp) {
  286 + that.setData({ currentTab: 2, select_classify_on: 220 });
  287 + that.get_brand();
  288 + } else if (t_type == 3 && that.data.is_show_xm) {
  289 + that.setData({ currentTab: 3, select_classify_on: 221 });
  290 + that.getServiceCategory();
  291 + } else if (that.data.is_show_pl) {
  292 + that.setData({ currentTab: 0, select_classify_on: 0 });
  293 + }
  294 + // 获取默认选中的第一个
  295 + if (that.data.is_show_gb && that.data.select_classify_on == 223) {
  296 + that.setData({ status_show: 1 });
  297 + } else if (that.data.is_show_pp && that.data.select_classify_on == 220) {
  298 + that.setData({ status_show: 2 });
  299 + }
  300 +
  301 + that.data.load = 1;
  302 + })
  303 +
  304 + },
  305 +
  306 + //---------------分类请求接口,数据进行拼装------------------
  307 + requestFirstCategoris: function () {
  308 + var t = this;
  309 + e.get("/api/weshop/goodscategory/page", {
  310 + data: { store_id: oo.stoid, pageSize: 6600, is_show: 1 },
  311 + success: function (e) {
  312 + var arr = new Array();
  313 + var dda = e.data.data.pageData;
  314 + if (dda != null && dda != "" && dda != undefined) {
  315 + t.setData({ is_pl_time: 1 });
  316 + }
  317 +
  318 + if (t.data.is_used_share == 0) {//is_used_share控制新旧版本
  319 + for (var i = 0; i < dda.length; i++) {
  320 + if (parseInt(dda[i].level) == 1) {
  321 + var item = { items: dda[i], array: new Array() }
  322 + arr.push(item);
  323 + } else if (parseInt(dda[i].level) == 2) {
  324 + for (var j = 0; j < arr.length; j++) {
  325 + if (parseInt(dda[i].parent_id) == parseInt(arr[j].items.id)) {
  326 + arr[j].array.push(dda[i]); break;
361 } 327 }
362 } 328 }
363 - for(var i=0;i<arr.length;i++){  
364 - arr[i]['items']['is_show_class'] = false;  
365 - var mobile_name = arr[i]['items']['name']  
366 - //if(mobile_name.length > 4){  
367 - //arr[i]['items']['name'] = mobile_name.substring(0, 4)  
368 - //}  
369 - }  
370 - if(t.data.is_show_pl==1 && t.data.is_show_pp != 1 && t.data.is_show_gb != 1){  
371 - arr[0]['items']['is_show_class'] = true;  
372 - }  
373 - //console.log(arr)  
374 - t.setData({one_level_classify:arr});  
375 - if(t.data.select_classify_on==0){  
376 - var item=arr[0]; 329 + } else {
  330 + continue;
  331 + }
  332 + }
  333 + t.setData({ catelist: arr });
  334 + } else if (t.data.is_used_share == 1 || t.data.is_used_share == 2) {
377 335
378 - var name = item.items.name;  
379 - var cid = item.items.id;  
380 - var arr = item.array; 336 + //---------新的版本----------------
  337 + for (var i = 0; i < dda.length; i++) {
  338 + //--要排队的元素---
  339 + var need_to_insert = dda[i];
  340 + if (parseInt(need_to_insert.level) == 1) {
  341 + var item = { items: need_to_insert, array: new Array() }//判断数组的长度看看有没有2级菜单
  342 + arr.push(item);
  343 + } else if (parseInt(need_to_insert.level) == 2) {
381 344
382 - console.log("11111",item); 345 + for (var j = 0; j < arr.length; j++) {
383 346
384 347
385 - if (arr.length == 0) {  
386 - t.setData({  
387 - select_classify_on: 0, index: 0, classify_name: name, cat_id: cid,  
388 - goodslist: null, is_level_three: 0  
389 - }); 348 + if (parseInt(need_to_insert.parent_id) == parseInt(arr[j].items.id)) {
390 349
391 - if(t.data.is_used_share == 2)  
392 - t.style(t.data.stylePage, cid) 350 + var ishaf_two = { items: need_to_insert, arrays: new Array() };
  351 + arr[j].array.push(ishaf_two); arr.ishaf_two = 0;
  352 + }
  353 + }
  354 + } else if (parseInt(need_to_insert.level) == 3) {//判断有3级的时候在二级里添加一个数组
393 355
394 - return false;  
395 - }  
396 - if (arr.length != 0) {  
397 - var is_lev_thr = 0  
398 - for (var i = 0; i < arr.length; i++) {  
399 - if (arr[i].arrays.length > 0) { is_lev_thr = 1; break; }  
400 - }  
401 - t.setData({ is_level_three: is_lev_thr });  
402 -  
403 - if (this.data.is_level_three != 1) {  
404 - t.setData({ index: 0, classify_name: name, goodslist: arr });  
405 - } else {  
406 - t.setData({ index: 0, goodslist: arr });  
407 - }  
408 - } 356 + for (var dd = 0; dd < arr.length; dd++) {
  357 + for (var pp = 0; pp < arr[dd].array.length; pp++) {
  358 + //--判断二级--
  359 + var two_item = arr[dd].array;
409 360
410 - t.style(t.data.stylePage, cid) 361 + if (two_item && two_item.length > 0) {
411 362
  363 + if (parseInt(need_to_insert.parent_id) == parseInt(two_item[pp].items.id)) {
  364 +
  365 + arr[dd].array[pp].arrays.push(need_to_insert); arr.ishaf_three = 0; break;
  366 + }
  367 + }
412 } 368 }
  369 + }
  370 + }
  371 + }
  372 + for (var i = 0; i < arr.length; i++) {
  373 + arr[i]['items']['is_show_class'] = false;
  374 + var mobile_name = arr[i]['items']['name']
  375 + //if(mobile_name.length > 4){
  376 + //arr[i]['items']['name'] = mobile_name.substring(0, 4)
  377 + //}
  378 + }
  379 + if (t.data.is_show_pl == 1 && t.data.is_show_pp != 1 && t.data.is_show_gb != 1) {
  380 + arr[0]['items']['is_show_class'] = true;
  381 + }
  382 + //console.log(arr)
  383 + t.setData({ one_level_classify: arr });
  384 + if (t.data.select_classify_on == 0) {
  385 + var item = arr[0];
  386 +
  387 + var name = item.items.name;
  388 + var cid = item.items.id;
  389 + var arr = item.array;
413 390
414 - } 391 + console.log("11111", item);
  392 + console.log(arr.length);
  393 +
  394 + if (arr.length == 0) {
  395 + t.setData({
  396 + select_classify_on: 0, index: 0, classify_name: name, cat_id: cid,
  397 + goodslist: null, is_level_three: 0
  398 + });
  399 +
  400 + if (t.data.is_used_share == 2)
  401 + t.style(t.data.stylePage, cid)
  402 +
  403 + return false;
415 } 404 }
416 - });  
417 - },  
418 -  
419 - requestCategories: function(t) {  
420 - var s = this;  
421 - e.get("/api/goods/goodsSecAndThirdCategoryList", {  
422 - data: {  
423 - parent_id: t  
424 - },  
425 - success: function(e) {  
426 - s.setData({  
427 - categories: e.data.result,  
428 - currentCategoryId: t  
429 - }); 405 + if (arr.length != 0) {
  406 + var is_lev_thr = 0
  407 + for (var i = 0; i < arr.length; i++) {
  408 + if (arr[i].arrays.length > 0) { is_lev_thr = 1; break; }
  409 + }
  410 + t.setData({ is_level_three: is_lev_thr ,cat_id:cid});
  411 +
  412 + if (this.data.is_level_three != 1) {
  413 + t.setData({ index: 0, classify_name: name, goodslist: arr });
  414 + } else {
  415 + t.setData({ index: 0, goodslist: arr });
  416 + }
430 } 417 }
431 - });  
432 - },  
433 418
434 - switchFirstCategory: function(t) {  
435 - this.requestCategories(t.currentTarget.dataset.id);  
436 - }, 419 + t.style(t.data.stylePage, cid)
437 420
438 - //-----------滑动切换----------  
439 - swiperTab: function (e) {  
440 - var that = this;  
441 - if (e.detail.source == "touch") {  
442 - this.setData({  
443 - currentTab: e.detail.current,  
444 - });  
445 - } 421 + }
446 422
447 - //获取国别  
448 - if (e.detail.current == 1 && that.data.nationlist == null) {  
449 - that.get_nation();  
450 - }  
451 - //获取品牌  
452 - if (e.detail.current == 2 && that.data.groups == null) {  
453 - that.get_brand(); 423 + }
454 } 424 }
  425 + });
  426 + },
455 427
456 - //获取服务卡项  
457 - if (e.detail.current == 3 && that.data.xmlist == null) {  
458 - that.getServiceCategory(); 428 + requestCategories: function (t) {
  429 + var s = this;
  430 + e.get("/api/goods/goodsSecAndThirdCategoryList", {
  431 + data: {
  432 + parent_id: t
  433 + },
  434 + success: function (e) {
  435 + s.setData({
  436 + categories: e.data.result,
  437 + currentCategoryId: t
  438 + });
459 } 439 }
  440 + });
  441 + },
460 442
  443 + switchFirstCategory: function (t) {
  444 + this.requestCategories(t.currentTarget.dataset.id);
  445 + },
461 446
462 - },  
463 - //-----------点击切换-----------  
464 - clickTab: function (e) {  
465 - var that = this;  
466 - if (this.data.currentTab === e.target.dataset.current) {  
467 - return false;  
468 - } else {  
469 - that.setData({  
470 - currentTab: e.target.dataset.current  
471 - })  
472 - }  
473 - //获取国别  
474 - if (e.detail.current == 1 && that.data.nationlist == null) {  
475 - that.get_nation();  
476 - } 447 + //-----------滑动切换----------
  448 + swiperTab: function (e) {
  449 + var that = this;
  450 + if (e.detail.source == "touch") {
  451 + this.setData({
  452 + currentTab: e.detail.current,
  453 + });
  454 + }
477 455
478 - //获取品牌  
479 - if (e.detail.current == 2 && that.data.groups == null) {  
480 - that.get_brand();  
481 - } 456 + //获取国别
  457 + if (e.detail.current == 1 && that.data.nationlist == null) {
  458 + that.get_nation();
  459 + }
  460 + //获取品牌
  461 + if (e.detail.current == 2 && that.data.groups == null) {
  462 + that.get_brand();
  463 + }
482 464
483 - //获取服务卡项  
484 - if (e.detail.current == 3 && that.data.xmlist == null) {  
485 - that.getServiceCategory();  
486 - } 465 + //获取服务卡项
  466 + if (e.detail.current == 3 && that.data.xmlist == null) {
  467 + that.getServiceCategory();
  468 + }
487 469
488 - },  
489 470
490 - tabLetter(e) {  
491 - const index = e.currentTarget.dataset.index;  
492 - this.setData({  
493 - selected: index,  
494 - scrollIntoView: index 471 + },
  472 + //-----------点击切换-----------
  473 + clickTab: function (e) {
  474 + var that = this;
  475 + if (this.data.currentTab === e.target.dataset.current) {
  476 + return false;
  477 + } else {
  478 + that.setData({
  479 + currentTab: e.target.dataset.current
495 }) 480 })
496 - this.cleanAcitvedStatus(); 481 + }
  482 + //获取国别
  483 + if (e.detail.current == 1 && that.data.nationlist == null) {
  484 + that.get_nation();
  485 + }
  486 +
  487 + //获取品牌
  488 + if (e.detail.current == 2 && that.data.groups == null) {
  489 + that.get_brand();
  490 + }
  491 +
  492 + //获取服务卡项
  493 + if (e.detail.current == 3 && that.data.xmlist == null) {
  494 + that.getServiceCategory();
  495 + }
  496 +
  497 + },
  498 +
  499 + tabLetter(e) {
  500 + const index = e.currentTarget.dataset.index;
  501 + this.setData({
  502 + selected: index,
  503 + scrollIntoView: index
  504 + })
  505 + this.cleanAcitvedStatus();
497 }, 506 },
498 //-------------------清除字母选中状态--------------- 507 //-------------------清除字母选中状态---------------
499 cleanAcitvedStatus() { 508 cleanAcitvedStatus() {
500 setTimeout(() => { 509 setTimeout(() => {
501 - this.setData({selected: 0}) }, 500); 510 + this.setData({ selected: 0 })
  511 + }, 500);
502 }, 512 },
503 513
504 //------------手指滑动------------------ 514 //------------手指滑动------------------
@@ -530,19 +540,19 @@ Page({ @@ -530,19 +540,19 @@ Page({
530 }, 540 },
531 541
532 //跳转到分类的商品列表 542 //跳转到分类的商品列表
533 - go_cate:function(t){  
534 - var cid= t.currentTarget.dataset.cid;  
535 - var pid = t.currentTarget.dataset.pid;  
536 - var lurl = "/pages/goods/goodsList/goodsList?cat_id=" + cid;  
537 - lurl+="&pid="+pid;  
538 - wx.navigateTo({ url: lurl}); 543 + go_cate: function (t) {
  544 + var cid = t.currentTarget.dataset.cid;
  545 + var pid = t.currentTarget.dataset.pid;
  546 + var lurl = "/pages/goods/goodsList/goodsList?cat_id=" + cid;
  547 + lurl += "&pid=" + pid;
  548 + wx.navigateTo({ url: lurl });
539 }, 549 },
540 550
541 //跳转到品牌的商品列表 551 //跳转到品牌的商品列表
542 go_brand: function (t) { 552 go_brand: function (t) {
543 var cid = t.currentTarget.dataset.bid; 553 var cid = t.currentTarget.dataset.bid;
544 var lurl = "/pages/goods/goodsList/goodsList?brand_id=" + cid; 554 var lurl = "/pages/goods/goodsList/goodsList?brand_id=" + cid;
545 - wx.navigateTo({ url: lurl}); 555 + wx.navigateTo({ url: lurl });
546 }, 556 },
547 557
548 //跳转到国别的商品列表 558 //跳转到国别的商品列表
@@ -551,24 +561,24 @@ Page({ @@ -551,24 +561,24 @@ Page({
551 var lurl = "/pages/goods/goodsList/goodsList?nation_id=" + cid; 561 var lurl = "/pages/goods/goodsList/goodsList?nation_id=" + cid;
552 wx.navigateTo({ url: lurl }); 562 wx.navigateTo({ url: lurl });
553 }, 563 },
554 - 564 +
555 //获取国别 565 //获取国别
556 - get_nation:function() { 566 + get_nation: function () {
557 var s = this; 567 var s = this;
558 e.get("/api/weshop/nation/page", { 568 e.get("/api/weshop/nation/page", {
559 data: { 569 data: {
560 is_hot: 1, 570 is_hot: 1,
561 - store_id:oo.stoid,  
562 - pageSize:300, 571 + store_id: oo.stoid,
  572 + pageSize: 300,
563 }, 573 },
564 success: function (e) { 574 success: function (e) {
565 var dda = e.data.data.pageData; 575 var dda = e.data.data.pageData;
566 - s.setData({ nationlist:dda}) 576 + s.setData({ nationlist: dda })
567 } 577 }
568 }); 578 });
569 }, 579 },
570 580
571 - //获取品牌 581 + //获取品牌
572 get_brand: function () { 582 get_brand: function () {
573 var compare = function (prop) { 583 var compare = function (prop) {
574 return function (obj1, obj2) { 584 return function (obj1, obj2) {
@@ -576,8 +586,10 @@ Page({ @@ -576,8 +586,10 @@ Page({
576 if (!isNaN(Number(val1)) && !isNaN(Number(val2))) { 586 if (!isNaN(Number(val1)) && !isNaN(Number(val2))) {
577 val1 = Number(val1); val2 = Number(val2); 587 val1 = Number(val1); val2 = Number(val2);
578 } 588 }
579 - if (val1 < val2) { return -1;  
580 - } else if (val1 > val2) { return 1; 589 + if (val1 < val2) {
  590 + return -1;
  591 + } else if (val1 > val2) {
  592 + return 1;
581 } else { return 0; } 593 } else { return 0; }
582 } 594 }
583 } 595 }
@@ -590,77 +602,77 @@ Page({ @@ -590,77 +602,77 @@ Page({
590 pageSize: 10000, 602 pageSize: 10000,
591 }, 603 },
592 success: function (e) { 604 success: function (e) {
593 - var arr=new Array();  
594 - var dda = e.data.data.pageData;  
595 - s.setData({brand_list:dda});  
596 -  
597 -  
598 - for (var i = 0; i < dda.length; i++) {  
599 - //console.log(dda[i].logo)  
600 - if(dda[i].logo==""){  
601 - dda[i].logo= s.data.iurl+"/miniapp/images/no_brand_def.jpg";  
602 - }else if(dda[i].logo && dda[i].logo.indexOf("http")<0){  
603 - dda[i].logo = oo.imghost+dda[i].logo;  
604 - }  
605 -  
606 - //进行排序,只有是默认排序的时候,才按首字母排序  
607 - // if(parseInt(s.data.is_used_share)!=0) continue;  
608 -  
609 - if (arr.length>0){  
610 - var find = 0;  
611 - //寻找字母在arr数组中是否存在,不存在就要添加,存在就在要这个数组添加元素  
612 - for (var k = 0; k < arr.length;k++){  
613 - if(dda[i].zm == arr[k].zm){ find=k+1; break;}  
614 - }  
615 - if (find == 0) {  
616 - var item = { zm: dda[i].zm, array: new Array() }  
617 - item.array.push(dda[i]);  
618 - arr.push(item);  
619 - } else{  
620 - arr[find - 1].array.push(dda[i]);  
621 - }  
622 - }else{  
623 - var item = { zm: dda[i].zm, array: new Array() }  
624 - item.array.push(dda[i]);  
625 - arr.push(item);  
626 - }  
627 - }  
628 - // if(parseInt(s.data.is_used_share)==0){  
629 - // arr.sort(compare("zm"));  
630 - // }else{  
631 - // var ob={array:dda};  
632 - // arr.push(ob);  
633 - // }  
634 -  
635 - arr.sort(compare("zm"));  
636 -  
637 - s.setData({ groups: arr });  
638 - //console.log(s.data.groups) 605 + var arr = new Array();
  606 + var dda = e.data.data.pageData;
  607 + s.setData({ brand_list: dda });
  608 +
  609 +
  610 + for (var i = 0; i < dda.length; i++) {
  611 + //console.log(dda[i].logo)
  612 + if (dda[i].logo == "") {
  613 + dda[i].logo = s.data.iurl + "/miniapp/images/no_brand_def.jpg";
  614 + } else if (dda[i].logo && dda[i].logo.indexOf("http") < 0) {
  615 + dda[i].logo = oo.imghost + dda[i].logo;
  616 + }
  617 +
  618 + //进行排序,只有是默认排序的时候,才按首字母排序
  619 + // if(parseInt(s.data.is_used_share)!=0) continue;
  620 +
  621 + if (arr.length > 0) {
  622 + var find = 0;
  623 + //寻找字母在arr数组中是否存在,不存在就要添加,存在就在要这个数组添加元素
  624 + for (var k = 0; k < arr.length; k++) {
  625 + if (dda[i].zm == arr[k].zm) { find = k + 1; break; }
  626 + }
  627 + if (find == 0) {
  628 + var item = { zm: dda[i].zm, array: new Array() }
  629 + item.array.push(dda[i]);
  630 + arr.push(item);
  631 + } else {
  632 + arr[find - 1].array.push(dda[i]);
  633 + }
  634 + } else {
  635 + var item = { zm: dda[i].zm, array: new Array() }
  636 + item.array.push(dda[i]);
  637 + arr.push(item);
  638 + }
  639 + }
  640 + // if(parseInt(s.data.is_used_share)==0){
  641 + // arr.sort(compare("zm"));
  642 + // }else{
  643 + // var ob={array:dda};
  644 + // arr.push(ob);
  645 + // }
  646 +
  647 + arr.sort(compare("zm"));
  648 +
  649 + s.setData({ groups: arr });
  650 + //console.log(s.data.groups)
639 } 651 }
640 }); 652 });
641 }, 653 },
642 654
643 655
644 // 获取服务卡项分类 656 // 获取服务卡项分类
645 - getServiceCategory: function() { 657 + getServiceCategory: function () {
646 var s = this; 658 var s = this;
647 e.get("/api/weshop/serviceCategory/page", { 659 e.get("/api/weshop/serviceCategory/page", {
648 data: { 660 data: {
649 is_show: 1, 661 is_show: 1,
650 - store_id:oo.stoid,  
651 - pageSize: 1000, 662 + store_id: oo.stoid,
  663 + pageSize: 1000,
652 }, 664 },
653 success: function (e) { 665 success: function (e) {
654 var dda = e.data.data.pageData; 666 var dda = e.data.data.pageData;
655 - s.setData({  
656 - xmlist:dda,  
657 - }); 667 + s.setData({
  668 + xmlist: dda,
  669 + });
658 } 670 }
659 }); 671 });
660 }, 672 },
661 673
662 -  
663 - goServiceCategoryList: function(t) { 674 +
  675 + goServiceCategoryList: function (t) {
664 var cid = t.currentTarget.dataset.cid; 676 var cid = t.currentTarget.dataset.cid;
665 var lurl = "/packageA/pages/cardList/cardList?cat_id=" + cid; 677 var lurl = "/packageA/pages/cardList/cardList?cat_id=" + cid;
666 wx.navigateTo({ url: lurl }); 678 wx.navigateTo({ url: lurl });
@@ -668,45 +680,45 @@ Page({ @@ -668,45 +680,45 @@ Page({
668 680
669 //---------分享配置-------- 681 //---------分享配置--------
670 onShareAppMessage: function (e) { 682 onShareAppMessage: function (e) {
671 - getApp().globalData.no_clear=1;  
672 - var url="pages/goods/categoryList/categoryList";  
673 - var userInfo=getApp().globalData.userInfo;  
674 - //是分销商才带  
675 - if(userInfo){  
676 - url+="?first_leader="+userInfo.user_id;  
677 - }  
678 - console.log("--分类分享---分享--");  
679 - console.log(url);  
680 - 683 + getApp().globalData.no_clear = 1;
  684 + var url = "pages/goods/categoryList/categoryList";
  685 + var userInfo = getApp().globalData.userInfo;
  686 + //是分销商才带
  687 + if (userInfo) {
  688 + url += "?first_leader=" + userInfo.user_id;
  689 + }
  690 + console.log("--分类分享---分享--");
  691 + console.log(url);
  692 +
681 return { 693 return {
682 - title: "商品分类",  
683 - path:url, 694 + title: "商品分类",
  695 + path: url,
684 } 696 }
685 }, 697 },
686 //图片失败,默认图片 698 //图片失败,默认图片
687 - bind_bnerr: function (e) { 699 + bind_bnerr: function (e) {
688 var _errImg = e.target.dataset.errorimg; 700 var _errImg = e.target.dataset.errorimg;
689 var _errObj = {}; 701 var _errObj = {};
690 - _errObj[_errImg] = this.data.iurl+"/miniapp/images/default_g_img.gif"; 702 + _errObj[_errImg] = this.data.iurl + "/miniapp/images/default_g_img.gif";
691 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; 703 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
692 }, 704 },
693 - //图片失败,默认图片  
694 - bind_bnerr_pp: function (e) {  
695 - var list = this.data.groups  
696 - var _errImg = e.target.dataset.errorimg;  
697 - var idx = e.target.dataset.idx;  
698 - var pix = e.target.dataset.pix;  
699 -  
700 - },  
701 - //商品图片失败,默认图片 705 + //图片失败,默认图片
  706 + bind_bnerr_pp: function (e) {
  707 + var list = this.data.groups
  708 + var _errImg = e.target.dataset.errorimg;
  709 + var idx = e.target.dataset.idx;
  710 + var pix = e.target.dataset.pix;
  711 +
  712 + },
  713 + //商品图片失败,默认图片
702 goods_bnerr: function (e) { 714 goods_bnerr: function (e) {
703 - var _errImg = e.target.dataset.err; 715 + var _errImg = e.target.dataset.err;
704 var _errObj = {}; 716 var _errObj = {};
705 _errObj[_errImg] = this.data.iurl + "/miniapp/images/no_cate_def.png"; 717 _errObj[_errImg] = this.data.iurl + "/miniapp/images/no_cate_def.png";
706 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; 718 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
707 }, 719 },
708 720
709 - goseach:function(){ 721 + goseach: function () {
710 wx.navigateTo({ 722 wx.navigateTo({
711 url: "/pages/goods/search/search" 723 url: "/pages/goods/search/search"
712 }); 724 });
@@ -714,106 +726,115 @@ Page({ @@ -714,106 +726,115 @@ Page({
714 726
715 //图片失败,默认图片 727 //图片失败,默认图片
716 bind_bnerr2: function (e) { 728 bind_bnerr2: function (e) {
717 - var _errImg = e.target.dataset.errorimg;  
718 - var _errObj = {};  
719 - _errObj[_errImg] = "/public/images/category.png";  
720 - this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;  
721 - 729 + var _errImg = e.target.dataset.errorimg;
  730 + var _errObj = {};
  731 + _errObj[_errImg] = "/public/images/category.png";
  732 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  733 +
722 }, 734 },
723 735
724 736
725 - //图片失败,默认图片  
726 - bind_bnerr_t3: function (e) {  
727 - var _errImg = e.target.dataset.errorimg;  
728 - var _errObj = {};  
729 - _errObj[_errImg] = "/miniapp/images/default_g_img.gif";  
730 - this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; 737 + //图片失败,默认图片
  738 + bind_bnerr_t3: function (e) {
  739 + var _errImg = e.target.dataset.errorimg;
  740 + var _errObj = {};
  741 + _errObj[_errImg] = "/miniapp/images/default_g_img.gif";
  742 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
731 743
732 - }, 744 + },
733 745
734 746
735 747
736 // 新的版本分类点击一级分类 748 // 新的版本分类点击一级分类
737 - click_classify:function(e){  
738 - // 在风格三的时候,才会有current  
739 - clearInterval(this.data.timer);  
740 -  
741 - let cur = e.currentTarget.dataset.current;  
742 - if(cur) { 749 + click_classify: function (e) {
  750 + // 在风格三的时候,才会有current
  751 + clearInterval(this.data.timer);
  752 + console.log('类别切换---------------');
  753 + this.setData({
  754 + toupper:true,
  755 + nextShow:false,
  756 + nextShow2:false
  757 + })
  758 + let cur = e.currentTarget.dataset.current;
  759 + console.log(cur);
  760 + console.log(this.data.currentTab);
  761 + if (cur > -1) {
  762 +
743 if (this.data.currentTab == cur) { 763 if (this.data.currentTab == cur) {
744 - if (this.data.select_classify_on != 220 && this.data.select_classify_on != 221 && this.data.select_classify_on != 223) {  
745 - return false;  
746 - } else if (cur != 0) {  
747 - return false;  
748 - } 764 +
  765 + if (this.data.select_classify_on != 220 && this.data.select_classify_on != 221 && this.data.select_classify_on != 223) {
  766 + return false;
  767 + } else if (cur != 0) {
  768 + return false;
  769 + }
749 } else { 770 } else {
750 - wx.pageScrollTo({  
751 - scrollTop: 0  
752 - })  
753 - this.setData({  
754 - currentTab: cur,  
755 - select_classify_on: cur  
756 - })  
757 - this.checkCor(); 771 + wx.pageScrollTo({
  772 + scrollTop: 0
  773 + })
  774 + this.setData({
  775 + currentTab: cur,
  776 + select_classify_on: cur
  777 + })
  778 + this.checkCor();
758 } 779 }
759 - }  
760 - this.setData({  
761 - countDownNum: 3,  
762 - });  
763 -  
764 - var arr2 = this.data.one_level_classify  
765 - for(var i=0;i<arr2.length;i++){  
766 - if(i == e.currentTarget.dataset.index){  
767 - arr2[i]['items']['is_show_class'] = true  
768 - }else{  
769 - arr2[i]['items']['is_show_class'] = false  
770 - }  
771 - }  
772 - this.setData({ one_level_classify: arr2});  
773 - //this.data.one_level_classify[e.currentTarget.dataset.index]['items']['is_show_class'] = true  
774 - // console.log(e.currentTarget.dataset.index)  
775 - clearInterval(this.data.timer);  
776 - this.setData({ countDownNum: 3, stylePage: 1, scrollTop: 0});  
777 - this.data.ishaf_three = 0;  
778 - var indexs = e.currentTarget.dataset.index;  
779 - var name = e.currentTarget.dataset.name;  
780 - var cid = e.currentTarget.dataset.cid;  
781 - var pid = e.currentTarget.dataset.pid;  
782 - var arr = e.currentTarget.dataset.arr;  
783 - console.log("cid:=" + name)  
784 - if (indexs == 220) { this.get_brand(); }  
785 - //==2的时候 请求数据为商品,不为分类  
786 - if (this.data.is_used_share == 2) {  
787 - this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, cat_id: cid,lastMsg: false, });  
788 - console.log("edqdqw:="+this.data.select_classify_on)  
789 - this.style(this.data.stylePage, cid)  
790 - }else{  
791 - if (arr != "undefined" && arr != undefined) {  
792 - if (arr.length == 0) {  
793 - this.setData({  
794 - select_classify_on: indexs, index: indexs, classify_name: name, cat_id: cid,  
795 - goodslist: null, is_level_three: 0  
796 - });  
797 - return false;  
798 - }  
799 - if (arr.length != 0) {  
800 - var is_lev_thr = 0  
801 - for (var i = 0; i < arr.length; i++) {  
802 - if (arr[i].arrays.length > 0) { is_lev_thr = 1; break; }  
803 - }  
804 - this.setData({ is_level_three: is_lev_thr });  
805 -  
806 - if (this.data.is_level_three != 1) {  
807 - this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, goodslist: arr });  
808 - } else {  
809 - this.setData({ select_classify_on: indexs, index: indexs, goodslist: arr }); 780 + }
  781 + this.setData({
  782 + countDownNum: 3,
  783 + });
  784 +
  785 + var arr2 = this.data.one_level_classify
  786 + for (var i = 0; i < arr2.length; i++) {
  787 + if (i == e.currentTarget.dataset.index) {
  788 + arr2[i]['items']['is_show_class'] = true
  789 + } else {
  790 + arr2[i]['items']['is_show_class'] = false
  791 + }
  792 + }
  793 + this.setData({ one_level_classify: arr2 });
  794 + //this.data.one_level_classify[e.currentTarget.dataset.index]['items']['is_show_class'] = true
  795 + // console.log(e.currentTarget.dataset.index)
  796 + clearInterval(this.data.timer);
  797 + this.setData({ countDownNum: 3, stylePage: 1, scrollTop: 0 });
  798 + this.data.ishaf_three = 0;
  799 + var indexs = e.currentTarget.dataset.index;
  800 + var name = e.currentTarget.dataset.name;
  801 + var cid = e.currentTarget.dataset.cid;
  802 + var pid = e.currentTarget.dataset.pid;
  803 + var arr = e.currentTarget.dataset.arr;
  804 + console.log("cid:=" + name)
  805 + if (indexs == 220) { this.get_brand(); }
  806 + //==2的时候 请求数据为商品,不为分类
  807 + if (this.data.is_used_share == 2) {
  808 + this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, cat_id: cid, lastMsg: false, });
  809 + console.log("edqdqw:=" + this.data.select_classify_on)
  810 + this.style(this.data.stylePage, cid)
  811 + } else {
  812 + if (arr != "undefined" && arr != undefined) {
  813 + if (arr.length == 0) {
  814 + this.setData({
  815 + select_classify_on: indexs, index: indexs, classify_name: name, cat_id: cid,
  816 + goodslist: null, is_level_three: 0
  817 + });
  818 + return false;
810 } 819 }
811 - }  
812 - }  
813 - this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, cat_id: cid, stylePage: 1,lastMsg: false,});  
814 - }  
815 -  
816 - }, 820 + if (arr.length != 0) {
  821 + var is_lev_thr = 0
  822 + for (var i = 0; i < arr.length; i++) {
  823 + if (arr[i].arrays.length > 0) { is_lev_thr = 1; break; }
  824 + }
  825 + this.setData({ is_level_three: is_lev_thr });
  826 +
  827 + if (this.data.is_level_three != 1) {
  828 + this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, goodslist: arr });
  829 + } else {
  830 + this.setData({ select_classify_on: indexs, index: indexs, goodslist: arr });
  831 + }
  832 + }
  833 + }
  834 + this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, cat_id: cid, stylePage: 1, lastMsg: false, });
  835 + }
  836 +
  837 + },
817 838
818 839
819 //图片失败 840 //图片失败
@@ -825,34 +846,34 @@ Page({ @@ -825,34 +846,34 @@ Page({
825 _errObj[_errImg] = "/miniapp/images/default_g_img.gif"; 846 _errObj[_errImg] = "/miniapp/images/default_g_img.gif";
826 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; 847 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
827 }, 848 },
828 -  
829 - 849 +
  850 +
830 //选择更多 851 //选择更多
831 - select_more:function(e){ 852 + select_more: function (e) {
832 var cid = e.currentTarget.dataset.cid; 853 var cid = e.currentTarget.dataset.cid;
833 var pid = e.currentTarget.dataset.pid; 854 var pid = e.currentTarget.dataset.pid;
834 var lurl = "/pages/goods/goodsList/goodsList?cat_id=" + cid + "&pid=" + pid; 855 var lurl = "/pages/goods/goodsList/goodsList?cat_id=" + cid + "&pid=" + pid;
835 wx.navigateTo({ url: lurl }); 856 wx.navigateTo({ url: lurl });
836 - 857 +
837 }, 858 },
838 -  
839 -  
840 -//扫一扫  
841 - getScancode:function(){  
842 - var _this = this;  
843 - getApp().globalData.no_clear=1; 859 +
  860 +
  861 + //扫一扫
  862 + getScancode: function () {
  863 + var _this = this;
  864 + getApp().globalData.no_clear = 1;
844 // 允许从相机和相册扫码 865 // 允许从相机和相册扫码
845 wx.scanCode({ 866 wx.scanCode({
846 success: (res) => { 867 success: (res) => {
847 - var result = res.result;  
848 - wx.navigateTo({  
849 - url: "/pages/goods/search/search?s_key="+result,  
850 - }); 868 + var result = res.result;
  869 + wx.navigateTo({
  870 + url: "/pages/goods/search/search?s_key=" + result,
  871 + });
851 } 872 }
852 }) 873 })
853 }, 874 },
854 -  
855 - 875 +
  876 +
856 onUnload: function () { 877 onUnload: function () {
857 //this.destroyActivityTimer(); 878 //this.destroyActivityTimer();
858 }, 879 },
@@ -882,97 +903,177 @@ Page({ @@ -882,97 +903,177 @@ Page({
882 console.log(data.data.data.pageData) 903 console.log(data.data.data.pageData)
883 that.setData({ 904 that.setData({
884 requestData: data.data.data.pageData, 905 requestData: data.data.data.pageData,
885 - is_go: 1 906 + is_go: 1
886 }); 907 });
887 that.setData({ is_go: 1 }); 908 that.setData({ is_go: 1 });
888 - that.data.stylePage++ , null == that.data.allData && (that.data.allData = Object.assign({}, data.data.data.pageData)), 909 + that.data.stylePage++, null == that.data.allData && (that.data.allData = Object.assign({}, data.data.data.pageData)),
889 wx.stopPullDownRefresh(); 910 wx.stopPullDownRefresh();
890 } 911 }
891 }); 912 });
892 913
893 }, 914 },
894 915
895 - 916 +
896 // 左侧更新 917 // 左侧更新
897 scrollLower: function (data) { 918 scrollLower: function (data) {
898 - if(this.data.is_no_more) return false; 919 + if (this.data.is_no_more) return false;
899 var that = this; 920 var that = this;
900 clearInterval(that.data.timer); 921 clearInterval(that.data.timer);
901 that.setData({ 922 that.setData({
902 stylePage: that.data.stylePage + 1, 923 stylePage: that.data.stylePage + 1,
903 countDownNum: 3, 924 countDownNum: 3,
904 lastMsg: false, 925 lastMsg: false,
905 - });  
906 - that.style(that.data.stylePage, that.data.cat_id); 926 + });
  927 + // if (nextTimeOff) {
  928 + // clearTimeout(nextTimeOff)
  929 + // }
  930 + // nextTimeOff = setTimeout(()=>{
  931 + that.style(that.data.stylePage, that.data.cat_id);
  932 + // },1000)
  933 + },
  934 + scrolltoupper(){
  935 + console.log('到顶部--------');
  936 + this.setData({
  937 + toupper:true
  938 + })
  939 + },
  940 + bScroll(even){
  941 + console.log('滑动开始');
  942 + console.log(even);
  943 + this.setData({
  944 + sClientY:even.changedTouches.length>0 ? even.changedTouches[0].clientY : 0
  945 + })
  946 + },
  947 + btouMove(even){
  948 + console.log('滑动结束');
  949 + console.log(even);
  950 + let eClientY = even.changedTouches.length>0 ? even.changedTouches[0].clientY : 0
  951 + let sClientY = this.data.sClientY
  952 + console.log(eClientY - sClientY);
  953 + if (eClientY - sClientY > 0) {
  954 + console.log('下滑');
  955 + console.log(this.data.toupper);
  956 + if (this.data.toupper) {
  957 + console.log('下滑请求数据');
  958 + this.setData({msgStatus:false,is_no_more:false})
  959 + clearInterval(this.data.timer);
  960 + this.nextCategory(true)
  961 + }else{
  962 + this.disNexCat()
  963 + }
  964 + }else{
  965 + console.log('上滑');
  966 + if (!this.data.msgStatus) {
  967 + this.setData({
  968 + toupper:false
  969 + })
  970 + }
  971 + this.disNexCat()
  972 + }
  973 + },
  974 + disNexCat(){
  975 + let that = this
  976 + const { windowHeight } = wx.getSystemInfoSync()
  977 + wx.createSelectorQuery().select('#sview').boundingClientRect(function(rect){
  978 + if (rect) {
  979 + const { top,height } = rect
  980 + if ((top < windowHeight) && (top + height >0) ) {
  981 + let nextShow2 = that.data.nextShow2
  982 + if (nextShow2) {
  983 + that.nextCategory()
  984 + }else{
  985 + that.setData({
  986 + nextShow2:true
  987 + })
  988 + }
  989 + }else{
  990 + that.setData({
  991 + nextShow2:false
  992 + })
  993 + }
  994 + }
  995 + }).exec()
907 }, 996 },
908 -  
909 //页面版面风格三的时候请求推荐商品 返回 997 //页面版面风格三的时候请求推荐商品 返回
910 style: function (page, cid) { 998 style: function (page, cid) {
911 console.log("page:=" + page) 999 console.log("page:=" + page)
  1000 + console.log("cid:=" + cid)
  1001 + console.log("cid:=" + this.data.cat_id);
912 var s = this 1002 var s = this
913 e.get("/api/weshop/goods/page?1=1", { 1003 e.get("/api/weshop/goods/page?1=1", {
914 data: { page: page, cat_id: cid, parent_id: 0, orderField: 'sort', orderType: 'asc', is_mainshow: 1, isonsale: 1, store_id: oo.stoid, is_recommend: 1 }, 1004 data: { page: page, cat_id: cid, parent_id: 0, orderField: 'sort', orderType: 'asc', is_mainshow: 1, isonsale: 1, store_id: oo.stoid, is_recommend: 1 },
915 success: function (e) { 1005 success: function (e) {
  1006 + console.log('上拉加载。。。。。。。。。');
916 console.log(e.data.data.pageData) 1007 console.log(e.data.data.pageData)
917 1008
918 if (e.data.data.pageData.length > 0) { 1009 if (e.data.data.pageData.length > 0) {
  1010 + clearInterval(s.data.timer);
919 s.setData({ 1011 s.setData({
920 - msgStatus: false,is_no_more:0 1012 + msgStatus: false, is_no_more: 0
921 }); 1013 });
922 //如果有数据 判断分页为第一页的时候直接渲染数据 1014 //如果有数据 判断分页为第一页的时候直接渲染数据
923 if (page > 1) { 1015 if (page > 1) {
924 //如果分页不是在第一页 那么就把返回的数据追加到原有数据后面 1016 //如果分页不是在第一页 那么就把返回的数据追加到原有数据后面
925 var arr = s.data.requestData 1017 var arr = s.data.requestData
926 -  
927 - for (var i = 0; i < e.data.data.pageData.length;i++){ 1018 +
  1019 + for (var i = 0; i < e.data.data.pageData.length; i++) {
928 arr.push(e.data.data.pageData[i]); 1020 arr.push(e.data.data.pageData[i]);
929 } 1021 }
930 - 1022 +
  1023 + if (e.data.data.pageData.length < e.data.data.pageSize) {
  1024 + s.setData({
  1025 + nextShow:true,
  1026 + // nextShow2:true
  1027 + })
  1028 + }
  1029 +
931 s.setData({ 1030 s.setData({
932 requestData: arr 1031 requestData: arr
933 }); 1032 });
934 -  
935 - }else{ 1033 +
  1034 + } else {
936 s.setData({ 1035 s.setData({
937 requestData: e.data.data.pageData 1036 requestData: e.data.data.pageData
938 }); 1037 });
  1038 + if ( e.data.data.pageData.length && (e.data.data.pageData.length < e.data.data.pageSize)) {
  1039 + s.setData({
  1040 + nextShow:true,
  1041 + // nextShow2:true
  1042 + })
  1043 + const { windowHeight } = wx.getSystemInfoSync()
  1044 + wx.createSelectorQuery().select('#sview').boundingClientRect(function(rect){
  1045 + if (rect) {
  1046 + const { top,height } = rect
  1047 + if ((top < windowHeight) && (top + height >0) ) {
  1048 + s.setData({
  1049 + nextShow2:true
  1050 + })
  1051 + }
  1052 + }
  1053 + }).exec()
  1054 + }
939 if (wx.pageScrollTo) { 1055 if (wx.pageScrollTo) {
940 wx.pageScrollTo({ 1056 wx.pageScrollTo({
941 scrollTop: 0 1057 scrollTop: 0
942 }) 1058 })
943 - } 1059 + }
944 } 1060 }
945 1061
946 - s.setData({  
947 - dataLength: s.data.requestData.length,  
948 - });  
949 - 1062 + s.setData({
  1063 + dataLength: s.data.requestData.length,
  1064 + });
  1065 +
950 } else { 1066 } else {
951 //没有数据页面显示暂无数据 1067 //没有数据页面显示暂无数据
952 if (page != 1) { 1068 if (page != 1) {
953 - var dataArray = s.data.one_level_classify  
954 - var index = s.data.index  
955 - dataArray[index]['items']['is_show_class'] = false  
956 - //没有下一个类别的时候  
957 - if(index+1>=dataArray.length){  
958 - s.setData({is_no_more:1});  
959 - }else{  
960 - dataArray[index+1]['items']['is_show_class'] = true  
961 - console.log(dataArray[index + 1]['items'])  
962 - s.setData({  
963 - msgStatus: true,  
964 - stylePage: 1,  
965 - index: index + 1,  
966 - select_classify_on: index + 1,  
967 - cat_id: dataArray[index + 1]['items']['id'],  
968 - classify_name: dataArray[index + 1]['items']['name'],  
969 - one_level_classify: dataArray,  
970 - is_no_more:0  
971 - });  
972 - s.style(s.data.stylePage, dataArray[index + 1]['items']['id'])  
973 - }  
974 -  
975 - }else{ 1069 + let nextShow = s.data.nextShow
  1070 +
  1071 + if (!nextShow) {
  1072 + s.setData({
  1073 + nextShow:true
  1074 + })
  1075 + }
  1076 + } else {
976 //没有数据而且是第一页的时候 1077 //没有数据而且是第一页的时候
977 s.setData({ 1078 s.setData({
978 stylePage: 1, 1079 stylePage: 1,
@@ -982,9 +1083,10 @@ Page({ @@ -982,9 +1083,10 @@ Page({
982 msgStatus: true, 1083 msgStatus: true,
983 countDownNum: countDownNum, 1084 countDownNum: countDownNum,
984 requestData: [], 1085 requestData: [],
985 - is_no_more:0, 1086 + is_no_more: 0,
986 }); 1087 });
987 - s.data.timer=setInterval(function () { 1088 + clearInterval(s.data.timer);
  1089 + s.data.timer = setInterval(function () {
988 if (countDownNum == 0) { 1090 if (countDownNum == 0) {
989 clearInterval(s.data.timer); 1091 clearInterval(s.data.timer);
990 //关闭定时器之后,可作其他处理 1092 //关闭定时器之后,可作其他处理
@@ -997,50 +1099,83 @@ Page({ @@ -997,50 +1099,83 @@ Page({
997 var dataArray = s.data.one_level_classify 1099 var dataArray = s.data.one_level_classify
998 var index = s.data.index 1100 var index = s.data.index
999 console.log(dataArray[index + 1]) 1101 console.log(dataArray[index + 1])
1000 - if (dataArray[index + 1] == undefined || dataArray[index + 1] == "undefined"){ 1102 + if (dataArray[index + 1] == undefined || dataArray[index + 1] == "undefined") {
1001 console.log("dataArray[index + 1] = undefined") 1103 console.log("dataArray[index + 1] = undefined")
1002 s.setData({ 1104 s.setData({
1003 stylePage: 1, 1105 stylePage: 1,
1004 msgStatus: true, 1106 msgStatus: true,
1005 lastMsg: true 1107 lastMsg: true
1006 }); 1108 });
1007 - }else{ 1109 + } else {
1008 dataArray[index]['items']['is_show_class'] = false 1110 dataArray[index]['items']['is_show_class'] = false
1009 - dataArray[index+1]['items']['is_show_class'] = true 1111 + dataArray[index + 1]['items']['is_show_class'] = true
1010 s.setData({ 1112 s.setData({
1011 stylePage: 1, 1113 stylePage: 1,
1012 index: index + 1, 1114 index: index + 1,
1013 select_classify_on: index + 1, 1115 select_classify_on: index + 1,
1014 cat_id: dataArray[index + 1]['items']['id'], 1116 cat_id: dataArray[index + 1]['items']['id'],
1015 classify_name: dataArray[index + 1]['items']['name'], 1117 classify_name: dataArray[index + 1]['items']['name'],
1016 - one_level_classify:dataArray 1118 + one_level_classify: dataArray
1017 }); 1119 });
1018 s.style(s.data.stylePage, dataArray[index + 1]['items']['id']); 1120 s.style(s.data.stylePage, dataArray[index + 1]['items']['id']);
1019 } 1121 }
1020 - 1122 +
1021 } 1123 }
1022 countDownNum--; 1124 countDownNum--;
1023 s.setData({ 1125 s.setData({
1024 countDownNum: countDownNum 1126 countDownNum: countDownNum
1025 }) 1127 })
1026 var arr2 = s.data.one_level_classify 1128 var arr2 = s.data.one_level_classify
1027 - for(var i=0;i<arr2.length;i++){  
1028 - if(i == s.data.index){  
1029 - arr2[i]['items']['is_show_class'] = true  
1030 - }else{  
1031 - arr2[i]['items']['is_show_class'] = false 1129 + for (var i = 0; i < arr2.length; i++) {
  1130 + if (i == s.data.index) {
  1131 + arr2[i]['items']['is_show_class'] = true
  1132 + } else {
  1133 + arr2[i]['items']['is_show_class'] = false
1032 } 1134 }
1033 } 1135 }
1034 - s.setData({ one_level_classify: arr2}); 1136 + s.setData({ one_level_classify: arr2 });
1035 }, 1000) 1137 }, 1000)
1036 } 1138 }
1037 -  
1038 - 1139 +
  1140 +
1039 } 1141 }
1040 } 1142 }
1041 }); 1143 });
1042 }, 1144 },
1043 - 1145 + //下一个品类
  1146 + nextCategory(up=false){
  1147 + console.log('跳转下一个页面');
  1148 + clearInterval(this.data.timer);
  1149 + this.setData({
  1150 + nextShow:false
  1151 + })
  1152 + var dataArray = this.data.one_level_classify
  1153 + var index = this.data.index
  1154 + let s = 1
  1155 + if (up) {
  1156 + s = -1
  1157 + }
  1158 + dataArray[index]['items']['is_show_class'] = false
  1159 + //没有下一个类别的时候
  1160 + if (index + s >= dataArray.length || index+s < 0) {
  1161 + this.setData({ is_no_more: 1 });
  1162 + } else {
  1163 + dataArray[index + s]['items']['is_show_class'] = true
  1164 + console.log(dataArray[index + s]['items'])
  1165 + this.setData({
  1166 + msgStatus: true,
  1167 + stylePage: 1,
  1168 + index: index + s,
  1169 + select_classify_on: index + s,
  1170 + cat_id: dataArray[index + s]['items']['id'],
  1171 + classify_name: dataArray[index + s]['items']['name'],
  1172 + one_level_classify: dataArray,
  1173 + is_no_more: 0,
  1174 + currentTab:index + s
  1175 + });
  1176 + this.style(this.data.stylePage, dataArray[index + s]['items']['id'])
  1177 + }
  1178 + },
1044 1179
1045 openFilterModal: function () { 1180 openFilterModal: function () {
1046 this.setData({ 1181 this.setData({
@@ -1090,28 +1225,28 @@ Page({ @@ -1090,28 +1225,28 @@ Page({
1090 func(ob); 1225 func(ob);
1091 }) 1226 })
1092 }, 1227 },
1093 - 1228 +
1094 //导航跳转 1229 //导航跳转
1095 - nav_goto:function(e){  
1096 - var url=e.currentTarget.dataset.url;  
1097 - if(!url || url=='') return;  
1098 - if(url[0]!='/') url='/'+url;  
1099 - getApp().goto(url);  
1100 - },  
1101 -  
1102 - onShareTimeline(){  
1103 - getApp().globalData.no_clear=1;  
1104 - var store_name=getApp().globalData.config?getApp().globalData.config.store_name:'';  
1105 - if(!store_name)  
1106 - store_name=getApp().globalData.setting.appName;  
1107 -  
1108 - var user_id=getApp().globalData.user_id;  
1109 - if(!user_id) user_id=0;  
1110 -  
1111 - return {  
1112 - title:'商品分类-'+store_name,  
1113 - query: "first_leader=" + user_id  
1114 - } 1230 + nav_goto: function (e) {
  1231 + var url = e.currentTarget.dataset.url;
  1232 + if (!url || url == '') return;
  1233 + if (url[0] != '/') url = '/' + url;
  1234 + getApp().goto(url);
  1235 + },
  1236 +
  1237 + onShareTimeline() {
  1238 + getApp().globalData.no_clear = 1;
  1239 + var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : '';
  1240 + if (!store_name)
  1241 + store_name = getApp().globalData.setting.appName;
  1242 +
  1243 + var user_id = getApp().globalData.user_id;
  1244 + if (!user_id) user_id = 0;
  1245 +
  1246 + return {
  1247 + title: '商品分类-' + store_name,
  1248 + query: "first_leader=" + user_id
1115 } 1249 }
  1250 + }
1116 1251
1117 }); 1252 });
1118 \ No newline at end of file 1253 \ No newline at end of file
pages/goods/categoryList/categoryList.wxml
@@ -5,231 +5,219 @@ @@ -5,231 +5,219 @@
5 <!-- 风格1 --> 5 <!-- 风格1 -->
6 <block wx:if="{{is_used_share==0}}"> 6 <block wx:if="{{is_used_share==0}}">
7 <view class='top_view' wx:if="{{is_show_pl || is_show_gb || is_show_pp }}"> 7 <view class='top_view' wx:if="{{is_show_pl || is_show_gb || is_show_pp }}">
8 - <view class="swiper-tab" >  
9 - <view wx:if="{{is_show_pl}}" class="swiper-tab-item {{currentTab==0?'active':''}}"  
10 - data-current="0" bindtap="clickTab">分类</view>  
11 - <view wx:if="{{is_show_gb}}" class="swiper-tab-item {{currentTab==1?'active':''}}"  
12 - data-current="1" bindtap="clickTab">国家</view>  
13 - <view wx:if="{{is_show_pp}}" class="swiper-tab-item {{currentTab==2?'active':''}}"  
14 - data-current="2" bindtap="clickTab">品牌</view>  
15 - <view wx:if="{{is_show_xm}}" class="swiper-tab-item {{currentTab==3?'active':''}}"  
16 - data-current="3" bindtap="clickTab">项目</view>  
17 - </view> 8 + <view class="swiper-tab">
  9 + <view wx:if="{{is_show_pl}}" class="swiper-tab-item {{currentTab==0?'active':''}}" data-current="0" bindtap="clickTab">分类</view>
  10 + <view wx:if="{{is_show_gb}}" class="swiper-tab-item {{currentTab==1?'active':''}}" data-current="1" bindtap="clickTab">国家</view>
  11 + <view wx:if="{{is_show_pp}}" class="swiper-tab-item {{currentTab==2?'active':''}}" data-current="2" bindtap="clickTab">品牌</view>
  12 + <view wx:if="{{is_show_xm}}" class="swiper-tab-item {{currentTab==3?'active':''}}" data-current="3" bindtap="clickTab">项目</view>
  13 + </view>
18 </view> 14 </view>
19 - <view class="search-box " bindtap="goseach">  
20 - <view class="search-inner">  
21 - <view class="search-img">  
22 - <image class="wh100" src="{{iurl}}/miniapp/images/search.png"></image>  
23 - </view>  
24 - <input bindfocus="goseach" class="search-cont" placeholder="寻找好口碑" type="text"></input>  
25 - </view> 15 + <view class="search-box " bindtap="goseach">
  16 + <view class="search-inner">
  17 + <view class="search-img">
  18 + <image class="wh100" src="{{iurl}}/miniapp/images/search.png"></image>
  19 + </view>
  20 + <input bindfocus="goseach" class="search-cont" placeholder="寻找好口碑" type="text"></input>
  21 + </view>
26 </view> 22 </view>
27 <block wx:if="{{is_show_pl || is_show_gb || is_show_pp || is_show_xm}}"> 23 <block wx:if="{{is_show_pl || is_show_gb || is_show_pp || is_show_xm}}">
28 - <swiper current="{{currentTab}}" duration="300" bindanimationfinish="swiperTab" style="height:{{abc}}rpx;margin-bottom:120rpx"> 24 + <swiper current="{{currentTab}}" duration="300" bindanimationfinish="swiperTab" style="height:{{abc}}rpx;margin-bottom:120rpx">
29 <!--------分类----------> 25 <!--------分类---------->
30 - <swiper-item >  
31 - <scroll-view scroll-y="true" class="fenlei-list"  
32 - scroll-with-animation="true" lower-threshold="1" bindscrolltolower="scrolltolower" style="height: {{abc}}rpx;" >  
33 - <block wx:for="{{catelist}}" wx:for-item="fitem" >  
34 - <view class='f_item'>  
35 - <view class="pic_view" bindtap="go_cate" data-cid="{{fitem.items.id}}" data-pid="0"><image class='fl_img' src='{{iurl}}{{fitem.items.image}}' binderror="bind_bnerr2" data-errorimg="catelist[{{index}}].items.image"></image>  
36 - <view class='over_view'></view>  
37 - <text class='f_item_over_t'>{{fitem.items.name}}</text></view>  
38 - <view class='fenlei_text_v'>  
39 - <view class='f_text' wx:for="{{fitem.array}}" wx:for-item="item"  
40 - bindtap="go_cate" data-cid="{{item.id}}" data-pid="{{item.parent_id}}">{{item.name}}</view>  
41 - </view>  
42 - </view>  
43 - </block>  
44 - </scroll-view> 26 + <swiper-item>
  27 + <scroll-view scroll-y="true" class="fenlei-list" scroll-with-animation="true" lower-threshold="1" bindscrolltolower="scrolltolower" style="height: {{abc}}rpx;">
  28 + <block wx:for="{{catelist}}" wx:for-item="fitem">
  29 + <view class='f_item'>
  30 + <view class="pic_view" bindtap="go_cate" data-cid="{{fitem.items.id}}" data-pid="0">
  31 + <image class='fl_img' src='{{iurl}}{{fitem.items.image}}' binderror="bind_bnerr2" data-errorimg="catelist[{{index}}].items.image"></image>
  32 + <view class='over_view'></view>
  33 + <text class='f_item_over_t'>{{fitem.items.name}}</text>
  34 + </view>
  35 + <view class='fenlei_text_v'>
  36 + <view class='f_text' wx:for="{{fitem.array}}" wx:for-item="item" bindtap="go_cate" data-cid="{{item.id}}" data-pid="{{item.parent_id}}">{{item.name}}</view>
  37 + </view>
  38 + </view>
  39 + </block>
  40 + </scroll-view>
45 </swiper-item> 41 </swiper-item>
46 <!-------国别----------> 42 <!-------国别---------->
47 <swiper-item> 43 <swiper-item>
48 - <scroll-view scroll-y="true" class="fenlei-list"  
49 - scroll-with-animation="true" lower-threshold="1" bindscrolltolower="scrolltolower" style="height: {{abc}}rpx;" >  
50 - <view class='f_item'  
51 - bindtap="go_nation" data-nid="{{bitem.id}}"  
52 - wx:for="{{nationlist}}" wx:for-item="bitem" wx:for-index="pidx">  
53 - <view>  
54 - <image wx:if="{{bitem.imgtype==1}}" class='n_img' src='{{bitem.logo}}'></image>  
55 - <image wx:else class='n_img' src='{{iurl}}{{bitem.logo}}'></image>  
56 -  
57 - <view class='nation_box'>  
58 - <view class='nt_1'><text class="nt_1_t">{{bitem.name}}</text></view>  
59 - <view class='nt_2'>{{bitem.enname}}</view>  
60 - </view>  
61 - </view>  
62 - </view>  
63 - </scroll-view> 44 + <scroll-view scroll-y="true" class="fenlei-list" scroll-with-animation="true" lower-threshold="1" bindscrolltolower="scrolltolower" style="height: {{abc}}rpx;">
  45 + <view class='f_item' bindtap="go_nation" data-nid="{{bitem.id}}" wx:for="{{nationlist}}" wx:for-item="bitem" wx:for-index="pidx">
  46 + <view>
  47 + <image wx:if="{{bitem.imgtype==1}}" class='n_img' src='{{bitem.logo}}'></image>
  48 + <image wx:else class='n_img' src='{{iurl}}{{bitem.logo}}'></image>
  49 +
  50 + <view class='nation_box'>
  51 + <view class='nt_1'><text class="nt_1_t">{{bitem.name}}</text></view>
  52 + <view class='nt_2'>{{bitem.enname}}</view>
  53 + </view>
  54 + </view>
  55 + </view>
  56 + </scroll-view>
64 </swiper-item> 57 </swiper-item>
65 <!-- 品牌 --> 58 <!-- 品牌 -->
66 <swiper-item> 59 <swiper-item>
67 - <scroll-view scroll-y="true" class="fenlei-list"  
68 - style="height: {{abc}}rpx;" scroll-into-view="{{scrollIntoView}}">  
69 - <block wx:for="{{groups}}" wx:for-item="group" wx:for-index="pidx">  
70 - <view >  
71 - <view id="{{group.zm}}" class="group-name">{{group.zm}}</view>  
72 - <view class="group-users">  
73 - <view wx:for="{{group.array}}" bindtap="go_brand" data-bid="{{user.id}}"  
74 - wx:for-item="user" wx:for-index="idx" class="user box box-lr">  
75 - <image class="user-avatar-img" src="{{user.logo}}"  
76 - data-errorimg="groups[{{pidx}}].array[{{idx}}].logo"  
77 - binderror="bind_bnerr"></image>  
78 - </view>  
79 - </view>  
80 - </view>  
81 - </block>  
82 - </scroll-view>  
83 -  
84 - <view class="nav box box-tb my-nav" catchtouchmove="touchmove" catchtouchend="touchend" >  
85 -<!-- <image src="/images/up.png" style="width:36rpx;height:36rpx;margin-right:10rpx;"></image> -->  
86 - <!-- <icon color="icon-close" color="#000" size="30" type="icon-shangjiantou" style=""></icon> -->  
87 - <view class="iconfont icon-shangjiantou"></view>  
88 - <view bindtap="tabLetter" data-index="{{item.zm}}" wx:for="{{groups}}"  
89 - class="flex box box-align-center box-pack-center letter">  
90 - <text class="letter-text {{selected == item.zm ? 'letter-actived' : ''}}" wx:if="{{item.zm}}">{{item.zm}}</text> 60 + <scroll-view scroll-y="true" class="fenlei-list" style="height: {{abc}}rpx;" scroll-into-view="{{scrollIntoView}}">
  61 + <block wx:for="{{groups}}" wx:for-item="group" wx:for-index="pidx">
  62 + <view>
  63 + <view id="{{group.zm}}" class="group-name">{{group.zm}}</view>
  64 + <view class="group-users">
  65 + <view wx:for="{{group.array}}" bindtap="go_brand" data-bid="{{user.id}}" wx:for-item="user" wx:for-index="idx" class="user box box-lr">
  66 + <image class="user-avatar-img" src="{{user.logo}}" data-errorimg="groups[{{pidx}}].array[{{idx}}].logo" binderror="bind_bnerr"></image>
  67 + </view>
91 </view> 68 </view>
92 </view> 69 </view>
  70 + </block>
  71 + </scroll-view>
  72 +
  73 + <view class="nav box box-tb my-nav" catchtouchmove="touchmove" catchtouchend="touchend">
  74 + <!-- <image src="/images/up.png" style="width:36rpx;height:36rpx;margin-right:10rpx;"></image> -->
  75 + <!-- <icon color="icon-close" color="#000" size="30" type="icon-shangjiantou" style=""></icon> -->
  76 + <view class="iconfont icon-shangjiantou"></view>
  77 + <view bindtap="tabLetter" data-index="{{item.zm}}" wx:for="{{groups}}" class="flex box box-align-center box-pack-center letter">
  78 + <text class="letter-text {{selected == item.zm ? 'letter-actived' : ''}}" wx:if="{{item.zm}}">{{item.zm}}</text>
  79 + </view>
  80 + </view>
93 </swiper-item> 81 </swiper-item>
94 - <!-------项目---------->  
95 - <swiper-item wx:if="{{is_show_xm}}">  
96 - <scroll-view scroll-y="true" class="fenlei-list"  
97 - scroll-with-animation="true" lower-threshold="1" bindscrolltolower="scrolltolower" style="height: {{abc}}rpx;" >  
98 - <block wx:if="{{xmlist && xmlist.length != 0}}">  
99 - <block wx:for="{{xmlist}}" wx:for-item="fitem" >  
100 - <view class='f_item'>  
101 - <view class="pic_view" bindtap="goServiceCategoryList" data-cid="{{fitem.id}}" data-pid="0">  
102 -  
103 - <image wx:if="{{fitem.showImgType==1}}" binderror="bind_bnerr2" class='fl_img' data-errorimg="xmlist[{{index}}].showImg" src='{{fitem.showImg}}'></image>  
104 - <image wx:else class='fl_img' binderror="bind_bnerr2" data-errorimg="xmlist[{{index}}].showImg" src='{{iurl}}{{fitem.showImg}}'></image>  
105 -  
106 - <view class='over_view'></view>  
107 - <text class='f_item_over_t'>{{fitem.name}}</text></view>  
108 - <view class='fenlei_text_v'>  
109 - <view class='f_text' wx:for="{{fitem.array}}" wx:for-item="item" bindtap="goServiceCategoryList" data-cid="{{item.id}}" data-pid="{{item.parent_id}}">{{item.name}}</view>  
110 - </view>  
111 - </view>  
112 - </block>  
113 - </block>  
114 -  
115 -  
116 - <view wx:else class="t-c fs28 c-9 pdt50">暂无项目</view>  
117 - </scroll-view>  
118 - </swiper-item>  
119 - </swiper>  
120 - <view class="no-data" wx:if="{{!is_date}}"> 82 + <!-------项目---------->
  83 + <swiper-item wx:if="{{is_show_xm}}">
  84 + <scroll-view scroll-y="true" class="fenlei-list" scroll-with-animation="true" lower-threshold="1" bindscrolltolower="scrolltolower" style="height: {{abc}}rpx;">
  85 + <block wx:if="{{xmlist && xmlist.length != 0}}">
  86 + <block wx:for="{{xmlist}}" wx:for-item="fitem">
  87 + <view class='f_item'>
  88 + <view class="pic_view" bindtap="goServiceCategoryList" data-cid="{{fitem.id}}" data-pid="0">
  89 +
  90 + <image wx:if="{{fitem.showImgType==1}}" binderror="bind_bnerr2" class='fl_img' data-errorimg="xmlist[{{index}}].showImg" src='{{fitem.showImg}}'></image>
  91 + <image wx:else class='fl_img' binderror="bind_bnerr2" data-errorimg="xmlist[{{index}}].showImg" src='{{iurl}}{{fitem.showImg}}'></image>
  92 +
  93 + <view class='over_view'></view>
  94 + <text class='f_item_over_t'>{{fitem.name}}</text>
  95 + </view>
  96 + <view class='fenlei_text_v'>
  97 + <view class='f_text' wx:for="{{fitem.array}}" wx:for-item="item" bindtap="goServiceCategoryList" data-cid="{{item.id}}" data-pid="{{item.parent_id}}">{{item.name}}</view>
  98 + </view>
  99 + </view>
  100 + </block>
  101 + </block>
  102 +
  103 +
  104 + <view wx:else class="t-c fs28 c-9 pdt50">暂无项目</view>
  105 + </scroll-view>
  106 + </swiper-item>
  107 + </swiper>
  108 + <view class="no-data" wx:if="{{!is_date}}">
121 <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> 109 <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image>
122 <view class="no-data-title">暂无分类</view> 110 <view class="no-data-title">暂无分类</view>
123 <navigator class="lookat" url="/pages/index/index/index">去逛逛</navigator> 111 <navigator class="lookat" url="/pages/index/index/index">去逛逛</navigator>
124 - </view> 112 + </view>
125 </block> 113 </block>
126 <block wx:elif="{{is_do}}"> 114 <block wx:elif="{{is_do}}">
127 - <view class="no-data" > 115 + <view class="no-data">
128 <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> 116 <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image>
129 <view class="no-data-title">商家暂未设置分类</view> 117 <view class="no-data-title">商家暂未设置分类</view>
130 <navigator class="lookat" url="/pages/index/index/index">去逛逛</navigator> 118 <navigator class="lookat" url="/pages/index/index/index">去逛逛</navigator>
131 - </view> 119 + </view>
132 </block> 120 </block>
133 </block> 121 </block>
134 <!-- 风格2 --> 122 <!-- 风格2 -->
135 <block wx:elif="{{is_used_share == 1}}"> 123 <block wx:elif="{{is_used_share == 1}}">
136 - <block wx:if="{{is_show_pl || is_show_gb || is_show_pp || is_show_xm}}">  
137 - <!-- 新版分类头部 -->  
138 - <view class="xc-search-box flex jc_sb ai-center" style="position:fixed;top:0;z-index:99">  
139 - <!-- <view class="xc-search-inner "> 124 + <block wx:if="{{is_show_pl || is_show_gb || is_show_pp || is_show_xm}}">
  125 + <!-- 新版分类头部 -->
  126 + <view class="xc-search-box flex jc_sb ai-center" style="position:fixed;top:0;z-index:99">
  127 + <!-- <view class="xc-search-inner ">
140 <view class="search-img left"> 128 <view class="search-img left">
141 <image class="wh100" src="{{iurl}}/miniapp/images/search.png"></image> 129 <image class="wh100" src="{{iurl}}/miniapp/images/search.png"></image>
142 </view> 130 </view>
143 <input bindfocus="goseach" class="search-cont" placeholder="搜索店铺商品" type="text"></input> 131 <input bindfocus="goseach" class="search-cont" placeholder="搜索店铺商品" type="text"></input>
144 </view> --> 132 </view> -->
145 - <!-- 搜索框 -->  
146 - <view class="search-container f1">  
147 - <view bindtap="goseach"><text class="iconfont icon-sousuo pdr10"></text>搜索店铺商品</view>  
148 - </view>  
149 - <view class="pdl30" bindtap="getScancode" >  
150 - <image class="scanning_black-img"src="{{iurl}}/miniapp/images/goodscategory/scanning_black.png"></image>  
151 - <!-- <view class="fs24">扫一扫</view> -->  
152 - </view>  
153 -  
154 - </view>  
155 -  
156 -  
157 - <!-- 分类项目内容 22 -->  
158 - <view class="flex project_height" style="height:100%;box-sizing:border-box;padding-bottom:100rpx;padding-top:108rpx;" id="two_type">  
159 - <!-- 分类项目的类型 -->  
160 - <view class="project_type" style="background-color:#f4f4f4;overflow-y:auto;position:fixed;left:0;z-index:99;top:108rpx;">  
161 - <view class="project_type-frame" style="margin-bottom:120rpx;">  
162 - <view wx:if="{{is_show_gb}}" class="{{status_show == 1?'':''}}">  
163 - <!-- <view style="{{status_show == 1?'position: absolute;height: 52rpx;width: 6rpx;background-color: red;left: 0; margin-top: 24rpx;':''}}"></view> -->  
164 - <view bindtap="click_classify" style="{{status_show == 1?'margin-top:0':'margin-top:40rpx'}}" class="fs30 {{select_classify_on==223?'select_classify':''}}" data-index="223" data-name="国家" wx:if="{{is_country}}">  
165 -  
166 - <!-- <view class="tab-bar-item sort-name ellipsis-1" style="letter-spacing:50rpx;">国家</view> -->  
167 - <view class="tab-bar-item sort-name ellipsis-1" style="">国家</view>  
168 -  
169 - </view>  
170 - </view>  
171 -  
172 - <view wx:if="{{is_show_pp}}">  
173 - <!-- <view style="{{status_show == 2?'position: absolute;height: 52rpx;width: 6rpx;background-color: red;left: 0; margin-top: 24rpx;':''}}"></view> -->  
174 - <view bindtap="click_classify" class="{{select_classify_on==220?'select_classify':''}} fs30" wx:if="{{is_brand}}" data-index="220" data-name="品牌">  
175 -  
176 - <!-- <view class="tab-bar-item sort-name ellipsis-1" style="letter-spacing:50rpx;">品牌</view> -->  
177 - <view class="tab-bar-item sort-name ellipsis-1" style="">品牌</view>  
178 - </view> 133 + <!-- 搜索框 -->
  134 + <view class="search-container f1">
  135 + <view bindtap="goseach"><text class="iconfont icon-sousuo pdr10"></text>搜索店铺商品</view>
  136 + </view>
  137 + <view class="pdl30" bindtap="getScancode">
  138 + <image class="scanning_black-img" src="{{iurl}}/miniapp/images/goodscategory/scanning_black.png"></image>
  139 + <!-- <view class="fs24">扫一扫</view> -->
  140 + </view>
  141 +
  142 + </view>
  143 +
  144 +
  145 + <!-- 分类项目内容 22 -->
  146 + <view class="flex project_height" style="height:100%;box-sizing:border-box;padding-bottom:100rpx;padding-top:108rpx;" id="two_type">
  147 + <!-- 分类项目的类型 -->
  148 + <view class="project_type" style="background-color:#f4f4f4;overflow-y:auto;position:fixed;left:0;z-index:99;top:108rpx;">
  149 + <view class="project_type-frame" style="margin-bottom:120rpx;">
  150 + <view wx:if="{{is_show_gb}}" class="{{status_show == 1?'':''}}">
  151 + <!-- <view style="{{status_show == 1?'position: absolute;height: 52rpx;width: 6rpx;background-color: red;left: 0; margin-top: 24rpx;':''}}"></view> -->
  152 + <view bindtap="click_classify" style="{{status_show == 1?'margin-top:0':'margin-top:40rpx'}}" class="fs30 {{select_classify_on==223?'select_classify':''}}" data-index="223" data-name="国家" wx:if="{{is_country}}">
  153 +
  154 + <!-- <view class="tab-bar-item sort-name ellipsis-1" style="letter-spacing:50rpx;">国家</view> -->
  155 + <view class="tab-bar-item sort-name ellipsis-1" style="">国家</view>
  156 +
  157 + </view>
  158 + </view>
  159 +
  160 + <view wx:if="{{is_show_pp}}">
  161 + <!-- <view style="{{status_show == 2?'position: absolute;height: 52rpx;width: 6rpx;background-color: red;left: 0; margin-top: 24rpx;':''}}"></view> -->
  162 + <view bindtap="click_classify" class="{{select_classify_on==220?'select_classify':''}} fs30" wx:if="{{is_brand}}" data-index="220" data-name="品牌">
  163 +
  164 + <!-- <view class="tab-bar-item sort-name ellipsis-1" style="letter-spacing:50rpx;">品牌</view> -->
  165 + <view class="tab-bar-item sort-name ellipsis-1" style="">品牌</view>
  166 + </view>
  167 + </view>
  168 +
  169 + <!-- 项目 -->
  170 + <view wx:if="{{is_show_xm}}">
  171 + <view bindtap="click_classify" class="fs30 {{select_classify_on==221?'select_classify':''}}" data-index="221" data-name="项目">
  172 + <view class="tab-bar-item sort-name ellipsis-1">项目</view>
  173 + </view>
  174 + </view>
  175 +
  176 +
  177 + <!-- 品类 -->
  178 + <view wx:if="{{is_show_pl}}">
  179 + <view wx:for="{{one_level_classify}}" wx:for-item="ittms">
  180 + <view class="{{ittms.items.is_show_class == true?'is_show_class':''}}">
  181 + <!-- 添加左边红色条 -->
  182 + <!-- <view style="{{ittms.items.is_show_class == true?'position: absolute;height: 52rpx;width: 6rpx;background-color: red;left: 0; margin-top: 24rpx;':''}}"></view> -->
  183 + <view bindtap="click_classify" data-arr="{{ittms.array}}" data-cid="{{ittms.items.id}}" data-pid="0" class="{{select_classify_on==index?'select_classify width80':''}} fs30 t-c {{select_classify_on==index&&ittms.items.name.length==2?'':''}} {{select_classify_on==index&&ittms.items.name.length==3?'':''}}" data-index="{{index}}" data-name="{{ittms.items.mobile_name}}">
  184 + <view class="tab-bar-item sort-name ellipsis-1">{{ittms.items.name}}</view>
  185 + </view>
179 </view> 186 </view>
180 -  
181 - <!-- 项目 -->  
182 - <view wx:if="{{is_show_xm}}">  
183 - <view bindtap="click_classify" class="fs30 {{select_classify_on==221?'select_classify':''}}" data-index="221" data-name="项目">  
184 - <view class="tab-bar-item sort-name ellipsis-1">项目</view>  
185 - </view>  
186 - </view>  
187 -  
188 -  
189 - <!-- 品类 -->  
190 - <view wx:if="{{is_show_pl}}">  
191 - <view wx:for="{{one_level_classify}}" wx:for-item="ittms">  
192 - <view class="{{ittms.items.is_show_class == true?'is_show_class':''}}">  
193 - <!-- 添加左边红色条 -->  
194 - <!-- <view style="{{ittms.items.is_show_class == true?'position: absolute;height: 52rpx;width: 6rpx;background-color: red;left: 0; margin-top: 24rpx;':''}}"></view> -->  
195 - <view bindtap="click_classify" data-arr="{{ittms.array}}" data-cid="{{ittms.items.id}}" data-pid="0" class="{{select_classify_on==index?'select_classify width80':''}} fs30 t-c {{select_classify_on==index&&ittms.items.name.length==2?'':''}} {{select_classify_on==index&&ittms.items.name.length==3?'':''}}" data-index="{{index}}" data-name="{{ittms.items.mobile_name}}">  
196 - <view class="tab-bar-item sort-name ellipsis-1">{{ittms.items.name}}</view>  
197 - </view>  
198 - </view>  
199 - </view>  
200 - </view>  
201 - 187 + </view>
202 </view> 188 </view>
203 189
204 </view> 190 </view>
205 - <!-- 分类项目的内容 -->  
206 - <view class="classify_content" style="padding-left:196rpx;"> 191 +
  192 + </view>
  193 + <!-- 分类项目的内容 -->
  194 + <view class="classify_content" style="padding-left:196rpx;">
207 <!-- 国家的样式 --> 195 <!-- 国家的样式 -->
208 <block wx:if="{{select_classify_on==223&&is_show_gb}}"> 196 <block wx:if="{{select_classify_on==223&&is_show_gb}}">
209 - <view class="classify_name fs28 flex-space-between">  
210 - <view>{{ishaf_three==1?good_list.name:classify_name}}</view> 197 + <view class="classify_name fs28 flex-space-between">
  198 + <view>{{ishaf_three==1?good_list.name:classify_name}}</view>
211 199
212 - </view>  
213 - <view class=" classify_content-frame flex-space-between " >  
214 - <view bindtap="go_nation" class="country_img-frame rel outer_location"wx:for="{{nationlist}}" wx:for-item="bitem" wx:for-index="pidx" data-nid="{{bitem.id}}" >  
215 - <image wx:if="{{bitem.imgtype==1}}" class="country_img" src="{{bitem.logo}}"></image>  
216 - <image wx:else class="country_img" src="{{iurl}}{{bitem.logo}}"></image>  
217 -  
218 - <view class='nation_box abs box'>  
219 - <view class='nt_1 t-c line-height' style="height:50rpx">  
220 - <text class="nation_z_name ellipsis-1 nt_1_t height fs24">{{bitem.name}}</text>  
221 - </view>  
222 - <view class='nt_2 t-c line-height fs24' style="line-height: 50rpx">  
223 - <text class="nation_y_name ellipsis-1 nt_1_t height fs24">{{bitem.enname}}</text>  
224 - </view>  
225 - </view>  
226 - <!--<view class='nation_box abs box' style="top:20rpx">-->  
227 - <!--</view>-->  
228 - </view>  
229 - </view> 200 + </view>
  201 + <view class=" classify_content-frame flex-space-between ">
  202 + <view bindtap="go_nation" class="country_img-frame rel outer_location" wx:for="{{nationlist}}" wx:for-item="bitem" wx:for-index="pidx" data-nid="{{bitem.id}}">
  203 + <image wx:if="{{bitem.imgtype==1}}" class="country_img" src="{{bitem.logo}}"></image>
  204 + <image wx:else class="country_img" src="{{iurl}}{{bitem.logo}}"></image>
  205 +
  206 + <view class='nation_box abs box'>
  207 + <view class='nt_1 t-c line-height' style="height:50rpx">
  208 + <text class="nation_z_name ellipsis-1 nt_1_t height fs24">{{bitem.name}}</text>
  209 + </view>
  210 + <view class='nt_2 t-c line-height fs24' style="line-height: 50rpx">
  211 + <text class="nation_y_name ellipsis-1 nt_1_t height fs24">{{bitem.enname}}</text>
  212 + </view>
  213 + </view>
  214 + <!--<view class='nation_box abs box' style="top:20rpx">-->
  215 + <!--</view>-->
  216 + </view>
  217 + </view>
230 </block> 218 </block>
231 <!-- 品牌 --> 219 <!-- 品牌 -->
232 -<!-- <block wx:if="{{select_classify_on==220&&is_show_pp}}"> 220 + <!-- <block wx:if="{{select_classify_on==220&&is_show_pp}}">
233 221
234 <view class="classify_name fs28 flex-space-between"> 222 <view class="classify_name fs28 flex-space-between">
235 <view>{{classify_name}}</view> 223 <view>{{classify_name}}</view>
@@ -250,136 +238,134 @@ @@ -250,136 +238,134 @@
250 </block> 238 </block>
251 </view> 239 </view>
252 </block> --> 240 </block> -->
253 - <block wx:if="{{select_classify_on==220&&is_show_pp}}">  
254 - <scroll-view scroll-y="true" class="fenlei-list"  
255 - style="height: 100%;padding-bottom:100rpx;" scroll-into-view="{{scrollIntoView}}">  
256 - <view class="classify_name fs28 flex-space-between">  
257 - <view>{{classify_name}}</view>  
258 - </view>  
259 - <block wx:for="{{groups}}" wx:for-item="brand_list" wx:for-index="pidx">  
260 - <view id="{{brand_list.zm}}" class="group-name">{{brand_list.zm}}</view>  
261 - <view class="classify_content-frame flex flex-wrap">  
262 - <view class="brand_img_frame "wx:for="{{brand_list.array}}" wx:for-item="user" wx:for-index="idx" bindtap="go_brand" data-bid="{{user.id}}" >  
263 - <view class="t-c">  
264 - <image class="brand_img" src="{{user.logo}}" data-pix="{{pidx}}" data-idx="{{idx}}" data-errorimg="groups[{{pidx}}].array[{{idx}}].logo" binderror="bind_bnerr_pp"></image>  
265 - <view class="brand_img_name ellipsis-1 fs24">{{user.name}}2</view>  
266 - </view>  
267 - </view>  
268 - </view>  
269 - </block>  
270 - </scroll-view>  
271 - <view class="nav box box-tb my-nav" style="top:140rpx;" catchtouchmove="touchmove" catchtouchend="touchend" >  
272 - <view class="iconfont icon-shangjiantou"></view>  
273 - <view bindtap="tabLetter" data-index="{{item.zm}}" wx:for="{{groups}}"  
274 - class="flex box box-align-center box-pack-center letter">  
275 - <text class="letter-text {{selected == item.zm ? 'letter-actived' : ''}}" wx:if="{{item.zm}}">{{item.zm}}</text>  
276 - </view>  
277 - </view>  
278 - </block>  
279 -  
280 -  
281 -  
282 -  
283 - <!-- 卡项 -->  
284 - <!-- <block wx:if="{{select_classify_on==220&&is_show_xm}}"> -->  
285 - <block wx:if="{{select_classify_on==221&&is_show_xm}}">  
286 - <block wx:if="{{xmlist && xmlist.length != 0}}">  
287 - <view class="classify_name fs28 flex-space-between">  
288 - <view>{{classify_name}}</view>  
289 - </view>  
290 -  
291 - <view class="classify_content-frame flex flex-wrap" style="padding-bottom: 130rpx;">  
292 - <block wx:for="{{xmlist}}">  
293 - <view class="brand_img_frame" bindtap="goServiceCategoryList" data-cid="{{item.id}}" >  
294 - <view class="t-c">  
295 - <image wx:if="{{item.ico}}" class="brand_img" src="{{item.ico}}" mode="heightFix"></image>  
296 - <image wx:else class="brand_img" src="{{iurl + '/miniapp/images/no_cate_def.png'}}" mode="heightFix"></image>  
297 - <view class="brand_img_name ellipsis-1 fs24">{{item.name}}</view>  
298 - </view>  
299 - </view>  
300 - </block>  
301 - </view>  
302 - </block>  
303 -  
304 - <view wx:else class="t-c fs28 c-9 pdt50">暂无项目</view>  
305 - </block>  
306 -  
307 - <!-- 品类-->  
308 - <block wx:if="{{is_show_pl&&select_classify_on!=221&&select_classify_on!=220&&select_classify_on!=223}}">  
309 - <block wx:if="{{select_classify_on!=221&&select_classify_on!=220&&select_classify_on!=223&&is_level_three!=1}}">  
310 - <!-- <block wx:if="{{select_classify_on == 0&&is_level_three!=1}}"> -->  
311 - <view class="my-container">  
312 - <view class="classify_name fs28 flex-space-between ai-center" data-pid="0" data-cid="{{cat_id}}" bindtap='select_more'>  
313 - <view class="classify_title ellipsis-1">{{classify_name}}</view>  
314 - <view class="flex select_more ai-center" >  
315 - <view class="red-co fs24" >更多</view>  
316 - <view class="bg_right width_height" style="margin-top: 0;"></view> 241 + <block wx:if="{{select_classify_on==220&&is_show_pp}}">
  242 + <scroll-view scroll-y="true" class="fenlei-list" style="height: 100%;padding-bottom:100rpx;" scroll-into-view="{{scrollIntoView}}">
  243 + <view class="classify_name fs28 flex-space-between">
  244 + <view>{{classify_name}}</view>
  245 + </view>
  246 + <block wx:for="{{groups}}" wx:for-item="brand_list" wx:for-index="pidx">
  247 + <view id="{{brand_list.zm}}" class="group-name">{{brand_list.zm}}</view>
  248 + <view class="classify_content-frame flex flex-wrap">
  249 + <view class="brand_img_frame " wx:for="{{brand_list.array}}" wx:for-item="user" wx:for-index="idx" bindtap="go_brand" data-bid="{{user.id}}">
  250 + <view class="t-c">
  251 + <image class="brand_img" src="{{user.logo}}" data-pix="{{pidx}}" data-idx="{{idx}}" data-errorimg="groups[{{pidx}}].array[{{idx}}].logo" binderror="bind_bnerr_pp"></image>
  252 + <view class="brand_img_name ellipsis-1 fs24">{{user.name}}</view>
  253 + </view>
  254 + </view>
317 </view> 255 </view>
  256 + </block>
  257 + </scroll-view>
  258 + <view class="nav box box-tb my-nav" style="top:140rpx;" catchtouchmove="touchmove" catchtouchend="touchend">
  259 + <view class="iconfont icon-shangjiantou"></view>
  260 + <view bindtap="tabLetter" data-index="{{item.zm}}" wx:for="{{groups}}" class="flex box box-align-center box-pack-center letter">
  261 + <text class="letter-text {{selected == item.zm ? 'letter-actived' : ''}}" wx:if="{{item.zm}}">{{item.zm}}</text>
318 </view> 262 </view>
319 - <!-- 显示2级列表 -->  
320 - <view class="classify_content-frame flex-wrap">  
321 - <block wx:if="{{goodslist && goodslist.length>0}}">  
322 - <block wx:for="{{goodslist}}" wx:for-item="goods" wx:for-index="indx">  
323 - <view class="type_img_frame t-c ib" data-cid="{{goods.items.id}}" data-pid="{{goods.items.parent_id}}" bindtap="go_cate">  
324 - <image class=" type_img" src="{{goods.items.icoimg==null||goods.items.icoimg==''?iurl+'/miniapp/images/no_cate_def.png':goods.items.icoimg}}" binderror="goods_bnerr" data-err="goodslist[{{index}}].logo"></image>  
325 - <view class="brand_img_name fs24 ellipsis-1 pdh10">{{goods.items.name}}</view>  
326 - </view>  
327 - </block>  
328 - </block>  
329 - <block wx:else>  
330 - <view class="no_child_lev fs28">该类别无子级</view>  
331 - </block>  
332 - </view> 263 + </view>
  264 + </block>
  265 +
  266 +
333 267
  268 +
  269 + <!-- 卡项 -->
  270 + <!-- <block wx:if="{{select_classify_on==220&&is_show_xm}}"> -->
  271 + <block wx:if="{{select_classify_on==221&&is_show_xm}}">
  272 + <block wx:if="{{xmlist && xmlist.length != 0}}">
  273 + <view class="classify_name fs28 flex-space-between">
  274 + <view>{{classify_name}}</view>
334 </view> 275 </view>
  276 +
  277 + <view class="classify_content-frame flex flex-wrap" style="padding-bottom: 130rpx;">
  278 + <block wx:for="{{xmlist}}">
  279 + <view class="brand_img_frame" bindtap="goServiceCategoryList" data-cid="{{item.id}}">
  280 + <view class="t-c">
  281 + <image wx:if="{{item.ico}}" class="brand_img" src="{{item.ico}}" mode="heightFix"></image>
  282 + <image wx:else class="brand_img" src="{{iurl + '/miniapp/images/no_cate_def.png'}}" mode="heightFix"></image>
  283 + <view class="brand_img_name ellipsis-1 fs24">{{item.name}}</view>
  284 + </view>
  285 + </view>
  286 + </block>
  287 + </view>
  288 + </block>
  289 +
  290 + <view wx:else class="t-c fs28 c-9 pdt50">暂无项目</view>
335 </block> 291 </block>
336 292
337 - <!-- 商品 含有3级的-->  
338 - <block wx:if="{{select_classify_on!=220&&select_classify_on!=221&&select_classify_on!=223&&is_level_three==1}}">  
339 - <block wx:for="{{goodslist}}" wx:for-item="goods" wx:for-index="inds">  
340 - <view> 293 + <!-- 品类-->
  294 + <block wx:if="{{is_show_pl&&select_classify_on!=221&&select_classify_on!=220&&select_classify_on!=223}}">
  295 + <block wx:if="{{select_classify_on!=221&&select_classify_on!=220&&select_classify_on!=223&&is_level_three!=1}}">
  296 + <!-- <block wx:if="{{select_classify_on == 0&&is_level_three!=1}}"> -->
  297 + <view class="my-container">
  298 + <view class="classify_name fs28 flex-space-between ai-center" data-pid="0" data-cid="{{cat_id}}" bindtap='select_more'>
  299 + <view class="classify_title ellipsis-1">{{classify_name}}</view>
  300 + <view class="flex select_more ai-center">
  301 + <view class="red-co fs24">更多</view>
  302 + <view class="bg_right width_height" style="margin-top: 0;"></view>
  303 + </view>
  304 + </view>
  305 + <!-- 显示2级列表 -->
  306 + <view class="classify_content-frame flex-wrap">
  307 + <block wx:if="{{goodslist && goodslist.length>0}}">
  308 + <block wx:for="{{goodslist}}" wx:for-item="goods" wx:for-index="indx">
  309 + <view class="type_img_frame t-c ib" data-cid="{{goods.items.id}}" data-pid="{{goods.items.parent_id}}" bindtap="go_cate">
  310 + <image class=" type_img" src="{{goods.items.icoimg==null||goods.items.icoimg==''?iurl+'/miniapp/images/no_cate_def.png':goods.items.icoimg}}" binderror="goods_bnerr" data-err="goodslist[{{index}}].logo"></image>
  311 + <view class="brand_img_name fs24 ellipsis-1 pdh10">{{goods.items.name}}</view>
  312 + </view>
  313 + </block>
  314 + </block>
  315 + <block wx:else>
  316 + <view class="no_child_lev fs28">该类别无子级</view>
  317 + </block>
  318 + </view>
  319 +
  320 + </view>
  321 + </block>
341 322
342 - <view class="classify_name fs28 flex-space-between ai-center"data-pid="{{goods.items.parent_id}}" data-cid="{{goods.items.id}}" bindtap='select_more'> 323 + <!-- 商品 含有3级的-->
  324 + <block wx:if="{{select_classify_on!=220&&select_classify_on!=221&&select_classify_on!=223&&is_level_three==1}}">
  325 + <block wx:for="{{goodslist}}" wx:for-item="goods" wx:for-index="inds">
  326 + <view>
343 327
344 - <view class="classify_title ellipsis-1">{{goods.items.name}}</view>  
345 - <view class="flex select_more ai-center" >  
346 - <view class="red-co fs24" >更多</view> 328 + <view class="classify_name fs28 flex-space-between ai-center" data-pid="{{goods.items.parent_id}}" data-cid="{{goods.items.id}}" bindtap='select_more'>
  329 +
  330 + <view class="classify_title ellipsis-1">{{goods.items.name}}</view>
  331 + <view class="flex select_more ai-center">
  332 + <view class="red-co fs24">更多</view>
347 <view class="bg_right width_height" style="margin-top: 0;"></view> 333 <view class="bg_right width_height" style="margin-top: 0;"></view>
348 - </view>  
349 - </view> 334 + </view>
  335 + </view>
350 336
351 - <block wx:if="{{goods.arrays.length>0}}">  
352 - <view class="classify_content-frame flex-wrap">  
353 - <view class="type_img_frame t-c ib" data-cid="{{item.id}}" data-pid="three" wx:for="{{goods.arrays}}" wx:for-index="index" wx:for-item="item" bindtap="go_cate">  
354 - <image class=" type_img"src="{{item.icoimg==null||item.icoimg==''?iurl+'/miniapp/images/no_cate_def.png':item.icoimg}}"binderror="goods_bnerr" data-err="goodslist[{{index}}].logo"></image>  
355 - <view class="brand_img_name fs24 ellipsis-1 pdh10">{{item.name}}</view>  
356 - </view>  
357 - </view>  
358 - <!-- <view class="divider_line"></view> -->  
359 - </block> 337 + <block wx:if="{{goods.arrays.length>0}}">
  338 + <view class="classify_content-frame flex-wrap">
  339 + <view class="type_img_frame t-c ib" data-cid="{{item.id}}" data-pid="three" wx:for="{{goods.arrays}}" wx:for-index="index" wx:for-item="item" bindtap="go_cate">
  340 + <image class=" type_img" src="{{item.icoimg==null||item.icoimg==''?iurl+'/miniapp/images/no_cate_def.png':item.icoimg}}" binderror="goods_bnerr" data-err="goodslist[{{index}}].logo"></image>
  341 + <view class="brand_img_name fs24 ellipsis-1 pdh10">{{item.name}}</view>
  342 + </view>
  343 + </view>
  344 + <!-- <view class="divider_line"></view> -->
  345 + </block>
360 346
361 - </view>  
362 - </block>  
363 - </block> 347 + </view>
  348 + </block>
  349 + </block>
364 </block> 350 </block>
365 - </view>  
366 - </view>  
367 - </block>  
368 - <block wx:elif="{{is_do}}">  
369 - <view class="no-data" >  
370 - <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image>  
371 - <view class="no-data-title">商家暂未设置分类</view>  
372 - <navigator class="lookat" url="/pages/index/index/index">去逛逛</navigator>  
373 - </view>  
374 - </block> 351 + </view>
  352 + </view>
  353 + </block>
  354 + <block wx:elif="{{is_do}}">
  355 + <view class="no-data">
  356 + <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image>
  357 + <view class="no-data-title">商家暂未设置分类</view>
  358 + <navigator class="lookat" url="/pages/index/index/index">去逛逛</navigator>
  359 + </view>
  360 + </block>
375 361
376 </block> 362 </block>
377 <!-- 风格3 --> 363 <!-- 风格3 -->
378 <block wx:elif="{{is_used_share == 2}}"> 364 <block wx:elif="{{is_used_share == 2}}">
379 - <block wx:if="{{is_show_pl || is_show_gb || is_show_pp || is_show_xm}}">  
380 - <!-- 头部 -->  
381 - <view class="xc-search-box flex-center white_b" id="navbar" style="position:fixed;top:0;z-index:99">  
382 - <!-- <view class="share-height t-c" bindtap="getScancode" > 365 + <block wx:if="{{is_show_pl || is_show_gb || is_show_pp || is_show_xm}}">
  366 + <!-- 头部 -->
  367 + <view class="xc-search-box flex-center white_b" id="navbar" style="position:fixed;top:0;z-index:99">
  368 + <!-- <view class="share-height t-c" bindtap="getScancode" >
383 <image class="scanning_black-img"src="{{iurl}}/miniapp/images/goodscategory/scanning_black.png"></image> 369 <image class="scanning_black-img"src="{{iurl}}/miniapp/images/goodscategory/scanning_black.png"></image>
384 <view class="fs24"> 370 <view class="fs24">
385 扫一扫 371 扫一扫
@@ -391,50 +377,50 @@ @@ -391,50 +377,50 @@
391 </view> 377 </view>
392 <input bindfocus="goseach" class="search-cont" placeholder="请输入您所搜索的商品" type="text"></input> 378 <input bindfocus="goseach" class="search-cont" placeholder="请输入您所搜索的商品" type="text"></input>
393 </view> --> 379 </view> -->
394 -  
395 - <!-- 搜索框 -->  
396 - <view class="search-container f1">  
397 - <view bindtap="goseach"><text class="iconfont icon-sousuo pdr10"></text>搜索店铺商品</view>  
398 - </view>  
399 - <view class="pdl30" bindtap="getScancode" >  
400 - <image class="scanning_black-img"src="{{iurl}}/miniapp/images/goodscategory/scanning_black.png"></image>  
401 - <!-- <view class="fs24">扫一扫</view> -->  
402 - </view> 380 +
  381 + <!-- 搜索框 -->
  382 + <view class="search-container f1">
  383 + <view bindtap="goseach"><text class="iconfont icon-sousuo pdr10"></text>搜索店铺商品</view>
403 </view> 384 </view>
404 - <!-- /头部 -->  
405 - <!-- 分类项目内容 -->  
406 - <view class="flex project_height" style="">  
407 - <!-- 分类项目的类型 -->  
408 - <view class="project_type" style="background-color:#f4f4f4;overflow-y:auto;position:fixed;left:0;z-index:99;top:108rpx;" id="thress_type3">  
409 - <view class="project_type-frame" style="margin-bottom:120rpx;">  
410 - <view wx:if="{{is_show_gb}}">  
411 - <view bindtap="click_classify" class="tab-bar-item {{select_classify_on==223 ? 'active' : ''}}" data-index="223" data-name="国家" wx:if="{{is_country}}" data-current="223">  
412 - <text style="">国家</text>  
413 - </view>  
414 - </view>  
415 -  
416 - <view wx:if="{{is_show_pp}}">  
417 - <view bindtap="click_classify" class="tab-bar-item {{select_classify_on==220 ? 'active' : ''}}" wx:if="{{is_brand}}" data-index="220" data-name="品牌" data-current="220">  
418 - <text style="">品牌</text>  
419 - </view>  
420 - </view>  
421 -  
422 -  
423 - <!-- 卡项 -->  
424 - <view wx:if="{{is_show_xm}}">  
425 - <view bindtap="click_classify" class="tab-bar-item {{select_classify_on == 221 ? 'active' : ''}}" data-index="221" data-name="项目" data-current="221">  
426 - <text>项目</text>  
427 - </view>  
428 - </view>  
429 -  
430 -  
431 -  
432 - <view wx:if="{{is_show_pl}}">  
433 - <!-- <view wx:for="{{one_level_classify}}" wx:for-item="ittms" class="class_set_height"> -->  
434 - <!-- <view class="{{ittms.items.is_show_class == true?'is_show_class':''}}"> -->  
435 - <!-- 添加左边红色条 -->  
436 - <!-- <view style="{{ittms.items.is_show_class == true?'position: absolute;height: 52rpx;width: 6rpx;background-color: red;left: 0; margin-top: 24rpx;':''}}"></view> -->  
437 - <!-- <view bindtap="click_classify" style="{{status_show == 0 && ittms == 0 ?'margin-top:0':'margin-top:0rpx'}}" data-arr="{{ittms.array}}" data-cid="{{ittms.items.id}}" data-pid="0" class="{{select_classify_on==index?'select_classify width80':''}} share_type fs30 t-c {{ittms.items.name.length==2? 'world_sn':''}} {{select_classify_on==index&&ittms.items.name.length==2?'text-indent':''}} {{select_classify_on==index&&ittms.items.name.length==3?'text3':''}}"data-index="{{index}}"data-name="{{ittms.items.mobile_name}}"> 385 + <view class="pdl30" bindtap="getScancode">
  386 + <image class="scanning_black-img" src="{{iurl}}/miniapp/images/goodscategory/scanning_black.png"></image>
  387 + <!-- <view class="fs24">扫一扫</view> -->
  388 + </view>
  389 + </view>
  390 + <!-- /头部 -->
  391 + <!-- 分类项目内容 -->
  392 + <view class="flex project_height" style="">
  393 + <!-- 分类项目的类型 -->
  394 + <view class="project_type" style="background-color:#f4f4f4;overflow-y:auto;position:fixed;left:0;z-index:99;top:108rpx;" id="thress_type3">
  395 + <view class="project_type-frame" style="margin-bottom:120rpx;">
  396 + <view wx:if="{{is_show_gb}}">
  397 + <view bindtap="click_classify" class="tab-bar-item {{select_classify_on==223 ? 'active' : ''}}" data-index="223" data-name="国家" wx:if="{{is_country}}" data-current="223">
  398 + <text style="">国家</text>
  399 + </view>
  400 + </view>
  401 +
  402 + <view wx:if="{{is_show_pp}}">
  403 + <view bindtap="click_classify" class="tab-bar-item {{select_classify_on==220 ? 'active' : ''}}" wx:if="{{is_brand}}" data-index="220" data-name="品牌" data-current="220">
  404 + <text style="">品牌</text>
  405 + </view>
  406 + </view>
  407 +
  408 +
  409 + <!-- 卡项 -->
  410 + <view wx:if="{{is_show_xm}}">
  411 + <view bindtap="click_classify" class="tab-bar-item {{select_classify_on == 221 ? 'active' : ''}}" data-index="221" data-name="项目" data-current="221">
  412 + <text>项目</text>
  413 + </view>
  414 + </view>
  415 +
  416 +
  417 +
  418 + <view wx:if="{{is_show_pl}}">
  419 + <!-- <view wx:for="{{one_level_classify}}" wx:for-item="ittms" class="class_set_height"> -->
  420 + <!-- <view class="{{ittms.items.is_show_class == true?'is_show_class':''}}"> -->
  421 + <!-- 添加左边红色条 -->
  422 + <!-- <view style="{{ittms.items.is_show_class == true?'position: absolute;height: 52rpx;width: 6rpx;background-color: red;left: 0; margin-top: 24rpx;':''}}"></view> -->
  423 + <!-- <view bindtap="click_classify" style="{{status_show == 0 && ittms == 0 ?'margin-top:0':'margin-top:0rpx'}}" data-arr="{{ittms.array}}" data-cid="{{ittms.items.id}}" data-pid="0" class="{{select_classify_on==index?'select_classify width80':''}} share_type fs30 t-c {{ittms.items.name.length==2? 'world_sn':''}} {{select_classify_on==index&&ittms.items.name.length==2?'text-indent':''}} {{select_classify_on==index&&ittms.items.name.length==3?'text3':''}}"data-index="{{index}}"data-name="{{ittms.items.mobile_name}}">
438 <view class="{{ittms.items.name.length==3?'flex-center-around':'flex-space-between'}}" wx:if="{{ittms.items.name.length<4}}"> 424 <view class="{{ittms.items.name.length==3?'flex-center-around':'flex-space-between'}}" wx:if="{{ittms.items.name.length<4}}">
439 <view wx:for="{{ittms.items.name}}" wx:for-item="name"wx:for-index="index"> 425 <view wx:for="{{ittms.items.name}}" wx:for-item="name"wx:for-index="index">
440 <view> 426 <view>
@@ -444,11 +430,11 @@ @@ -444,11 +430,11 @@
444 </view> 430 </view>
445 <view wx:else class="sort-name ellipsis-1">{{ittms.items.name}}</view> 431 <view wx:else class="sort-name ellipsis-1">{{ittms.items.name}}</view>
446 </view> --> 432 </view> -->
447 - <!-- </view> -->  
448 - <scroll-view scroll-y scroll-with-animation class="tab-view" scroll-top="{{scrollTop}}" style="height:88%">  
449 - <view wx:for="{{one_level_classify}}" wx:for-item="ittms" wx:key="{{index}}" class="tab-bar-item {{select_classify_on==index ? 'active' : ''}}" data-current="{{index}}" catchtap="click_classify" data-arr="{{ittms.array}}" data-cid="{{ittms.items.id}}" data-pid="0" data-index="{{index}}"data-name="{{ittms.items.mobile_name}}">  
450 - <text>{{ittms.items.name}}</text>  
451 - <!-- <view class="{{ittms.items.name.length==3?'flex-center-around':'flex-space-between'}}" wx:if="{{ittms.items.name.length<4}}"> 433 + <!-- </view> -->
  434 + <scroll-view scroll-y scroll-with-animation class="tab-view" scroll-top="{{scrollTop}}" style="height:88%">
  435 + <view wx:for="{{one_level_classify}}" wx:for-item="ittms" wx:key="{{index}}" class="tab-bar-item {{select_classify_on==index ? 'active' : ''}}" data-current="{{index}}" catchtap="click_classify" data-arr="{{ittms.array}}" data-cid="{{ittms.items.id}}" data-pid="0" data-index="{{index}}" data-name="{{ittms.items.mobile_name}}">
  436 + <text>{{ittms.items.name}}</text>
  437 + <!-- <view class="{{ittms.items.name.length==3?'flex-center-around':'flex-space-between'}}" wx:if="{{ittms.items.name.length<4}}">
452 <view wx:for="{{ittms.items.name}}" wx:for-item="name"wx:for-index="index"> 438 <view wx:for="{{ittms.items.name}}" wx:for-item="name"wx:for-index="index">
453 <text> 439 <text>
454 {{name}} 440 {{name}}
@@ -456,45 +442,45 @@ @@ -456,45 +442,45 @@
456 </view> 442 </view>
457 </view> 443 </view>
458 <text wx:else class="sort-name ellipsis-1">{{ittms.items.name}}</text> --> 444 <text wx:else class="sort-name ellipsis-1">{{ittms.items.name}}</text> -->
459 - </view>  
460 - </scroll-view>  
461 -  
462 - <!-- </view> -->  
463 </view> 445 </view>
464 -  
465 -  
466 -  
467 - </view>  
468 - </view>  
469 - <!-- 分类项目的内容 -->  
470 - <view class="classify_content" style="padding-left:26%;padding-top:108rpx;box-sizing: border-box;"> 446 + </scroll-view>
  447 +
  448 + <!-- </view> -->
  449 + </view>
  450 +
  451 +
  452 +
  453 + </view>
  454 + </view>
  455 + <!-- 分类项目的内容 -->
  456 + <view class="classify_content" style="padding-left:26%;padding-top:108rpx;box-sizing: border-box;" bindtouchstart="bScroll" bindtouchend="btouMove">
471 <!-- 国家的样式 --> 457 <!-- 国家的样式 -->
472 <block wx:if="{{select_classify_on==223&&is_show_gb}}"> 458 <block wx:if="{{select_classify_on==223&&is_show_gb}}">
473 - <view class="classify_name fs28 flex-space-between">  
474 - <view>{{ishaf_three==1?good_list.name:classify_name}}</view> 459 + <view class="classify_name fs28 flex-space-between">
  460 + <view>{{ishaf_three==1?good_list.name:classify_name}}</view>
475 461
476 - </view>  
477 - <view class=" classify_content-frame flex-space-between " >  
478 - <view bindtap="go_nation" class="country_img-frame rel outer_location"wx:for="{{nationlist}}" wx:for-item="bitem" wx:for-index="pidx" data-nid="{{bitem.id}}" >  
479 - <image wx:if="{{bitem.imgtype==1}}" class="country_img" src="{{bitem.logo}}"></image>  
480 - <image wx:else class="country_img" src="{{iurl}}{{bitem.logo}}"></image>  
481 - <view class='nation_box abs box'>  
482 - <view class='nt_1 t-c line-height' style="height:50rpx">  
483 - <text class="nation_z_name ellipsis-1 nt_1_t height fs24">{{bitem.name}}</text>  
484 - </view>  
485 - <view class='nt_2 t-c line-height fs24' style="line-height: 50rpx">  
486 - <text class="nation_y_name ellipsis-1 nt_1_t height fs24">{{bitem.enname}}</text>  
487 - </view>  
488 - </view>  
489 - <!--<view class='nation_box abs box' style="top:20rpx">-->  
490 - <!--</view>-->  
491 - </view>  
492 - </view> 462 + </view>
  463 + <view class=" classify_content-frame flex-space-between ">
  464 + <view bindtap="go_nation" class="country_img-frame rel outer_location" wx:for="{{nationlist}}" wx:for-item="bitem" wx:for-index="pidx" data-nid="{{bitem.id}}">
  465 + <image wx:if="{{bitem.imgtype==1}}" class="country_img" src="{{bitem.logo}}"></image>
  466 + <image wx:else class="country_img" src="{{iurl}}{{bitem.logo}}"></image>
  467 + <view class='nation_box abs box'>
  468 + <view class='nt_1 t-c line-height' style="height:50rpx">
  469 + <text class="nation_z_name ellipsis-1 nt_1_t height fs24">{{bitem.name}}</text>
  470 + </view>
  471 + <view class='nt_2 t-c line-height fs24' style="line-height: 50rpx">
  472 + <text class="nation_y_name ellipsis-1 nt_1_t height fs24">{{bitem.enname}}</text>
  473 + </view>
  474 + </view>
  475 + <!--<view class='nation_box abs box' style="top:20rpx">-->
  476 + <!--</view>-->
  477 + </view>
  478 + </view>
493 </block> 479 </block>
494 -  
495 - 480 +
  481 +
496 <!-- 品牌 --> 482 <!-- 品牌 -->
497 -<!-- <block wx:if="{{select_classify_on==220&&is_show_pp}}"> 483 + <!-- <block wx:if="{{select_classify_on==220&&is_show_pp}}">
498 484
499 <view class="classify_name fs28 flex-space-between"> 485 <view class="classify_name fs28 flex-space-between">
500 <view>{{classify_name}}</view> 486 <view>{{classify_name}}</view>
@@ -513,236 +499,242 @@ @@ -513,236 +499,242 @@
513 </block> 499 </block>
514 </view> 500 </view>
515 </block> --> 501 </block> -->
516 -  
517 - <!-- 品牌 -->  
518 - <block wx:if="{{select_classify_on==220&&is_show_pp}}">  
519 - <scroll-view scroll-y="true" class="fenlei-list"  
520 - style="height: 100%;padding-bottom:100rpx;" scroll-into-view="{{scrollIntoView}}">  
521 - <view class="classify_name fs28 flex-space-between">  
522 - <view>{{classify_name}}</view>  
523 - </view>  
524 - <block wx:for="{{groups}}" wx:for-item="brand_list" wx:for-index="pidx">  
525 - <view id="{{brand_list.zm}}" class="group-name">{{brand_list.zm}}</view>  
526 - <view class="classify_content-frame flex flex-wrap">  
527 - <view class="brand_img_frame "wx:for="{{brand_list.array}}" wx:for-item="user" wx:for-index="idx" bindtap="go_brand" data-bid="{{user.id}}" >  
528 - <view class="t-c">  
529 - <image class="brand_img" src="{{user.logo}}" data-pix="{{pidx}}" data-idx="{{idx}}" data-errorimg="groups[{{pidx}}].array[{{idx}}].logo" binderror="bind_bnerr_pp"></image>  
530 - <view class="brand_img_name ellipsis-1 fs24">{{user.name}}</view>  
531 - </view>  
532 - </view>  
533 - </view>  
534 - </block>  
535 - </scroll-view>  
536 - <view class="nav box box-tb my-nav" style="top:140rpx;" catchtouchmove="touchmove" catchtouchend="touchend" >  
537 - <!-- <image src="/images/up.png" style="width:36rpx;height:36rpx;margin-right:10rpx;"></image> -->  
538 - <view class="iconfont icon-shangjiantou"></view>  
539 - <view bindtap="tabLetter" data-index="{{item.zm}}" wx:for="{{groups}}"  
540 - class="flex box box-align-center box-pack-center letter">  
541 - <text class="letter-text {{selected == item.zm ? 'letter-actived' : ''}}" wx:if="{{item.zm}}">{{item.zm}}</text>  
542 - </view>  
543 - </view>  
544 - </block>  
545 -  
546 -  
547 -  
548 -  
549 - <!-- 卡项 -->  
550 - <block wx:if="{{select_classify_on==221&&is_show_xm}}">  
551 - <block wx:if="{{xmlist && xmlist.length != 0}}">  
552 - <view class="classify_name fs28 flex-space-between">  
553 - <view>{{classify_name}}</view>  
554 - </view>  
555 -  
556 - <view class="classify_content-frame flex flex-wrap" style="padding-bottom: 130rpx;">  
557 - <block wx:for="{{xmlist}}">  
558 - <view class="brand_img_frame" bindtap="goServiceCategoryList" data-cid="{{item.id}}">  
559 - <view class="t-c">  
560 - <image wx:if="{{item.ico}}" class="brand_img" src="{{item.ico}}" mode="heightFix"></image>  
561 - <image wx:else class="brand_img" src="{{iurl + '/miniapp/images/no_cate_def.png'}}" mode="heightFix"></image>  
562 - <view class="brand_img_name ellipsis-1 fs24">{{item.name}}</view>  
563 - </view>  
564 - </view>  
565 - </block>  
566 - </view>  
567 - </block>  
568 -  
569 - <view wx:else class="t-c fs28 c-9 pdt50">暂无项目</view>  
570 -  
571 - </block>  
572 -  
573 - 502 +
  503 + <!-- 品牌 -->
  504 + <block wx:if="{{select_classify_on==220&&is_show_pp}}">
  505 + <scroll-view scroll-y="true" class="fenlei-list" style="height: 100%;padding-bottom:100rpx;" scroll-into-view="{{scrollIntoView}}">
  506 + <view class="classify_name fs28 flex-space-between">
  507 + <view>{{classify_name}}</view>
  508 + </view>
  509 + <block wx:for="{{groups}}" wx:for-item="brand_list" wx:for-index="pidx">
  510 + <view id="{{brand_list.zm}}" class="group-name">{{brand_list.zm}}</view>
  511 + <view class="classify_content-frame flex flex-wrap">
  512 + <view class="brand_img_frame " wx:for="{{brand_list.array}}" wx:for-item="user" wx:for-index="idx" bindtap="go_brand" data-bid="{{user.id}}">
  513 + <view class="t-c">
  514 + <image class="brand_img" src="{{user.logo}}" data-pix="{{pidx}}" data-idx="{{idx}}" data-errorimg="groups[{{pidx}}].array[{{idx}}].logo" binderror="bind_bnerr_pp"></image>
  515 + <view class="brand_img_name ellipsis-1 fs24">{{user.name}}</view>
  516 + </view>
  517 + </view>
  518 + </view>
  519 + </block>
  520 + </scroll-view>
  521 + <view class="nav box box-tb my-nav" style="top:140rpx;" catchtouchmove="touchmove" catchtouchend="touchend">
  522 + <!-- <image src="/images/up.png" style="width:36rpx;height:36rpx;margin-right:10rpx;"></image> -->
  523 + <view class="iconfont icon-shangjiantou"></view>
  524 + <view bindtap="tabLetter" data-index="{{item.zm}}" wx:for="{{groups}}" class="flex box box-align-center box-pack-center letter">
  525 + <text class="letter-text {{selected == item.zm ? 'letter-actived' : ''}}" wx:if="{{item.zm}}">{{item.zm}}</text>
  526 + </view>
  527 + </view>
  528 + </block>
  529 +
  530 +
  531 +
  532 +
  533 + <!-- 卡项 -->
  534 + <block wx:if="{{select_classify_on==221&&is_show_xm}}">
  535 + <block wx:if="{{xmlist && xmlist.length != 0}}">
  536 + <view class="classify_name fs28 flex-space-between">
  537 + <view>{{classify_name}}</view>
  538 + </view>
  539 +
  540 + <view class="classify_content-frame flex flex-wrap" style="padding-bottom: 130rpx;">
  541 + <block wx:for="{{xmlist}}">
  542 + <view class="brand_img_frame" bindtap="goServiceCategoryList" data-cid="{{item.id}}">
  543 + <view class="t-c">
  544 + <image wx:if="{{item.ico}}" class="brand_img" src="{{item.ico}}" mode="heightFix"></image>
  545 + <image wx:else class="brand_img" src="{{iurl + '/miniapp/images/no_cate_def.png'}}" mode="heightFix"></image>
  546 + <view class="brand_img_name ellipsis-1 fs24">{{item.name}}</view>
  547 + </view>
  548 + </view>
  549 + </block>
  550 + </view>
  551 + </block>
  552 +
  553 + <view wx:else class="t-c fs28 c-9 pdt50">暂无项目</view>
  554 +
  555 + </block>
  556 +
  557 +
574 <!-- 品类--> 558 <!-- 品类-->
575 - <!-- <block wx:if="{{select_classify_on==0&&is_show_pl}}"> -->  
576 - <block wx:if="{{is_show_pl&&select_classify_on!=220&&select_classify_on!=223&&select_classify_on!=221}}">  
577 - <!-- <block wx:if="{{select_classify_on!=220&&select_classify_on!=223}}"> --> 559 + <!-- <block wx:if="{{select_classify_on==0&&is_show_pl}}"> -->
  560 + <block wx:if="{{is_show_pl&&select_classify_on!=220&&select_classify_on!=223&&select_classify_on!=221}}" >
  561 + <!-- <block wx:if="{{select_classify_on!=220&&select_classify_on!=223}}"> -->
578 <block wx:if="{{select_classify_on!=220&&select_classify_on!=223&&select_classify_on!=221}}"> 562 <block wx:if="{{select_classify_on!=220&&select_classify_on!=223&&select_classify_on!=221}}">
579 - <view style="width:100%;height:100%;position: relative;">  
580 - <view class="classify_name fs28 flex ai-center flex-space-between" id="header" data-pid="0" data-cid="{{cat_id}}" bindtap='select_more' style="box-sizing:border-box;position:fixed;z-index: 999;width:74%;background-color:#ffffff;padding:0 20rpx;">  
581 - <view class="classify_title ellipsis-1">{{classify_name}}</view>  
582 - <view class="flex select_more ai-center" >  
583 - <view class="red-co fs24" >更多</view>  
584 - <view class="bg_right width_height" style="margin-top: 0;"></view>  
585 - </view> 563 + <view style="width:100%;height:100%;position: relative;">
  564 + <view class="classify_name fs28 flex ai-center flex-space-between" id="header" data-pid="0" data-cid="{{cat_id}}" bindtap='select_more' style="box-sizing:border-box;position:fixed;z-index: 999;width:74%;background-color:#ffffff;padding:0 20rpx;">
  565 + <view class="classify_title ellipsis-1">{{classify_name}}</view>
  566 + <view class="flex select_more ai-center">
  567 + <view class="red-co fs24">更多</view>
  568 + <view class="bg_right width_height" style="margin-top: 0;"></view>
586 </view> 569 </view>
587 - <!-- 显示商品列表开始 -->  
588 - <!-- <view class="classify_content-frame flex-wrap" style="width:100%;overflow:hidden;heigth:100%;"> -->  
589 -  
590 - <!-- <view class="null" style="width:100%;margin-top:70rpx;"></view> -->  
591 - <scroll-view scroll-y scroll-top="{{scrollTop}}" bindscrolltolower='scrollLower' style="height:{{windowHeight}};position:absolute;margin-top:70rpx;top:0;bottom:0;left:0;width:100%;"> 570 + </view>
  571 + <!-- 显示商品列表开始 -->
  572 + <!-- <view class="classify_content-frame flex-wrap" style="width:100%;overflow:hidden;heigth:100%;"> -->
  573 +
  574 + <!-- <view class="null" style="width:100%;margin-top:70rpx;"></view> -->
  575 + <scroll-view scroll-y scroll-top="{{scrollTop}}" bindscrolltolower='scrollLower' bindscrolltoupper='scrolltoupper' style="height:{{windowHeight}};position:absolute;margin-top:70rpx;top:0;bottom:0;left:0;width:100%;">
592 <view class="null" style="width:100%;height:1px;"></view> 576 <view class="null" style="width:100%;height:1px;"></view>
593 <!-- goodslist --> 577 <!-- goodslist -->
594 - <view class="choice_list" style="height:{{msgStatus != true?'100%':''}}">  
595 - <navigator class="choice_item" style="margin-bottom:{{dataLength -1 == index?'100px':'0'}}" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" wx:for="{{requestData}}" data-id="{{index}}" wx:key="{{index}}">  
596 - <view class="img-wrap">  
597 - <image src="{{url+item.original_img}}" binderror="bind_bnerr_t3" data-url="{{url+item.original_img}}" lazy-load="true" data-errorimg="requestData[{{index}}].original_img"></image> 578 + <view class="choice_list" style="height:{{msgStatus != true?'100%':''}}">
  579 +
  580 + <navigator class="choice_item" style="margin-bottom:{{dataLength -1 == index?'50px':'0'}}" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" wx:for="{{requestData}}" data-id="{{index}}" wx:key="{{index}}">
  581 + <view class="img-wrap">
  582 + <image src="{{url+item.original_img}}" binderror="bind_bnerr_t3" data-url="{{url+item.original_img}}" lazy-load="true" data-errorimg="requestData[{{index}}].original_img"></image>
  583 + </view>
  584 + <view class="item-cont">
  585 + <view class="title">{{item.goods_name}}</view>
  586 + <!-- 判断是否有活动价 -->
  587 + <block wx:if="{{item.prom_price>0 || item.prom_integral}}">
  588 + <view class="flex ai-center">
  589 + <!-- 活动价 -->
  590 + <view class="price">
  591 + <text wx:if="{{item.prom_integral}}">{{item.prom_integral}}积分</text>
  592 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  593 + <text wx:if="{{item.prom_price}}" class="rmb">{{item.prom_price}}</text>
  594 + </view>
  595 + <!-- <view class="word-line xc-ash rmb mgl10 fs24">{{item.market_price}}</view>-->
  596 + </view>
  597 +
  598 + <view class="comment">
  599 +
  600 + <view class="fs22 pdt10 t-r">
  601 + <span>评论{{item.comment_count}}</span>
  602 + <span class="pdl30">已售{{item.sales_sum}}</span>
  603 + </view>
  604 + </view>
  605 + </block>
  606 + <block wx:else>
  607 +
  608 + <!-- 商品价格,先判断下是后又等级价-->
  609 + <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}">
  610 +
  611 +
  612 + <!-- 当会员是等级卡的时候 -->
  613 + <block wx:if="{{card_field}}">
  614 + <!-- 等级价>0 -->
  615 + <block wx:if="{{item[card_field]>0}}">
  616 + <view class="flex ai_and">
  617 + <view class="price rmb">{{item[card_field]}}</view>
  618 + <view class="card_bg ellipsis-1">
  619 + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>
  620 + <view class="card_name">{{card_name}}</view>
  621 + </view>
598 </view> 622 </view>
599 - <view class="item-cont">  
600 - <view class="title">{{item.goods_name}}</view>  
601 - <!-- 判断是否有活动价 -->  
602 - <block wx:if="{{item.prom_price>0 || item.prom_integral}}">  
603 - <view class="flex ai-center">  
604 - <!-- 活动价 -->  
605 - <view class="price">  
606 - <text wx:if="{{item.prom_integral}}">{{item.prom_integral}}积分</text>  
607 - <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>  
608 - <text wx:if="{{item.prom_price}}" class="rmb">{{item.prom_price}}</text>  
609 - </view>  
610 -<!-- <view class="word-line xc-ash rmb mgl10 fs24">{{item.market_price}}</view>-->  
611 - </view>  
612 -  
613 - <view class="comment">  
614 -  
615 - <view class="fs22 pdt10 t-r">  
616 - <span>评论{{item.comment_count}}</span>  
617 - <span class="pdl30">已售{{item.sales_sum}}</span>  
618 - </view>  
619 - </view>  
620 - </block>  
621 - <block wx:else>  
622 -  
623 - <!-- 商品价格,先判断下是后又等级价-->  
624 - <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}">  
625 -  
626 -  
627 - <!-- 当会员是等级卡的时候 -->  
628 - <block wx:if="{{card_field}}">  
629 - <!-- 等级价>0 -->  
630 - <block wx:if="{{item[card_field]>0}}">  
631 - <view class="flex ai_and">  
632 - <view class="price rmb">{{item[card_field]}}</view>  
633 - <view class="card_bg ellipsis-1">  
634 - <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>  
635 - <view class="card_name">{{card_name}}</view>  
636 - </view>  
637 - </view>  
638 - <view class="comment flex jc_sb">  
639 -<!-- <view class="word-line xc-ash rmb fs24">{{item.market_price}}</view>-->  
640 - <view class="fs22 pdt10 t-r">  
641 - <span>评论{{item.comment_count}}</span>  
642 - <span class="pdl30">已售{{item.sales_sum}}</span>  
643 - </view>  
644 - </view>  
645 - </block>  
646 - <block wx:else>  
647 - <view class="flex ai-center">  
648 - <view class="price rmb">{{item.shop_price}}</view>  
649 -<!-- <view class="word-line xc-ash rmb fs24 mgl10">{{item.market_price}}</view>-->  
650 - </view>  
651 -  
652 - <view class="comment">  
653 - <view class="fs22 pdt10 t-r">  
654 - <span>评论{{item.comment_count}}</span>  
655 - <span class="pdl30">已售{{item.sales_sum}}</span>  
656 - </view>  
657 - </view>  
658 - </block>  
659 - </block>  
660 - <block wx:else>  
661 -  
662 - <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}">  
663 - <view class="flex ai-center">  
664 - <view class="price rmb">{{item.shop_price}}</view>  
665 -<!-- <view class="word-line xc-ash mk_price rmb fs24 mgl10">{{item.market_price}}</view>-->  
666 - </view>  
667 - <view class="comment">  
668 - <view class="flex ai-center">  
669 - <view class="rmb">{{g_filter.get_card_price(item,card_list,0)}}</view>  
670 - <view class="card_bg ellipsis-1">  
671 - <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>  
672 - <view class="card_name">{{g_filter.get_card_price(item,card_list,1)}}</view>  
673 - </view>  
674 - </view>  
675 - </view>  
676 -  
677 - <view class="fs22 t-r" style="color:#999;">  
678 - <span>评论{{item.comment_count}}</span>  
679 - <span class="pdl30">已售{{item.sales_sum}}</span>  
680 - </view>  
681 -  
682 -  
683 - </block>  
684 - <block wx:else>  
685 - <view class="flex ai-center">  
686 - <view class="price rmb">{{item.shop_price}}</view>  
687 -<!-- <view class="word-line xc-ash rmb fs24 mgl10">{{item.market_price}}</view>-->  
688 - </view>  
689 - <!-- <view class="price">¥{{item.shop_price}}</view> -->  
690 - <view class="comment">  
691 - <!-- <view class="word-line xc-ash">¥{{item.market_price}}</view> -->  
692 - <view class="fs22 pdt10 t-r">  
693 - <span>评论{{item.comment_count}}</span>  
694 - <span class="pdl30">已售{{item.sales_sum}}</span>  
695 - </view>  
696 - </view>  
697 - </block>  
698 - </block>  
699 - </block>  
700 - <block wx:else>  
701 - <view class="flex ai-center">  
702 - <view class="price rmb">{{item.shop_price}}</view>  
703 -<!-- <view class="word-line xc-ash rmb fs24 mgl10">{{item.market_price}}</view>-->  
704 - </view>  
705 - <!-- <view class="price">¥{{item.shop_price}}</view> -->  
706 - <view class="comment">  
707 - <!-- <view class="word-line xc-ash">¥{{item.market_price}}</view> -->  
708 - <view class="fs22 pdt10 t-r">  
709 - <span>评论{{item.comment_count}}</span>  
710 - <span class="pdl30">已售{{item.sales_sum}}</span>  
711 - </view>  
712 - </view>  
713 - </block>  
714 - </block> 623 + <view class="comment flex jc_sb">
  624 + <!-- <view class="word-line xc-ash rmb fs24">{{item.market_price}}</view>-->
  625 + <view class="fs22 pdt10 t-r">
  626 + <span>评论{{item.comment_count}}</span>
  627 + <span class="pdl30">已售{{item.sales_sum}}</span>
715 </view> 628 </view>
716 - </navigator>  
717 - <!-- 暂无更多 -->  
718 - <view style="height: 30rpx;line-height: 30rpx;margin-top: 20rpx;font-size: 25rpx; text-align: center;"  
719 - wx:if="{{is_no_more}}">暂无更多</view>  
720 - </view>  
721 - <view class="no-data" wx:if="{{msgStatus == true}}">  
722 - <!-- <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> --> 629 + </view>
  630 + </block>
  631 + <block wx:else>
  632 + <view class="flex ai-center">
  633 + <view class="price rmb">{{item.shop_price}}</view>
  634 + <!-- <view class="word-line xc-ash rmb fs24 mgl10">{{item.market_price}}</view>-->
  635 + </view>
  636 +
  637 + <view class="comment">
  638 + <view class="fs22 pdt10 t-r">
  639 + <span>评论{{item.comment_count}}</span>
  640 + <span class="pdl30">已售{{item.sales_sum}}</span>
  641 + </view>
  642 + </view>
  643 + </block>
  644 + </block>
  645 + <block wx:else>
  646 +
  647 + <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}">
  648 + <view class="flex ai-center">
  649 + <view class="price rmb">{{item.shop_price}}</view>
  650 + <!-- <view class="word-line xc-ash mk_price rmb fs24 mgl10">{{item.market_price}}</view>-->
  651 + </view>
  652 + <view class="comment">
  653 + <view class="flex ai-center">
  654 + <view class="rmb">{{g_filter.get_card_price(item,card_list,0)}}</view>
  655 + <view class="card_bg ellipsis-1">
  656 + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>
  657 + <view class="card_name">{{g_filter.get_card_price(item,card_list,1)}}</view>
  658 + </view>
  659 + </view>
  660 + </view>
723 661
724 - <view wx:if="{{msgStatus == true && lastMsg == false}}" class="no-data-title" style="text-align:center;margin-top:100px">  
725 - <view style="color:#444;line-height:30px;">该类别暂无推荐商品</view><view style="color:#444;line-height:30px;"> {{countDownNum}} 秒后自动跳到下一个类别</view> </view>  
726 - <view wx:elif="{{lastMsg == true && msgStatus == true}}" class="no-data-title" style="text-align:center;margin-top:100px">该类别暂无推荐商品</view>  
727 - <!-- <navigator class="lookat" url="/pages/index/index/index"> 去逛逛 </navigator> --> 662 + <view class="fs22 t-r" style="color:#999;">
  663 + <span>评论{{item.comment_count}}</span>
  664 + <span class="pdl30">已售{{item.sales_sum}}</span>
  665 + </view>
  666 +
  667 +
  668 + </block>
  669 + <block wx:else>
  670 + <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>-->
  673 + </view>
  674 + <!-- <view class="price">¥{{item.shop_price}}</view> -->
  675 + <view class="comment">
  676 + <!-- <view class="word-line xc-ash">¥{{item.market_price}}</view> -->
  677 + <view class="fs22 pdt10 t-r">
  678 + <span>评论{{item.comment_count}}</span>
  679 + <span class="pdl30">已售{{item.sales_sum}}</span>
  680 + </view>
  681 + </view>
  682 + </block>
  683 + </block>
  684 + </block>
  685 + <block wx:else>
  686 + <view class="flex ai-center">
  687 + <view class="price rmb">{{item.shop_price}}</view>
  688 + <!-- <view class="word-line xc-ash rmb fs24 mgl10">{{item.market_price}}</view>-->
  689 + </view>
  690 + <!-- <view class="price">¥{{item.shop_price}}</view> -->
  691 + <view class="comment">
  692 + <!-- <view class="word-line xc-ash">¥{{item.market_price}}</view> -->
  693 + <view class="fs22 pdt10 t-r">
  694 + <span>评论{{item.comment_count}}</span>
  695 + <span class="pdl30">已售{{item.sales_sum}}</span>
  696 + </view>
  697 + </view>
  698 + </block>
  699 + </block>
728 </view> 700 </view>
729 -  
730 -  
731 - </scroll-view>  
732 - <!-- /goodslist -->  
733 - </view>  
734 - <!-- 商品列表结束 -->  
735 - 701 + </navigator>
  702 + <!-- 暂无更多 -->
  703 + <view style="height: 30rpx;line-height: 30rpx;margin-top: 20rpx;font-size: 25rpx; text-align: center;" wx:if="{{is_no_more}}">暂无更多</view>
  704 + <view id="sview" style="height: 420rpx;width: 100%;text-align: center;" wx:if="{{nextShow}}">
  705 + <view style="display: flex;align-items: center;justify-content: center;height:60rpx;">
  706 + <text class="iconfont icon-arrowup" style="font-size: 25rpx;color: #999;">上滑查看下一个分类</text>
  707 + <!-- <text >上滑查看下一个分类</text> -->
  708 + </view>
  709 + </view>
  710 + </view>
  711 + <view class="no-data" wx:if="{{msgStatus == true}}">
  712 + <!-- <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> -->
  713 +
  714 + <view wx:if="{{msgStatus == true && lastMsg == false}}" class="no-data-title" style="text-align:center;margin-top:100px">
  715 + <view style="color:#444;line-height:30px;">该类别暂无推荐商品</view>
  716 + <view style="color:#444;line-height:30px;"> {{countDownNum}} 秒后自动跳到下一个类别</view>
  717 + </view>
  718 + <view wx:elif="{{lastMsg == true && msgStatus == true}}" class="no-data-title" style="text-align:center;margin-top:100px">该类别暂无推荐商品</view>
  719 + <!-- <navigator class="lookat" url="/pages/index/index/index"> 去逛逛 </navigator> -->
  720 + </view>
  721 +
  722 +
  723 + </scroll-view>
  724 + <!-- /goodslist -->
  725 + </view>
  726 + <!-- 商品列表结束 -->
  727 +
736 </block> 728 </block>
737 </block> 729 </block>
738 - </view>  
739 - </view>  
740 - </block>  
741 - <block wx:elif="{{is_do}}">  
742 - <view class="no-data" >  
743 - <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image>  
744 - <view class="no-data-title">商家暂未设置分类</view>  
745 - <navigator class="lookat" url="/pages/index/index/index">去逛逛</navigator>  
746 - </view>  
747 - </block>  
748 -</block> 730 + </view>
  731 + </view>
  732 + </block>
  733 + <block wx:elif="{{is_do}}">
  734 + <view class="no-data">
  735 + <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image>
  736 + <view class="no-data-title">商家暂未设置分类</view>
  737 + <navigator class="lookat" url="/pages/index/index/index">去逛逛</navigator>
  738 + </view>
  739 + </block>
  740 +</block>
749 \ No newline at end of file 741 \ No newline at end of file
pages/goods/goodsInfo/goodsInfo.js
@@ -286,13 +286,16 @@ Page({ @@ -286,13 +286,16 @@ Page({
286 286
287 if (json_str) { 287 if (json_str) {
288 var json_data = JSON.parse(json_str); 288 var json_data = JSON.parse(json_str);
  289 + console.log('自定义海报参数-------');
  290 + console.log(json_data);
289 if (json_data.bg_img) { 291 if (json_data.bg_img) {
290 - 292 +
291 //-- 把图片那到本地 -- 293 //-- 把图片那到本地 --
292 wx.getImageInfo({ 294 wx.getImageInfo({
293 src: json_data.bg_img, 295 src: json_data.bg_img,
294 success: function (res) { 296 success: function (res) {
295 var path = res.path; 297 var path = res.path;
  298 +
296 th.setData({share_b_img: path}) 299 th.setData({share_b_img: path})
297 }, 300 },
298 fail: function (res) { 301 fail: function (res) {
@@ -414,6 +417,7 @@ Page({ @@ -414,6 +417,7 @@ Page({
414 is_show_gb: 1 417 is_show_gb: 1
415 }); 418 });
416 } 419 }
  420 + console.log('获取系统参数');
417 console.log(e); 421 console.log(e);
418 var json_d = JSON.parse(e.switch_list); 422 var json_d = JSON.parse(e.switch_list);
419 ee.setData({ 423 ee.setData({
@@ -737,15 +741,33 @@ Page({ @@ -737,15 +741,33 @@ Page({
737 data: { 741 data: {
738 store_id: os.stoid, 742 store_id: os.stoid,
739 type: 1, 743 type: 1,
740 - pageSize: 3, 744 + pageSize: 100,
741 page: 1, 745 page: 1,
742 is_share: 0, 746 is_share: 0,
743 }, 747 },
744 }).then(res1 => { 748 }).then(res1 => {
  749 +
745 fir_quan = res1.data.data.pageData; 750 fir_quan = res1.data.data.pageData;
746 }) 751 })
747 } 752 }
748 - 753 + //过滤不是本商品的单品优惠券-------------------
  754 + if(fir_quan.length > 0 ){
  755 + let goodInfo = ee.data.data
  756 + for (let index = fir_quan.length-1; index >= 0; index--) {
  757 + if (fir_quan[index].useobjecttype==20) { //判断是单品优惠券
  758 + if (fir_quan[index].useobjectno != goodInfo.goods_sn) {
  759 + fir_quan.splice(index,1)
  760 + }
  761 + }
  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);
  770 + }
749 //--------获取视频图片--------- 771 //--------获取视频图片---------
750 await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, { 772 await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, {
751 1: 1 773 1: 1
@@ -761,7 +783,7 @@ Page({ @@ -761,7 +783,7 @@ Page({
761 is_collect: is_collect, 783 is_collect: is_collect,
762 collect_id: collect_id, 784 collect_id: collect_id,
763 categories3: categories3, 785 categories3: categories3,
764 - fir_quan: fir_quan, 786 + fir_quan: arr,
765 fir_comments: fir_com, 787 fir_comments: fir_com,
766 mapurl_f_img: mapurl_f_img, 788 mapurl_f_img: mapurl_f_img,
767 mapurl: mapurl, 789 mapurl: mapurl,
@@ -1841,6 +1863,7 @@ Page({ @@ -1841,6 +1863,7 @@ Page({
1841 goods_price: newd.goods_price, 1863 goods_price: newd.goods_price,
1842 member_goods_price: newd.goods_price, 1864 member_goods_price: newd.goods_price,
1843 store_id: th.data.stoid, 1865 store_id: th.data.stoid,
  1866 + prom_id:newd.prom_id //把活动id带上去(用于购物车失效变成有效商品)
1844 }; 1867 };
1845 1868
1846 //---是不是从收藏夹出来的--- 1869 //---是不是从收藏夹出来的---
@@ -1853,6 +1876,7 @@ Page({ @@ -1853,6 +1876,7 @@ Page({
1853 updata['guide_type'] = 0; 1876 updata['guide_type'] = 0;
1854 } 1877 }
1855 } 1878 }
  1879 +
1856 1880
1857 i.put("/api/weshop/cart/update", { 1881 i.put("/api/weshop/cart/update", {
1858 data: updata, 1882 data: updata,
@@ -2268,7 +2292,7 @@ Page({ @@ -2268,7 +2292,7 @@ Page({
2268 sort_store: 0, 2292 sort_store: 0,
2269 open_ind_store: open_store, 2293 open_ind_store: open_store,
2270 }) 2294 })
2271 - //--先判断会员状态-- 2295 + //--先判断会员状态--
2272 var user_info = getApp().globalData.userInfo; 2296 var user_info = getApp().globalData.userInfo;
2273 if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { 2297 if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
2274 wx.navigateTo({ 2298 wx.navigateTo({
@@ -2921,7 +2945,8 @@ Page({ @@ -2921,7 +2945,8 @@ Page({
2921 } 2945 }
2922 }) 2946 })
2923 } 2947 }
2924 - 2948 + console.log('活动详情------------');
  2949 + console.log(prom);
2925 //----------如果有活动,并且在进行中,就不计算线下库存--------------- 2950 //----------如果有活动,并且在进行中,就不计算线下库存---------------
2926 var now = ut.gettimestamp(); 2951 var now = ut.gettimestamp();
2927 if (prom) { 2952 if (prom) {
@@ -3584,7 +3609,7 @@ Page({ @@ -3584,7 +3609,7 @@ Page({
3584 prom_end_time: prom_end_time, 3609 prom_end_time: prom_end_time,
3585 prom_start_time: prom_start_time, 3610 prom_start_time: prom_start_time,
3586 isshow: 1, 3611 isshow: 1,
3587 - prom_act: t.data.data 3612 + // prom_act: t.data.data
3588 }); 3613 });
3589 3614
3590 ee.get_sto(); 3615 ee.get_sto();
@@ -4765,7 +4790,18 @@ Page({ @@ -4765,7 +4790,18 @@ Page({
4765 wx.hideLoading(); 4790 wx.hideLoading();
4766 quan_list = res.data.data.pageData; 4791 quan_list = res.data.data.pageData;
4767 }) 4792 })
4768 - 4793 + //过滤不是本商品的单品优惠券
  4794 + if (quan_list.length > 0) {
  4795 + let goodInfo = th.data.data
  4796 + for (let index = quan_list.length-1; index >= 0; index--) {
  4797 + if (quan_list[index].useobjecttype==20) { //判断是单品优惠券
  4798 + if (quan_list[index].useobjectno != goodInfo.goods_sn) {
  4799 + quan_list.splice(index,1)
  4800 + }
  4801 + }
  4802 + }
  4803 + }
  4804 + //------------------------
4769 if (quan_list) { 4805 if (quan_list) {
4770 for (var ind in quan_list) { 4806 for (var ind in quan_list) {
4771 var ep = quan_list[ind]; 4807 var ep = quan_list[ind];
@@ -4994,11 +5030,15 @@ Page({ @@ -4994,11 +5030,15 @@ Page({
4994 if (this.data.card_field && this.data.data[this.data.card_field]) { 5030 if (this.data.card_field && this.data.data[this.data.card_field]) {
4995 price = this.data.data[this.data.card_field]; 5031 price = this.data.data[this.data.card_field];
4996 } 5032 }
4997 - if (this.data.prom_act) price = this.data.prom_price; 5033 + if (this.data.prom_act) price = this.data.prom_price;
4998 price = parseFloat(price).toFixed(2); 5034 price = parseFloat(price).toFixed(2);
4999 context.setFontSize(32 * unit); 5035 context.setFontSize(32 * unit);
5000 - context.setFillStyle('#DE1117');  
5001 - context.fillText('¥' + price, 54 * unit, 735 * unit); 5036 + context.setFillStyle('#DE1117');
  5037 + if (this.data.prom_type == 4 && this.data.prom_integral){
  5038 + context.fillText(this.data.prom_integral+'积分+¥' + price, 54 * unit, 735 * unit);
  5039 + }else{
  5040 + context.fillText('¥' + price, 54 * unit, 735 * unit);
  5041 + }
5002 5042
5003 5043
5004 }; 5044 };
@@ -5038,13 +5078,18 @@ Page({ @@ -5038,13 +5078,18 @@ Page({
5038 5078
5039 //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 4阶梯团 5079 //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 4阶梯团
5040 var type = this.data.prom_type; 5080 var type = this.data.prom_type;
5041 - if (type == 2) type = -1; 5081 + console.log('商品类型-----');
  5082 + console.log(type);
  5083 + // if (type == 2) type = -1;
  5084 + if (type == 4) type = 0;
  5085 + if (type == 2) type = 0;
5042 if (type == 6) type = 2; // 6拼团 2团购 5086 if (type == 6) type = 2; // 6拼团 2团购
5043 if (type == 10) type = -1; 5087 if (type == 10) type = -1;
5044 - 5088 +
5045 5089
5046 if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3; 5090 if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3;
5047 - 5091 + console.log('商品类型。。。。。');
  5092 + console.log(type);
5048 wx.showLoading({title: '生成中...',}) 5093 wx.showLoading({title: '生成中...',})
5049 var that = this, th = that; 5094 var that = this, th = that;
5050 //设置画板显示,才能开始绘图 5095 //设置画板显示,才能开始绘图
@@ -5092,19 +5137,24 @@ Page({ @@ -5092,19 +5137,24 @@ Page({
5092 pg_path = th.data.share_b_img; 5137 pg_path = th.data.share_b_img;
5093 } 5138 }
5094 // context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); 5139 // context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
  5140 + console.log('海报类型-----')
  5141 + console.log(type);
5095 5142
5096 -  
5097 - if (type == 0 || type == 1 || type == 2 || type == 3) { // 如果是普通商品,绘制新海报 5143 + if ( !th.data.share_b_img && (type == 0 || type == 1 || type == 2 || type == 3 )){ // 如果是普通商品,绘制新海报
5098 th.drawPoster(context, unit, th.data.share_goods_img, vpath, type); 5144 th.drawPoster(context, unit, th.data.share_goods_img, vpath, type);
5099 } else { 5145 } else {
5100 context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); 5146 context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
  5147 + // var erm_x = parseFloat(th.data.poster.ewm_x) * 2;
  5148 + // var erm_y = parseFloat(th.data.poster.ewm_y) * 2;
  5149 + // context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit);
  5150 + // th.drawPoster(context, unit, th.data.share_goods_img, vpath);
5101 }; 5151 };
5102 - 5152 +
5103 // th.drawPoster(context, unit, th.data.share_goods_img, vpath); 5153 // th.drawPoster(context, unit, th.data.share_goods_img, vpath);
5104 5154
5105 5155
5106 //-- 是自定义海报的情况下 -- 5156 //-- 是自定义海报的情况下 --
5107 - if (type != 0 && type != 1 && type != 2 && type != 3) { 5157 + if (th.data.share_b_img || (type != 0 && type != 1 && type != 2 && type != 3)) {
5108 5158
5109 if (th.data.poster && parseInt(th.data.poster.style) == 2) { 5159 if (th.data.poster && parseInt(th.data.poster.style) == 2) {
5110 //在线上分享人的情况下 5160 //在线上分享人的情况下
@@ -5158,7 +5208,7 @@ Page({ @@ -5158,7 +5208,7 @@ Page({
5158 5208
5159 //---产品名称--- 5209 //---产品名称---
5160 //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 5210 //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
5161 - if (type != 4 && type != 0 && type != 1 && type != 2 && type != 3) { 5211 + if (th.data.share_b_img || (type != 4 && type != 0 && type != 1 && type != 2 && type != 3)) {
5162 context.setFillStyle("black"); 5212 context.setFillStyle("black");
5163 context.setFontSize(21.3 * unit) 5213 context.setFontSize(21.3 * unit)
5164 getApp().draw_Text(context, share_title, 5214 getApp().draw_Text(context, share_title,
@@ -5179,6 +5229,11 @@ Page({ @@ -5179,6 +5229,11 @@ Page({
5179 var wd1 = th.data.screenWidth - ut.measureText(pri0, 31 * unit) - 25; 5229 var wd1 = th.data.screenWidth - ut.measureText(pri0, 31 * unit) - 25;
5180 context.fillText("¥", wd1 - 15, 185 * unit); 5230 context.fillText("¥", wd1 - 15, 185 * unit);
5181 context.setFontSize(31 * unit) 5231 context.setFontSize(31 * unit)
  5232 + // if(th.data.prom_type==4){
  5233 + // context.fillText(th.data.prom_integral+'积分'+pri0, wd1, 185 * unit);
  5234 + // }else{
  5235 + // context.fillText(pri0, wd1, 185 * unit);
  5236 + // }
5182 context.fillText(pri0, wd1, 185 * unit); 5237 context.fillText(pri0, wd1, 185 * unit);
5183 5238
5184 //---市场价划掉--- 5239 //---市场价划掉---
@@ -5195,7 +5250,7 @@ Page({ @@ -5195,7 +5250,7 @@ Page({
5195 context.lineTo(wd2 + ut.measureText(pri0, 22 * unit) + 5, 206 * unit); 5250 context.lineTo(wd2 + ut.measureText(pri0, 22 * unit) + 5, 206 * unit);
5196 context.stroke();--*/ 5251 context.stroke();--*/
5197 5252
5198 - } else if (type == 4 && type != 0 && type != 1 && type != 2 && type != 3) { 5253 + } else if ( ( type == 4 && type != 0 && type != 1 && type != 2 && type != 3)) {
5199 context.setFillStyle("black"); 5254 context.setFillStyle("black");
5200 context.setFontSize(21.3 * unit) 5255 context.setFontSize(21.3 * unit)
5201 getApp().draw_Text(context, share_title, 5256 getApp().draw_Text(context, share_title,
@@ -5223,18 +5278,56 @@ Page({ @@ -5223,18 +5278,56 @@ Page({
5223 } 5278 }
5224 5279
5225 //---中间大图--- 5280 //---中间大图---
5226 - if (type != 0 && type != 1 && type != 2 && type != 3) { 5281 + if ( th.data.share_b_img || (type != 0 && type != 1 && type != 2 && type != 3)) {
5227 context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit); 5282 context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit);
5228 } 5283 }
5229 ; 5284 ;
  5285 +
  5286 + //---自定义海报 产品质量保证
  5287 + if(th.data.share_b_img && th.data.poster.show_quality==1 ){
  5288 + var g_path = "../../../images/share/s_gou.png";
  5289 + context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit);
  5290 + context.setFillStyle("red")
  5291 + context.setFontSize(18 * unit)
  5292 + context.fillText("正品保证", 84 * unit, 690 * unit);
  5293 +
  5294 + context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit);
  5295 + context.setFillStyle("red")
  5296 + context.setFontSize(18 * unit)
  5297 + context.fillText("纯实体店", 246 * unit, 690 * unit);
  5298 +
  5299 + context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit);
  5300 + context.setFillStyle("red")
  5301 + context.setFontSize(18 * unit)
  5302 + context.fillText("官方验证", 420 * unit, 690 * unit);
5230 5303
5231 -  
5232 - //-------大图后面就不一样了----------- 5304 + }
  5305 + //-------大图后面就不一样了-----------
5233 switch (type) { 5306 switch (type) {
5234 case 0: 5307 case 0:
  5308 + if(!th.data.share_b_img){
  5309 + break
  5310 + }
  5311 + //---画线---
  5312 + context.setLineWidth(1 * unit)
  5313 + context.moveTo(32 * unit, 710 * unit)
  5314 + context.lineTo(520 * unit, 710 * unit)
  5315 + context.stroke();
  5316 + //---文字---
  5317 + context.setFillStyle("black")
  5318 + context.setFontSize(22 * unit)
  5319 + // 原来start --->
  5320 + context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 776 * unit);
  5321 + context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 826 * unit);
  5322 + // <--- 原来end
  5323 + // context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 816 * unit);
  5324 + // context.setFontSize(18 * unit)
  5325 + // context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 850 * unit);
  5326 + //---二维吗图---
  5327 + context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit);
5235 break;//普通商品的展示 5328 break;//普通商品的展示
5236 case 4: 5329 case 4:
5237 - //中间的几个字 5330 + // 中间的几个字
5238 if (th.data.poster && parseInt(th.data.poster.style) == 2) { 5331 if (th.data.poster && parseInt(th.data.poster.style) == 2) {
5239 if (parseInt(th.data.poster.show_quality)) { 5332 if (parseInt(th.data.poster.show_quality)) {
5240 var g_path = "../../../images/share/s_gou.png"; 5333 var g_path = "../../../images/share/s_gou.png";
@@ -5303,7 +5396,7 @@ Page({ @@ -5303,7 +5396,7 @@ Page({
5303 5396
5304 //---二维吗图--- 5397 //---二维吗图---
5305 //-- 自定义海报 -- 5398 //-- 自定义海报 --
5306 - if (th.data.poster) { 5399 + if (th.data.share_b_img || th.data.poster) {
5307 var erm_x = parseFloat(th.data.poster.ewm_x) * 2; 5400 var erm_x = parseFloat(th.data.poster.ewm_x) * 2;
5308 var erm_y = parseFloat(th.data.poster.ewm_y) * 2; 5401 var erm_y = parseFloat(th.data.poster.ewm_y) * 2;
5309 context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit); 5402 context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit);
@@ -5314,7 +5407,10 @@ Page({ @@ -5314,7 +5407,10 @@ Page({
5314 ; 5407 ;
5315 5408
5316 break; 5409 break;
5317 - case -12: //秒杀商品的展示 5410 + case 1: //秒杀商品的展示
  5411 + if(!th.data.share_b_img){
  5412 + break
  5413 + }
5318 //---画线--- 5414 //---画线---
5319 context.setLineWidth(1 * unit) 5415 context.setLineWidth(1 * unit)
5320 context.moveTo(32 * unit, 670 * unit) 5416 context.moveTo(32 * unit, 670 * unit)
@@ -5337,7 +5433,7 @@ Page({ @@ -5337,7 +5433,7 @@ Page({
5337 5433
5338 //---二维吗图--- 5434 //---二维吗图---
5339 //-- 自定义海报 -- 5435 //-- 自定义海报 --
5340 - if (th.data.poster) { 5436 + if (th.data.share_b_img || th.data.poster) {
5341 var erm_x = parseFloat(th.data.poster.ewm_x) * 2; 5437 var erm_x = parseFloat(th.data.poster.ewm_x) * 2;
5342 var erm_y = parseFloat(th.data.poster.ewm_y) * 2; 5438 var erm_y = parseFloat(th.data.poster.ewm_y) * 2;
5343 context.drawImage(vpath, erm_x * unit, erm_y * unit, 135 * unit, 135 * unit); 5439 context.drawImage(vpath, erm_x * unit, erm_y * unit, 135 * unit, 135 * unit);
@@ -5347,7 +5443,10 @@ Page({ @@ -5347,7 +5443,10 @@ Page({
5347 } 5443 }
5348 break; 5444 break;
5349 5445
5350 - case -2: //会员团和商家团的展示 5446 + case 2: //会员团和商家团的展示
  5447 + if(!th.data.share_b_img){
  5448 + break
  5449 + }
5351 //---画线--- 5450 //---画线---
5352 context.setLineWidth(1 * unit) 5451 context.setLineWidth(1 * unit)
5353 context.moveTo(32 * unit, 670 * unit) 5452 context.moveTo(32 * unit, 670 * unit)
@@ -5383,7 +5482,7 @@ Page({ @@ -5383,7 +5482,7 @@ Page({
5383 5482
5384 //---二维吗图--- 5483 //---二维吗图---
5385 //-- 自定义海报 -- 5484 //-- 自定义海报 --
5386 - if (th.data.poster) { 5485 + if (th.data.share_b_img || th.data.poster) {
5387 var erm_x = parseFloat(th.data.poster.ewm_x) * 2; 5486 var erm_x = parseFloat(th.data.poster.ewm_x) * 2;
5388 var erm_y = parseFloat(th.data.poster.ewm_y) * 2; 5487 var erm_y = parseFloat(th.data.poster.ewm_y) * 2;
5389 context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit); 5488 context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit);
@@ -5392,7 +5491,10 @@ Page({ @@ -5392,7 +5491,10 @@ Page({
5392 context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit); 5491 context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit);
5393 } 5492 }
5394 break 5493 break
5395 - case -3: //阶梯团的展示 5494 + case 3: //阶梯团的展示
  5495 + if(!th.data.share_b_img){
  5496 + break
  5497 + }
5396 //---画线--- 5498 //---画线---
5397 context.setLineWidth(1 * unit) 5499 context.setLineWidth(1 * unit)
5398 context.moveTo(32 * unit, 670 * unit) 5500 context.moveTo(32 * unit, 670 * unit)
@@ -5428,7 +5530,7 @@ Page({ @@ -5428,7 +5530,7 @@ Page({
5428 5530
5429 5531
5430 //-- 自定义海报 -- 5532 //-- 自定义海报 --
5431 - if (th.data.poster) { 5533 + if (th.data.share_b_img || th.data.poster) {
5432 var erm_x = parseFloat(th.data.poster.ewm_x) * 2; 5534 var erm_x = parseFloat(th.data.poster.ewm_x) * 2;
5433 var erm_y = parseFloat(th.data.poster.ewm_y) * 2; 5535 var erm_y = parseFloat(th.data.poster.ewm_y) * 2;
5434 context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit); 5536 context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit);
@@ -5459,7 +5561,7 @@ Page({ @@ -5459,7 +5561,7 @@ Page({
5459 5561
5460 //---二维吗图--- 5562 //---二维吗图---
5461 //-- 自定义海报 -- 5563 //-- 自定义海报 --
5462 - if (th.data.poster) { 5564 + if (th.data.share_b_img || th.data.poster) {
5463 var erm_x = parseFloat(th.data.poster.ewm_x) * 2; 5565 var erm_x = parseFloat(th.data.poster.ewm_x) * 2;
5464 var erm_y = parseFloat(th.data.poster.ewm_y) * 2; 5566 var erm_y = parseFloat(th.data.poster.ewm_y) * 2;
5465 context.drawImage(vpath, erm_x * unit, erm_y * unit, 135 * unit, 135 * unit); 5567 context.drawImage(vpath, erm_x * unit, erm_y * unit, 135 * unit, 135 * unit);
@@ -5474,7 +5576,7 @@ Page({ @@ -5474,7 +5576,7 @@ Page({
5474 5576
5475 5577
5476 //--- 如果是自定义海报的时候 --- 5578 //--- 如果是自定义海报的时候 ---
5477 - if (type != 0 && type != 1 && type != 2 && type != 3) { 5579 + if ( th.data.share_b_img || (type != 0 && type != 1 && type != 2 && type != 3)) {
5478 5580
5479 if (th.data.poster && parseInt(th.data.poster.style) == 2) { 5581 if (th.data.poster && parseInt(th.data.poster.style) == 2) {
5480 5582
@@ -5676,8 +5778,14 @@ Page({ @@ -5676,8 +5778,14 @@ Page({
5676 tt(); 5778 tt();
5677 }, 5779 },
5678 fail: function (res) { 5780 fail: function (res) {
5679 - ee.data.share_goods_img = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的  
5680 - tt(); 5781 + //获取默认空白图
  5782 + wx.getImageInfo({
  5783 + src: ee.data.iurl+'/miniapp/images/default_g_img.gif',
  5784 + success: function(res) {
  5785 + ee.data.share_goods_img = res.path; //分享的图片不能用网络的
  5786 + tt();
  5787 + }
  5788 + })
5681 } 5789 }
5682 }); 5790 });
5683 }, 5791 },
pages/goods/goodsInfo/goodsInfo.wxml
@@ -169,7 +169,7 @@ @@ -169,7 +169,7 @@
169 {{djs.min}} 169 {{djs.min}}
170 </view> 170 </view>
171 <view class="xc-time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">分</view> 171 <view class="xc-time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">分</view>
172 - <view class='xc-time-val white t-c' style=";background:{{prom_st==1?'#d40022':'#0097e0'}}"> 172 + <view class='xc-time-val white t-c' style="background:{{prom_st==1?'#d40022':'#0097e0'}}">
173 {{djs.sec}} 173 {{djs.sec}}
174 </view> 174 </view>
175 <view class="xc-time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">秒</view> 175 <view class="xc-time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">秒</view>
@@ -264,7 +264,7 @@ @@ -264,7 +264,7 @@
264 &nbsp;&nbsp;&nbsp;¥{{filters.toFix(data.shop_price,2)}} 264 &nbsp;&nbsp;&nbsp;¥{{filters.toFix(data.shop_price,2)}}
265 </text> 265 </text>
266 </view> 266 </view>
267 - <!-- 这个是分享按钮 --> 267 + <!-- 这个是分享按钮 -->
268 <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> --> 268 <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> -->
269 <view class="xc-share-frame t-c shrink0" bindtap="clickShare"> 269 <view class="xc-share-frame t-c shrink0" bindtap="clickShare">
270 <!-- <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> --> 270 <!-- <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> -->
@@ -604,7 +604,7 @@ @@ -604,7 +604,7 @@
604 </block> 604 </block>
605 </block> 605 </block>
606 <!-- 许程 7.24暂时注释 --> 606 <!-- 许程 7.24暂时注释 -->
607 - <view class="bdt16" wx:if="{{prom_type!=1&& prom_type!=1 && prom_act.kttype!=3&&prom_act.kttype!=2&&prom_act.kttype!=1 && is_closecoupon!=1 && sele_g.is_xz_yh !=1}}"> 607 + <view class="bdt16" wx:if="{{ prom_type!=1 && prom_act.kttype!=3&&prom_act.kttype!=2&&prom_act.kttype!=1 && is_closecoupon!=1 && sele_g.is_xz_yh !=1}}">
608 <view class="cx-frame flex" style="position: relative" wx:if="{{fir_quan.length>0}}"> 608 <view class="cx-frame flex" style="position: relative" wx:if="{{fir_quan.length>0}}">
609 <view class="cx-sizs fs30">领券</view> 609 <view class="cx-sizs fs30">领券</view>
610 <view class="flex ai_c f1 pdh20"> 610 <view class="flex ai_c f1 pdh20">
@@ -1034,7 +1034,7 @@ @@ -1034,7 +1034,7 @@
1034 <view class="shopping-cart cart-ico new_split"> 1034 <view class="shopping-cart cart-ico new_split">
1035 <navigator open-type="switchTab" url="/pages/cart/cart/cart"> 1035 <navigator open-type="switchTab" url="/pages/cart/cart/cart">
1036 <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image> 1036 <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image>
1037 - <view class="cart-num ellipsis-1">{{cartGoodsNum}}</view> 1037 + <!-- <view class="cart-num ellipsis-1">{{cartGoodsNum}}</view> -->
1038 <view>购物车</view> 1038 <view>购物车</view>
1039 </navigator> 1039 </navigator>
1040 </view> 1040 </view>
pages/index/index/index.js
@@ -14,7 +14,7 @@ var e = function (e) { @@ -14,7 +14,7 @@ var e = function (e) {
14 var regeneratorRuntime = require('../../../utils/runtime.js'); 14 var regeneratorRuntime = require('../../../utils/runtime.js');
15 var api = require('../../../api/api.js'); 15 var api = require('../../../api/api.js');
16 var d = getApp().globalData; 16 var d = getApp().globalData;
17 - 17 +
18 var full_screen = require('full_screen.js'); 18 var full_screen = require('full_screen.js');
19 19
20 20
@@ -78,7 +78,7 @@ Page({ @@ -78,7 +78,7 @@ Page({
78 78
79 showHongbao: false, 79 showHongbao: false,
80 showHongbaoSmall: false, 80 showHongbaoSmall: false,
81 - 81 + goodsGroupArr:[], //商品模块列表
82 is_full_screen_show: 0, //全屏显示 82 is_full_screen_show: 0, //全屏显示
83 sec_show: 3, //倒计时的秒数 83 sec_show: 3, //倒计时的秒数
84 full_ad: null, //全屏广告 84 full_ad: null, //全屏广告
@@ -297,8 +297,34 @@ Page({ @@ -297,8 +297,34 @@ Page({
297 }); 297 });
298 } 298 }
299 }) 299 })
300 - },  
301 - 300 + },
  301 + onReady(){
  302 + console.log('渲染完成----')
  303 + console.log(this.data.template_arr);
  304 + console.log('....................');
  305 + },
  306 +
  307 + //获取商品模块实例
  308 + newGoodsGroup(){
  309 + let arr=[]
  310 + if (this.data.template_arr.length == 0) {
  311 + return
  312 + }
  313 + this.data.template_arr.map((item,index)=>{
  314 + if (item.ename == 'goodsGroup') {
  315 + arr.push(`goodsGroup${index}`)
  316 + }
  317 + })
  318 + if (arr.length > 0) {
  319 + this.setData({
  320 + goodsGroupArr : arr
  321 + })
  322 + arr.map(item=>{
  323 + let a = '.'+item
  324 + this[item] = this.selectComponent(a);
  325 + })
  326 + }
  327 + },
302 328
303 //关闭新用户领取广告 329 //关闭新用户领取广告
304 close_disgraceful: function () { 330 close_disgraceful: function () {
@@ -523,13 +549,17 @@ Page({ @@ -523,13 +549,17 @@ Page({
523 if (data && data.length > 0) { 549 if (data && data.length > 0) {
524 var temp_data = data[0]; 550 var temp_data = data[0];
525 var t_arr = JSON.parse(temp_data.json_str); 551 var t_arr = JSON.parse(temp_data.json_str);
526 - 552 + console.log('商品列表------------1')
  553 + console.log(t_arr)
  554 + console.log('商品列表------------2')
527 th.setData({ 555 th.setData({
528 template_arr: t_arr, 556 template_arr: t_arr,
529 isTemplate: 1, 557 isTemplate: 1,
530 bgcolor_t: temp_data.bkcolor 558 bgcolor_t: temp_data.bkcolor
531 - });  
532 - 559 + });
  560 + setTimeout(()=>{
  561 + th.newGoodsGroup()
  562 + },1000)
533 //---如果有设定顶部的颜色的时候-- 563 //---如果有设定顶部的颜色的时候--
534 if (temp_data.top_color && temp_data.top_color != 'null') { 564 if (temp_data.top_color && temp_data.top_color != 'null') {
535 565
@@ -723,6 +753,8 @@ Page({ @@ -723,6 +753,8 @@ Page({
723 }, 753 },
724 //---加载更多是靠这个函数---- 754 //---加载更多是靠这个函数----
725 onReachBottom: function () { 755 onReachBottom: function () {
  756 + console.log('下拉加载2');
  757 +
726 var goods_list = this.selectComponent("#goods_list"); //组件的id 758 var goods_list = this.selectComponent("#goods_list"); //组件的id
727 if (goods_list) goods_list.get_list(); 759 if (goods_list) goods_list.get_list();
728 760
@@ -731,7 +763,17 @@ Page({ @@ -731,7 +763,17 @@ Page({
731 let item = getApp().globalData.func_list[i]; 763 let item = getApp().globalData.func_list[i];
732 item.re_show(); 764 item.re_show();
733 } 765 }
734 - } 766 + }
  767 +
  768 +
  769 + //自定义时商品自动加载更多
  770 + let goodsGroupArr = this.data.goodsGroupArr
  771 + if (this.data.isTemplate && goodsGroupArr.length >0) {
  772 + goodsGroupArr.map(item=>{
  773 + this[item].automore()
  774 + })
  775 + }
  776 +
735 }, 777 },
736 778
737 onPullDownRefresh: function (e) { 779 onPullDownRefresh: function (e) {
@@ -1226,8 +1268,26 @@ Page({ @@ -1226,8 +1268,26 @@ Page({
1226 getApp().goto(url); 1268 getApp().goto(url);
1227 }, 1269 },
1228 1270
1229 -  
1230 - 1271 + //视频号跳转
  1272 + nv_void(){
  1273 + // getApp().openChannelsActivity()
  1274 + wx.getChannelsLiveInfo({
  1275 + finderUserName:'sphYA5FuPCZxHaw',
  1276 + success:(res)=>{
  1277 + console.log(res)
  1278 + },
  1279 + fail:(error)=>{
  1280 + console.log(error)
  1281 + }
  1282 + })
  1283 + },
  1284 + getchir(){
  1285 + const child = this.selectComponent('.goodsg');
  1286 + console.log('子组件--------111111------')
  1287 + console.log(child)
  1288 + console.log('子组件----------2222----')
  1289 +
  1290 + },
1231 1291
1232 1292
1233 }); 1293 });
pages/index/index/index.json
@@ -26,5 +26,6 @@ @@ -26,5 +26,6 @@
26 "mp-dialog": "weui-miniprogram/dialog/dialog", 26 "mp-dialog": "weui-miniprogram/dialog/dialog",
27 "mp-sticky": "/components/mp-sticky/mp-sticky" 27 "mp-sticky": "/components/mp-sticky/mp-sticky"
28 }, 28 },
29 - "enablePullDownRefresh": false 29 + "enablePullDownRefresh": false,
  30 + "onReachBottomDistance":300
30 } 31 }
31 \ No newline at end of file 32 \ No newline at end of file
pages/index/index/index.wxml
@@ -209,7 +209,7 @@ @@ -209,7 +209,7 @@
209 209
210 210
211 <!--幸运购--> 211 <!--幸运购-->
212 - <view class="seckill" wx:if="{{luckGo_list && luckGo_list.length != 0}}"> 212 + <view class="seckill" wx:if="{{luckGo_list && luckGo_list.length != 0}}">
213 <navigator bindtap="go_url" data-remark="1" data-url="/packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList" hover-class="none"> 213 <navigator bindtap="go_url" data-remark="1" data-url="/packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList" hover-class="none">
214 <view class="seckill-time"> 214 <view class="seckill-time">
215 <view class="classname flex ai_c"> 215 <view class="classname flex ai_c">
@@ -375,7 +375,7 @@ @@ -375,7 +375,7 @@
375 <!--是否是自定义--> 375 <!--是否是自定义-->
376 <view class="container" wx:if="{{isTemplate}}" style="background-color:{{bgcolor_t}}; padding-bottom: 10rpx"> 376 <view class="container" wx:if="{{isTemplate}}" style="background-color:{{bgcolor_t}}; padding-bottom: 10rpx">
377 <!-- 置顶层 --> 377 <!-- 置顶层 -->
378 - <view class="dis_top"> 378 + <view class="dis_top" style="position:fixed">
379 <!-- 关注公众号的显示 --> 379 <!-- 关注公众号的显示 -->
380 <view id="off_top" wx:if="{{is_gz_h5}}"><official-account ></official-account></view> 380 <view id="off_top" wx:if="{{is_gz_h5}}"><official-account ></official-account></view>
381 381
@@ -392,7 +392,14 @@ @@ -392,7 +392,14 @@
392 </block> 392 </block>
393 </view> 393 </view>
394 <!-- 撑开层 --> 394 <!-- 撑开层 -->
395 - <view></view> 395 + <view>
  396 + <block wx:for="{{template_arr}}" >
  397 + <block wx:if="{{item.content.is_top==1}}">
  398 + <view style="height:100rpx"></view>
  399 + </block>
  400 + </block>
  401 +
  402 + </view>
396 403
397 <block wx:for="{{template_arr}}" wx:key="{{index}}"> 404 <block wx:for="{{template_arr}}" wx:key="{{index}}">
398 <view> 405 <view>
@@ -410,7 +417,7 @@ @@ -410,7 +417,7 @@
410 </block> 417 </block>
411 <!--商品分组--> 418 <!--商品分组-->
412 <block wx:if="{{item.ename=='goodsGroup'}}"> 419 <block wx:if="{{item.ename=='goodsGroup'}}">
413 - <goodsGroup object="{{item.content}}" sticky="{{template_arr[0].content.is_top}}"></goodsGroup> 420 + <goodsGroup class="{{'goodsGroup' + index}}" object="{{item.content}}" sticky="{{template_arr[0].content.is_top}}" ></goodsGroup>
414 421
415 </block> 422 </block>
416 <!--通知--> 423 <!--通知-->
pages/team/team_success/team_success.js
@@ -794,8 +794,14 @@ Page({ @@ -794,8 +794,14 @@ Page({
794 tt(); 794 tt();
795 }, 795 },
796 fail: function (res) { 796 fail: function (res) {
797 - ee.data.share_img_localpath= "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的  
798 - tt(); 797 + //获取默认空白图
  798 + wx.getImageInfo({
  799 + src: os.imghost+'/miniapp/images/default_g_img.gif',
  800 + success: function(res) {
  801 + ee.data.share_img_localpath = res.path; //分享的图片不能用网络的
  802 + tt();
  803 + }
  804 + })
799 } 805 }
800 }); 806 });
801 }, 807 },
pages/template/index.js
@@ -11,7 +11,8 @@ var t = getApp(), @@ -11,7 +11,8 @@ var t = getApp(),
11 Page({ 11 Page({
12 data: { 12 data: {
13 url: os.imghost, 13 url: os.imghost,
14 - temp_id:0, 14 + temp_id:0,
  15 + goodsGroupArr:[]
15 }, 16 },
16 17
17 onLoad: function(e) { 18 onLoad: function(e) {
@@ -46,7 +47,27 @@ Page({ @@ -46,7 +47,27 @@ Page({
46 47
47 } 48 }
48 }, 49 },
49 - 50 + //获取商品模块实例
  51 + newGoodsGroup(){
  52 + let arr=[]
  53 + if (this.data.template_arr.length == 0) {
  54 + return
  55 + }
  56 + this.data.template_arr.map((item,index)=>{
  57 + if (item.ename == 'goodsGroup') {
  58 + arr.push(`goodsGroup${index}`)
  59 + }
  60 + })
  61 + if (arr.length > 0) {
  62 + this.setData({
  63 + goodsGroupArr : arr
  64 + })
  65 + arr.map(item=>{
  66 + let a = '.'+item
  67 + this[item] = this.selectComponent(a);
  68 + })
  69 + }
  70 + },
50 //当隐藏的时候就关闭计时器 71 //当隐藏的时候就关闭计时器
51 onHide: function() { 72 onHide: function() {
52 73
@@ -70,6 +91,9 @@ Page({ @@ -70,6 +91,9 @@ Page({
70 isTemplate: 1, 91 isTemplate: 1,
71 bgcolor_t: temp_data.bkcolor 92 bgcolor_t: temp_data.bkcolor
72 }); 93 });
  94 + setTimeout(()=>{
  95 + th.newGoodsGroup()
  96 + },1000)
73 97
74 //---如果有设定顶部的颜色的时候-- 98 //---如果有设定顶部的颜色的时候--
75 if(temp_data.top_color && temp_data.top_color!='null' ){ 99 if(temp_data.top_color && temp_data.top_color!='null' ){
@@ -156,6 +180,14 @@ Page({ @@ -156,6 +180,14 @@ Page({
156 item.re_show(); 180 item.re_show();
157 } 181 }
158 } 182 }
  183 +
  184 + //自定义时商品自动加载更多
  185 + let goodsGroupArr = this.data.goodsGroupArr
  186 + if (this.data.isTemplate && goodsGroupArr.length >0) {
  187 + goodsGroupArr.map(item=>{
  188 + this[item].automore()
  189 + })
  190 + }
159 }, 191 },
160 192
161 193
pages/template/index.json
@@ -22,5 +22,6 @@ @@ -22,5 +22,6 @@
22 "scan": "/components/diy_scan/diy_scan", 22 "scan": "/components/diy_scan/diy_scan",
23 "presell": "/components/diy_pregoods/diy_pregoods" 23 "presell": "/components/diy_pregoods/diy_pregoods"
24 }, 24 },
25 - "enablePullDownRefresh": false 25 + "enablePullDownRefresh": false,
  26 + "onReachBottomDistance":300
26 } 27 }
27 \ No newline at end of file 28 \ No newline at end of file
pages/template/index.wxml
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 </block> 15 </block>
16 <!--商品分组--> 16 <!--商品分组-->
17 <block wx:if="{{item.ename=='goodsGroup'}}"> 17 <block wx:if="{{item.ename=='goodsGroup'}}">
18 - <goodsGroup object="{{item.content}}"></goodsGroup> 18 + <goodsGroup class="{{'goodsGroup' + index}}" object="{{item.content}}"></goodsGroup>
19 </block> 19 </block>
20 <!--通知--> 20 <!--通知-->
21 <block wx:if="{{item.ename=='notice'}}"> 21 <block wx:if="{{item.ename=='notice'}}">
pages/user/assistance/task_assistance.wxml
@@ -59,6 +59,12 @@ @@ -59,6 +59,12 @@
59 style="background-color:#{{btn_color ? btn_color:'fbda0e'}};color:{{font_color?('#'+font_color):'white'}};"> 59 style="background-color:#{{btn_color ? btn_color:'fbda0e'}};color:{{font_color?('#'+font_color):'white'}};">
60 好友拆一拆 60 好友拆一拆
61 </view> 61 </view>
  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> -->
  67 +
62 <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" 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"
63 style="background-color:#{{btn_color ? btn_color:'fbda0e'}};color:{{font_color?('#'+font_color):'white'}};"> 69 style="background-color:#{{btn_color ? btn_color:'fbda0e'}};color:{{font_color?('#'+font_color):'white'}};">
64 立即兑换 70 立即兑换
pages/user/cardinfo/cardinfo.js
@@ -673,7 +673,7 @@ Page({ @@ -673,7 +673,7 @@ Page({
673 tt(); 673 tt();
674 }, 674 },
675 fail: function (res) { 675 fail: function (res) {
676 - ee.data.head_pic = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的 676 + ee.data.head_pic = "../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的
677 tt(); 677 tt();
678 } 678 }
679 }); 679 });
@@ -707,7 +707,7 @@ Page({ @@ -707,7 +707,7 @@ Page({
707 to_user_money:function(){ 707 to_user_money:function(){
708 //提现小于0的值也不提现 708 //提现小于0的值也不提现
709 if(!this.data.free.VIPRebate || parseFloat(this.data.free.VIPRebate)<=0){ 709 if(!this.data.free.VIPRebate || parseFloat(this.data.free.VIPRebate)<=0){
710 - getApp().my_warnning("您目前没有可提现的金额",0,th); return false; 710 + getApp().my_warnning("您目前没有可提现的金额",0,this); return false;
711 } 711 }
712 this.setData({yu_e_show:1}) 712 this.setData({yu_e_show:1})
713 }, 713 },
pages/user/cardinfo/cardinfo.wxml
1 <import src="../../../utils/wxParse/wxParse.wxml"></import> 1 <import src="../../../utils/wxParse/wxParse.wxml"></import>
2 -<import src="../../../utils/filter.wxs"></import>  
3 <wxs module="filters" src="../../../utils/filter.wxs"></wxs> 2 <wxs module="filters" src="../../../utils/filter.wxs"></wxs>
4 3
5 <view> 4 <view>
@@ -63,7 +62,7 @@ @@ -63,7 +62,7 @@
63 62
64 <view class="flex"> 63 <view class="flex">
65 <view class="Detailed flex-center"> 64 <view class="Detailed flex-center">
66 - <navigator url="/pages/user/Detailed/Detailed">明细</navigator> 65 + <navigator url="/packageE/pages/user/Detailed/Detailed">明细</navigator>
67 </view> 66 </view>
68 <view class="Invitation_Cash" bindtap="to_user_money">转到余额</view> 67 <view class="Invitation_Cash" bindtap="to_user_money">转到余额</view>
69 </view> 68 </view>
pages/user/get_user_info/get_user_info.js deleted
1 -var e = getApp();  
2 -  
3 -e.request;  
4 -  
5 -Page({  
6 - data: {  
7 - url: e.globalData.setting.url,  
8 - resourceUrl: e.globalData.setting.resourceUrl,  
9 - requestData: null  
10 - },  
11 - onLoad: function() {},  
12 - onShow: function() {},  
13 - bindGetUserinfo: function(t) {  
14 - if (void 0 != t.detail.userInfo) try {  
15 - wx.setStorageSync("wx_user_info", t.detail.encryptedData), e.globalData.wechatUser = t.detail.userInfo,  
16 - e.auth.login(e.globalData.code, t.detail, function(t) {  
17 - e.showSuccess("登录成功", function() {  
18 - wx.navigateBack();  
19 - });  
20 - });  
21 - } catch (e) {  
22 - console.log(e);  
23 - } else console.log("bindGetUserinfo fail . res.detail.userInfo is undefined");  
24 - }  
25 -});  
26 \ No newline at end of file 0 \ No newline at end of file
pages/user/get_user_info/get_user_info.json deleted
1 -{  
2 - "navigationBarTitleText": "登录"  
3 -}  
4 \ No newline at end of file 0 \ No newline at end of file
pages/user/get_user_info/get_user_info.wxml deleted
1 -<view class="no-data">  
2 - <image class="cart-image"></image>  
3 - <view class="no-data-title">请先登录, 以便操作更多功能</view>  
4 - <button bindgetuserinfo="bindGetUserinfo" class="getuse_info" openType="getUserInfo">获取用户信息</button>  
5 - <navigator class="similer" url="/pages/index/index/index">返回首页</navigator>  
6 -</view>  
pages/user/get_user_info/get_user_info.wxss deleted
1 -page {  
2 - background-color: #fff;  
3 -}  
4 -  
5 -.container {  
6 - display: flex;  
7 - height: 100%;  
8 - align-items: center;  
9 - justify-content: center;  
10 - background-color: #fff;  
11 - padding-bottom: 100rpx;  
12 -}  
13 -  
14 -.login-in {  
15 - width: 100%;  
16 - box-sizing: border-box;  
17 -}  
18 -  
19 -.order-item {  
20 - display: flex;  
21 - justify-content: space-around;  
22 - height: 200rpx;  
23 - padding: 10rpx 0;  
24 - border-bottom: 1px solid #ddd;  
25 -}  
26 -  
27 -.goods-ico {  
28 - display: flex;  
29 - align-items: center;  
30 -}  
31 -  
32 -.goods-img {  
33 - width: 180rpx;  
34 - height: 180rpx;  
35 - font-size: 0;  
36 - margin-top: 10rpx;  
37 -}  
38 -  
39 -.goods-cont {  
40 - position: relative;  
41 - width: 430rpx;  
42 - height: 200rpx;  
43 - font-size: 28rpx;  
44 -}  
45 -  
46 -.goods-name {  
47 - width: 370rpx;  
48 - height: 64rpx;  
49 - margin: 8rpx 0;  
50 - line-height: 32rpx;  
51 - color: #333;  
52 -}  
53 -  
54 -.goods-attribute {  
55 - max-height: 52rpx;  
56 - line-height: 26rpx;  
57 - font-size: 24rpx;  
58 - color: #999;  
59 -}  
60 -  
61 -.goods-price {  
62 - height: 40rpx;  
63 - line-height: 40rpx;  
64 - margin-top: 10rpx;  
65 -}  
66 -  
67 -.btn-del {  
68 - position: absolute;  
69 - right: 0;  
70 - top: 8rpx;  
71 - width: 34rpx;  
72 - height: 34rpx;  
73 -}  
74 -  
75 -.count {  
76 - position: absolute;  
77 - right: 0;  
78 - bottom: 5rpx;  
79 - width: 156rpx;  
80 - height: 50rpx;  
81 - border: 1px solid #ddd;  
82 -}  
83 -  
84 -.count>view,.count>input {  
85 - float: left;  
86 - width: 50rpx;  
87 - height: 50rpx;  
88 - line-height: 50rpx;  
89 - text-align: center;  
90 -}  
91 -  
92 -.sub {  
93 - border-right: 1px solid #ddd;  
94 -}  
95 -  
96 -.add {  
97 - border-left: 1px solid #ddd;  
98 -}  
99 -  
100 -.pay-for {  
101 - width: 100%;  
102 - height: 100rpx;  
103 - position: fixed;  
104 - left: 0;  
105 - bottom: 0;  
106 - font-size: 28rpx;  
107 - color: #666;  
108 - background-color: #f0f2f5;  
109 -}  
110 -  
111 -.pay-for .pay-btn {  
112 - float: right;  
113 - width: 200rpx;  
114 - height: 100rpx;  
115 - line-height: 100rpx;  
116 - text-align: center;  
117 - background-color: #f23030;  
118 - color: #fff;  
119 - border-radius: 0;  
120 -}  
121 -  
122 -.pay-for .consumer {  
123 - float: right;  
124 - margin-right: 20rpx;  
125 - line-height: 50rpx;  
126 -}  
127 -  
128 -.pay-for .checkbox {  
129 - float: left;  
130 - padding-left: 40rpx;  
131 - line-height: 100rpx;  
132 - display: flex;  
133 - align-items: center;  
134 -}  
135 -  
136 -.pay-for .ico-check {  
137 - display: flex;  
138 - align-items: center;  
139 - margin-right: 20rpx;  
140 -}  
141 -  
142 -.getuse_info {  
143 - width: 60%;  
144 - background-color: #ff354d;  
145 - color: #fff;  
146 - border: none;  
147 - border-radius: 8rpx;  
148 -}  
149 -  
150 -.similer {  
151 - margin: 0 auto;  
152 - margin-top: 20px;  
153 - width: 60%;  
154 - height: 64rpx;  
155 - line-height: 64rpx;  
156 - font-size: 28rpx;  
157 - border-radius: 8rpx;  
158 - border: 1px solid #999;  
159 -}  
160 \ No newline at end of file 0 \ No newline at end of file
pages/user/index/index.js
@@ -711,7 +711,7 @@ Page({ @@ -711,7 +711,7 @@ Page({
711 url + "&gradeId=" + th.data.gradeId + "&FormId=" + item.Id); 711 url + "&gradeId=" + th.data.gradeId + "&FormId=" + item.Id);
712 break; 712 break;
713 case "02": 713 case "02":
714 - getApp().goto("/pages/user/user_fw/user_fw?gradeId=" + th.data.gradeId + "&FormId=" + item.Id); 714 + getApp().goto("/packageE/pages/user/user_fw/user_fw?gradeId=" + th.data.gradeId + "&FormId=" + item.Id);
715 break; 715 break;
716 case "03": 716 case "03":
717 getApp().goto("/pages/user/user_spsy/user_spsy?img=" + 717 getApp().goto("/pages/user/user_spsy/user_spsy?img=" +
pages/user/order_list/order_list.js
@@ -10,7 +10,7 @@ var t = function(t) { @@ -10,7 +10,7 @@ var t = function(t) {
10 oo = e.globalData, 10 oo = e.globalData,
11 r = e.request, 11 r = e.request,
12 rq = r, 12 rq = r,
13 - a = require("../../../utils/common.js"), 13 + a = require("../../../utils/common.js"),
14 s = new t.default(); 14 s = new t.default();
15 var regeneratorRuntime = require('../../../utils/runtime.js'); 15 var regeneratorRuntime = require('../../../utils/runtime.js');
16 var ut= require('../../../utils/util.js'); 16 var ut= require('../../../utils/util.js');
@@ -481,6 +481,45 @@ Page({ @@ -481,6 +481,45 @@ Page({
481 } 481 }
482 }); 482 });
483 }, 483 },
  484 + //-----删除订单-----
  485 + deleteSerOrderData: function(t) {
  486 + var th = this;
  487 + var order_id = t.currentTarget.dataset.orderid;
  488 + let order_sn = t.currentTarget.dataset.ordersn;
  489 + var index = t.currentTarget.dataset.index;
  490 + // var up_data={order_id: order_id,isdel:1};
  491 + // var order=th.data.orderList[index];
  492 + // if(order.order_status!=6){
  493 + // up_data.order_status=5;
  494 + // }
  495 + wx.showModal({
  496 + title: "是否删除订单?",
  497 + success: function(tt) {
  498 + tt.confirm && rq.put("/api/weshop/recharge/update", {
  499 + data: {
  500 + store_id: os.stoid,
  501 + order_id: order_id,
  502 + order_sn: order_sn,
  503 + order_status: 5,
  504 + },
  505 + success: function(t) {
  506 + let cardList = th.data.cardList
  507 + cardList.splice(index,1)
  508 + th.setData({
  509 + cardList
  510 + })
  511 + // for (var e = 0; e < th.data.orderList.length; e++)
  512 + // if (th.data.orderList[e].order_id == order_id) {
  513 + // th.data.orderList.splice(e, 1), th.setData({
  514 + // orderList: th.data.orderList
  515 + // });
  516 + // break;
  517 + // }
  518 + }
  519 + })
  520 + }
  521 + });
  522 + },
484 523
485 deleteOrderData2: function(order_id) { 524 deleteOrderData2: function(order_id) {
486 var th = this; 525 var th = this;
pages/user/order_list/order_list.wxml
@@ -73,8 +73,12 @@ @@ -73,8 +73,12 @@
73 <block wx:if="{{!(item.is_all_return_status==0 || item.is_all_return_status==1)}}"> 73 <block wx:if="{{!(item.is_all_return_status==0 || item.is_all_return_status==1)}}">
74 <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==0)}}">待发货</view> 74 <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==0)}}">待发货</view>
75 <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==1)}}">待收货</view> 75 <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==1)}}">待收货</view>
76 - <view wx:if="{{(item.order_status==2)}}">待评价</view>  
77 - <view wx:if="{{item.order_status==4}}">已评价</view> 76 + <view wx:if="{{(item.order_status==2)}}" class="flex-center">待评价<view class="lin"></view>
  77 + <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData" data-index="{{index}}" data-order_id="{{item.order_id}}"></image>
  78 + </view>
  79 + <view wx:if="{{item.order_status==4}}" class="flex-center">已评价<view class="lin"></view>
  80 + <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData" data-index="{{index}}" data-order_id="{{item.order_id}}"></image>
  81 + </view>
78 <view wx:if="{{item.order_status==3 && item.pt_status!=6}}" class="flex-center" >已取消<view class="lin"></view> 82 <view wx:if="{{item.order_status==3 && item.pt_status!=6}}" class="flex-center" >已取消<view class="lin"></view>
79 <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData" data-index="{{index}}" data-order_id="{{item.order_id}}"></image> 83 <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData" data-index="{{index}}" data-order_id="{{item.order_id}}"></image>
80 </view> 84 </view>
@@ -90,8 +94,12 @@ @@ -90,8 +94,12 @@
90 <view wx:if="{{(item.order_status==0&&item.pay_status==0)}}">未支付</view> 94 <view wx:if="{{(item.order_status==0&&item.pay_status==0)}}">未支付</view>
91 <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==0 && item.team_status == 2)}}">待发货</view> 95 <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==0 && item.team_status == 2)}}">待发货</view>
92 <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==1 && item.team_status == 2)}}">待收货</view> 96 <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==1 && item.team_status == 2)}}">待收货</view>
93 - <view wx:if="{{(item.order_status==2)}}">待评价</view>  
94 - <view wx:if="{{item.order_status==4}}">已评价</view> 97 + <view wx:if="{{(item.order_status==2)}}" class="flex-center">待评价<view class="lin"></view>
  98 + <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData" data-index="{{index}}" data-order_id="{{item.order_id}}"></image>
  99 + </view>
  100 + <view wx:if="{{item.order_status==4}}" class="flex-center">已评价<view class="lin"></view>
  101 + <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData" data-index="{{index}}" data-order_id="{{item.order_id}}"></image>
  102 + </view>
95 <view wx:if="{{item.pay_status == 0 && item.order_status==3 && item.pt_status!=6}}" class="flex-center" >已取消<view class="lin"></view> 103 <view wx:if="{{item.pay_status == 0 && item.order_status==3 && item.pt_status!=6}}" class="flex-center" >已取消<view class="lin"></view>
96 <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData" data-index="{{index}}" data-order_id="{{item.order_id}}"></image> 104 <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData" data-index="{{index}}" data-order_id="{{item.order_id}}"></image>
97 </view> 105 </view>
@@ -103,8 +111,12 @@ @@ -103,8 +111,12 @@
103 <block wx:if="{{!(item.is_all_return_status==0 || item.is_all_return_status==1)}}"> 111 <block wx:if="{{!(item.is_all_return_status==0 || item.is_all_return_status==1)}}">
104 <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==0)}}">待发货</view> 112 <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==0)}}">待发货</view>
105 <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==1)}}">待收货</view> 113 <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==1)}}">待收货</view>
106 - <view wx:if="{{(item.order_status==2)}}">待评价</view>  
107 - <view wx:if="{{item.order_status==4}}">已评价</view> 114 + <view wx:if="{{(item.order_status==2)}}" class="flex-center">待评价<view class="lin"></view>
  115 + <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData" data-index="{{index}}" data-order_id="{{item.order_id}}"></image>
  116 + </view>
  117 + <view wx:if="{{item.order_status==4}}" class="flex-center">已评价<view class="lin"></view>
  118 + <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData" data-index="{{index}}" data-order_id="{{item.order_id}}"></image>
  119 + </view>
108 <view wx:if="{{item.order_status==3 && item.pt_status!=6}}" class="flex-center" >已取消<view class="lin"></view> 120 <view wx:if="{{item.order_status==3 && item.pt_status!=6}}" class="flex-center" >已取消<view class="lin"></view>
109 <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData" data-index="{{index}}" data-order_id="{{item.order_id}}"></image> 121 <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData" data-index="{{index}}" data-order_id="{{item.order_id}}"></image>
110 </view> 122 </view>
@@ -294,9 +306,15 @@ @@ -294,9 +306,15 @@
294 <!-- 订单状态 --> 306 <!-- 订单状态 -->
295 <view class="flex-center c-r"> 307 <view class="flex-center c-r">
296 <view wx:if="{{item.order_status == 0}}">待支付</view> 308 <view wx:if="{{item.order_status == 0}}">待支付</view>
297 - <view wx:if="{{item.order_status == 1}}">待评价</view>  
298 - <view wx:if="{{item.order_status == 2}}">已评价</view>  
299 - <view wx:if="{{item.order_status == 3}}" class="c-a9">已取消</view> 309 + <view wx:if="{{item.order_status == 1}}" class="flex-center">待评价 <view class="lin"></view>
  310 + <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteSerOrderData" data-index="{{index}}" data-orderid="{{item.order_id}}" data-ordersn="{{item.order_sn}}" ></image>
  311 + </view>
  312 + <view wx:if="{{item.order_status == 2}}" class="flex-center">已评价<view class="lin"></view>
  313 + <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteSerOrderData" data-index="{{index}}" data-orderid="{{item.order_id}}" data-ordersn="{{item.order_sn}}" ></image>
  314 + </view>
  315 + <view wx:if="{{item.order_status == 3}}" class="c-a9" class="flex-center">已取消<view class="lin"></view>
  316 + <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteSerOrderData" data-index="{{index}}" data-orderid="{{item.order_id}}" data-ordersn="{{item.order_sn}}" ></image>
  317 + </view>
300 <view wx:if="{{item.order_status == 5}}">已作废</view> 318 <view wx:if="{{item.order_status == 5}}">已作废</view>
301 </view> 319 </view>
302 </view> 320 </view>
@@ -367,7 +385,7 @@ @@ -367,7 +385,7 @@
367 <image wx:if="{{(item.order_status==1&&item.pay_status==1 && item.shipping_status==0 && item.exp_type==1 && !(item.order_goods[0].prom_type==9))}}" class="code" src="{{iurl}}miniapp/images/order/code.png" bindtap="code_show" data-order_sn="{{item.order_sn}}"></image> 385 <image wx:if="{{(item.order_status==1&&item.pay_status==1 && item.shipping_status==0 && item.exp_type==1 && !(item.order_goods[0].prom_type==9))}}" class="code" src="{{iurl}}miniapp/images/order/code.png" bindtap="code_show" data-order_sn="{{item.order_sn}}"></image>
368 <view bindtap="cancle" class="commodity_To_evaluate flex-level View_evaluation" data-id="{{tabIndex}}" data-orderid="{{item.order_id}}" data-ordersn="{{item.order_sn}}" wx:if="{{(item.order_status==0)}}" data-index="{{tabIndex}}">取消订单</view> 386 <view bindtap="cancle" class="commodity_To_evaluate flex-level View_evaluation" data-id="{{tabIndex}}" data-orderid="{{item.order_id}}" data-ordersn="{{item.order_sn}}" wx:if="{{(item.order_status==0)}}" data-index="{{tabIndex}}">取消订单</view>
369 387
370 - 388 +
371 <navigator class="commodity_To_evaluate flex-level View_evaluation" url="/packageA/pages/details_serviceCard/details_serviceCard?order_id={{item.order_id}}">订单详情</navigator> 389 <navigator class="commodity_To_evaluate flex-level View_evaluation" url="/packageA/pages/details_serviceCard/details_serviceCard?order_id={{item.order_id}}">订单详情</navigator>
372 390
373 391
pages/user/userqy/userqy.js
@@ -197,7 +197,7 @@ Page({ @@ -197,7 +197,7 @@ Page({
197 +url+"&gradeId="+th.data.gradeId+"&FormId="+item.Id); 197 +url+"&gradeId="+th.data.gradeId+"&FormId="+item.Id);
198 break; 198 break;
199 case "02": 199 case "02":
200 - getApp().goto("/pages/user/user_fw/user_fw?gradeId="+th.data.gradeId+"&FormId="+item.Id); 200 + getApp().goto("/packageE/pages/user/user_fw/user_fw?gradeId="+th.data.gradeId+"&FormId="+item.Id);
201 break; 201 break;
202 case "03": 202 case "03":
203 getApp().goto("/pages/user/user_spsy/user_spsy?img="+url+"&gradeId="+th.data.gradeId+"&FormId="+item.Id); 203 getApp().goto("/pages/user/user_spsy/user_spsy?img="+url+"&gradeId="+th.data.gradeId+"&FormId="+item.Id);
utils/auth.js
@@ -269,7 +269,7 @@ module.exports = { @@ -269,7 +269,7 @@ module.exports = {
269 }, 269 },
270 goGetUserInfo: function() { 270 goGetUserInfo: function() {
271 wx.navigateTo({ 271 wx.navigateTo({
272 - url: "/pages/user/get_user_info/get_user_info" 272 + url: "/packageE/pages/togoin/togoin"
273 }); 273 });
274 } 274 }
275 }; 275 };
utils/wxParse/wxParse.wxss
@@ -178,6 +178,7 @@ view.wxParse view{ @@ -178,6 +178,7 @@ view.wxParse view{
178 .wxParse-li-text { 178 .wxParse-li-text {
179 align-items: center; 179 align-items: center;
180 line-height: 20px; 180 line-height: 20px;
  181 + position: relative;
181 } 182 }
182 183
183 .wxParse-li-circle { 184 .wxParse-li-circle {