Commit 51388ed6 by 李嘉林

商品服务接口加参数

parent fe0771ab
...@@ -375,6 +375,7 @@ export default { ...@@ -375,6 +375,7 @@ export default {
brandMore: false, brandMore: false,
brandList: [], brandList: [],
brandListCopy: [], brandListCopy: [],
terminalProductIds: [],
specifications: [], specifications: [],
randomNumber: "", randomNumber: "",
hideBrandSelectFlag: false, // 隐藏品牌筛选 hideBrandSelectFlag: false, // 隐藏品牌筛选
...@@ -428,6 +429,7 @@ export default { ...@@ -428,6 +429,7 @@ export default {
this.submitFliterVal = val.submitFliterVal; this.submitFliterVal = val.submitFliterVal;
this.categoryId = val.categoryId; this.categoryId = val.categoryId;
this.brandListCopy = val.filterBrand; this.brandListCopy = val.filterBrand;
this.terminalProductIds = val.terminalProductIds;
this.randomNumber = val.randomNumber; this.randomNumber = val.randomNumber;
this.hideBrandSelectFlag = val.hideBrandSelectFlag; this.hideBrandSelectFlag = val.hideBrandSelectFlag;
console.log(this.submitFliterVal,'-------------this.submitFliterVal') console.log(this.submitFliterVal,'-------------this.submitFliterVal')
...@@ -472,6 +474,11 @@ export default { ...@@ -472,6 +474,11 @@ export default {
let query = { let query = {
filterFieldsShowFlag: 1, filterFieldsShowFlag: 1,
} }
if(this.sourceType == 1) {
query.categoryId = this.categoryId;
query.brandIdList = this.brandListCopy;
query.terminalProductIds = this.terminalProductIds;
}
goodsApi.query_product_attribute_values_list(query).then(res=>{ goodsApi.query_product_attribute_values_list(query).then(res=>{
if(res.data.code == "200" && res.data.data && res.data.data.length){ if(res.data.code == "200" && res.data.data && res.data.data.length){
this.attributeList = res.data.data || []; this.attributeList = res.data.data || [];
...@@ -631,6 +638,7 @@ export default { ...@@ -631,6 +638,7 @@ export default {
this.submitFliterVal.brandActiveNameList = []; this.submitFliterVal.brandActiveNameList = [];
this.submitFliterVal.categoryIdList = []; this.submitFliterVal.categoryIdList = [];
this.submitFliterVal.goodsSpecificationIds = []; this.submitFliterVal.goodsSpecificationIds = [];
this.submitFliterVal.productAttributeIds = [];
this.brandList.forEach(item=>{ this.brandList.forEach(item=>{
item.selectFlag = false; item.selectFlag = false;
}); });
......
...@@ -73,8 +73,11 @@ const componentOptions = { ...@@ -73,8 +73,11 @@ const componentOptions = {
observers: {}, observers: {},
// 组件生命周期 // 组件生命周期
lifetimes: { lifetimes: {
created() {}, created() {
console.log("--goodsList-created")
},
ready() { ready() {
console.log("--goodsList-ready")
let _this = this; let _this = this;
let { clientHeight } = this.data; let { clientHeight } = this.data;
wx.getSystemInfo({ wx.getSystemInfo({
...@@ -117,6 +120,7 @@ const componentOptions = { ...@@ -117,6 +120,7 @@ const componentOptions = {
pageLifetimes: { pageLifetimes: {
// 页面被展示 // 页面被展示
show() { show() {
console.log("--goodsList-show")
const { isPageHidden } = this.data; const { isPageHidden } = this.data;
// show事件发生前,页面不是处于隐藏状态时 // show事件发生前,页面不是处于隐藏状态时
...@@ -153,12 +157,17 @@ const componentOptions = { ...@@ -153,12 +157,17 @@ const componentOptions = {
let { item } = e.currentTarget.dataset; let { item } = e.currentTarget.dataset;
let { filterPriceType, filterType } = this.data; let { filterPriceType, filterType } = this.data;
if(item == 99) { if(item == 99) {
// 展示筛选弹窗
let _this = this; let _this = this;
// 商品产品详情
let terminalProductIds = _this.data.datas.componentData.goodsList.map(element => {
return element.terminalProductId;
});
// 展示筛选弹窗
app.openFilterGoods({ app.openFilterGoods({
submitFliterVal: _this.data.submitFliterVal, submitFliterVal: _this.data.submitFliterVal,
categoryId: _this.data.datas.componentData.goodsSource == "classify"?_this.data.datas.componentData.categoryId : "", categoryId: _this.data.datas.componentData.goodsSource == "classify"?_this.data.datas.componentData.categoryId : "",
filterBrand: _this.data.datas.componentData.filterBrand, filterBrand: _this.data.datas.componentData.filterBrand,
terminalProductIds,
randomNumber: _this.data.randomNumber, randomNumber: _this.data.randomNumber,
hideBrandSelectFlag: _this.data.datas.componentData.filterBrand.length>0?true:false, hideBrandSelectFlag: _this.data.datas.componentData.filterBrand.length>0?true:false,
sourceType: 1, sourceType: 1,
...@@ -423,9 +432,9 @@ const componentOptions = { ...@@ -423,9 +432,9 @@ const componentOptions = {
let pageGoodsList = this.getStorageSync('pageGoodsList') || [] let pageGoodsList = this.getStorageSync('pageGoodsList') || []
if (flag) { if (flag) {
pageGoodsList[that.data.goodsListIndex].push(...goodsList) pageGoodsList[that.data.goodsListIndex] = goodsList;
}else{ }else{
pageGoodsList[that.data.datasIndex].push(...goodsList) pageGoodsList[that.data.datasIndex] = goodsList;
console.log(pageGoodsList[that.data.datasIndex],'--pageGoodsList[that.data.datasIndex]') console.log(pageGoodsList[that.data.datasIndex],'--pageGoodsList[that.data.datasIndex]')
} }
this.setStorageSync('pageGoodsList', pageGoodsList); this.setStorageSync('pageGoodsList', pageGoodsList);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment