Authored by 肖亚东

加价购页面逻辑处理 — review by 李奇

... ... @@ -64,6 +64,9 @@ Page({
this.setData({ promotion_ids, is_gift, status });
this.queryGiftPageData();
new app.WeToast();
},
/**
... ... @@ -117,8 +120,12 @@ Page({
onPressProduct: function (event) {
let data = event.currentTarget.dataset;
let product_skn = data.productSkn;
let promotion_id = data.promotion_id;
this.setData({ current_skn: product_skn,promotion_id });
let promotion_id = data.item.promotion_id;
this.setData({
current_skn: product_skn,
promotion_id
});
let param = {
method: 'app.product.gift',
uid: app.getUid(),
... ... @@ -257,6 +264,7 @@ Page({
selected: 'Y',
goods_type: goods_type,
edit_product_sku: 0,
uid: app && app.getUid(),
};
} else if (that.data.status === '30') {
param = {
... ... @@ -266,6 +274,7 @@ Page({
promotion_id: promotion_id,
goods_type: goods_type,
buy_number: 1,
uid: app && app.getUid(),
}
} else {
tt.navigateBack();
... ... @@ -310,9 +319,6 @@ Page({
},
errorToast: function(event) {
console.log('====================================');
console.log(event);
console.log('====================================');
let detail = event.detail;
this.wetoast.toast({
title: detail.title,
... ...
{
"navigationBarTitleText": "换购商品",
"navigationBarTitleText": "",
"usingComponents": {
"shoppingCartFooterView": "../../components/shopCart/footerView/shoppingCartFooterView",
"shoppingCartProductCell": "../../components/shopCart/cells/shoppingCartProductCell",
"shoppingCartGiftOrPriceCell": "../../components/shopCart/cells/shoppingCartGiftOrPriceCell",
"shoppingCartInvalidProductCell": "../../components/shopCart/cells/shoppingCartInvalidProductCell",
"shoppingCartPromotionCell": "../../components/shopCart/cells/shoppingCartPromotionCell",
"shoppingCartOneProductCell": "../../components/shopCart/cells/shoppingCartOneProductCell",
"picker":"../../components/picker/picker"
}
}
\ No newline at end of file
... ...
... ... @@ -49,3 +49,5 @@
></picker>
</view>
<import src="../../vendors/toast/wetoast.ttml"/>
<template is="wetoast" data="{{...__wetoast__}}"/>
\ No newline at end of file
... ...
/* giftPage.wxss */
/* @import "../goodsDetail/picker/picker.wxss"; */
.container {
background-color: white;
... ...
... ... @@ -213,18 +213,12 @@ Page({
},
onShoppingCartProductAction: function(event) {
console.log(event);
let dataset = event.detail.currentTarget.dataset;
console.log(dataset);
if (Object.keys(dataset).length === 0) {
dataset = event.detail.detail.currentTarget.dataset;
}
let identifier = dataset.identifier;
console.log('===onShoppingCartProductAction====');
console.log(dataset);
console.log('====================================');
switch (identifier) {
case "selectSingleGoodsAction":
... ... @@ -407,19 +401,19 @@ Page({
},
moveEnd: function (e) {
// console.log('moveEnd');
// console.log(e);
let isEditing = this.data.isEditing;
if (isEditing) {
return;
}
let changedTouches = e.detail.detail.changedTouches;
let changedTouches = e.detail.changedTouches;
if (!changedTouches) {
changedTouches = e.detail.changedTouches;
changedTouches = e.detail.detail.changedTouches;
}
let dataset = e.detail.detail.currentTarget.dataset;
if (!dataset) {
dataset = e.detail.currentTarget.dataset;
let dataset = e.detail.currentTarget.dataset;
if (Object.keys(dataset).length === 0) {
dataset = e.detail.detail.currentTarget.dataset;
}
var X = changedTouches[0].clientX;
... ...