Commit adc60526 by 李嘉林

企业用户

parent 3d48f618
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="list clearfix brand-wrap" v-if="!hideBrandSelectFlag"> <div class="list clearfix brand-wrap">
<div class="tit"> <div class="tit">
<div class="tit-title">品牌</div> <div class="tit-title">品牌</div>
<div <div
...@@ -214,6 +214,7 @@ export default { ...@@ -214,6 +214,7 @@ export default {
GoodsSpecificationNameAndValuesListResponseDTO: [], GoodsSpecificationNameAndValuesListResponseDTO: [],
brandMore: false, brandMore: false,
brandList: [], brandList: [],
brandListCopy: [],
brandList2: [], brandList2: [],
randomNumber: "", randomNumber: "",
hideBrandSelectFlag: false, // 隐藏品牌筛选 hideBrandSelectFlag: false, // 隐藏品牌筛选
...@@ -232,7 +233,6 @@ export default { ...@@ -232,7 +233,6 @@ export default {
}, },
}, },
created() { created() {
this.getProductBrand();
this.query_specification_name_and_values_list(); this.query_specification_name_and_values_list();
}, },
mounted() { mounted() {
...@@ -244,10 +244,13 @@ export default { ...@@ -244,10 +244,13 @@ export default {
}, },
methods: { methods: {
open(val) { open(val) {
console.log("筛选商品open"); console.log("筛选商品open",val);
this.submitFliterVal = val.submitFliterVal; this.submitFliterVal = val.submitFliterVal;
this.brandListCopy = val.filterBrand;
this.randomNumber = val.randomNumber; this.randomNumber = val.randomNumber;
this.hideBrandSelectFlag = val.hideBrandSelectFlag; this.hideBrandSelectFlag = val.hideBrandSelectFlag;
console.log(this.submitFliterVal,'-------------this.submitFliterVal')
this.getProductBrand();
this.show = true; this.show = true;
}, },
close() { close() {
...@@ -290,7 +293,22 @@ export default { ...@@ -290,7 +293,22 @@ export default {
res.data.data.list.forEach(item=>{ res.data.data.list.forEach(item=>{
item.selectFlag = false; item.selectFlag = false;
}) })
this.brandList = res.data.data.list; let list = [];
if(this.brandListCopy.length>0) {
list = res.data.data.list.filter(item=>this.brandListCopy.includes(item.id));
// 后面手动未选
console.log(this.submitFliterVal.brandIdList,'----------this.submitFliterVal.brandIdList')
let list2 = res.data.data.list.filter(item=>this.submitFliterVal.brandIdList.includes(item.id));
this.submitFliterVal.brandActiveNameList = list2.map(item=>item.brandName);
} else {
list = res.data.data.list;
}
list.forEach(item=>{
if(this.submitFliterVal.brandIdList.includes(item.id)) {
item.selectFlag = true;
}
})
this.brandList = list;
this.brandList2 = this.brandList.slice(8); this.brandList2 = this.brandList.slice(8);
console.log(this.brandList,'---------brandList') console.log(this.brandList,'---------brandList')
} }
...@@ -342,7 +360,6 @@ export default { ...@@ -342,7 +360,6 @@ export default {
this.submitFliterVal.minPrice = ""; this.submitFliterVal.minPrice = "";
this.submitFliterVal.maxPrice = ""; this.submitFliterVal.maxPrice = "";
this.submitFliterVal.attribute = []; this.submitFliterVal.attribute = [];
if (!this.hideBrandSelectFlag) {
this.submitFliterVal.brandIdList = []; this.submitFliterVal.brandIdList = [];
this.submitFliterVal.brandActiveNameList = []; this.submitFliterVal.brandActiveNameList = [];
this.brandList.forEach(item=>{ this.brandList.forEach(item=>{
...@@ -351,7 +368,6 @@ export default { ...@@ -351,7 +368,6 @@ export default {
this.brandList2.forEach(item=>{ this.brandList2.forEach(item=>{
item.selectFlag = false; item.selectFlag = false;
}); });
}
this.GoodsSpecificationNameAndValuesListResponseDTO.forEach( this.GoodsSpecificationNameAndValuesListResponseDTO.forEach(
(ele) => { (ele) => {
if (ele.specificationValueList) { if (ele.specificationValueList) {
...@@ -382,13 +398,13 @@ export default { ...@@ -382,13 +398,13 @@ export default {
Toast("最高价应大于最低价"); Toast("最高价应大于最低价");
return; return;
} }
let callbackObj = {
submitFliterVal: this.submitFliterVal,
randomNumber: this.randomNumber,
};
// 向外传值 // 向外传值
console.log(callbackObj,'----callbackObj') console.log(this.submitFliterVal,this.randomNumber,'-----------------确认submitFliterVal')
app.getFilterGoodsData(callbackObj); let _this = this;
app.getFilterGoodsData({
submitFliterVal: _this.submitFliterVal,
randomNumber: _this.randomNumber,
});
this.show = false; this.show = false;
}, },
}, },
......
...@@ -179,6 +179,18 @@ wx.onAppRoute(res => { ...@@ -179,6 +179,18 @@ wx.onAppRoute(res => {
// 获取当前页面信息 // 获取当前页面信息
let currentPage = getCurrentPages() let currentPage = getCurrentPages()
// let fromPath = currentPage[currentPage.length - 1].__displayReporter.showReferpagepath // let fromPath = currentPage[currentPage.length - 1].__displayReporter.showReferpagepath
let whetherToForceLogin = mpApp.globalData.shopInfo && mpApp.globalData.shopInfo.whetherToForceLogin || 0
log.info("wx.onAppRoute", res, mpApp.globalData.shopInfo, whetherToForceLogin, wx.getStorageSync('sessionid'), res.path != "pages/login/main");
console.log(res,mpApp.globalData.shopInfo,whetherToForceLogin,wx.getStorageSync('sessionid'),res.path !="pages/login/main",'---------wx.onAppRoute')
if (whetherToForceLogin == 1 && !wx.getStorageSync('sessionid') && res.path !="pages/login/main") {
let backUrl = `/pages/home/main`;
const url = `/pages/login/main?back=${encodeURIComponent(
backUrl
)}&hideBack=1`;
wx.navigateTo({
url: url
});
}
new Promise((resolve) => { new Promise((resolve) => {
if (!spokesmanId) { if (!spokesmanId) {
// 获取当前分销员 id // 获取当前分销员 id
......
<template> <template>
<div class="domain"> <div class="domain">
<ThemeDataPlant :pageCode="14"></ThemeDataPlant> <ThemeDataPlant :pageCode="14"></ThemeDataPlant>
<div class="tabbar" :style="{'height' : tabbarHeight + 'px','padding-top':systemInfo.statusBarHeight + 'px'}" @click="back"> <div class="tabbar" v-if="hideBack == 0" :style="{'height' : tabbarHeight + 'px','padding-top':systemInfo.statusBarHeight + 'px'}" @click="back">
<div class="tab-back"> <div class="tab-back">
<van-icon name="arrow-left" /> <van-icon name="arrow-left" />
</div> </div>
...@@ -145,6 +145,7 @@ export default { ...@@ -145,6 +145,7 @@ export default {
tabbarHeight : 0, tabbarHeight : 0,
pageInfo: {}, pageInfo: {},
pageData: {}, pageData: {},
hideBack: 0, //0显示返回按钮 1隐藏
}; };
}, },
computed: { computed: {
...@@ -198,6 +199,7 @@ export default { ...@@ -198,6 +199,7 @@ export default {
this.backPath = options.back; this.backPath = options.back;
} }
} }
this.hideBack = options.hideBack == 1?1:0
if (options.params) { if (options.params) {
this.defalutBackParams= serialize(options.params); this.defalutBackParams= serialize(options.params);
this.backParams = this.defalutBackParams; this.backParams = this.defalutBackParams;
......
...@@ -62,8 +62,8 @@ const componentOptions = { ...@@ -62,8 +62,8 @@ const componentOptions = {
brandIdList: [], //品牌 brandIdList: [], //品牌
brandActiveNameList: [], brandActiveNameList: [],
goodsSpecificationIds: [], goodsSpecificationIds: [],
randomNumber: "",
}, },
randomNumber: "",
}, },
// 数据监听器 // 数据监听器
observers: {}, observers: {},
...@@ -74,12 +74,16 @@ const componentOptions = { ...@@ -74,12 +74,16 @@ const componentOptions = {
let _this = this; let _this = this;
app.getFilterGoodsData = (val) => { app.getFilterGoodsData = (val) => {
if (val.randomNumber != _this.data.randomNumber) return; if (val.randomNumber != _this.data.randomNumber) return;
console.log(val,'-------------------------77')
_this.setData({ _this.setData({
submitFliterVal: val.submitFliterVal, submitFliterVal: val.submitFliterVal,
}) })
console.log(_this.data.submitFliterVal,'----------submitFliterVal') console.log(_this.data.submitFliterVal,'----------submitFliterVal')
_this.init(); _this.init();
} }
this.setData({
"submitFliterVal.brandIdList": JSON.parse(JSON.stringify(this.data.datas.componentData.filterBrand)),
})
this.init(); this.init();
}, },
moved() {}, moved() {},
...@@ -143,6 +147,7 @@ const componentOptions = { ...@@ -143,6 +147,7 @@ const componentOptions = {
let _this = this; let _this = this;
app.openFilterGoods({ app.openFilterGoods({
submitFliterVal: _this.data.submitFliterVal, submitFliterVal: _this.data.submitFliterVal,
filterBrand: _this.data.datas.componentData.filterBrand,
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,
}); });
...@@ -161,7 +166,6 @@ const componentOptions = { ...@@ -161,7 +166,6 @@ const componentOptions = {
goodsSource, goodsSource,
angleSignImg, angleSignImg,
titleIcon, titleIcon,
filterBrand
} = this.data.datas.componentData; } = this.data.datas.componentData;
angleSignImg = DFSImg(angleSignImg,150,150,1); angleSignImg = DFSImg(angleSignImg,150,150,1);
if (titleIcon) { if (titleIcon) {
...@@ -171,7 +175,6 @@ const componentOptions = { ...@@ -171,7 +175,6 @@ const componentOptions = {
"data.datas.componentData.angleSignImg": angleSignImg, "data.datas.componentData.angleSignImg": angleSignImg,
titleIcon, titleIcon,
mainColor: app.themeColor["--main-color"], mainColor: app.themeColor["--main-color"],
"submitFliterVal.brandIdList": filterBrand,
randomNumber: random_string(6), randomNumber: random_string(6),
}); });
console.log(this.data.titleIcon, "----------------------------68"); console.log(this.data.titleIcon, "----------------------------68");
......
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