|
@@ -31,7 +31,39 @@ Page({ |
|
@@ -31,7 +31,39 @@ Page({ |
31
|
status2: '',
|
31
|
status2: '',
|
32
|
title2: '',
|
32
|
title2: '',
|
33
|
scrollTop:'',
|
33
|
scrollTop:'',
|
34
|
- pid:''
|
34
|
+ pid:'',
|
|
|
35
|
+ logok:'',
|
|
|
36
|
+ selected:0,
|
|
|
37
|
+ list:[{
|
|
|
38
|
+ pagePath: "/packageA/pages/index/index",
|
|
|
39
|
+ text: "商品",
|
|
|
40
|
+ iconPath: "/images/tabbar/icon_75.png",
|
|
|
41
|
+ selectedIconPath: "/images/tabbar/icon_68.png"
|
|
|
42
|
+ },
|
|
|
43
|
+ {
|
|
|
44
|
+ pagePath: "/packageA/pages/message/message",
|
|
|
45
|
+ text: "消息",
|
|
|
46
|
+ iconPath: "/images/tabbar/message.png",
|
|
|
47
|
+ selectedIconPath: "/images/tabbar/messageactive.png"
|
|
|
48
|
+ },
|
|
|
49
|
+ {
|
|
|
50
|
+ pagePath: "/packageA/pages/shop_cart/shop_cart",
|
|
|
51
|
+ text: "购物车",
|
|
|
52
|
+ iconPath: "/images/tabbar/icon_70.png",
|
|
|
53
|
+ selectedIconPath: "/images/tabbar/icon_73.png"
|
|
|
54
|
+ },
|
|
|
55
|
+ {
|
|
|
56
|
+ pagePath: "/packageA/pages/my/my",
|
|
|
57
|
+ text: "我的",
|
|
|
58
|
+ iconPath: "/images/tabbar/icon_71.png",
|
|
|
59
|
+ selectedIconPath: "/images/tabbar/icon_72.png"
|
|
|
60
|
+ }],
|
|
|
61
|
+ category_id1:'',
|
|
|
62
|
+ sort:'',
|
|
|
63
|
+ keyword:'',
|
|
|
64
|
+ shop_arr:[],
|
|
|
65
|
+ pricesheng:false,
|
|
|
66
|
+ xiaoliang:false
|
35
|
},
|
67
|
},
|
36
|
|
68
|
|
37
|
scroll(e) {
|
69
|
scroll(e) {
|
|
@@ -66,11 +98,11 @@ if( app.globalData.index==undefined){ |
|
@@ -66,11 +98,11 @@ if( app.globalData.index==undefined){ |
66
|
this.get_shopnum()
|
98
|
this.get_shopnum()
|
67
|
this.getmessagelist();
|
99
|
this.getmessagelist();
|
68
|
console.log('998867',this.data.pid)
|
100
|
console.log('998867',this.data.pid)
|
69
|
- if(this.data.pid){
|
|
|
70
|
- this.get_info(this.data.pid, 2);
|
|
|
71
|
- }else{
|
|
|
72
|
- this.get_info(0, 1);
|
|
|
73
|
- }
|
101
|
+ // if(this.data.pid){
|
|
|
102
|
+ // this.get_info(this.data.pid, 2);
|
|
|
103
|
+ // }else{
|
|
|
104
|
+ // this.get_info(0, 1);
|
|
|
105
|
+ // }
|
74
|
|
106
|
|
75
|
// 获取活动专区
|
107
|
// 获取活动专区
|
76
|
this.getzhuanqulist();
|
108
|
this.getzhuanqulist();
|
|
@@ -83,9 +115,33 @@ if( app.globalData.index==undefined){ |
|
@@ -83,9 +115,33 @@ if( app.globalData.index==undefined){ |
83
|
}
|
115
|
}
|
84
|
//控制显示隐藏
|
116
|
//控制显示隐藏
|
85
|
this.ishow()
|
117
|
this.ishow()
|
|
|
118
|
+// 我写的项目
|
|
|
119
|
+// 获取一级分类
|
|
|
120
|
+this.getonkind();
|
|
|
121
|
+// 获取商品列表
|
|
|
122
|
+this.getgoodlist()
|
86
|
|
123
|
|
87
|
},
|
124
|
},
|
88
|
|
125
|
|
|
|
126
|
+ // 获取一级分类
|
|
|
127
|
+ getonkind(){
|
|
|
128
|
+ let that= this;
|
|
|
129
|
+ let url="/sundry/get_category"
|
|
|
130
|
+ app.postk(url, {}).then((r) => {
|
|
|
131
|
+ console.log('商品分类',r)
|
|
|
132
|
+ let obj = {
|
|
|
133
|
+ name: '首页',
|
|
|
134
|
+ id: ''
|
|
|
135
|
+ }
|
|
|
136
|
+ r.data.unshift(obj)
|
|
|
137
|
+ that.setData({
|
|
|
138
|
+ nav_arr: r.data
|
|
|
139
|
+ })
|
|
|
140
|
+ })
|
|
|
141
|
+ },
|
|
|
142
|
+
|
|
|
143
|
+
|
|
|
144
|
+
|
89
|
// 获取个人信息
|
145
|
// 获取个人信息
|
90
|
getInfoFun() {
|
146
|
getInfoFun() {
|
91
|
let that= this;
|
147
|
let that= this;
|
|
@@ -112,7 +168,7 @@ if( app.globalData.index==undefined){ |
|
@@ -112,7 +168,7 @@ if( app.globalData.index==undefined){ |
112
|
success(res) {
|
168
|
success(res) {
|
113
|
if (res.confirm) {
|
169
|
if (res.confirm) {
|
114
|
wx.navigateTo({
|
170
|
wx.navigateTo({
|
115
|
- url: '/pages/register/register',
|
171
|
+ url: '/packageA/pages/register/register',
|
116
|
})
|
172
|
})
|
117
|
} else if (res.cancel) {
|
173
|
} else if (res.cancel) {
|
118
|
}
|
174
|
}
|
|
@@ -138,7 +194,7 @@ if( app.globalData.index==undefined){ |
|
@@ -138,7 +194,7 @@ if( app.globalData.index==undefined){ |
138
|
success(res) {
|
194
|
success(res) {
|
139
|
if (res.confirm) {
|
195
|
if (res.confirm) {
|
140
|
wx.navigateTo({
|
196
|
wx.navigateTo({
|
141
|
- url: '/pages/login/login',
|
197
|
+ url: '/packageA/pages/login/login',
|
142
|
})
|
198
|
})
|
143
|
} else if (res.cancel) {
|
199
|
} else if (res.cancel) {
|
144
|
}
|
200
|
}
|
|
@@ -150,7 +206,7 @@ if( app.globalData.index==undefined){ |
|
@@ -150,7 +206,7 @@ if( app.globalData.index==undefined){ |
150
|
|
206
|
|
151
|
}
|
207
|
}
|
152
|
wx.navigateTo({
|
208
|
wx.navigateTo({
|
153
|
- url: '/pages/xianshi/xianshi?title2='+this.data.title2,
|
209
|
+ url: '/packageA/pages/xianshi/xianshi?title2='+this.data.title2,
|
154
|
})
|
210
|
})
|
155
|
}
|
211
|
}
|
156
|
|
212
|
|
|
@@ -257,15 +313,15 @@ if( app.globalData.index==undefined){ |
|
@@ -257,15 +313,15 @@ if( app.globalData.index==undefined){ |
257
|
//获取活动专区列表
|
313
|
//获取活动专区列表
|
258
|
getzhuanqulist() {
|
314
|
getzhuanqulist() {
|
259
|
let that = this
|
315
|
let that = this
|
260
|
- let url = '/activity/get_all';
|
316
|
+ let url = '/activity/get_list';
|
261
|
let data = {
|
317
|
let data = {
|
262
|
|
318
|
|
263
|
|
319
|
|
264
|
}
|
320
|
}
|
265
|
- app.post(url, data, "POST").then((r) => {
|
321
|
+ app.postk(url, data, "POST").then((r) => {
|
266
|
console.log(r)
|
322
|
console.log(r)
|
267
|
that.setData({
|
323
|
that.setData({
|
268
|
- activity: r.msg
|
324
|
+ activity: r.data
|
269
|
})
|
325
|
})
|
270
|
|
326
|
|
271
|
console.log(that.data.activity)
|
327
|
console.log(that.data.activity)
|
|
@@ -289,7 +345,7 @@ if( app.globalData.index==undefined){ |
|
@@ -289,7 +345,7 @@ if( app.globalData.index==undefined){ |
289
|
success(res) {
|
345
|
success(res) {
|
290
|
if (res.confirm) {
|
346
|
if (res.confirm) {
|
291
|
wx.navigateTo({
|
347
|
wx.navigateTo({
|
292
|
- url: '/pages/register/register',
|
348
|
+ url: '/packageA/pages/register/register',
|
293
|
})
|
349
|
})
|
294
|
} else if (res.cancel) {
|
350
|
} else if (res.cancel) {
|
295
|
}
|
351
|
}
|
|
@@ -306,7 +362,7 @@ if( app.globalData.index==undefined){ |
|
@@ -306,7 +362,7 @@ if( app.globalData.index==undefined){ |
306
|
|
362
|
|
307
|
|
363
|
|
308
|
wx.navigateTo({
|
364
|
wx.navigateTo({
|
309
|
- url: '/pages/login/login',
|
365
|
+ url: '/packageA/pages/login/login',
|
310
|
})
|
366
|
})
|
311
|
} else if (res.cancel) {
|
367
|
} else if (res.cancel) {
|
312
|
}
|
368
|
}
|
|
@@ -316,7 +372,7 @@ if( app.globalData.index==undefined){ |
|
@@ -316,7 +372,7 @@ if( app.globalData.index==undefined){ |
316
|
return false
|
372
|
return false
|
317
|
}
|
373
|
}
|
318
|
wx.navigateTo({
|
374
|
wx.navigateTo({
|
319
|
- url: '/pages/zhuanqu/zhuanqu?id=' + id,
|
375
|
+ url: '/packageA/pages/zhuanqu/zhuanqu?id=' + id,
|
320
|
})
|
376
|
})
|
321
|
}
|
377
|
}
|
322
|
|
378
|
|
|
@@ -331,7 +387,7 @@ if( app.globalData.index==undefined){ |
|
@@ -331,7 +387,7 @@ if( app.globalData.index==undefined){ |
331
|
success(res) {
|
387
|
success(res) {
|
332
|
if (res.confirm) {
|
388
|
if (res.confirm) {
|
333
|
wx.navigateTo({
|
389
|
wx.navigateTo({
|
334
|
- url: '/pages/register/register',
|
390
|
+ url: '/packageA/pages/register/register',
|
335
|
})
|
391
|
})
|
336
|
} else if (res.cancel) {
|
392
|
} else if (res.cancel) {
|
337
|
}
|
393
|
}
|
|
@@ -350,7 +406,7 @@ if( app.globalData.index==undefined){ |
|
@@ -350,7 +406,7 @@ if( app.globalData.index==undefined){ |
350
|
|
406
|
|
351
|
|
407
|
|
352
|
wx.navigateTo({
|
408
|
wx.navigateTo({
|
353
|
- url: '/pages/login/login',
|
409
|
+ url: '/packageA/pages/login/login',
|
354
|
})
|
410
|
})
|
355
|
} else if (res.cancel) {
|
411
|
} else if (res.cancel) {
|
356
|
}
|
412
|
}
|
|
@@ -360,7 +416,7 @@ if( app.globalData.index==undefined){ |
|
@@ -360,7 +416,7 @@ if( app.globalData.index==undefined){ |
360
|
return false
|
416
|
return false
|
361
|
}
|
417
|
}
|
362
|
wx.navigateTo({
|
418
|
wx.navigateTo({
|
363
|
- url: '/pages/classify/classify',
|
419
|
+ url: '/packageA/pages/classify/classify',
|
364
|
})
|
420
|
})
|
365
|
},
|
421
|
},
|
366
|
//展示所有的小分类
|
422
|
//展示所有的小分类
|
|
@@ -379,7 +435,7 @@ if( app.globalData.index==undefined){ |
|
@@ -379,7 +435,7 @@ if( app.globalData.index==undefined){ |
379
|
success(res) {
|
435
|
success(res) {
|
380
|
if (res.confirm) {
|
436
|
if (res.confirm) {
|
381
|
wx.navigateTo({
|
437
|
wx.navigateTo({
|
382
|
- url: '/pages/register/register',
|
438
|
+ url: '/packageA/pages/register/register',
|
383
|
})
|
439
|
})
|
384
|
} else if (res.cancel) {
|
440
|
} else if (res.cancel) {
|
385
|
}
|
441
|
}
|
|
@@ -396,7 +452,7 @@ if( app.globalData.index==undefined){ |
|
@@ -396,7 +452,7 @@ if( app.globalData.index==undefined){ |
396
|
|
452
|
|
397
|
|
453
|
|
398
|
wx.navigateTo({
|
454
|
wx.navigateTo({
|
399
|
- url: '/pages/login/login',
|
455
|
+ url: '/packageA/pages/login/login',
|
400
|
})
|
456
|
})
|
401
|
} else if (res.cancel) {
|
457
|
} else if (res.cancel) {
|
402
|
}
|
458
|
}
|
|
@@ -405,12 +461,17 @@ if( app.globalData.index==undefined){ |
|
@@ -405,12 +461,17 @@ if( app.globalData.index==undefined){ |
405
|
|
461
|
|
406
|
return false
|
462
|
return false
|
407
|
}
|
463
|
}
|
408
|
- let title = this.data.nav_arr[this.data.nav_index].name
|
|
|
409
|
- let index = e.currentTarget.dataset.index ? e.currentTarget.dataset.index : 0
|
|
|
410
|
- let pid = this.data.nav_arr[this.data.nav_index].id
|
|
|
411
|
- wx.navigateTo({
|
|
|
412
|
- url: '/pages/search/search_result/search_result?title=' + title + "&index=" + index + '&pid=' + pid
|
464
|
+ let title = this.data.nav_arr[this.data.nav_index].name
|
|
|
465
|
+ let category_id2=e.currentTarget.dataset.id;
|
|
|
466
|
+ wx.navigateTo({
|
|
|
467
|
+ url: '/packageA/pages/search/search_result/search_result?title=' + title + '&category_id2=' + category_id2
|
413
|
})
|
468
|
})
|
|
|
469
|
+
|
|
|
470
|
+ // let index = e.currentTarget.dataset.index ? e.currentTarget.dataset.index : 0
|
|
|
471
|
+ // let pid = this.data.nav_arr[this.data.nav_index].id
|
|
|
472
|
+ // wx.navigateTo({
|
|
|
473
|
+ // url: '/packageA/pages/search/search_result/search_result?title=' + title + "&index=" + index + '&pid=' + pid
|
|
|
474
|
+ // })
|
414
|
}
|
475
|
}
|
415
|
|
476
|
|
416
|
},
|
477
|
},
|
|
@@ -432,7 +493,7 @@ if( app.globalData.index==undefined){ |
|
@@ -432,7 +493,7 @@ if( app.globalData.index==undefined){ |
432
|
success(res) {
|
493
|
success(res) {
|
433
|
if (res.confirm) {
|
494
|
if (res.confirm) {
|
434
|
wx.navigateTo({
|
495
|
wx.navigateTo({
|
435
|
- url: '/pages/register/register',
|
496
|
+ url: '/packageA/pages/register/register',
|
436
|
})
|
497
|
})
|
437
|
} else if (res.cancel) {
|
498
|
} else if (res.cancel) {
|
438
|
}
|
499
|
}
|
|
@@ -447,7 +508,7 @@ if( app.globalData.index==undefined){ |
|
@@ -447,7 +508,7 @@ if( app.globalData.index==undefined){ |
447
|
success(res) {
|
508
|
success(res) {
|
448
|
if (res.confirm) {
|
509
|
if (res.confirm) {
|
449
|
wx.navigateTo({
|
510
|
wx.navigateTo({
|
450
|
- url: '/pages/login/login',
|
511
|
+ url: '/packageA/pages/login/login',
|
451
|
})
|
512
|
})
|
452
|
} else if (res.cancel) {
|
513
|
} else if (res.cancel) {
|
453
|
}
|
514
|
}
|
|
@@ -458,12 +519,12 @@ if( app.globalData.index==undefined){ |
|
@@ -458,12 +519,12 @@ if( app.globalData.index==undefined){ |
458
|
}
|
519
|
}
|
459
|
if (style == 2) {
|
520
|
if (style == 2) {
|
460
|
wx.navigateTo({
|
521
|
wx.navigateTo({
|
461
|
- url: '/pages/outerChain/outerChain?src=' + e.currentTarget.dataset.src
|
522
|
+ url: '/packageA/pages/outerChain/outerChain?src=' + e.currentTarget.dataset.src
|
462
|
})
|
523
|
})
|
463
|
} else {
|
524
|
} else {
|
464
|
- wx.navigateTo({
|
|
|
465
|
- url: '/pages/shop_detail/shop_detail?id=' + id
|
|
|
466
|
- })
|
525
|
+ // wx.navigateTo({
|
|
|
526
|
+ // url: '/packageA/pages/shop_detail/shop_detail?id=' + id
|
|
|
527
|
+ // })
|
467
|
}
|
528
|
}
|
468
|
}
|
529
|
}
|
469
|
|
530
|
|
|
@@ -475,67 +536,129 @@ if( app.globalData.index==undefined){ |
|
@@ -475,67 +536,129 @@ if( app.globalData.index==undefined){ |
475
|
// 排序
|
536
|
// 排序
|
476
|
reorder(e) {
|
537
|
reorder(e) {
|
477
|
let that = this
|
538
|
let that = this
|
478
|
- let index = Number(e.currentTarget.dataset.index)
|
|
|
479
|
- if (index == 1) {
|
|
|
480
|
- if (that.data.price == "price") {
|
|
|
481
|
- that.setData({
|
|
|
482
|
- price: 'price desc'
|
|
|
483
|
- })
|
|
|
484
|
- } else {
|
|
|
485
|
- that.setData({
|
|
|
486
|
- price: 'price'
|
|
|
487
|
- })
|
|
|
488
|
- }
|
|
|
489
|
- } else if (index == 2) {
|
|
|
490
|
- if (that.data.paynum == "paynum") {
|
|
|
491
|
- that.setData({
|
|
|
492
|
- paynum: 'paynum desc'
|
|
|
493
|
- })
|
|
|
494
|
- } else {
|
|
|
495
|
- that.setData({
|
|
|
496
|
- paynum: 'paynum'
|
|
|
497
|
- })
|
|
|
498
|
- }
|
|
|
499
|
- }
|
|
|
500
|
- this.setData({
|
|
|
501
|
- c_index: e.currentTarget.dataset.index,
|
|
|
502
|
- page: 1,
|
|
|
503
|
- page_type: false
|
539
|
+ that.setData({
|
|
|
540
|
+ page:1,
|
|
|
541
|
+ shop_arr:[]
|
504
|
})
|
542
|
})
|
505
|
- //调用排序接口
|
|
|
506
|
- this.good_list(this.data.pid, e.currentTarget.dataset.index)
|
|
|
507
|
- },
|
|
|
508
|
-
|
543
|
+ let index = Number(e.currentTarget.dataset.index);
|
|
|
544
|
+ that.setData({
|
|
|
545
|
+ c_index:index,
|
|
|
546
|
+ sort:index
|
|
|
547
|
+ })
|
|
|
548
|
+ if(index==1){
|
|
|
549
|
+ this.setData({
|
|
|
550
|
+ pricesheng:!this.data.pricesheng
|
|
|
551
|
+ })
|
|
|
552
|
+ if(this.data.pricesheng==true){
|
|
|
553
|
+ this.setData({
|
|
|
554
|
+ sort:1
|
|
|
555
|
+ })
|
|
|
556
|
+ }else{
|
|
|
557
|
+ this.setData({
|
|
|
558
|
+ sort:2
|
|
|
559
|
+ })
|
|
|
560
|
+ }
|
|
|
561
|
+ }
|
|
|
562
|
+ if(this.data.index==2){
|
|
|
563
|
+ this.setData({
|
|
|
564
|
+ xiaoliang:!this.data.xiaoliang
|
|
|
565
|
+ })
|
|
|
566
|
+ if(this.data.xiaoliang==true){
|
|
|
567
|
+ this.setData({
|
|
|
568
|
+ sort:3
|
|
|
569
|
+ })
|
|
|
570
|
+ }else{
|
|
|
571
|
+ this.setData({
|
|
|
572
|
+ sort:4
|
|
|
573
|
+ })
|
|
|
574
|
+ }
|
|
|
575
|
+ }
|
|
|
576
|
+ that.getgoodlist()
|
|
|
577
|
+
|
|
|
578
|
+ // let that = this
|
|
|
579
|
+ // let index = Number(e.currentTarget.dataset.index)
|
|
|
580
|
+ // if (index == 1) {
|
|
|
581
|
+ // if (that.data.price == "price") {
|
|
|
582
|
+ // that.setData({
|
|
|
583
|
+ // price: 'price desc'
|
|
|
584
|
+ // })
|
|
|
585
|
+ // } else {
|
|
|
586
|
+ // that.setData({
|
|
|
587
|
+ // price: 'price'
|
|
|
588
|
+ // })
|
|
|
589
|
+ // }
|
|
|
590
|
+ // } else if (index == 2) {
|
|
|
591
|
+ // if (that.data.paynum == "paynum") {
|
|
|
592
|
+ // that.setData({
|
|
|
593
|
+ // paynum: 'paynum desc'
|
|
|
594
|
+ // })
|
|
|
595
|
+ // } else {
|
|
|
596
|
+ // that.setData({
|
|
|
597
|
+ // paynum: 'paynum'
|
|
|
598
|
+ // })
|
|
|
599
|
+ // }
|
|
|
600
|
+ // }
|
|
|
601
|
+ // this.setData({
|
|
|
602
|
+ // c_index: e.currentTarget.dataset.index,
|
|
|
603
|
+ // page: 1,
|
|
|
604
|
+ // page_type: false
|
|
|
605
|
+ // })
|
|
|
606
|
+ // //调用排序接口
|
|
|
607
|
+ // this.good_list(this.data.pid, e.currentTarget.dataset.index)
|
|
|
608
|
+ },
|
|
|
609
|
+// 选择一级分类
|
509
|
select_nav(e) {
|
610
|
select_nav(e) {
|
510
|
let index = Number(e.currentTarget.dataset.index)
|
611
|
let index = Number(e.currentTarget.dataset.index)
|
511
|
let id = e.currentTarget.dataset.id;
|
612
|
let id = e.currentTarget.dataset.id;
|
|
|
613
|
+ let newclass_arr=this.data.nav_arr[index].child
|
512
|
this.setData({
|
614
|
this.setData({
|
513
|
- pid:id
|
|
|
514
|
- })
|
|
|
515
|
-
|
|
|
516
|
- this.setData({
|
|
|
517
|
- scrollTop: 0
|
615
|
+ category_id1:id,
|
|
|
616
|
+ class_arr:newclass_arr,
|
|
|
617
|
+ nav_index:index
|
518
|
})
|
618
|
})
|
519
|
- if (index == this.data.nav_index) {
|
|
|
520
|
- return
|
|
|
521
|
- } else {
|
|
|
522
|
- this.setData({
|
|
|
523
|
- nav_index: index,
|
|
|
524
|
- page: 1,
|
|
|
525
|
- page_type: false,
|
|
|
526
|
- c_index: 0, //筛选分类下标
|
|
|
527
|
- price: 'price desc', //价格排序方式
|
|
|
528
|
- paynum: 'paynum desc' //销量排序方式
|
619
|
+ },
|
|
|
620
|
+ // 获取商品列表
|
|
|
621
|
+ getgoodlist(){
|
|
|
622
|
+ let that=this;
|
|
|
623
|
+ let url = '/goods/get_goods'
|
|
|
624
|
+ let param={
|
|
|
625
|
+ category_id1:this.data.category_id1,
|
|
|
626
|
+ sort:this.data.sort,
|
|
|
627
|
+ keyword:this.data.keyword,
|
|
|
628
|
+ page:this.data.page,
|
|
|
629
|
+ pageNum:10
|
|
|
630
|
+ }
|
|
|
631
|
+ app.postk(url, param).then((res) => {
|
|
|
632
|
+ if(that.data.page>1){
|
|
|
633
|
+ if(res.data.length==0){
|
|
|
634
|
+ wx.showToast({
|
|
|
635
|
+ title:'没有更多了~',
|
|
|
636
|
+ icon:'none'
|
|
|
637
|
+
|
|
|
638
|
+ })
|
|
|
639
|
+ }else{
|
|
|
640
|
+ this.setData({
|
|
|
641
|
+ shop_arr:that.data.shop_arr.concat(res.data)
|
|
|
642
|
+ })
|
|
|
643
|
+ }
|
|
|
644
|
+ }else{
|
|
|
645
|
+ this.setData({
|
|
|
646
|
+ shop_arr:that.data.shop_arr.concat(res.data)
|
|
|
647
|
+ })
|
|
|
648
|
+ }
|
|
|
649
|
+
|
|
|
650
|
+
|
|
|
651
|
+ console.log(that.data.shop_arr,'轮播图')
|
529
|
})
|
652
|
})
|
530
|
- this.get_info(id, 2)
|
|
|
531
|
- }
|
|
|
532
|
- },
|
653
|
+ },
|
|
|
654
|
+
|
533
|
// 轮播图
|
655
|
// 轮播图
|
534
|
get_banner() {
|
656
|
get_banner() {
|
535
|
- let url = app.interface.banner
|
|
|
536
|
- app.post(url, {}).then((res) => {
|
657
|
+ let url = '/sundry/get_slide'
|
|
|
658
|
+ app.postk(url, {}).then((res) => {
|
|
|
659
|
+ console.log(res,'轮播图')
|
537
|
this.setData({
|
660
|
this.setData({
|
538
|
- imgurl: res.msg
|
661
|
+ imgurl: res.data
|
539
|
})
|
662
|
})
|
540
|
})
|
663
|
})
|
541
|
},
|
664
|
},
|
|
@@ -553,45 +676,45 @@ if( app.globalData.index==undefined){ |
|
@@ -553,45 +676,45 @@ if( app.globalData.index==undefined){ |
553
|
})
|
676
|
})
|
554
|
},
|
677
|
},
|
555
|
//获取页面信息
|
678
|
//获取页面信息
|
556
|
- get_info(pid, type) { //type 1为小标题 2为小标题下的小分类
|
|
|
557
|
- wx.showLoading({
|
|
|
558
|
- title: '加载中'
|
|
|
559
|
- })
|
|
|
560
|
- let that = this
|
|
|
561
|
- let url = app.interface.index
|
|
|
562
|
- let params = {
|
|
|
563
|
- pid: pid
|
|
|
564
|
- }
|
|
|
565
|
- app.post(url, params).then((res) => {
|
|
|
566
|
- console.log('88776654', res)
|
|
|
567
|
- wx.hideLoading()
|
|
|
568
|
- if (type == 1) {
|
|
|
569
|
- let obj = {
|
|
|
570
|
- name: '首页',
|
|
|
571
|
- id: ''
|
|
|
572
|
- }
|
|
|
573
|
- res.msg.unshift(obj)
|
|
|
574
|
- that.setData({
|
|
|
575
|
- nav_arr: res.msg
|
|
|
576
|
- })
|
|
|
577
|
- that.get_info(res.msg[0].id, 2)
|
|
|
578
|
- } else if (type == 2) {
|
|
|
579
|
- console.log('666', res)
|
|
|
580
|
- // let obj = {
|
|
|
581
|
- // name: '全部',
|
|
|
582
|
- // id: ''
|
|
|
583
|
- // }
|
|
|
584
|
- // res.msg.unshift(obj)
|
|
|
585
|
- that.setData({
|
|
|
586
|
- class_arr: res.msg,
|
|
|
587
|
- cid: ''
|
|
|
588
|
- })
|
|
|
589
|
- that.good_list(pid, that.data.c_index)
|
|
|
590
|
- }
|
|
|
591
|
- }).catch((er) => {
|
|
|
592
|
- wx.hideLoading()
|
|
|
593
|
- })
|
|
|
594
|
- },
|
679
|
+ // get_info(pid, type) { //type 1为小标题 2为小标题下的小分类
|
|
|
680
|
+ // wx.showLoading({
|
|
|
681
|
+ // title: '加载中'
|
|
|
682
|
+ // })
|
|
|
683
|
+ // let that = this
|
|
|
684
|
+ // let url = app.interface.index
|
|
|
685
|
+ // let params = {
|
|
|
686
|
+ // pid: pid
|
|
|
687
|
+ // }
|
|
|
688
|
+ // app.post(url, params).then((res) => {
|
|
|
689
|
+ // console.log('88776654', res)
|
|
|
690
|
+ // wx.hideLoading()
|
|
|
691
|
+ // if (type == 1) {
|
|
|
692
|
+ // let obj = {
|
|
|
693
|
+ // name: '首页',
|
|
|
694
|
+ // id: ''
|
|
|
695
|
+ // }
|
|
|
696
|
+ // res.msg.unshift(obj)
|
|
|
697
|
+ // that.setData({
|
|
|
698
|
+ // nav_arr: res.data
|
|
|
699
|
+ // })
|
|
|
700
|
+ // that.get_info(res.msg[0].id, 2)
|
|
|
701
|
+ // } else if (type == 2) {
|
|
|
702
|
+ // console.log('666', res)
|
|
|
703
|
+ // // let obj = {
|
|
|
704
|
+ // // name: '全部',
|
|
|
705
|
+ // // id: ''
|
|
|
706
|
+ // // }
|
|
|
707
|
+ // // res.msg.unshift(obj)
|
|
|
708
|
+ // that.setData({
|
|
|
709
|
+ // class_arr: res.data,
|
|
|
710
|
+ // cid: ''
|
|
|
711
|
+ // })
|
|
|
712
|
+ // that.good_list(pid, that.data.c_index)
|
|
|
713
|
+ // }
|
|
|
714
|
+ // }).catch((er) => {
|
|
|
715
|
+ // wx.hideLoading()
|
|
|
716
|
+ // })
|
|
|
717
|
+ // },
|
595
|
//获取商品列表
|
718
|
//获取商品列表
|
596
|
good_list(pid, c_index) {
|
719
|
good_list(pid, c_index) {
|
597
|
wx.showLoading({
|
720
|
wx.showLoading({
|
|
@@ -712,7 +835,9 @@ if( app.globalData.index==undefined){ |
|
@@ -712,7 +835,9 @@ if( app.globalData.index==undefined){ |
712
|
* 生命周期函数--监听页面显示
|
835
|
* 生命周期函数--监听页面显示
|
713
|
*/
|
836
|
*/
|
714
|
onShow: function() {
|
837
|
onShow: function() {
|
715
|
-
|
838
|
+ this.setData({
|
|
|
839
|
+ logok:app.globalData.baseUrlimg+"assets/img/cb2ad36a391388f19f5f912fa021f8f.png"
|
|
|
840
|
+ })
|
716
|
this.get_banner()
|
841
|
this.get_banner()
|
717
|
console.log(app.globalData.index)
|
842
|
console.log(app.globalData.index)
|
718
|
if(app.globalData.index==0){
|
843
|
if(app.globalData.index==0){
|
|
@@ -727,9 +852,9 @@ if( app.globalData.index==undefined){ |
|
@@ -727,9 +852,9 @@ if( app.globalData.index==undefined){ |
727
|
this.getmessagelist();
|
852
|
this.getmessagelist();
|
728
|
console.log('998867',this.data.pid)
|
853
|
console.log('998867',this.data.pid)
|
729
|
if(this.data.pid){
|
854
|
if(this.data.pid){
|
730
|
- this.get_info(this.data.pid, 2);
|
855
|
+ // this.get_info(this.data.pid, 2);
|
731
|
}else{
|
856
|
}else{
|
732
|
- this.get_info(0, 1);
|
857
|
+ // this.get_info(0, 1);
|
733
|
}
|
858
|
}
|
734
|
|
859
|
|
735
|
//控制显示隐藏
|
860
|
//控制显示隐藏
|
|
@@ -761,39 +886,46 @@ if( app.globalData.index==undefined){ |
|
@@ -761,39 +886,46 @@ if( app.globalData.index==undefined){ |
761
|
|
886
|
|
762
|
},
|
887
|
},
|
763
|
loadMore(e){
|
888
|
loadMore(e){
|
764
|
- console.log(e)
|
|
|
765
|
- let that = this
|
|
|
766
|
- if (that.data.page_type) {
|
|
|
767
|
- wx.showToast({
|
|
|
768
|
- title: '暂无更多数据',
|
|
|
769
|
- icon: 'none',
|
|
|
770
|
- duration: 1000
|
|
|
771
|
- })
|
|
|
772
|
- return
|
|
|
773
|
- }
|
|
|
774
|
- that.setData({
|
|
|
775
|
- page: that.data.page + 1
|
889
|
+ let newpage=this.data.page;
|
|
|
890
|
+ newpage++;
|
|
|
891
|
+ this.setData({
|
|
|
892
|
+ page:newpage
|
776
|
})
|
893
|
})
|
777
|
- that.good_list(that.data.pid, that.data.c_index)
|
894
|
+ this.getgoodlist()
|
|
|
895
|
+ // console.log(e)
|
|
|
896
|
+ // let that = this
|
|
|
897
|
+ // if (that.data.page_type) {
|
|
|
898
|
+ // wx.showToast({
|
|
|
899
|
+ // title: '暂无更多数据',
|
|
|
900
|
+ // icon: 'none',
|
|
|
901
|
+ // duration: 1000
|
|
|
902
|
+ // })
|
|
|
903
|
+ // return
|
|
|
904
|
+ // }
|
|
|
905
|
+ // that.setData({
|
|
|
906
|
+ // page: that.data.page + 1
|
|
|
907
|
+ // })
|
|
|
908
|
+ // that.good_list(that.data.pid, that.data.c_index)
|
778
|
},
|
909
|
},
|
779
|
/**
|
910
|
/**
|
780
|
* 页面上拉触底事件的处理函数
|
911
|
* 页面上拉触底事件的处理函数
|
781
|
*/
|
912
|
*/
|
782
|
onReachBottom: function() {
|
913
|
onReachBottom: function() {
|
783
|
- console.log(43898438493)
|
|
|
784
|
- let that = this
|
|
|
785
|
- if (that.data.page_type) {
|
|
|
786
|
- wx.showToast({
|
|
|
787
|
- title: '暂无更多数据',
|
|
|
788
|
- icon: 'none',
|
|
|
789
|
- duration: 1000
|
|
|
790
|
- })
|
|
|
791
|
- return
|
|
|
792
|
- }
|
|
|
793
|
- that.setData({
|
|
|
794
|
- page: that.data.page + 1
|
|
|
795
|
- })
|
|
|
796
|
- that.good_list(that.data.pid, that.data.c_index)
|
914
|
+
|
|
|
915
|
+ // console.log(43898438493)
|
|
|
916
|
+ // let that = this
|
|
|
917
|
+ // if (that.data.page_type) {
|
|
|
918
|
+ // wx.showToast({
|
|
|
919
|
+ // title: '暂无更多数据',
|
|
|
920
|
+ // icon: 'none',
|
|
|
921
|
+ // duration: 1000
|
|
|
922
|
+ // })
|
|
|
923
|
+ // return
|
|
|
924
|
+ // }
|
|
|
925
|
+ // that.setData({
|
|
|
926
|
+ // page: that.data.page + 1
|
|
|
927
|
+ // })
|
|
|
928
|
+ // that.good_list(that.data.pid, that.data.c_index)
|
797
|
},
|
929
|
},
|
798
|
|
930
|
|
799
|
/**
|
931
|
/**
|