|
|
@ -251,65 +251,74 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
order: function (e) { |
|
|
order: function (e) { |
|
|
// console.log(this.data.info,this.data.skuFlag)
|
|
|
commonApi.user_post("/product/checkStock",{ |
|
|
app.globalData.postProduct = [] |
|
|
sku_id: this.data.skuList[this.data.skuIndex].id, |
|
|
app.globalData.list = [] |
|
|
}).then(res => { |
|
|
if (this.data.skuFlag == 'order'){ |
|
|
console.log(res) |
|
|
if (e.currentTarget.dataset.disable == 1) return; |
|
|
if(res && res.code != 1){ |
|
|
util.pagePoint({ |
|
|
return; |
|
|
event: 'scene_order', |
|
|
}else{ |
|
|
param: { |
|
|
// console.log(this.data.info,this.data.skuFlag)
|
|
|
type: this.data.info.type, |
|
|
app.globalData.postProduct = [] |
|
|
id: this.data.info.id |
|
|
app.globalData.list = [] |
|
|
} |
|
|
if (this.data.skuFlag == 'order'){ |
|
|
}, 1) |
|
|
if (e.currentTarget.dataset.disable == 1) return; |
|
|
wx.setStorageSync('login_from', 'scene_order_login') |
|
|
util.pagePoint({ |
|
|
wx.setStorageSync('order_from', 'scene_order_submit') |
|
|
event: 'scene_order', |
|
|
app.globalData.couponInfo = null; |
|
|
param: { |
|
|
app.globalData.retailId = this.data.retailId; |
|
|
type: this.data.info.type, |
|
|
// let sku = e.currentTarget.dataset.sku,product = e.currentTarget.dataset.product;
|
|
|
id: this.data.info.id |
|
|
// let sku = {sku:e.currentTarget.dataset.product.sku[this.data.skuIndex]},product = {product: e.currentTarget.dataset.product}
|
|
|
} |
|
|
let sku = {sku:this.data.skuList[this.data.skuIndex]},product = {product:this.data.info.product[this.data.skuList[this.data.skuIndex].proIndex]} |
|
|
}, 1) |
|
|
app.globalData.product = {...sku,...product} |
|
|
wx.setStorageSync('login_from', 'scene_order_login') |
|
|
wx.navigateTo({ |
|
|
wx.setStorageSync('order_from', 'scene_order_submit') |
|
|
url: '/pages/order/scene/index', |
|
|
app.globalData.couponInfo = null; |
|
|
}) |
|
|
app.globalData.retailId = this.data.retailId; |
|
|
}else { |
|
|
// let sku = e.currentTarget.dataset.sku,product = e.currentTarget.dataset.product;
|
|
|
commonApi.user_post("cart/add_sku", { |
|
|
// let sku = {sku:e.currentTarget.dataset.product.sku[this.data.skuIndex]},product = {product: e.currentTarget.dataset.product}
|
|
|
sku_id: this.data.skuList[this.data.skuIndex].id, |
|
|
let sku = {sku:this.data.skuList[this.data.skuIndex]},product = {product:this.data.info.product[this.data.skuList[this.data.skuIndex].proIndex]} |
|
|
num: this.data.producNum |
|
|
app.globalData.product = {...sku,...product} |
|
|
}).then(res => { |
|
|
wx.navigateTo({ |
|
|
if (res.code == 1) { |
|
|
url: '/pages/order/scene/index', |
|
|
commonApi.user_post('cart/get_list', {}).then(res => { |
|
|
}) |
|
|
this.setData({ |
|
|
}else { |
|
|
cartCount: res.data.length |
|
|
commonApi.user_post("cart/add_sku", { |
|
|
}) |
|
|
sku_id: this.data.skuList[this.data.skuIndex].id, |
|
|
}) |
|
|
num: this.data.producNum |
|
|
// 加动效
|
|
|
}).then(res => { |
|
|
this.setData({ |
|
|
if (res.code == 1) { |
|
|
skuFlag: null, |
|
|
commonApi.user_post('cart/get_list', {}).then(res => { |
|
|
aniSkuIndex: this.data.skuIndex, |
|
|
this.setData({ |
|
|
cartImgInfo: null |
|
|
cartCount: res.data.length |
|
|
}) |
|
|
}) |
|
|
setTimeout(() => { |
|
|
}) |
|
|
this.setData({ |
|
|
// 加动效
|
|
|
aniSkuIndex: -1 |
|
|
this.setData({ |
|
|
}) |
|
|
skuFlag: null, |
|
|
wx.showModal({ |
|
|
aniSkuIndex: this.data.skuIndex, |
|
|
title: "提示", |
|
|
cartImgInfo: null |
|
|
content: "去购物车结算?", |
|
|
}) |
|
|
success: function (res) { |
|
|
setTimeout(() => { |
|
|
if (res.confirm) { |
|
|
this.setData({ |
|
|
wx.navigateTo({ |
|
|
aniSkuIndex: -1 |
|
|
url: '/pages/user/cartlist/list', |
|
|
}) |
|
|
}) |
|
|
wx.showModal({ |
|
|
} |
|
|
title: "提示", |
|
|
} |
|
|
content: "去购物车结算?", |
|
|
}) |
|
|
success: function (res) { |
|
|
}, 650) |
|
|
if (res.confirm) { |
|
|
} |
|
|
wx.navigateTo({ |
|
|
}) |
|
|
url: '/pages/user/cartlist/list', |
|
|
} |
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, 650) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
pagePoint: function (e) { |
|
|
pagePoint: function (e) { |
|
|
util.pagePoint({ |
|
|
util.pagePoint({ |
|
|
|