|
|
|
@ -20,22 +20,32 @@ |
|
|
|
|
<view class=""> |
|
|
|
|
<span class="zdyTitle" v-if="( productCodeLable? index==3 : false ) ">渠道</span> |
|
|
|
|
<view class="filter-content-detail show_min_height"> |
|
|
|
|
<text v-if="( productCodeLable? index==3 : false ) " v-for="( detailItem,idx) in selectDetailLists" :key="idx" class='filter-content-detail-item-default' :style="{'background-color':detailItem.isSelected?themeColor:'#FFFFFF','color':detailItem.isSelected?'#FFFFFF':'#666666'}" |
|
|
|
|
<text v-if="( productCodeLable? index==3 : false ) " |
|
|
|
|
v-for="( detailItem,idx) in selectDetailLists" :key="idx" |
|
|
|
|
class='filter-content-detail-item-default' |
|
|
|
|
:style="{'background-color':detailItem.isSelected?themeColor:'#FFFFFF','color':detailItem.isSelected?'#FFFFFF':'#666666'}" |
|
|
|
|
@tap="itemTaps(idx,selectDetailLists,item.isMutiple,'channelCode',detailItem)"> |
|
|
|
|
{{detailItem.title}} |
|
|
|
|
</text> |
|
|
|
|
</view> |
|
|
|
|
<span class="zdyTitle" v-if="( productCodeLable? index==3 : false ) ">品牌</span> |
|
|
|
|
<view class="filter-content-detail show_min_height"> |
|
|
|
|
<text v-if="( productCodeLable? index!==2 : true ) " v-for="( detailItem,idx) in selectDetailList" :key="idx" class='filter-content-detail-item-default' :style="{'background-color':detailItem.isSelected?themeColor:'#FFFFFF','color':detailItem.isSelected?'#FFFFFF':'#666666'}" |
|
|
|
|
<text v-if="( productCodeLable? index!==2 : true ) " |
|
|
|
|
v-for="( detailItem,idx) in selectDetailList" :key="idx" |
|
|
|
|
class='filter-content-detail-item-default' |
|
|
|
|
:style="{'background-color':detailItem.isSelected?themeColor:'#FFFFFF','color':detailItem.isSelected?'#FFFFFF':'#666666'}" |
|
|
|
|
@tap="itemTap(idx,selectDetailList,item.isMutiple,item.key,detailItem,index)"> |
|
|
|
|
{{detailItem.title}} |
|
|
|
|
</text> |
|
|
|
|
</view> |
|
|
|
|
<view style="margin-bottom: 10rpx;" v-for="(p,pIndex) in productCodeLable" v-if="(productCodeLable? index==2:false) "> |
|
|
|
|
<view style="margin-bottom: 10rpx;" v-for="(p,pIndex) in productCodeLable" |
|
|
|
|
v-if="(productCodeLable? index==2:false) "> |
|
|
|
|
<view class="newselsetitle">{{p}}</view> |
|
|
|
|
<view class="newselse"> |
|
|
|
|
<text :style="{background:seleIdex == zIndex +'/'+ p + '/' + index?'#FF6700':'',color:seleIdex == zIndex +'/'+ p + '/' + index?'#FFFFFF':'',border:seleIdex == zIndex +'/'+ p + '/' + index?'0px':''}" @click="pseleFn(zIndex,p,index)" v-for="(z,zIndex) in productCodeList[p]" class="newselseitem" >{{z}}</text> |
|
|
|
|
<text |
|
|
|
|
:style="{background:seleIdex == zIndex +'/'+ p + '/' + index?'#FF6700':'',color:seleIdex == zIndex +'/'+ p + '/' + index?'#FFFFFF':'',border:seleIdex == zIndex +'/'+ p + '/' + index?'0px':''}" |
|
|
|
|
@click="pseleFn(zIndex,p,index)" v-for="(z,zIndex) in productCodeList[p]" |
|
|
|
|
class="newselseitem">{{z}}</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -54,14 +64,16 @@ |
|
|
|
|
</view> |
|
|
|
|
</picker-view-column> |
|
|
|
|
<picker-view-column v-if="areaCodeList[areaIndex[0]]"> |
|
|
|
|
<view class="center" v-for="(item, index) in areaCodeList[areaIndex[0]].childList" :key="index"> |
|
|
|
|
<view class="center" v-for="(item, index) in areaCodeList[areaIndex[0]].childList" |
|
|
|
|
:key="index"> |
|
|
|
|
<view v-show="false">{{ JSON.stringify(item.areaName) }}</view> |
|
|
|
|
{{ item.areaName }} |
|
|
|
|
</view> |
|
|
|
|
</picker-view-column> |
|
|
|
|
<picker-view-column v-if="areaCodeList[areaIndex[0]]"> |
|
|
|
|
<view class="center" |
|
|
|
|
v-for="(item, index) in areaCodeList[areaIndex[0]].childList[areaIndex[1]].childList" :key="index"> |
|
|
|
|
v-for="(item, index) in areaCodeList[areaIndex[0]].childList[areaIndex[1]].childList" |
|
|
|
|
:key="index"> |
|
|
|
|
<view v-show="false">{{ JSON.stringify(item.areaName) }}</view> |
|
|
|
|
{{ item.areaName }} |
|
|
|
|
</view> |
|
|
|
@ -70,10 +82,13 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="filter-content-footer"> |
|
|
|
|
<view class="filter-content-footer-item" style="color: #777777; background-color: #FFFFFF;" @tap="resetClick(selectDetailList,item.key,selectDetailLists,'channelCode',index)"> |
|
|
|
|
<view class="filter-content-footer-item" style="color: #777777; background-color: #FFFFFF;" |
|
|
|
|
@tap="resetClick(selectDetailList,item.key,selectDetailLists,'channelCode',index)"> |
|
|
|
|
<text>重置</text> |
|
|
|
|
</view> |
|
|
|
|
<view class="filter-content-footer-item" :style="{'color': '#FFFFFF', 'background-color': themeColor}" @tap="sureClick(selectDetailList,item.key,index)"> |
|
|
|
|
<view class="filter-content-footer-item" |
|
|
|
|
:style="{'color': '#FFFFFF', 'background-color': themeColor}" |
|
|
|
|
@tap="sureClick(selectDetailList,item.key,index)"> |
|
|
|
|
<text>确定</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -143,13 +158,13 @@ |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
productCodeList: function(n, o) { |
|
|
|
|
console.log('%c 打印的新的列表格式箭头↓zxxxx','color:red;font-size:32px') |
|
|
|
|
// console.log('%c 打印的新的列表格式箭头↓zxxxx','color:red;font-size:32px') |
|
|
|
|
this.setingFn() |
|
|
|
|
console.log(this.productCodeList,this.menuList,'9999999999999') |
|
|
|
|
// console.log(this.productCodeList,this.menuList,'9999999999999') |
|
|
|
|
}, |
|
|
|
|
selectDetailList: function(n, o) { |
|
|
|
|
console.log('%c 元数组切换↓1','font-size:50px;color:blue') |
|
|
|
|
console.log(this.menuIndex) |
|
|
|
|
// console.log('%c 元数组切换↓1','font-size:50px;color:blue') |
|
|
|
|
// console.log(this.menuIndex) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
@ -161,8 +176,29 @@ |
|
|
|
|
*/ |
|
|
|
|
// console.log(this.menuList,'打印列表列表') |
|
|
|
|
this.setingFn() |
|
|
|
|
this.areaCodeList = uni.getStorageSync('areaCodeList') |
|
|
|
|
this.areaCodeList.unshift({areaName:'全部',childList:[{areaName:'',childList:[{areaName:''}]}]}) |
|
|
|
|
this.areaCodeList = uni.getStorageSync('areaCodeList') || [] |
|
|
|
|
this.areaCodeList.unshift({ |
|
|
|
|
areaName: '全部', |
|
|
|
|
childList: [{ |
|
|
|
|
areaName: '', |
|
|
|
|
childList: [{ |
|
|
|
|
areaName: '' |
|
|
|
|
}] |
|
|
|
|
}] |
|
|
|
|
}) |
|
|
|
|
if (this.areaCodeList.length === 1) { |
|
|
|
|
let instance = setInterval(() => { |
|
|
|
|
// console.log('执行一次') |
|
|
|
|
if (this.areaCodeList1.length) { |
|
|
|
|
clearInterval(instance) |
|
|
|
|
this.areaCodeList = [...this.areaCodeList, ...this.areaCodeList1] |
|
|
|
|
} |
|
|
|
|
}, 2000) |
|
|
|
|
} |
|
|
|
|
// setTimeout(() => { |
|
|
|
|
|
|
|
|
|
// },3000) |
|
|
|
|
|
|
|
|
|
// setTimeout(()=>{ |
|
|
|
|
// if(this.areaCodeList1.length<1){ |
|
|
|
|
// this.areaCodeList = uni.getStorageSync('areaCodeList') |
|
|
|
@ -221,16 +257,21 @@ |
|
|
|
|
// 数组push‘全部’ |
|
|
|
|
if (val[0] != 0) { |
|
|
|
|
if (this.areaCodeList[val[0]].childList[0].areaName != '全部') { |
|
|
|
|
this.areaCodeList[val[0]].childList.unshift({areaName:'全部'}) |
|
|
|
|
this.areaCodeList[val[0]].childList.unshift({ |
|
|
|
|
areaName: '全部' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
if (this.areaIndex[1] != 0) { |
|
|
|
|
if (this.areaCodeList[val[0]].childList[val[1]].childList[0].areaName != '全部') { |
|
|
|
|
this.areaCodeList[val[0]].childList[val[1]].childList.unshift({areaName:'全部'}) |
|
|
|
|
this.areaCodeList[val[0]].childList[val[1]].childList.unshift({ |
|
|
|
|
areaName: '全部' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.provinceCode = this.areaCodeList[this.areaIndex[0]].id |
|
|
|
|
this.cityCode = this.areaCodeList[this.areaIndex[0]].childList[this.areaIndex[1]].id |
|
|
|
|
this.areaCode = this.areaCodeList[this.areaIndex[0]].childList[this.areaIndex[1]].childList[this.areaIndex[2]].id |
|
|
|
|
this.areaCode = this.areaCodeList[this.areaIndex[0]].childList[this.areaIndex[1]].childList[this |
|
|
|
|
.areaIndex[2]].id |
|
|
|
|
} else { |
|
|
|
|
this.provinceCode = this.cityCode = this.areaCode = '' |
|
|
|
|
this.areaIndex = [0, 0, 0] |
|
|
|
@ -260,7 +301,8 @@ |
|
|
|
|
let obj = {} |
|
|
|
|
for (let i = 0; i < this.menuList.length; i++) { |
|
|
|
|
let item = this.menuList[i]; |
|
|
|
|
if (!this.independence && item.defaultSelectedIndex != null && item.defaultSelectedIndex.toString().length > 0) { // 处理并列菜单默认值 |
|
|
|
|
if (!this.independence && item.defaultSelectedIndex != null && item.defaultSelectedIndex.toString() |
|
|
|
|
.length > 0) { // 处理并列菜单默认值 |
|
|
|
|
|
|
|
|
|
if (item.isMutiple) { |
|
|
|
|
obj[item.key] = []; |
|
|
|
@ -324,16 +366,20 @@ |
|
|
|
|
if (Array.isArray(this.menuList[i].defaultSelectedIndex)) { // 把所有默认的为false的点为true |
|
|
|
|
for (let j = 0; j < this.menuList[i].defaultSelectedIndex.length; j++) { |
|
|
|
|
if (this.selectDetailList[this.menuList[i].defaultSelectedIndex[j]].isSelected == false) { |
|
|
|
|
this.itemTap(this.menuList[i].defaultSelectedIndex[j], this.selectDetailList, this.menuList[i].isMutiple, this |
|
|
|
|
this.itemTap(this.menuList[i].defaultSelectedIndex[j], this.selectDetailList, this |
|
|
|
|
.menuList[i].isMutiple, this |
|
|
|
|
.menuList[i].key) |
|
|
|
|
this.itemTaps(this.menuList[i].defaultSelectedIndex[j], this.selectDetailList, this.menuList[i].isMutiple, this |
|
|
|
|
this.itemTaps(this.menuList[i].defaultSelectedIndex[j], this.selectDetailList, this |
|
|
|
|
.menuList[i].isMutiple, this |
|
|
|
|
.menuList[i].key) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
this.itemTap(this.menuList[i].defaultSelectedIndex, this.selectDetailList, this.menuList[i].isMutiple, this.menuList[ |
|
|
|
|
this.itemTap(this.menuList[i].defaultSelectedIndex, this.selectDetailList, this.menuList[i] |
|
|
|
|
.isMutiple, this.menuList[ |
|
|
|
|
i].key) |
|
|
|
|
this.itemTaps(this.menuList[i].defaultSelectedIndex, this.selectDetailList, this.menuList[i].isMutiple, this.menuList[ |
|
|
|
|
this.itemTaps(this.menuList[i].defaultSelectedIndex, this.selectDetailList, this.menuList[i] |
|
|
|
|
.isMutiple, this.menuList[ |
|
|
|
|
i].key) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -342,9 +388,11 @@ |
|
|
|
|
// 把所有不是默认的为true的点为false |
|
|
|
|
for (let j = 0; j < unDefaultSelectedIndexArr.length; j++) { |
|
|
|
|
if (this.selectDetailList[unDefaultSelectedIndexArr[j]].isSelected == true) { |
|
|
|
|
this.itemTap(unDefaultSelectedIndexArr[j], this.selectDetailList, this.menuList[i].isMutiple, this |
|
|
|
|
this.itemTap(unDefaultSelectedIndexArr[j], this.selectDetailList, this.menuList[i] |
|
|
|
|
.isMutiple, this |
|
|
|
|
.menuList[i].key) |
|
|
|
|
this.itemTaps(unDefaultSelectedIndexArr[j], this.selectDetailList, this.menuList[i].isMutiple, this |
|
|
|
|
this.itemTaps(unDefaultSelectedIndexArr[j], this.selectDetailList, this.menuList[i] |
|
|
|
|
.isMutiple, this |
|
|
|
|
.menuList[i].key) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -716,7 +764,8 @@ |
|
|
|
|
// console.log(this.seleIdex.split('/'),this.productCodeList[this.seleIdex.split('/')[1]][this.seleIdex.split('/')[0]],this.seleIdex.split('/')[2],'dddddddddddddddddd') |
|
|
|
|
if (this.seleIdex !== null && this.seleIdex.split('/')[2] == 2) { |
|
|
|
|
|
|
|
|
|
obj.result.oilProductCode = this.productCodeList[this.seleIdex.split('/')[1]][this.seleIdex.split('/')[0]]?this.productCodeList[this.seleIdex.split('/')[1]][this.seleIdex.split('/')[0]]:'' |
|
|
|
|
obj.result.oilProductCode = this.productCodeList[this.seleIdex.split('/')[1]][this.seleIdex.split('/')[ |
|
|
|
|
0]] ? this.productCodeList[this.seleIdex.split('/')[1]][this.seleIdex.split('/')[0]] : '' |
|
|
|
|
obj.titles.oilProductCode = obj.result.oilProductCode ? obj.result.oilProductCode : '全部' |
|
|
|
|
this.oilCode = obj.result.oilProductCode |
|
|
|
|
console.log(obj, 'look me!2') |
|
|
|
@ -729,7 +778,9 @@ |
|
|
|
|
console.log('%c 重置方法第一步resetClick函数参数↓', 'color:red;font-size:30px') |
|
|
|
|
console.log(list, key) |
|
|
|
|
if (this.seleIdex !== null && this.seleIdex.split('/')[2] == 2) { |
|
|
|
|
console.log(this.seleIdex.split('/'),this.productCodeList[this.seleIdex.split('/')[1]][this.seleIdex.split('/')[0]]) |
|
|
|
|
console.log(this.seleIdex.split('/'), this.productCodeList[this.seleIdex.split('/')[1]][this.seleIdex |
|
|
|
|
.split('/')[0] |
|
|
|
|
]) |
|
|
|
|
this.pseleFn() |
|
|
|
|
// console.log(obj,'look me!2') |
|
|
|
|
// this.$emit("confirm", obj); |
|
|
|
@ -778,16 +829,19 @@ |
|
|
|
|
flex-direction: row; |
|
|
|
|
flex-wrap: wrap; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.newselsetitle { |
|
|
|
|
font-weight: 600; |
|
|
|
|
margin-bottom: 15rpx; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.newselse { |
|
|
|
|
width: 100%; |
|
|
|
|
display: flex; |
|
|
|
|
gap: 15rpx; |
|
|
|
|
flex-wrap: wrap; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.newselseitem { |
|
|
|
|
padding: 5rpx 10rpx; |
|
|
|
|
/* background-color: #000000; */ |
|
|
|
@ -797,6 +851,7 @@ |
|
|
|
|
border: 1rpx solid #bbbbbb; |
|
|
|
|
min-width: 90rpx; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.filter-content { |
|
|
|
|
background-color: #F6F7F8; |
|
|
|
|
} |
|
|
|
@ -926,6 +981,7 @@ |
|
|
|
|
height: 600upx; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.zdyTitle { |
|
|
|
|
font-weight: 600; |
|
|
|
|
margin: 10px 10px 0; |
|
|
|
|