...
|
...
|
@@ -42,7 +42,7 @@ Page({ |
|
|
},
|
|
|
sourceType: 'gift',
|
|
|
},
|
|
|
|
|
|
promotion_id:''
|
|
|
|
|
|
},
|
|
|
|
...
|
...
|
@@ -117,7 +117,8 @@ Page({ |
|
|
onPressProduct: function (event) {
|
|
|
let data = event.currentTarget.dataset;
|
|
|
let product_skn = data.productSkn;
|
|
|
this.setData({ current_skn: product_skn });
|
|
|
let promotion_id = data.promotion_id;
|
|
|
this.setData({ current_skn: product_skn,promotion_id });
|
|
|
let param = {
|
|
|
method: 'app.product.gift',
|
|
|
uid: app.getUid(),
|
...
|
...
|
@@ -131,7 +132,7 @@ Page({ |
|
|
// console.log(data);
|
|
|
if (!data || data.code != 200)
|
|
|
return;
|
|
|
|
|
|
|
|
|
let colorSelected = false;
|
|
|
let color_length = 0;
|
|
|
if (data.data.goods_list) {
|
...
|
...
|
@@ -225,13 +226,13 @@ Page({ |
|
|
|
|
|
// 添加加价购商品到购物车
|
|
|
addShopCart: function (event) {
|
|
|
|
|
|
debugger
|
|
|
this.setData(event.detail);
|
|
|
|
|
|
let that = this;
|
|
|
let select_sku = that.data.selectedSKU;
|
|
|
let select_skn = that.data.current_skn;
|
|
|
let goods_type = that.data.is_gift ? 1 : 2;
|
|
|
|
|
|
let promotion_id = that.data.promotion_id;
|
|
|
if (!select_sku) {
|
|
|
tt.showToast({
|
|
|
title: '请选择颜色或尺码',
|
...
|
...
|
@@ -247,7 +248,8 @@ Page({ |
|
|
that.resetPickerData();
|
|
|
|
|
|
let param = {};
|
|
|
if (that.data.status == '10') {
|
|
|
console.log(that.data.status);
|
|
|
if (that.data.status === '10') {
|
|
|
param = {
|
|
|
method: 'app.Shopping.add',
|
|
|
product_sku: select_sku,
|
...
|
...
|
@@ -257,7 +259,7 @@ Page({ |
|
|
goods_type: goods_type,
|
|
|
edit_product_sku: 0,
|
|
|
};
|
|
|
} else if (that.data.status == '30') {
|
|
|
} else if (that.data.status === '30') {
|
|
|
param = {
|
|
|
method: 'app.Shopping.swapGift',
|
|
|
new_product_skn: select_skn,
|
...
|
...
|
@@ -267,12 +269,9 @@ Page({ |
|
|
buy_number: 1,
|
|
|
}
|
|
|
} else {
|
|
|
tt.navigateBack({
|
|
|
|
|
|
});
|
|
|
tt.navigateBack();
|
|
|
return;
|
|
|
}
|
|
|
// console.log(param);
|
|
|
api.get({data: param})
|
|
|
.then(json => {
|
|
|
if (json && json.code) {
|
...
|
...
|
@@ -294,7 +293,7 @@ Page({ |
|
|
|
|
|
|
|
|
this.setData(event.detail);
|
|
|
|
|
|
|
|
|
if (!this.data.selectedSKU) {
|
|
|
this.wetoast.toast({
|
|
|
title: '请选择颜色或尺码',
|
...
|
...
|
|