|
@@ -45,16 +45,16 @@ Page({ |
|
@@ -45,16 +45,16 @@ Page({ |
45
|
statestatus: 0,
|
45
|
statestatus: 0,
|
46
|
groupList: [],
|
46
|
groupList: [],
|
47
|
yesno: false,
|
47
|
yesno: false,
|
48
|
- stock:0,
|
|
|
49
|
- is_vip:0,
|
|
|
50
|
- string:'',
|
48
|
+ stock: 0,
|
|
|
49
|
+ is_vip: 0,
|
|
|
50
|
+ string: '',
|
51
|
gggPrice: null
|
51
|
gggPrice: null
|
52
|
},
|
52
|
},
|
53
|
//进入评论详情
|
53
|
//进入评论详情
|
54
|
- go_comment_detail(e){
|
54
|
+ go_comment_detail(e) {
|
55
|
var id = e.currentTarget.dataset.id
|
55
|
var id = e.currentTarget.dataset.id
|
56
|
wx.navigateTo({
|
56
|
wx.navigateTo({
|
57
|
- url: '../user_comment_detail/user_comment_detail?id='+id,
|
57
|
+ url: '../user_comment_detail/user_comment_detail?id=' + id,
|
58
|
})
|
58
|
})
|
59
|
},
|
59
|
},
|
60
|
//进入基本参数
|
60
|
//进入基本参数
|
|
@@ -79,7 +79,7 @@ Page({ |
|
@@ -79,7 +79,7 @@ Page({ |
79
|
})
|
79
|
})
|
80
|
wx.pageScrollTo({
|
80
|
wx.pageScrollTo({
|
81
|
scrollTop: 0,
|
81
|
scrollTop: 0,
|
82
|
- duration:0
|
82
|
+ duration: 0
|
83
|
})
|
83
|
})
|
84
|
this.fetchGoods()
|
84
|
this.fetchGoods()
|
85
|
},
|
85
|
},
|
|
@@ -145,7 +145,7 @@ Page({ |
|
@@ -145,7 +145,7 @@ Page({ |
145
|
let listAll = t.data.goods.attr.attr_sku;
|
145
|
let listAll = t.data.goods.attr.attr_sku;
|
146
|
let list = listAll[e.currentTarget.dataset.parent].item;
|
146
|
let list = listAll[e.currentTarget.dataset.parent].item;
|
147
|
let x = e.currentTarget.dataset.index;
|
147
|
let x = e.currentTarget.dataset.index;
|
148
|
- let stock=t.data.stock
|
148
|
+ let stock = t.data.stock
|
149
|
// 当前点击Id
|
149
|
// 当前点击Id
|
150
|
let nowId = e.currentTarget.dataset.gid;
|
150
|
let nowId = e.currentTarget.dataset.gid;
|
151
|
//当前点击value
|
151
|
//当前点击value
|
|
@@ -224,7 +224,7 @@ Page({ |
|
@@ -224,7 +224,7 @@ Page({ |
224
|
string = sys_attrprice[i].sku_values
|
224
|
string = sys_attrprice[i].sku_values
|
225
|
}
|
225
|
}
|
226
|
}
|
226
|
}
|
227
|
- if(that.data.is_vip==1){
|
227
|
+ if (that.data.is_vip == 1) {
|
228
|
gggPrice = vip_skuid_price
|
228
|
gggPrice = vip_skuid_price
|
229
|
} else {
|
229
|
} else {
|
230
|
gggPrice = old_skuid_price
|
230
|
gggPrice = old_skuid_price
|
|
@@ -238,7 +238,7 @@ Page({ |
|
@@ -238,7 +238,7 @@ Page({ |
238
|
vip_skuid_price: vip_skuid_price,
|
238
|
vip_skuid_price: vip_skuid_price,
|
239
|
skuid_arr: new_arr,
|
239
|
skuid_arr: new_arr,
|
240
|
ids: new_arr_item,
|
240
|
ids: new_arr_item,
|
241
|
- stock:stock,
|
241
|
+ stock: stock,
|
242
|
string: string,
|
242
|
string: string,
|
243
|
gggPrice: gggPrice
|
243
|
gggPrice: gggPrice
|
244
|
});
|
244
|
});
|
|
@@ -280,13 +280,13 @@ Page({ |
|
@@ -280,13 +280,13 @@ Page({ |
280
|
}
|
280
|
}
|
281
|
},
|
281
|
},
|
282
|
//渲染是不是会员
|
282
|
//渲染是不是会员
|
283
|
- fetchUser(){
|
283
|
+ fetchUser() {
|
284
|
let url = '/wxapp/user/index'
|
284
|
let url = '/wxapp/user/index'
|
285
|
- let that=this
|
|
|
286
|
- app.post(url).then(res=>{
|
|
|
287
|
- if(res.code==1){
|
285
|
+ let that = this
|
|
|
286
|
+ app.post(url).then(res => {
|
|
|
287
|
+ if (res.code == 1) {
|
288
|
that.setData({
|
288
|
that.setData({
|
289
|
- is_vip:res.data.user.is_vip
|
289
|
+ is_vip: res.data.user.is_vip
|
290
|
})
|
290
|
})
|
291
|
that.fetchGoods()
|
291
|
that.fetchGoods()
|
292
|
}
|
292
|
}
|
|
@@ -300,7 +300,7 @@ Page({ |
|
@@ -300,7 +300,7 @@ Page({ |
300
|
id: this.data.id
|
300
|
id: this.data.id
|
301
|
};
|
301
|
};
|
302
|
let that = this
|
302
|
let that = this
|
303
|
- let stock=null
|
303
|
+ let stock = null
|
304
|
let string = null
|
304
|
let string = null
|
305
|
app.post(url, params).then(r => {
|
305
|
app.post(url, params).then(r => {
|
306
|
console.log(r);
|
306
|
console.log(r);
|
|
@@ -336,13 +336,13 @@ Page({ |
|
@@ -336,13 +336,13 @@ Page({ |
336
|
old_skuid_price = sys_attrprice[i].old_price
|
336
|
old_skuid_price = sys_attrprice[i].old_price
|
337
|
vip_skuid_price = sys_attrprice[i].vip_price
|
337
|
vip_skuid_price = sys_attrprice[i].vip_price
|
338
|
stock = sys_attrprice[i].stock
|
338
|
stock = sys_attrprice[i].stock
|
339
|
- string =sys_attrprice[i].sku_values
|
339
|
+ string = sys_attrprice[i].sku_values
|
340
|
}
|
340
|
}
|
341
|
}
|
341
|
}
|
342
|
var gggPrice = null
|
342
|
var gggPrice = null
|
343
|
- if(that.data.is_vip==1){
|
343
|
+ if (that.data.is_vip == 1) {
|
344
|
gggPrice = vip_skuid_price
|
344
|
gggPrice = vip_skuid_price
|
345
|
- }else{
|
345
|
+ } else {
|
346
|
gggPrice = old_skuid_price
|
346
|
gggPrice = old_skuid_price
|
347
|
}
|
347
|
}
|
348
|
r.data.comment.forEach(function(ele, index) {
|
348
|
r.data.comment.forEach(function(ele, index) {
|
|
@@ -354,7 +354,7 @@ Page({ |
|
@@ -354,7 +354,7 @@ Page({ |
354
|
ele.create_time = app.timeFormate(ele.create_time, 'YYMMDD');
|
354
|
ele.create_time = app.timeFormate(ele.create_time, 'YYMMDD');
|
355
|
});
|
355
|
});
|
356
|
console.log(r.data.vips.cashback_price)
|
356
|
console.log(r.data.vips.cashback_price)
|
357
|
- r.data.vips.cashback_price +='0'
|
357
|
+ r.data.vips.cashback_price += '0'
|
358
|
r.data.vips.cashback_price = r.data.vips.cashback_price.substr(0, 4)
|
358
|
r.data.vips.cashback_price = r.data.vips.cashback_price.substr(0, 4)
|
359
|
var zuihoujiage = ''
|
359
|
var zuihoujiage = ''
|
360
|
if (that.data.is_vip == 1) {
|
360
|
if (that.data.is_vip == 1) {
|
|
@@ -471,7 +471,7 @@ Page({ |
|
@@ -471,7 +471,7 @@ Page({ |
471
|
skuid: that.data.skuid,
|
471
|
skuid: that.data.skuid,
|
472
|
num: that.data.num
|
472
|
num: that.data.num
|
473
|
}
|
473
|
}
|
474
|
- if(that.data.stock>0){
|
474
|
+ if (that.data.stock > 0) {
|
475
|
if (that.data.num <= e.currentTarget.dataset.limit || e.currentTarget.dataset.limit == 0) {
|
475
|
if (that.data.num <= e.currentTarget.dataset.limit || e.currentTarget.dataset.limit == 0) {
|
476
|
app.post(url, params).then(r => {
|
476
|
app.post(url, params).then(r => {
|
477
|
if (r.code == 1) {
|
477
|
if (r.code == 1) {
|
|
@@ -494,11 +494,11 @@ Page({ |
|
@@ -494,11 +494,11 @@ Page({ |
494
|
})
|
494
|
})
|
495
|
return;
|
495
|
return;
|
496
|
}
|
496
|
}
|
497
|
- }else{
|
497
|
+ } else {
|
498
|
console.log(454545)
|
498
|
console.log(454545)
|
499
|
wx.showToast({
|
499
|
wx.showToast({
|
500
|
title: '已经售罄',
|
500
|
title: '已经售罄',
|
501
|
- icon:'none'
|
501
|
+ icon: 'none'
|
502
|
})
|
502
|
})
|
503
|
}
|
503
|
}
|
504
|
} else {
|
504
|
} else {
|
|
@@ -511,8 +511,8 @@ Page({ |
|
@@ -511,8 +511,8 @@ Page({ |
511
|
},
|
511
|
},
|
512
|
hide_masks() {
|
512
|
hide_masks() {
|
513
|
var that = this
|
513
|
var that = this
|
514
|
- var minimum=that.data.goods.minimum_price
|
|
|
515
|
- var pp=that.data.gPrice
|
514
|
+ var minimum = that.data.goods.minimum_price
|
|
|
515
|
+ var pp = that.data.gPrice
|
516
|
console.log(pp)
|
516
|
console.log(pp)
|
517
|
pp = Math.round(pp)
|
517
|
pp = Math.round(pp)
|
518
|
console.log(pp)
|
518
|
console.log(pp)
|
|
@@ -524,7 +524,7 @@ Page({ |
|
@@ -524,7 +524,7 @@ Page({ |
524
|
});
|
524
|
});
|
525
|
var str = ''
|
525
|
var str = ''
|
526
|
str = that.data.id_arr.join(',');
|
526
|
str = that.data.id_arr.join(',');
|
527
|
- if(gPrice>=minimum){
|
527
|
+ if (gPrice >= minimum) {
|
528
|
if (that.data.stock > 0) {
|
528
|
if (that.data.stock > 0) {
|
529
|
if (that.data.goods.info.limit_numer == that.data.num || that.data.goods.info.limit_numer == 0) {
|
529
|
if (that.data.goods.info.limit_numer == that.data.num || that.data.goods.info.limit_numer == 0) {
|
530
|
if (that.data.id_arr.length > 1) {
|
530
|
if (that.data.id_arr.length > 1) {
|
|
@@ -553,10 +553,10 @@ Page({ |
|
@@ -553,10 +553,10 @@ Page({ |
553
|
})
|
553
|
})
|
554
|
return;
|
554
|
return;
|
555
|
}
|
555
|
}
|
556
|
- }else{
|
556
|
+ } else {
|
557
|
wx.showToast({
|
557
|
wx.showToast({
|
558
|
- title: '商品实付'+minimum+'元起送',
|
|
|
559
|
- icon:'none'
|
558
|
+ title: '商品实付' + minimum + '元起送',
|
|
|
559
|
+ icon: 'none'
|
560
|
})
|
560
|
})
|
561
|
}
|
561
|
}
|
562
|
} else {
|
562
|
} else {
|