KongDuo
xiaozhiyong 2 years ago
parent 9068007759
commit 0b96f27a99
  1. 108
      components/sl-filter/filter-view.vue
  2. 10
      components/sl-filter/sl-filter.vue
  3. 4
      pages/tabbar/station/stationList.vue
  4. 4
      utils/request.js

@ -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)) { // falsetrue
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 @@
// truefalse
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;

@ -80,6 +80,16 @@
watch:{
isTransNav:function(n,o){
console.log(n,'*****')
},
'areaCodeList':{
handler(n,o) {
// console.log('watch',n,o)
if(n.length) {
this.areaCodeList1 = n
}
},
deep:true,
immediate:true,
}
},
computed: {

@ -27,7 +27,7 @@
<!-- 筛选开始 -->
<scroll-view style="flex: 1;" class="screentop bg-white">
<view @click="reunrnFn" class="">
<sl-filter reflexTitle ref="slFilter" :productCodeList="productCodeList" :areaCodeList="areaCodeList" @result="filterRes" :menuList="menuList" v-if="TabHead == 0"></sl-filter>
<sl-filter reflexTitle ref="slFilter" v-if="TabHead == 0" :productCodeList="productCodeList" :areaCodeList="areaCodeList" @result="filterRes" :menuList="menuList" ></sl-filter>
<sl-filter reflexTitle ref="slFilter" @result="filterRes" :menuList="ureaMenuList" v-if="TabHead == 1 && changeHs == true"></sl-filter>
<sl-filter reflexTitle ref="slFilter" @result="filterRes" :menuList="productTypes" v-if="changeHs == false && TabHead == 1 "></sl-filter>
</view>
@ -243,6 +243,7 @@
// console.log(storykey)
},
onLoad() {
console.log("111111111111111",uni.getStorageSync('filterDatas'))
if (!uni.getStorageSync('filterDatas')) {
this.getFilterData()
// console.log('dhgiuhihqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq')
@ -393,6 +394,7 @@
},
getFilterData() {
oilSiteApi.getCheckInfo().then(res => {
console.log('resresresresres',res)
if (res.code == 20000) {
uni.setStorageSync('productCodeList', res.data.productCodeList)
uni.setStorageSync('areaCodeList', res.data.areaCodeList)

@ -3,9 +3,9 @@ import utils from '@/utils/encode'
// const env = process.env.NODE_ENV
// const env = 'production'/* */
// const env = 'test'
const env = 'production'
const env = 'test'
// 45
const testUrl = 'http://192.168.1.85:38080'
const testUrl = 'http://192.168.1.83:38080'
// const productUrl = 'https://www.xingoil.com/adminapi'
const productUrl = 'http://uat.xingoil.com/adminapi'

Loading…
Cancel
Save