...
|
...
|
@@ -45,16 +45,16 @@ Page({ |
|
|
statestatus: 0,
|
|
|
groupList: [],
|
|
|
yesno: false,
|
|
|
stock:0,
|
|
|
is_vip:0,
|
|
|
string:'',
|
|
|
stock: 0,
|
|
|
is_vip: 0,
|
|
|
string: '',
|
|
|
gggPrice: null
|
|
|
},
|
|
|
//进入评论详情
|
|
|
go_comment_detail(e){
|
|
|
go_comment_detail(e) {
|
|
|
var id = e.currentTarget.dataset.id
|
|
|
wx.navigateTo({
|
|
|
url: '../user_comment_detail/user_comment_detail?id='+id,
|
|
|
url: '../user_comment_detail/user_comment_detail?id=' + id,
|
|
|
})
|
|
|
},
|
|
|
//进入基本参数
|
...
|
...
|
@@ -79,7 +79,7 @@ Page({ |
|
|
})
|
|
|
wx.pageScrollTo({
|
|
|
scrollTop: 0,
|
|
|
duration:0
|
|
|
duration: 0
|
|
|
})
|
|
|
this.fetchGoods()
|
|
|
},
|
...
|
...
|
@@ -145,7 +145,7 @@ Page({ |
|
|
let listAll = t.data.goods.attr.attr_sku;
|
|
|
let list = listAll[e.currentTarget.dataset.parent].item;
|
|
|
let x = e.currentTarget.dataset.index;
|
|
|
let stock=t.data.stock
|
|
|
let stock = t.data.stock
|
|
|
// 当前点击Id
|
|
|
let nowId = e.currentTarget.dataset.gid;
|
|
|
//当前点击value
|
...
|
...
|
@@ -224,7 +224,7 @@ Page({ |
|
|
string = sys_attrprice[i].sku_values
|
|
|
}
|
|
|
}
|
|
|
if(that.data.is_vip==1){
|
|
|
if (that.data.is_vip == 1) {
|
|
|
gggPrice = vip_skuid_price
|
|
|
} else {
|
|
|
gggPrice = old_skuid_price
|
...
|
...
|
@@ -238,7 +238,7 @@ Page({ |
|
|
vip_skuid_price: vip_skuid_price,
|
|
|
skuid_arr: new_arr,
|
|
|
ids: new_arr_item,
|
|
|
stock:stock,
|
|
|
stock: stock,
|
|
|
string: string,
|
|
|
gggPrice: gggPrice
|
|
|
});
|
...
|
...
|
@@ -280,13 +280,13 @@ Page({ |
|
|
}
|
|
|
},
|
|
|
//渲染是不是会员
|
|
|
fetchUser(){
|
|
|
fetchUser() {
|
|
|
let url = '/wxapp/user/index'
|
|
|
let that=this
|
|
|
app.post(url).then(res=>{
|
|
|
if(res.code==1){
|
|
|
let that = this
|
|
|
app.post(url).then(res => {
|
|
|
if (res.code == 1) {
|
|
|
that.setData({
|
|
|
is_vip:res.data.user.is_vip
|
|
|
is_vip: res.data.user.is_vip
|
|
|
})
|
|
|
that.fetchGoods()
|
|
|
}
|
...
|
...
|
@@ -300,7 +300,7 @@ Page({ |
|
|
id: this.data.id
|
|
|
};
|
|
|
let that = this
|
|
|
let stock=null
|
|
|
let stock = null
|
|
|
let string = null
|
|
|
app.post(url, params).then(r => {
|
|
|
console.log(r);
|
...
|
...
|
@@ -336,13 +336,13 @@ Page({ |
|
|
old_skuid_price = sys_attrprice[i].old_price
|
|
|
vip_skuid_price = sys_attrprice[i].vip_price
|
|
|
stock = sys_attrprice[i].stock
|
|
|
string =sys_attrprice[i].sku_values
|
|
|
string = sys_attrprice[i].sku_values
|
|
|
}
|
|
|
}
|
|
|
var gggPrice = null
|
|
|
if(that.data.is_vip==1){
|
|
|
if (that.data.is_vip == 1) {
|
|
|
gggPrice = vip_skuid_price
|
|
|
}else{
|
|
|
} else {
|
|
|
gggPrice = old_skuid_price
|
|
|
}
|
|
|
r.data.comment.forEach(function(ele, index) {
|
...
|
...
|
@@ -354,7 +354,7 @@ Page({ |
|
|
ele.create_time = app.timeFormate(ele.create_time, 'YYMMDD');
|
|
|
});
|
|
|
console.log(r.data.vips.cashback_price)
|
|
|
r.data.vips.cashback_price +='0'
|
|
|
r.data.vips.cashback_price += '0'
|
|
|
r.data.vips.cashback_price = r.data.vips.cashback_price.substr(0, 4)
|
|
|
var zuihoujiage = ''
|
|
|
if (that.data.is_vip == 1) {
|
...
|
...
|
@@ -471,7 +471,7 @@ Page({ |
|
|
skuid: that.data.skuid,
|
|
|
num: that.data.num
|
|
|
}
|
|
|
if(that.data.stock>0){
|
|
|
if (that.data.stock > 0) {
|
|
|
if (that.data.num <= e.currentTarget.dataset.limit || e.currentTarget.dataset.limit == 0) {
|
|
|
app.post(url, params).then(r => {
|
|
|
if (r.code == 1) {
|
...
|
...
|
@@ -494,11 +494,11 @@ Page({ |
|
|
})
|
|
|
return;
|
|
|
}
|
|
|
}else{
|
|
|
} else {
|
|
|
console.log(454545)
|
|
|
wx.showToast({
|
|
|
title: '已经售罄',
|
|
|
icon:'none'
|
|
|
icon: 'none'
|
|
|
})
|
|
|
}
|
|
|
} else {
|
...
|
...
|
@@ -511,8 +511,8 @@ Page({ |
|
|
},
|
|
|
hide_masks() {
|
|
|
var that = this
|
|
|
var minimum=that.data.goods.minimum_price
|
|
|
var pp=that.data.gPrice
|
|
|
var minimum = that.data.goods.minimum_price
|
|
|
var pp = that.data.gPrice
|
|
|
console.log(pp)
|
|
|
pp = Math.round(pp)
|
|
|
console.log(pp)
|
...
|
...
|
@@ -524,7 +524,7 @@ Page({ |
|
|
});
|
|
|
var str = ''
|
|
|
str = that.data.id_arr.join(',');
|
|
|
if(gPrice>=minimum){
|
|
|
if (gPrice >= minimum) {
|
|
|
if (that.data.stock > 0) {
|
|
|
if (that.data.goods.info.limit_numer == that.data.num || that.data.goods.info.limit_numer == 0) {
|
|
|
if (that.data.id_arr.length > 1) {
|
...
|
...
|
@@ -553,10 +553,10 @@ Page({ |
|
|
})
|
|
|
return;
|
|
|
}
|
|
|
}else{
|
|
|
} else {
|
|
|
wx.showToast({
|
|
|
title: '商品实付'+minimum+'元起送',
|
|
|
icon:'none'
|
|
|
title: '商品实付' + minimum + '元起送',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
}
|
|
|
} else {
|
...
|
...
|
|