...
|
...
|
@@ -82,7 +82,7 @@ Page({ |
|
|
onLoad: function (options) {
|
|
|
var that = this
|
|
|
// Picker.init(that);
|
|
|
// new app.WeToast();
|
|
|
new app.WeToast();
|
|
|
},
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -177,14 +177,53 @@ Page({ |
|
|
});
|
|
|
},
|
|
|
|
|
|
processShopCartData:function(data){
|
|
|
if (!data) {
|
|
|
return;
|
|
|
}
|
|
|
let commonShoppingCartData = data.ordinary_cart_data
|
|
|
let presellShoppingCartData = data.advance_cart_data
|
|
|
let commonProductNaviTitle = '普通商品(' + commonShoppingCartData.shopping_cart_data.goods_count + ')'
|
|
|
let presellProductNavTitle = '预售商品(' + presellShoppingCartData.shopping_cart_data.goods_count + ')'
|
|
|
commonShoppingCartData = curShoppingCartDataAddExpandedFlag(commonShoppingCartData);
|
|
|
// presellShoppingCartData = curShoppingCartDataAddExpandedFlag(presellShoppingCartData);
|
|
|
|
|
|
let curShoppingCartData = commonShoppingCartData;
|
|
|
// if (this.data.isSelectCommonNavi) {
|
|
|
// curShoppingCartData = commonShoppingCartData
|
|
|
// } else {
|
|
|
// curShoppingCartData = presellShoppingCartData
|
|
|
// }
|
|
|
const windowHeight = app.globalData.systemInfo.windowHeight;
|
|
|
let scrollerViewTop = 0;
|
|
|
if (curShoppingCartData.shipping_cost_prompt.shipping_cost_tips != '' || curShoppingCartData.shipping_cost_prompt.price_down_tips != '')
|
|
|
{
|
|
|
scrollerViewTop += 40;
|
|
|
}
|
|
|
let scrollerViewHeight = app.globalData.systemInfo.windowHeight - scrollerViewTop - 64;
|
|
|
|
|
|
this.setData({
|
|
|
commonShoppingCartData,
|
|
|
presellShoppingCartData,
|
|
|
commonProductNaviTitle,
|
|
|
presellProductNavTitle,
|
|
|
curShoppingCartData,
|
|
|
scrollerViewTop,
|
|
|
scrollerViewHeight,
|
|
|
});
|
|
|
},
|
|
|
|
|
|
onShoppingCartProductAction: function(event) {
|
|
|
let dataset = event.detail.detail.currentTarget.dataset;
|
|
|
if (!dataset) {
|
|
|
dataset = event.detail.currentTarget.dataset;
|
|
|
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(event);
|
|
|
console.log(dataset);
|
|
|
console.log('====================================');
|
|
|
|
...
|
...
|
@@ -208,8 +247,12 @@ Page({ |
|
|
this.plusBuyCountAction(dataset);
|
|
|
break;
|
|
|
case "plusReachedMaxAction":
|
|
|
this.plusReachedMaxAction(dataset);
|
|
|
this.plusReachedMaxAction();
|
|
|
break;
|
|
|
case "navToPromotionPage":
|
|
|
this.navToPromotionPage(dataset);
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
break;
|
|
|
}
|
...
|
...
|
@@ -225,45 +268,6 @@ Page({ |
|
|
});
|
|
|
},
|
|
|
|
|
|
processShopCartData:function(data){
|
|
|
if (!data) {
|
|
|
return;
|
|
|
}
|
|
|
let commonShoppingCartData = data.ordinary_cart_data
|
|
|
let presellShoppingCartData = data.advance_cart_data
|
|
|
let commonProductNaviTitle = '普通商品(' + commonShoppingCartData.shopping_cart_data.goods_count + ')'
|
|
|
let presellProductNavTitle = '预售商品(' + presellShoppingCartData.shopping_cart_data.goods_count + ')'
|
|
|
commonShoppingCartData = curShoppingCartDataAddExpandedFlag(commonShoppingCartData);
|
|
|
// presellShoppingCartData = curShoppingCartDataAddExpandedFlag(presellShoppingCartData);
|
|
|
|
|
|
let curShoppingCartData = commonShoppingCartData;
|
|
|
// if (this.data.isSelectCommonNavi) {
|
|
|
// curShoppingCartData = commonShoppingCartData
|
|
|
// } else {
|
|
|
// curShoppingCartData = presellShoppingCartData
|
|
|
// }
|
|
|
const windowHeight = app.globalData.systemInfo.windowHeight;
|
|
|
let scrollerViewTop = 0;
|
|
|
if (curShoppingCartData.shipping_cost_prompt.shipping_cost_tips != '' || curShoppingCartData.shipping_cost_prompt.price_down_tips != '')
|
|
|
{
|
|
|
scrollerViewTop += 40;
|
|
|
}
|
|
|
let scrollerViewHeight = app.globalData.systemInfo.windowHeight - scrollerViewTop - 64;
|
|
|
console.log('=========curShoppingCartData========');
|
|
|
console.log(curShoppingCartData);
|
|
|
console.log(scrollerViewHeight);
|
|
|
console.log('====================================');
|
|
|
this.setData({
|
|
|
commonShoppingCartData,
|
|
|
presellShoppingCartData,
|
|
|
commonProductNaviTitle,
|
|
|
presellProductNavTitle,
|
|
|
curShoppingCartData,
|
|
|
scrollerViewTop,
|
|
|
scrollerViewHeight,
|
|
|
});
|
|
|
},
|
|
|
|
|
|
naviTabSelected:function(event) {
|
|
|
let selectedNaviType = event.currentTarget.dataset.type;
|
|
|
let isSelectCommonNavi = true;
|
...
|
...
|
@@ -332,9 +336,6 @@ Page({ |
|
|
},
|
|
|
|
|
|
selectAllGoodsAction:function(event){
|
|
|
console.log('====================================');
|
|
|
console.log(event);
|
|
|
console.log('====================================');
|
|
|
let bSelectAll = event.detail.currentTarget.dataset.type;
|
|
|
let isEditing = this.data.isEditing;
|
|
|
if(isEditing) {
|
...
|
...
|
@@ -538,13 +539,13 @@ Page({ |
|
|
});
|
|
|
},
|
|
|
|
|
|
cutDownBuyCountAction:function(event){
|
|
|
cutDownBuyCountAction:function(dataset){
|
|
|
let isReduceOrPlue = this.data.isReduceOrPlue;
|
|
|
if (isReduceOrPlue){
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
let goodsItem = event.currentTarget.dataset.type;
|
|
|
let goodsItem = dataset.type;
|
|
|
let min_buy_number = goodsItem.min_buy_number > 0 ? goodsItem.min_buy_number : 1;
|
|
|
|
|
|
let current_buy_number = parseInt(goodsItem.buy_number);
|
...
|
...
|
@@ -598,7 +599,7 @@ Page({ |
|
|
});
|
|
|
});
|
|
|
},
|
|
|
plusBuyCountAction:function(event){
|
|
|
plusBuyCountAction:function(dataset){
|
|
|
let isReduceOrPlue = this.data.isReduceOrPlue;
|
|
|
if (isReduceOrPlue) {
|
|
|
return;
|
...
|
...
|
@@ -606,7 +607,7 @@ Page({ |
|
|
this.setData({
|
|
|
isReduceOrPlue: true,
|
|
|
});
|
|
|
let goodsItem = event.currentTarget.dataset.type;
|
|
|
let goodsItem = dataset.type;
|
|
|
let increaseBuyCountParam = {
|
|
|
product_sku: goodsItem.product_sku,
|
|
|
increase_number: 1,
|
...
|
...
|
@@ -644,16 +645,16 @@ Page({ |
|
|
});
|
|
|
});
|
|
|
},
|
|
|
plusReachedMaxAction:function(event){
|
|
|
plusReachedMaxAction:function(){
|
|
|
this.wetoast.toast({
|
|
|
title: '对不起,没有更多库存了',
|
|
|
titleClassName: 'wetoast-title',
|
|
|
duration: 1000
|
|
|
});
|
|
|
},
|
|
|
chooseSizeColorAction:function(event){
|
|
|
chooseSizeColorAction:function(dataset){
|
|
|
var that = this
|
|
|
let goodsItem = event.currentTarget.dataset.type;
|
|
|
let goodsItem = dataset.type;
|
|
|
// console.log(goodsItem);
|
|
|
this.setData({
|
|
|
curProcessGoodsItem: goodsItem,
|
...
|
...
|
@@ -1065,8 +1066,8 @@ Page({ |
|
|
});
|
|
|
},
|
|
|
|
|
|
navToPromotionPage: function(event) {
|
|
|
let promotionItem = event.currentTarget.dataset.promotionItem;
|
|
|
navToPromotionPage: function(dataset) {
|
|
|
let promotionItem = dataset.promotionItem;
|
|
|
let promotion_type = promotionItem.promotion_type;
|
|
|
|
|
|
// console.log(promotionItem);
|
...
|
...
|
|