Commit 51388ed6 by 李嘉林

商品服务接口加参数

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