KongDuo
xiaozhiyong 2 years ago
parent 9068007759
commit 0b96f27a99
  1. 458
      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

@ -16,71 +16,86 @@
<text>{{item.detailTitle}}</text> <text>{{item.detailTitle}}</text>
</view> </view>
<!-- <view class="filter-content-detail show_min_height"> --> <!-- <view class="filter-content-detail show_min_height"> -->
<scroll-view scroll-y="true" > <scroll-view scroll-y="true">
<view class=""> <view class="">
<span class="zdyTitle" v-if="( productCodeLable? index==3 : false ) ">渠道</span> <span class="zdyTitle" v-if="( productCodeLable? index==3 : false ) ">渠道</span>
<view class="filter-content-detail show_min_height"> <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 ) "
@tap="itemTaps(idx,selectDetailLists,item.isMutiple,'channelCode',detailItem)"> v-for="( detailItem,idx) in selectDetailLists" :key="idx"
{{detailItem.title}} class='filter-content-detail-item-default'
</text> :style="{'background-color':detailItem.isSelected?themeColor:'#FFFFFF','color':detailItem.isSelected?'#FFFFFF':'#666666'}"
</view> @tap="itemTaps(idx,selectDetailLists,item.isMutiple,'channelCode',detailItem)">
<span class="zdyTitle" v-if="( productCodeLable? index==3 : false ) ">品牌</span> {{detailItem.title}}
<view class="filter-content-detail show_min_height"> </text>
<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'}" </view>
@tap="itemTap(idx,selectDetailList,item.isMutiple,item.key,detailItem,index)"> <span class="zdyTitle" v-if="( productCodeLable? index==3 : false ) ">品牌</span>
{{detailItem.title}} <view class="filter-content-detail show_min_height">
</text> <text v-if="( productCodeLable? index!==2 : true ) "
</view> v-for="( detailItem,idx) in selectDetailList" :key="idx"
<view style="margin-bottom: 10rpx;" v-for="(p,pIndex) in productCodeLable" v-if="(productCodeLable? index==2:false) "> class='filter-content-detail-item-default'
<view class="newselsetitle">{{p}}</view> :style="{'background-color':detailItem.isSelected?themeColor:'#FFFFFF','color':detailItem.isSelected?'#FFFFFF':'#666666'}"
<view class="newselse"> @tap="itemTap(idx,selectDetailList,item.isMutiple,item.key,detailItem,index)">
<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> {{detailItem.title}}
</view> </text>
</view>
<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>
</view> </view>
</view> </view>
</scroll-view> </view>
</scroll-view>
</view>
<view class="filter-content-detail" v-show="pickerShow">
<!-- 省市区选择 -->
<view class="region-box" v-if="( productCodeLable? index==1 : true ) ">
<picker-view :value="region" @change="bindChange">
<picker-view-column>
<view class="center" v-for="(item, index) in areaCodeList" :key="index">
<!-- v-show不可去除 去掉会显示undefined 原因未知 -->
<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"
: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">
<view v-show="false">{{ JSON.stringify(item.areaName) }}</view>
{{ item.areaName }}
</view>
</picker-view-column>
</picker-view>
</view> </view>
<view class="filter-content-detail" v-show="pickerShow"> </view>
<!-- 省市区选择 --> <view class="filter-content-footer">
<view class="region-box" v-if="( productCodeLable? index==1 : true ) "> <view class="filter-content-footer-item" style="color: #777777; background-color: #FFFFFF;"
<picker-view :value="region" @change="bindChange"> @tap="resetClick(selectDetailList,item.key,selectDetailLists,'channelCode',index)">
<picker-view-column> <text>重置</text>
<view class="center" v-for="(item, index) in areaCodeList" :key="index">
<!-- v-show不可去除 去掉会显示undefined 原因未知 -->
<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" :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">
<view v-show="false">{{ JSON.stringify(item.areaName) }}</view>
{{ item.areaName }}
</view>
</picker-view-column>
</picker-view>
</view>
</view> </view>
<view class="filter-content-footer"> <view class="filter-content-footer-item"
<view class="filter-content-footer-item" style="color: #777777; background-color: #FFFFFF;" @tap="resetClick(selectDetailList,item.key,selectDetailLists,'channelCode',index)"> :style="{'color': '#FFFFFF', 'background-color': themeColor}"
<text>重置</text> @tap="sureClick(selectDetailList,item.key,index)">
</view> <text>确定</text>
<view class="filter-content-footer-item" :style="{'color': '#FFFFFF', 'background-color': themeColor}" @tap="sureClick(selectDetailList,item.key,index)">
<text>确定</text>
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view>
</template> </template>
@ -88,7 +103,7 @@
export default { export default {
data() { data() {
return { return {
productCodeLable:null, productCodeLable: null,
selectArr: [], selectArr: [],
result: {}, result: {},
menuIndex: 0, menuIndex: 0,
@ -98,17 +113,17 @@
selectedKey: '', selectedKey: '',
cacheSelectedObj: {}, cacheSelectedObj: {},
defaultSelectedTitleObj: {}, defaultSelectedTitleObj: {},
seleIdex:null, seleIdex: null,
areaCodeList:[], areaCodeList: [],
areaIndex:[0, 0, 0], areaIndex: [0, 0, 0],
provinceCode:'', provinceCode: '',
cityCode:'', cityCode: '',
areaCode:'', areaCode: '',
region:[], region: [],
paixu:1, paixu: 1,
oilCode:'0#', oilCode: '0#',
showHide:true, showHide: true,
pickerShow:false, pickerShow: false,
}; };
}, },
props: { props: {
@ -141,15 +156,15 @@
default: false default: false
} }
}, },
watch:{ watch: {
productCodeList:function(n,o){ productCodeList: function(n, o) {
console.log('%c 打印的新的列表格式箭头↓zxxxx','color:red;font-size:32px') // console.log('%c zxxxx','color:red;font-size:32px')
this.setingFn() this.setingFn()
console.log(this.productCodeList,this.menuList,'9999999999999') // console.log(this.productCodeList,this.menuList,'9999999999999')
}, },
selectDetailList:function(n,o){ selectDetailList: function(n, o) {
console.log('%c 元数组切换↓1','font-size:50px;color:blue') // console.log('%c 1','font-size:50px;color:blue')
console.log(this.menuIndex) // console.log(this.menuIndex)
} }
}, },
@ -158,11 +173,32 @@
* @property {Object} productCodeList: 传入的新列表格式 * @property {Object} productCodeList: 传入的新列表格式
* @property {Array} productCodeLable: 传入的新列表格式的列表标题 * @property {Array} productCodeLable: 传入的新列表格式的列表标题
* @property {Function} setingFn: 调用微信接口获取code 通过code调用服务端接口换取请求头数据 * @property {Function} setingFn: 调用微信接口获取code 通过code调用服务端接口换取请求头数据
*/ */
// console.log(this.menuList,'') // console.log(this.menuList,'')
this.setingFn() this.setingFn()
this.areaCodeList = uni.getStorageSync('areaCodeList') this.areaCodeList = uni.getStorageSync('areaCodeList') || []
this.areaCodeList.unshift({areaName:'全部',childList:[{areaName:'',childList:[{areaName:''}]}]}) 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(()=>{ // setTimeout(()=>{
// if(this.areaCodeList1.length<1){ // if(this.areaCodeList1.length<1){
// this.areaCodeList = uni.getStorageSync('areaCodeList') // this.areaCodeList = uni.getStorageSync('areaCodeList')
@ -199,17 +235,17 @@
}, },
methods: { methods: {
// //
bindChange(e,ccc) { bindChange(e, ccc) {
// //
const val = e.detail.value const val = e.detail.value
this.areaIndex = val this.areaIndex = val
this.region = val this.region = val
console.log(this.areaIndex,val,'省市区下标') console.log(this.areaIndex, val, '省市区下标')
if(this.areaIndex[0] !== val[0]) { if (this.areaIndex[0] !== val[0]) {
// 0 // 0
this.areaIndex = [val[0], 0, 0] this.areaIndex = [val[0], 0, 0]
// console.log(this.areaCodeList[val[0]].childList[0].areaName,'[]') // console.log(this.areaCodeList[val[0]].childList[0].areaName,'[]')
} else if(this.areaIndex[1] !== val[1]) { } else if (this.areaIndex[1] !== val[1]) {
this.areaIndex[1] = val[1] this.areaIndex[1] = val[1]
// //
this.areaIndex = [val[0], val[1], 0] this.areaIndex = [val[0], val[1], 0]
@ -217,41 +253,46 @@
} else { } else {
this.areaIndex = e.detail.value; this.areaIndex = e.detail.value;
} }
if(!ccc){ if (!ccc) {
// push // push
if(val[0] != 0) { if (val[0] != 0) {
if(this.areaCodeList[val[0]].childList[0].areaName != '全部'){ 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.areaIndex[1] != 0) {
if(this.areaCodeList[val[0]].childList[val[1]].childList[0].areaName != '全部'){ 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.provinceCode = this.areaCodeList[this.areaIndex[0]].id
this.cityCode = this.areaCodeList[this.areaIndex[0]].childList[this.areaIndex[1]].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
}else { .areaIndex[2]].id
this.provinceCode = this.cityCode =this.areaCode = '' } else {
this.areaIndex = [0,0,0] this.provinceCode = this.cityCode = this.areaCode = ''
this.areaIndex = [0, 0, 0]
} }
} }
this.$emit('changeArea',e) this.$emit('changeArea', e)
}, },
pseleFn(e,w,j){ pseleFn(e, w, j) {
if(arguments.length<3){ if (arguments.length < 3) {
this.seleIdex = '#' + '/'+ '柴油' + '/' + this.menuIndex this.seleIdex = '#' + '/' + '柴油' + '/' + this.menuIndex
}else{ } else {
this.seleIdex = e + '/'+ w + '/' + j this.seleIdex = e + '/' + w + '/' + j
} }
// this.oilCode = this.seleIdex // this.oilCode = this.seleIdex
// console.log(e,w,j,'aaaaaaaaaaaaaaaaa') // console.log(e,w,j,'aaaaaaaaaaaaaaaaa')
}, },
setingFn(){ setingFn() {
if(this.productCodeList){ if (this.productCodeList) {
this.productCodeLable = Object.keys(this.productCodeList) this.productCodeLable = Object.keys(this.productCodeList)
} }
// console.log(this.productCodeLable,'ddddddddddddddddddd') // console.log(this.productCodeLable,'ddddddddddddddddddd')
@ -260,7 +301,8 @@
let obj = {} let obj = {}
for (let i = 0; i < this.menuList.length; i++) { for (let i = 0; i < this.menuList.length; i++) {
let item = this.menuList[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) { if (item.isMutiple) {
obj[item.key] = []; obj[item.key] = [];
@ -303,7 +345,7 @@
resetAllSelect(callback) { resetAllSelect(callback) {
let titles = []; let titles = [];
for (let i = 0; i < this.menuList.length; i++) { for (let i = 0; i < this.menuList.length; i++) {
this.resetSelected(this.menuList[i].detailList,this.menuList[i].key); this.resetSelected(this.menuList[i].detailList, this.menuList[i].key);
titles[this.menuList[i].key] = this.menuList[i].title; titles[this.menuList[i].key] = this.menuList[i].title;
} }
// console.log(titles,'*************************') // console.log(titles,'*************************')
@ -324,16 +366,20 @@
if (Array.isArray(this.menuList[i].defaultSelectedIndex)) { // falsetrue if (Array.isArray(this.menuList[i].defaultSelectedIndex)) { // falsetrue
for (let j = 0; j < this.menuList[i].defaultSelectedIndex.length; j++) { for (let j = 0; j < this.menuList[i].defaultSelectedIndex.length; j++) {
if (this.selectDetailList[this.menuList[i].defaultSelectedIndex[j]].isSelected == false) { 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
.menuList[i].key) .menuList[i].key)
this.itemTaps(this.menuList[i].defaultSelectedIndex[j], this.selectDetailList, this.menuList[i].isMutiple, this
.menuList[i].key)
} }
} }
} else { } 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]
i].key) .isMutiple, this.menuList[
this.itemTaps(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[
i].key) i].key)
} }
@ -342,10 +388,12 @@
// truefalse // truefalse
for (let j = 0; j < unDefaultSelectedIndexArr.length; j++) { for (let j = 0; j < unDefaultSelectedIndexArr.length; j++) {
if (this.selectDetailList[unDefaultSelectedIndexArr[j]].isSelected == true) { 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]
.menuList[i].key) .isMutiple, this
this.itemTaps(unDefaultSelectedIndexArr[j], this.selectDetailList, this.menuList[i].isMutiple, this .menuList[i].key)
.menuList[i].key) this.itemTaps(unDefaultSelectedIndexArr[j], this.selectDetailList, this.menuList[i]
.isMutiple, this
.menuList[i].key)
} }
} }
} }
@ -449,7 +497,7 @@
} }
}, },
// //
itemTap(index, list, isMutiple, key, detailItem,indexs) { itemTap(index, list, isMutiple, key, detailItem, indexs) {
// //
if (isMutiple == true) { if (isMutiple == true) {
list[index].isSelected = !list[index].isSelected; list[index].isSelected = !list[index].isSelected;
@ -511,11 +559,11 @@
} }
} }
} }
if(indexs==1){ if (indexs == 1) {
if(detailItem.value==10){ if (detailItem.value == 10) {
this.detailItems = '' this.detailItems = ''
this.pickerShow = true this.pickerShow = true
}else{ } else {
this.detailItems = detailItem.value this.detailItems = detailItem.value
this.provinceCode = '' this.provinceCode = ''
this.cityCode = '' this.cityCode = ''
@ -523,16 +571,16 @@
this.pickerShow = false this.pickerShow = false
this.region = [] this.region = []
} }
}else{ } else {
this.pickerShow = false this.pickerShow = false
} }
if(indexs==2){ if (indexs == 2) {
this.oilCode = detailItem.value this.oilCode = detailItem.value
} }
if(indexs==0){ if (indexs == 0) {
this.paixu = detailItem.value=='juli'?1:2 this.paixu = detailItem.value == 'juli' ? 1 : 2
} }
console.log(index, list, isMutiple, key, detailItem,indexs,'打印打印打印') console.log(index, list, isMutiple, key, detailItem, indexs, '打印打印打印')
// this.detailItems = detailItem.value*1000 // this.detailItems = detailItem.value*1000
} }
// #ifdef H5 // #ifdef H5
@ -540,7 +588,7 @@
// #endif // #endif
}, },
// //
itemTaps(index, list, isMutiple, key, detailItem,indexs) { itemTaps(index, list, isMutiple, key, detailItem, indexs) {
// //
if (isMutiple == true) { if (isMutiple == true) {
list[index].isSelected = !list[index].isSelected; list[index].isSelected = !list[index].isSelected;
@ -602,13 +650,13 @@
} }
} }
} }
console.log(index, list, isMutiple, key, detailItem,'打印打印打印') console.log(index, list, isMutiple, key, detailItem, '打印打印打印')
} }
// #ifdef H5 // #ifdef H5
this.$forceUpdate(); this.$forceUpdate();
// #endif // #endif
}, },
resetSelected(list, key,lists, keys) { resetSelected(list, key, lists, keys) {
// console.log('%c resetSelected','color:green;font-size:30px') // console.log('%c resetSelected','color:green;font-size:30px')
if (typeof this.result[key] == 'object') { if (typeof this.result[key] == 'object') {
this.result[key] = []; this.result[key] = [];
@ -625,7 +673,7 @@
list[i].isSelected = false; list[i].isSelected = false;
} }
} }
if(key=='siteBrand'){ if (key == 'siteBrand') {
if (typeof this.result[keys] == 'object') { if (typeof this.result[keys] == 'object') {
this.result[keys] = []; this.result[keys] = [];
this.selectedTitleObj[keys] = lists[0].title; this.selectedTitleObj[keys] = lists[0].title;
@ -672,33 +720,33 @@
this.$emit("confirm", obj); this.$emit("confirm", obj);
}, },
// //
sureClick(selectDetailList,item,index) { sureClick(selectDetailList, item, index) {
console.log(index,this.oilCode,this.paixu,'5555555555555') console.log(index, this.oilCode, this.paixu, '5555555555555')
if(index == 2&&!this.oilCode){ if (index == 2 && !this.oilCode) {
this.menuList[0].detailList[0].isSelected = true this.menuList[0].detailList[0].isSelected = true
this.menuList[0].detailList[1].isSelected = false this.menuList[0].detailList[1].isSelected = false
this.paixu = 1 this.paixu = 1
this.selectedTitleObj['sort'] = '距离优先' this.selectedTitleObj['sort'] = '距离优先'
} }
if(index == 0&&!this.oilCode&&this.paixu==2){ if (index == 0 && !this.oilCode && this.paixu == 2) {
uni.showToast({ uni.showToast({
title: '请先选择油品再价格排序', title: '请先选择油品再价格排序',
icon: 'none' icon: 'none'
}) })
this.itemTap(0, selectDetailList, false, item,selectDetailList[1],index) this.itemTap(0, selectDetailList, false, item, selectDetailList[1], index)
this.paixu = 1 this.paixu = 1
return return
} }
if(this.areaIndex[0] == 0){ if (this.areaIndex[0] == 0) {
this.provinceCode = '' this.provinceCode = ''
this.cityCode = '' this.cityCode = ''
this.areaCode = '' this.areaCode = ''
} }
if(this.areaIndex[1] == 0){ if (this.areaIndex[1] == 0) {
this.cityCode = '' this.cityCode = ''
this.areaCode = '' this.areaCode = ''
} }
if(this.areaIndex[2] == 0){ if (this.areaIndex[2] == 0) {
this.areaCode = '' this.areaCode = ''
} }
let obj = { let obj = {
@ -709,43 +757,46 @@
obj.result.provinceCode = this.provinceCode obj.result.provinceCode = this.provinceCode
obj.result.cityCode = this.cityCode obj.result.cityCode = this.cityCode
obj.result.areaCode = this.areaCode obj.result.areaCode = this.areaCode
obj.result.distance = this.provinceCode?'':this.cityCode?'':this.areaCode?'':this.detailItems obj.result.distance = this.provinceCode ? '' : this.cityCode ? '' : this.areaCode ? '' : this.detailItems
obj.result.sort = this.paixu==1?'juli':'price' obj.result.sort = this.paixu == 1 ? 'juli' : 'price'
// obj.result.distance = this.detailItems // obj.result.distance = this.detailItems
console.log(obj,this.oilCode,'look me!') console.log(obj, this.oilCode, 'look me!')
// console.log(this.seleIdex.split('/'),this.productCodeList[this.seleIdex.split('/')[1]][this.seleIdex.split('/')[0]],this.seleIdex.split('/')[2],'dddddddddddddddddd') // 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){ 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('/')[
obj.titles.oilProductCode = obj.result.oilProductCode?obj.result.oilProductCode:'全部' 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 this.oilCode = obj.result.oilProductCode
console.log(obj,'look me!2') console.log(obj, 'look me!2')
this.$emit("confirm", obj); this.$emit("confirm", obj);
return return
} }
this.$emit("confirm", obj); this.$emit("confirm", obj);
}, },
resetClick(list, key,lists,keys,index) { resetClick(list, key, lists, keys, index) {
console.log('%c 重置方法第一步resetClick函数参数↓','color:red;font-size:30px') console.log('%c 重置方法第一步resetClick函数参数↓', 'color:red;font-size:30px')
console.log(list, key) console.log(list, key)
if(this.seleIdex!==null&&this.seleIdex.split('/')[2]==2){ 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() this.pseleFn()
// console.log(obj,'look me!2') // console.log(obj,'look me!2')
// this.$emit("confirm", obj); // this.$emit("confirm", obj);
} }
if(key == 'channelCode'){ if (key == 'channelCode') {
this.provinceCode = '' this.provinceCode = ''
this.cityCode = '' this.cityCode = ''
this.areaCode = '' this.areaCode = ''
} }
this.resetSelected(list, key,lists,keys) this.resetSelected(list, key, lists, keys)
if(index == 2){ if (index == 2) {
this.oilCode = '' this.oilCode = ''
this.paixu = 1 this.paixu = 1
console.log(this.oilCode,index,'9999999999999999') console.log(this.oilCode, index, '9999999999999999')
} }
if(index == 1){ if (index == 1) {
this.provinceCode = '' this.provinceCode = ''
this.cityCode = '' this.cityCode = ''
this.areaCode = '' this.areaCode = ''
@ -753,14 +804,14 @@
this.region = [] this.region = []
this.pickerShow = false this.pickerShow = false
let aaa = { let aaa = {
detail:{ detail: {
value:[0,0] value: [0, 0]
} }
} }
let ccc = 1 let ccc = 1
this.bindChange(aaa,ccc) this.bindChange(aaa, ccc)
} }
if(index == 0){ if (index == 0) {
this.paixu = 1 this.paixu = 1
} }
} }
@ -769,26 +820,29 @@
</script> </script>
<style> <style>
.show_min_height{ .show_min_height {
max-height: 40vh; max-height: 40vh;
/* overflow-y: scroll; */ /* overflow-y: scroll; */
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
flex-direction: row; flex-direction: row;
flex-wrap: wrap; flex-wrap: wrap;
} }
.newselsetitle{
.newselsetitle {
font-weight: 600; font-weight: 600;
margin-bottom: 15rpx; margin-bottom: 15rpx;
} }
.newselse{
.newselse {
width: 100%; width: 100%;
display: flex; display: flex;
gap:15rpx; gap: 15rpx;
flex-wrap: wrap; flex-wrap: wrap;
} }
.newselseitem{
.newselseitem {
padding: 5rpx 10rpx; padding: 5rpx 10rpx;
/* background-color: #000000; */ /* background-color: #000000; */
display: flex; display: flex;
@ -797,6 +851,7 @@
border: 1rpx solid #bbbbbb; border: 1rpx solid #bbbbbb;
min-width: 90rpx; min-width: 90rpx;
} }
.filter-content { .filter-content {
background-color: #F6F7F8; background-color: #F6F7F8;
} }
@ -884,49 +939,50 @@
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.region-box { .region-box {
background-color: #FFFFFF; background-color: #FFFFFF;
.center { .center {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.btn-Block { .btn-Block {
width: 100%; width: 100%;
background-color: #FFFFFF; background-color: #FFFFFF;
padding: 25upx; padding: 25upx;
height: 230upx; height: 230upx;
.btn-left { .btn-left {
width: 250upx; width: 250upx;
height: 80upx; height: 80upx;
border-radius: 10upx; border-radius: 10upx;
color: #289CFD; color: #289CFD;
background-color: rgba(153, 153, 153, 0.2); background-color: rgba(153, 153, 153, 0.2);
margin-right: 30upx; margin-right: 30upx;
}
.btn-right {
width: 250upx;
height: 80upx;
border-radius: 10upx;
color: #FFFFFF;
background-color: #289CFD;
}
} }
.btn-right { .picker-view {
width: 250upx; background-color: #FFFEFD;
height: 80upx;
border-radius: 10upx;
color: #FFFFFF;
background-color: #289CFD;
} }
}
.picker-view { picker-view {
background-color: #FFFEFD; width: 100%;
height: 600upx;
}
} }
picker-view { .zdyTitle {
width: 100%;
height: 600upx;
}
}
.zdyTitle{
font-weight: 600; font-weight: 600;
margin: 10px 10px 0; margin: 10px 10px 0;
display: block; display: block;

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

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

@ -3,9 +3,9 @@ import utils from '@/utils/encode'
// const env = process.env.NODE_ENV // const env = process.env.NODE_ENV
// const env = 'production'/* */ // const env = 'production'/* */
// const env = 'test' // const env = 'test'
const env = 'production' const env = 'test'
// 45 // 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 = 'https://www.xingoil.com/adminapi'
const productUrl = 'http://uat.xingoil.com/adminapi' const productUrl = 'http://uat.xingoil.com/adminapi'

Loading…
Cancel
Save