|
@@ -250,6 +250,7 @@ Page({
|
|
|
'Accept': 'application/json'
|
|
|
},
|
|
|
success: function (res) {
|
|
|
+
|
|
|
console.log(res);
|
|
|
//有此商品
|
|
|
if (res.data.total > 0) {
|
|
@@ -367,6 +368,7 @@ Page({
|
|
|
},
|
|
|
success: function (res) {
|
|
|
console.log(res);
|
|
|
+ let showPrice = (res.data.maxAndMin.min == res.data.maxAndMin.max) ? res.data.maxAndMin.min : (res.data.maxAndMin.min + '-' + res.data.maxAndMin.max);
|
|
|
//有此商品
|
|
|
if (res.data.total > 0) {
|
|
|
if (res.data.commodity.commodity_flag == '1') {//此商品为下架商品
|
|
@@ -722,7 +724,8 @@ Page({
|
|
|
var dataContList = {
|
|
|
id: groupList[i].id,
|
|
|
product_price: groupList[i].product_price,
|
|
|
- product_repertory: groupList[i].product_repertory
|
|
|
+ product_repertory: groupList[i].product_repertory,
|
|
|
+ product_channel_price: groupList[i].product_channel_price, //添加渠道价格
|
|
|
};
|
|
|
dataList[dataTit] = dataContList;
|
|
|
}
|
|
@@ -731,7 +734,8 @@ Page({
|
|
|
groupList: groupList,
|
|
|
dataList: dataList,
|
|
|
showNum: sumTotal,
|
|
|
- commodityChannelPrice: res.data.data[0].commodityChannelPrice
|
|
|
+ commodityChannelPrice: res.data.data[0].product_channel_price,
|
|
|
+ showPrice: res.data.data[0].product_channel_price,
|
|
|
})
|
|
|
loadingFlag++;
|
|
|
if (loadingFlag == 6) {
|
|
@@ -804,8 +808,13 @@ Page({
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
+ console.log(res, "res,showPrice")
|
|
|
+
|
|
|
+ // if(that.data.loginStatic){
|
|
|
+ // showPrice =
|
|
|
+ // }
|
|
|
that.setData({
|
|
|
- showPrice: (res.data.maxAndMin.min == res.data.maxAndMin.max) ? res.data.maxAndMin.min :(res.data.maxAndMin.min + '-' + res.data.maxAndMin.max),
|
|
|
+ showPrice: showPrice,
|
|
|
minPrice: res.data.maxAndMin.min,//最低价格
|
|
|
maxPrice: res.data.maxAndMin.max,//最高价格
|
|
|
minNumber: res.data.commodity.commodity_num,
|
|
@@ -885,7 +894,6 @@ Page({
|
|
|
initSKU: function () {
|
|
|
var that = this;
|
|
|
var dataList = that.data.dataList;//已有的规则组合信息
|
|
|
-
|
|
|
//数据已有组合类
|
|
|
var i, j, skuKeys = that.getObjKeys(dataList);
|
|
|
|
|
@@ -915,7 +923,8 @@ Page({
|
|
|
var SKUResult = that.data.SKUResult;
|
|
|
SKUResult[skuKeyAttrs.join("-")] = {
|
|
|
product_repertory: sku.product_repertory,
|
|
|
- product_price: [sku.product_price]
|
|
|
+ product_price: [sku.product_price],
|
|
|
+ product_channel_price: [sku.product_channel_price], //添加渠道价格
|
|
|
};
|
|
|
}
|
|
|
|
|
@@ -1007,6 +1016,7 @@ Page({
|
|
|
|
|
|
//把组合的key放入结果集SKUResult
|
|
|
addSKUResult: function ( combArrItem, sku) {
|
|
|
+ console.log(sku,"sku")
|
|
|
var that = this;
|
|
|
var key = combArrItem.join("-");
|
|
|
var SKUResult = that.data.SKUResult;
|
|
@@ -1017,7 +1027,8 @@ Page({
|
|
|
} else {
|
|
|
SKUResult[key] = {
|
|
|
product_repertory: sku.product_repertory,
|
|
|
- product_price: [sku.product_price]
|
|
|
+ product_price: [sku.product_price],
|
|
|
+ product_channel_price:[sku.product_channel_price], //添加渠道价格
|
|
|
};
|
|
|
}
|
|
|
that.setData({
|
|
@@ -1143,12 +1154,16 @@ Page({
|
|
|
console.log("selectedIds.join('-'):"+selectedIds.join('-'));
|
|
|
|
|
|
var prices = SKUResult[selectedIds.join('-')].product_price;
|
|
|
+ console.log(prices,"prices")
|
|
|
var maxPrice = parseFloat(Math.max.apply(Math, prices)) + + parseFloat(clickBoxPrice);
|
|
|
var minPrice = parseFloat(Math.min.apply(Math, prices)) + + parseFloat(clickBoxPrice);
|
|
|
|
|
|
|
|
|
var showNum = SKUResult[selectedIds.join('-')].product_repertory;//当前规格下的库存
|
|
|
var showPrice = maxPrice > minPrice ? minPrice + "-" + maxPrice : maxPrice; //当前规格下的价格
|
|
|
+ if(that.data.loginStatic){ // 表示是渠道价格
|
|
|
+ showPrice = SKUResult[selectedIds.join('-')].product_channel_price//当前规格下的渠道价格
|
|
|
+ }
|
|
|
var num = this.data.minNumber;//当前数量
|
|
|
if (num >= showNum){
|
|
|
that.setData({
|