|
@@ -42,7 +42,7 @@ Page({ |
|
@@ -42,7 +42,7 @@ Page({ |
42
|
},
|
42
|
},
|
43
|
sourceType: 'gift',
|
43
|
sourceType: 'gift',
|
44
|
},
|
44
|
},
|
45
|
-
|
45
|
+ promotion_id:''
|
46
|
|
46
|
|
47
|
},
|
47
|
},
|
48
|
|
48
|
|
|
@@ -117,7 +117,8 @@ Page({ |
|
@@ -117,7 +117,8 @@ Page({ |
117
|
onPressProduct: function (event) {
|
117
|
onPressProduct: function (event) {
|
118
|
let data = event.currentTarget.dataset;
|
118
|
let data = event.currentTarget.dataset;
|
119
|
let product_skn = data.productSkn;
|
119
|
let product_skn = data.productSkn;
|
120
|
- this.setData({ current_skn: product_skn });
|
120
|
+ let promotion_id = data.promotion_id;
|
|
|
121
|
+ this.setData({ current_skn: product_skn,promotion_id });
|
121
|
let param = {
|
122
|
let param = {
|
122
|
method: 'app.product.gift',
|
123
|
method: 'app.product.gift',
|
123
|
uid: app.getUid(),
|
124
|
uid: app.getUid(),
|
|
@@ -131,7 +132,7 @@ Page({ |
|
@@ -131,7 +132,7 @@ Page({ |
131
|
// console.log(data);
|
132
|
// console.log(data);
|
132
|
if (!data || data.code != 200)
|
133
|
if (!data || data.code != 200)
|
133
|
return;
|
134
|
return;
|
134
|
-
|
135
|
+
|
135
|
let colorSelected = false;
|
136
|
let colorSelected = false;
|
136
|
let color_length = 0;
|
137
|
let color_length = 0;
|
137
|
if (data.data.goods_list) {
|
138
|
if (data.data.goods_list) {
|
|
@@ -225,13 +226,13 @@ Page({ |
|
@@ -225,13 +226,13 @@ Page({ |
225
|
|
226
|
|
226
|
// 添加加价购商品到购物车
|
227
|
// 添加加价购商品到购物车
|
227
|
addShopCart: function (event) {
|
228
|
addShopCart: function (event) {
|
228
|
-
|
229
|
+ debugger
|
229
|
this.setData(event.detail);
|
230
|
this.setData(event.detail);
|
230
|
-
|
231
|
+ let that = this;
|
231
|
let select_sku = that.data.selectedSKU;
|
232
|
let select_sku = that.data.selectedSKU;
|
232
|
let select_skn = that.data.current_skn;
|
233
|
let select_skn = that.data.current_skn;
|
233
|
let goods_type = that.data.is_gift ? 1 : 2;
|
234
|
let goods_type = that.data.is_gift ? 1 : 2;
|
234
|
-
|
235
|
+ let promotion_id = that.data.promotion_id;
|
235
|
if (!select_sku) {
|
236
|
if (!select_sku) {
|
236
|
tt.showToast({
|
237
|
tt.showToast({
|
237
|
title: '请选择颜色或尺码',
|
238
|
title: '请选择颜色或尺码',
|
|
@@ -247,7 +248,8 @@ Page({ |
|
@@ -247,7 +248,8 @@ Page({ |
247
|
that.resetPickerData();
|
248
|
that.resetPickerData();
|
248
|
|
249
|
|
249
|
let param = {};
|
250
|
let param = {};
|
250
|
- if (that.data.status == '10') {
|
251
|
+ console.log(that.data.status);
|
|
|
252
|
+ if (that.data.status === '10') {
|
251
|
param = {
|
253
|
param = {
|
252
|
method: 'app.Shopping.add',
|
254
|
method: 'app.Shopping.add',
|
253
|
product_sku: select_sku,
|
255
|
product_sku: select_sku,
|
|
@@ -257,7 +259,7 @@ Page({ |
|
@@ -257,7 +259,7 @@ Page({ |
257
|
goods_type: goods_type,
|
259
|
goods_type: goods_type,
|
258
|
edit_product_sku: 0,
|
260
|
edit_product_sku: 0,
|
259
|
};
|
261
|
};
|
260
|
- } else if (that.data.status == '30') {
|
262
|
+ } else if (that.data.status === '30') {
|
261
|
param = {
|
263
|
param = {
|
262
|
method: 'app.Shopping.swapGift',
|
264
|
method: 'app.Shopping.swapGift',
|
263
|
new_product_skn: select_skn,
|
265
|
new_product_skn: select_skn,
|
|
@@ -267,12 +269,9 @@ Page({ |
|
@@ -267,12 +269,9 @@ Page({ |
267
|
buy_number: 1,
|
269
|
buy_number: 1,
|
268
|
}
|
270
|
}
|
269
|
} else {
|
271
|
} else {
|
270
|
- tt.navigateBack({
|
|
|
271
|
-
|
|
|
272
|
- });
|
272
|
+ tt.navigateBack();
|
273
|
return;
|
273
|
return;
|
274
|
}
|
274
|
}
|
275
|
- // console.log(param);
|
|
|
276
|
api.get({data: param})
|
275
|
api.get({data: param})
|
277
|
.then(json => {
|
276
|
.then(json => {
|
278
|
if (json && json.code) {
|
277
|
if (json && json.code) {
|
|
@@ -294,7 +293,7 @@ Page({ |
|
@@ -294,7 +293,7 @@ Page({ |
294
|
|
293
|
|
295
|
|
294
|
|
296
|
this.setData(event.detail);
|
295
|
this.setData(event.detail);
|
297
|
-
|
296
|
+
|
298
|
if (!this.data.selectedSKU) {
|
297
|
if (!this.data.selectedSKU) {
|
299
|
this.wetoast.toast({
|
298
|
this.wetoast.toast({
|
300
|
title: '请选择颜色或尺码',
|
299
|
title: '请选择颜色或尺码',
|