Compare commits
8 Commits
ff29386609
...
41c2629561
| Author | SHA1 | Date | |
|---|---|---|---|
| 41c2629561 | |||
|
|
0811a1583d | ||
|
|
6ac28b64e5 | ||
|
|
2902947b0d | ||
| 979cd0ac62 | |||
|
|
386045339f | ||
|
|
a43da27bda | ||
|
|
fee01ae875 |
@@ -10,6 +10,14 @@ export default {
|
|||||||
data:data
|
data:data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
//查询不可用油卡
|
||||||
|
getSyncDeductions (data) {
|
||||||
|
return request({
|
||||||
|
url: `/oil-dict/areaCode/getSyncDeductions`,
|
||||||
|
method: 'post',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
},
|
||||||
//获取用户油卡账户信息 (个人 / 自营 / 外请)
|
//获取用户油卡账户信息 (个人 / 自营 / 外请)
|
||||||
getUserAccount (data) {
|
getUserAccount (data) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -3,24 +3,32 @@
|
|||||||
<view>
|
<view>
|
||||||
<view style="padding: 0px 0px;">
|
<view style="padding: 0px 0px;">
|
||||||
<view class="filter-content" v-for="(item, index) in menuList" :key="index" v-if="menuIndex == index">
|
<view class="filter-content" v-for="(item, index) in menuList" :key="index" v-if="menuIndex == index">
|
||||||
<view v-if="item.isSort">
|
<!-- <view v-if="item.isSort">
|
||||||
<view class="filter-content-list">
|
<view class="filter-content-list">
|
||||||
<view v-for="(detailItem,idx) in selectDetailList" :key="idx" :class="detailItem.isSelected?'filter-content-list-item-active':'filter-content-list-item-default'"
|
<view v-for="(detailItem,idx) in selectDetailList" :key="idx" :class="detailItem.isSelected?'filter-content-list-item-active':'filter-content-list-item-default'"
|
||||||
:style="{'color': detailItem.isSelected?themeColor:'#666666'}" @tap="sortTap(idx,selectDetailList,item.key)">
|
:style="{'color': detailItem.isSelected?themeColor:'#666666'}" @tap="sortTap(idx,selectDetailList,item.key)">
|
||||||
<text>{{detailItem.title}}</text>
|
<text>{{detailItem.title}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
<view v-else>
|
<view>
|
||||||
<view classs="filter-content-title" v-if="item.detailTitle && item.detailTitle.length">
|
<view classs="filter-content-title" v-if="item.detailTitle && item.detailTitle.length">
|
||||||
<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>
|
||||||
|
<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'}"
|
||||||
|
@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">
|
<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)">
|
@tap="itemTap(idx,selectDetailList,item.isMutiple,item.key,detailItem,index)">
|
||||||
{{detailItem.title}}
|
{{detailItem.title}}
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -34,9 +42,9 @@
|
|||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="filter-content-detail">
|
<view class="filter-content-detail" v-show="pickerShow">
|
||||||
<!-- 省市区选择 -->
|
<!-- 省市区选择 -->
|
||||||
<view class="region-box" v-if="( productCodeLable? index==0 : true ) ">
|
<view class="region-box" v-if="( productCodeLable? index==1 : true ) ">
|
||||||
<picker-view :value="region" @change="bindChange">
|
<picker-view :value="region" @change="bindChange">
|
||||||
<picker-view-column>
|
<picker-view-column>
|
||||||
<view class="center" v-for="(item, index) in areaCodeList" :key="index">
|
<view class="center" v-for="(item, index) in areaCodeList" :key="index">
|
||||||
@@ -58,10 +66,10 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="filter-content-footer">
|
<view class="filter-content-footer">
|
||||||
<view class="filter-content-footer-item" style="color: #777777; background-color: #FFFFFF;" @tap="resetClick(selectDetailList,item.key)">
|
<view class="filter-content-footer-item" style="color: #777777; background-color: #FFFFFF;" @tap="resetClick(selectDetailList,item.key,selectDetailLists,'channelCode',index)">
|
||||||
<text>重置</text>
|
<text>重置</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="filter-content-footer-item" :style="{'color': '#FFFFFF', 'background-color': themeColor}" @tap="sureClick">
|
<view class="filter-content-footer-item" :style="{'color': '#FFFFFF', 'background-color': themeColor}" @tap="sureClick(selectDetailList,item.key,index)">
|
||||||
<text>确定</text>
|
<text>确定</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -81,6 +89,7 @@
|
|||||||
result: {},
|
result: {},
|
||||||
menuIndex: 0,
|
menuIndex: 0,
|
||||||
selectDetailList: [],
|
selectDetailList: [],
|
||||||
|
selectDetailLists: [],
|
||||||
independenceObj: {},
|
independenceObj: {},
|
||||||
selectedKey: '',
|
selectedKey: '',
|
||||||
cacheSelectedObj: {},
|
cacheSelectedObj: {},
|
||||||
@@ -90,7 +99,12 @@
|
|||||||
areaIndex:[0, 0, 0],
|
areaIndex:[0, 0, 0],
|
||||||
provinceCode:'',
|
provinceCode:'',
|
||||||
cityCode:'',
|
cityCode:'',
|
||||||
areaCode:''
|
areaCode:'',
|
||||||
|
region:[],
|
||||||
|
paixu:1,
|
||||||
|
oilCode:'0#',
|
||||||
|
showHide:true,
|
||||||
|
pickerShow:false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
@@ -180,7 +194,7 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//选择值改变事件 省市区级联选择
|
//选择值改变事件 省市区级联选择
|
||||||
bindChange(e) {
|
bindChange(e,ccc) {
|
||||||
// 用于对比滑动的是哪一列数据
|
// 用于对比滑动的是哪一列数据
|
||||||
const val = e.detail.value
|
const val = e.detail.value
|
||||||
this.areaIndex = val
|
this.areaIndex = val
|
||||||
@@ -197,7 +211,7 @@
|
|||||||
} else {
|
} else {
|
||||||
this.areaIndex = e.detail.value;
|
this.areaIndex = e.detail.value;
|
||||||
}
|
}
|
||||||
|
if(!ccc){
|
||||||
// 数组push‘全部’
|
// 数组push‘全部’
|
||||||
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:'全部'})
|
||||||
@@ -205,12 +219,11 @@
|
|||||||
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:'全部'})
|
||||||
}
|
}
|
||||||
console.log(this.areaCodeList,'99999999999999999')
|
|
||||||
console.log(this.areaCodeList[this.areaIndex[0]],this.areaCodeList[this.areaIndex[0]].childList,this.areaCodeList[this.areaIndex[0]].childList[this.areaIndex[1]].childList,'打印圣兽下标')
|
|
||||||
console.log(this.areaCodeList[this.areaIndex[0]].areaName + this.areaCodeList[this.areaIndex[0]].childList[this.areaIndex[1]].areaName + this.areaCodeList[this.areaIndex[0]].childList[this.areaIndex[1]].childList[this.areaIndex[2]].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.areaIndex[2]].id
|
||||||
|
}
|
||||||
|
|
||||||
this.$emit('changeArea',e)
|
this.$emit('changeArea',e)
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -221,6 +234,7 @@
|
|||||||
}else{
|
}else{
|
||||||
this.seleIdex = e + '/'+ w + '/' + j
|
this.seleIdex = e + '/'+ w + '/' + j
|
||||||
}
|
}
|
||||||
|
this.oilCode = this.seleIdex
|
||||||
},
|
},
|
||||||
setingFn(){
|
setingFn(){
|
||||||
if(this.productCodeList){
|
if(this.productCodeList){
|
||||||
@@ -237,12 +251,15 @@
|
|||||||
if (item.isMutiple) {
|
if (item.isMutiple) {
|
||||||
obj[item.key] = [];
|
obj[item.key] = [];
|
||||||
item.detailList[0].isSelected = false;
|
item.detailList[0].isSelected = false;
|
||||||
|
item.detailLists[0].isSelected = false;
|
||||||
if (!Array.isArray(item.defaultSelectedIndex)) { // 如果默认值不是数组
|
if (!Array.isArray(item.defaultSelectedIndex)) { // 如果默认值不是数组
|
||||||
item.defaultSelectedIndex = [item.defaultSelectedIndex];
|
item.defaultSelectedIndex = [item.defaultSelectedIndex];
|
||||||
}
|
}
|
||||||
for (let j = 0; j < item.defaultSelectedIndex.length; j++) { // 将默认选中的值放入selectedObj
|
for (let j = 0; j < item.defaultSelectedIndex.length; j++) { // 将默认选中的值放入selectedObj
|
||||||
item.detailList[item.defaultSelectedIndex[j]].isSelected = true;
|
item.detailList[item.defaultSelectedIndex[j]].isSelected = true;
|
||||||
obj[item.key].push(item.detailList[item.defaultSelectedIndex[j]].value)
|
obj[item.key].push(item.detailList[item.defaultSelectedIndex[j]].value)
|
||||||
|
item.detailLists[item.defaultSelectedIndex[j]].isSelected = true;
|
||||||
|
obj[item.key].push(item.detailLists[item.defaultSelectedIndex[j]].value)
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -251,6 +268,11 @@
|
|||||||
this.defaultSelectedTitleObj[item.key] = item.detailList[item.defaultSelectedIndex].title;
|
this.defaultSelectedTitleObj[item.key] = item.detailList[item.defaultSelectedIndex].title;
|
||||||
item.detailList[0].isSelected = false;
|
item.detailList[0].isSelected = false;
|
||||||
item.detailList[item.defaultSelectedIndex].isSelected = true;
|
item.detailList[item.defaultSelectedIndex].isSelected = true;
|
||||||
|
obj[item.key] = item.detailLists[item.defaultSelectedIndex].value;
|
||||||
|
this.selectedTitleObj[item.key] = item.detailLists[item.defaultSelectedIndex].title;
|
||||||
|
this.defaultSelectedTitleObj[item.key] = item.detailLists[item.defaultSelectedIndex].title;
|
||||||
|
item.detailLists[0].isSelected = false;
|
||||||
|
item.detailLists[item.defaultSelectedIndex].isSelected = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (item.isMutiple) {
|
if (item.isMutiple) {
|
||||||
@@ -290,11 +312,15 @@
|
|||||||
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)
|
.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].isMutiple, this.menuList[
|
||||||
i].key)
|
i].key)
|
||||||
|
this.itemTaps(this.menuList[i].defaultSelectedIndex, this.selectDetailList, this.menuList[i].isMutiple, this.menuList[
|
||||||
|
i].key)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取非默认项的下标
|
// 获取非默认项的下标
|
||||||
@@ -304,6 +330,8 @@
|
|||||||
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].isMutiple, this
|
||||||
.menuList[i].key)
|
.menuList[i].key)
|
||||||
|
this.itemTaps(unDefaultSelectedIndexArr[j], this.selectDetailList, this.menuList[i].isMutiple, this
|
||||||
|
.menuList[i].key)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -344,9 +372,10 @@
|
|||||||
this.$emit('update:menuList', val)
|
this.$emit('update:menuList', val)
|
||||||
},
|
},
|
||||||
menuTabClick(index) {
|
menuTabClick(index) {
|
||||||
console.log('展开')
|
console.log(this.menuList,'展开')
|
||||||
this.menuIndex = index;
|
this.menuIndex = index;
|
||||||
this.selectDetailList = this.menuList[index].detailList;
|
this.selectDetailList = this.menuList[index].detailList;
|
||||||
|
this.selectDetailLists = this.menuList[index].detailLists;
|
||||||
this.selectedKey = this.menuList[index].key;
|
this.selectedKey = this.menuList[index].key;
|
||||||
// 如果是独立菜单
|
// 如果是独立菜单
|
||||||
if (this.independence && !this.menuList[index].isSort) {
|
if (this.independence && !this.menuList[index].isSort) {
|
||||||
@@ -375,6 +404,7 @@
|
|||||||
for (let i = 0; i < idx.length; i++) {
|
for (let i = 0; i < idx.length; i++) {
|
||||||
if (this.menuList[index].detailList[idx[i]].isSelected == false) {
|
if (this.menuList[index].detailList[idx[i]].isSelected == false) {
|
||||||
this.itemTap(idx[i], this.menuList[index].detailList, true, this.selectedKey);
|
this.itemTap(idx[i], this.menuList[index].detailList, true, this.selectedKey);
|
||||||
|
this.itemTaps(idx[i], this.menuList[index].detailList, true, this.selectedKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -382,6 +412,7 @@
|
|||||||
if (this.menuList[index].detailList[idx].isSelected == false) {
|
if (this.menuList[index].detailList[idx].isSelected == false) {
|
||||||
|
|
||||||
this.itemTap(idx, this.menuList[index].detailList, false, this.selectedKey);
|
this.itemTap(idx, this.menuList[index].detailList, false, this.selectedKey);
|
||||||
|
this.itemTaps(idx, this.menuList[index].detailList, false, this.selectedKey);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -404,7 +435,98 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
//图标点击方法
|
//图标点击方法
|
||||||
itemTap(index, list, isMutiple, key, detailItem) {
|
itemTap(index, list, isMutiple, key, detailItem,indexs) {
|
||||||
|
//是否多选
|
||||||
|
if (isMutiple == true) {
|
||||||
|
list[index].isSelected = !list[index].isSelected;
|
||||||
|
if (index == 0) {
|
||||||
|
this.resetSelected(list, key)
|
||||||
|
if (!this.independence) {
|
||||||
|
this.selectedTitleObj[key] = list[index].title;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
list[0].isSelected = false
|
||||||
|
if (list[index].isSelected) {
|
||||||
|
if (this.independence) {
|
||||||
|
this.independenceObj[this.selectedKey].push(list[index].value);
|
||||||
|
} else {
|
||||||
|
this.selectedObj[key].push(list[index].value);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
list[index].isSelected = false;
|
||||||
|
if (this.independence) {
|
||||||
|
var idx = this.independenceObj[this.selectedKey].indexOf(list[index].value);
|
||||||
|
this.independenceObj[this.selectedKey].splice(idx, 1);
|
||||||
|
} else {
|
||||||
|
var idx = this.selectedObj[key].indexOf(list[index].value);
|
||||||
|
this.selectedObj[key].splice(idx, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if (this.independence) {
|
||||||
|
this.result = this.independenceObj;
|
||||||
|
} else {
|
||||||
|
this.result = this.selectedObj;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//判断是否是第一个
|
||||||
|
if (index == 0) {
|
||||||
|
this.resetSelected(list, key)
|
||||||
|
if (!this.independence) {
|
||||||
|
this.selectedTitleObj[key] = list[index].title;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//列表第一个为false
|
||||||
|
list[0].isSelected = false
|
||||||
|
if (this.independence) {
|
||||||
|
this.independenceObj[this.selectedKey] = list[index].value;
|
||||||
|
this.result = this.independenceObj;
|
||||||
|
} else {
|
||||||
|
this.selectedObj[key] = list[index].value;
|
||||||
|
this.result = this.selectedObj;
|
||||||
|
this.selectedTitleObj[key] = list[index].title;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i = 0; i < list.length; i++) {
|
||||||
|
if (index == i) {
|
||||||
|
list[i].isSelected = true
|
||||||
|
} else {
|
||||||
|
list[i].isSelected = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(indexs==1){
|
||||||
|
if(detailItem.value==10){
|
||||||
|
this.detailItems = ''
|
||||||
|
this.pickerShow = true
|
||||||
|
}else{
|
||||||
|
this.detailItems = detailItem.value
|
||||||
|
this.provinceCode = ''
|
||||||
|
this.cityCode = ''
|
||||||
|
this.areaCode = ''
|
||||||
|
this.pickerShow = false
|
||||||
|
this.region = []
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
this.pickerShow = false
|
||||||
|
}
|
||||||
|
if(indexs==2){
|
||||||
|
this.oilCode = detailItem.value
|
||||||
|
}
|
||||||
|
if(indexs==0){
|
||||||
|
this.paixu = detailItem.value=='juli'?1:2
|
||||||
|
}
|
||||||
|
console.log(index, list, isMutiple, key, detailItem,indexs,'打印打印打印')
|
||||||
|
// this.detailItems = detailItem.value*1000
|
||||||
|
}
|
||||||
|
// #ifdef H5
|
||||||
|
this.$forceUpdate();
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
//图标点击方法
|
||||||
|
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;
|
||||||
@@ -467,13 +589,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(index, list, isMutiple, key, detailItem,'打印打印打印')
|
console.log(index, list, isMutiple, key, detailItem,'打印打印打印')
|
||||||
this.detailItems = detailItem.value*1000
|
|
||||||
}
|
}
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
resetSelected(list, key) {
|
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] = [];
|
||||||
@@ -490,6 +611,24 @@
|
|||||||
list[i].isSelected = false;
|
list[i].isSelected = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(key=='siteBrand'){
|
||||||
|
if (typeof this.result[keys] == 'object') {
|
||||||
|
this.result[keys] = [];
|
||||||
|
this.selectedTitleObj[keys] = lists[0].title;
|
||||||
|
} else {
|
||||||
|
this.result[keys] = '';
|
||||||
|
this.selectedTitleObj[key] = lists[0].title;
|
||||||
|
console.log(this.result,'重置之后的数据')
|
||||||
|
}
|
||||||
|
for (let i = 0; i < lists.length; i++) {
|
||||||
|
if (i == 0) {
|
||||||
|
lists[i].isSelected = true;
|
||||||
|
} else {
|
||||||
|
lists[i].isSelected = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(this.result)
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
// #endif
|
// #endif
|
||||||
@@ -519,7 +658,23 @@
|
|||||||
this.$emit("confirm", obj);
|
this.$emit("confirm", obj);
|
||||||
},
|
},
|
||||||
//点击 确定方法
|
//点击 确定方法
|
||||||
sureClick() {
|
sureClick(selectDetailList,item,index) {
|
||||||
|
console.log(index,this.oilCode,this.paixu,'5555555555555')
|
||||||
|
if(index == 2&&!this.oilCode){
|
||||||
|
this.menuList[0].detailList[0].isSelected = true
|
||||||
|
this.menuList[0].detailList[1].isSelected = false
|
||||||
|
this.paixu = 1
|
||||||
|
this.selectedTitleObj['sort'] = '距离优先'
|
||||||
|
}
|
||||||
|
if(index == 0&&!this.oilCode&&this.paixu==2){
|
||||||
|
uni.showToast({
|
||||||
|
title: '请先选择油品再价格排序',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
this.itemTap(0, selectDetailList, false, item,selectDetailList[1],index)
|
||||||
|
this.paixu = 1
|
||||||
|
return
|
||||||
|
}
|
||||||
if(this.areaIndex[0] == 0){
|
if(this.areaIndex[0] == 0){
|
||||||
this.provinceCode = ''
|
this.provinceCode = ''
|
||||||
this.cityCode = ''
|
this.cityCode = ''
|
||||||
@@ -540,6 +695,9 @@
|
|||||||
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.sort = this.paixu==1?'juli':'price'
|
||||||
|
obj.result.oilProductCode = this.oilCode
|
||||||
// obj.result.distance = this.detailItems
|
// obj.result.distance = this.detailItems
|
||||||
console.log(obj,'look me!')
|
console.log(obj,'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')
|
||||||
@@ -553,7 +711,7 @@
|
|||||||
}
|
}
|
||||||
this.$emit("confirm", obj);
|
this.$emit("confirm", obj);
|
||||||
},
|
},
|
||||||
resetClick(list, key) {
|
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){
|
||||||
@@ -561,14 +719,36 @@
|
|||||||
this.pseleFn()
|
this.pseleFn()
|
||||||
// console.log(obj,'look me!2')
|
// console.log(obj,'look me!2')
|
||||||
// this.$emit("confirm", obj);
|
// this.$emit("confirm", obj);
|
||||||
return
|
|
||||||
}
|
}
|
||||||
if(key == 'channelCode'){
|
if(key == 'channelCode'){
|
||||||
this.provinceCode = ''
|
this.provinceCode = ''
|
||||||
this.cityCode = ''
|
this.cityCode = ''
|
||||||
this.areaCode = ''
|
this.areaCode = ''
|
||||||
}
|
}
|
||||||
this.resetSelected(list, key)
|
this.resetSelected(list, key,lists,keys)
|
||||||
|
if(index == 2){
|
||||||
|
this.oilCode = ''
|
||||||
|
this.paixu = 1
|
||||||
|
console.log(this.oilCode,index,'9999999999999999')
|
||||||
|
}
|
||||||
|
if(index == 1){
|
||||||
|
this.provinceCode = ''
|
||||||
|
this.cityCode = ''
|
||||||
|
this.areaCode = ''
|
||||||
|
this.detailItems = ''
|
||||||
|
this.region = []
|
||||||
|
this.pickerShow = false
|
||||||
|
let aaa = {
|
||||||
|
detail:{
|
||||||
|
value:[0,0]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let ccc = 1
|
||||||
|
this.bindChange(aaa,ccc)
|
||||||
|
}
|
||||||
|
if(index == 0){
|
||||||
|
this.paixu = 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -732,4 +912,9 @@
|
|||||||
height: 600upx;
|
height: 600upx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.zdyTitle{
|
||||||
|
font-weight: 600;
|
||||||
|
margin: 10px 10px 0;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -201,6 +201,16 @@
|
|||||||
d_item.isSelected = false
|
d_item.isSelected = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(item.detailLists){
|
||||||
|
for (let j = 0; j < item.detailLists.length; j++) {
|
||||||
|
let d_item = item.detailLists[j];
|
||||||
|
if (j == 0) {
|
||||||
|
d_item.isSelected = true
|
||||||
|
} else {
|
||||||
|
d_item.isSelected = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return arr;
|
return arr;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -87,7 +87,22 @@
|
|||||||
ureaFilterDatas:[],
|
ureaFilterDatas:[],
|
||||||
loadStatus: 'load',
|
loadStatus: 'load',
|
||||||
siteName: '',
|
siteName: '',
|
||||||
menuList: [{
|
menuList: [
|
||||||
|
{
|
||||||
|
title: '距离优先',
|
||||||
|
isMutiple: false,
|
||||||
|
key: 'sort',
|
||||||
|
detailList: [{
|
||||||
|
title: "距离优先",
|
||||||
|
value: 'juli'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "价格优先",
|
||||||
|
value: 'price'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
title: '距离',
|
title: '距离',
|
||||||
isMutiple: false,
|
isMutiple: false,
|
||||||
key: 'distance',
|
key: 'distance',
|
||||||
@@ -106,17 +121,22 @@
|
|||||||
{
|
{
|
||||||
title: "50Km",
|
title: "50Km",
|
||||||
value: 50000
|
value: 50000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "省市",
|
||||||
|
value: 10
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},{
|
|
||||||
title: '渠道',
|
|
||||||
isMutiple: false,
|
|
||||||
key: 'channelCode',
|
|
||||||
detailList: [{
|
|
||||||
title: "全部",
|
|
||||||
value: ""
|
|
||||||
}]
|
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// title: '渠道',
|
||||||
|
// isMutiple: false,
|
||||||
|
// key: 'channelCode',
|
||||||
|
// detailList: [{
|
||||||
|
// title: "全部",
|
||||||
|
// value: ""
|
||||||
|
// }]
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
title: '0#轻柴油',
|
title: '0#轻柴油',
|
||||||
key: 'oilProductCode',
|
key: 'oilProductCode',
|
||||||
@@ -131,6 +151,10 @@
|
|||||||
key: 'siteBrand',
|
key: 'siteBrand',
|
||||||
isSort: true,
|
isSort: true,
|
||||||
isMutiple: false,
|
isMutiple: false,
|
||||||
|
detailLists:[{
|
||||||
|
title: "全部",
|
||||||
|
value: ""
|
||||||
|
}],
|
||||||
detailList: [{
|
detailList: [{
|
||||||
title: "全部",
|
title: "全部",
|
||||||
value: ""
|
value: ""
|
||||||
@@ -379,7 +403,8 @@
|
|||||||
this.productCodeList = uni.getStorageSync('productCodeList')
|
this.productCodeList = uni.getStorageSync('productCodeList')
|
||||||
// console.log(this.productCodeList,'新的列表格式')
|
// console.log(this.productCodeList,'新的列表格式')
|
||||||
res.data.channelCodes.map(item => {
|
res.data.channelCodes.map(item => {
|
||||||
this.menuList[1].detailList.push({
|
// this.menuList[1].detailList.push({
|
||||||
|
this.menuList[3].detailLists.push({
|
||||||
title: item.name,
|
title: item.name,
|
||||||
value: item.id
|
value: item.id
|
||||||
})
|
})
|
||||||
@@ -418,7 +443,7 @@
|
|||||||
value: 'E'
|
value: 'E'
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
this.oliMenuList[3].detailList = data
|
// this.oliMenuList[3].detailList = data
|
||||||
// // console.log(channelCodes, productCodes, siteBrands)
|
// // console.log(channelCodes, productCodes, siteBrands)
|
||||||
// this.$refs.slFilter.resetMenuList(this.menuList)
|
// this.$refs.slFilter.resetMenuList(this.menuList)
|
||||||
}
|
}
|
||||||
@@ -478,7 +503,7 @@
|
|||||||
currentPage: this.currentPage,
|
currentPage: this.currentPage,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
params: { //类型:Object 必有字段 备注:// 筛选对象
|
params: { //类型:Object 必有字段 备注:// 筛选对象
|
||||||
sort: "juli", //类型:String 必有字段 备注:// 智能排序 ( price:价格最低 juli:距离最近 ) 默认距离排序
|
// sort: "juli", //类型:String 必有字段 备注:// 智能排序 ( price:价格最低 juli:距离最近 ) 默认距离排序
|
||||||
siteName: this.siteName,
|
siteName: this.siteName,
|
||||||
...uni.getStorageSync('location'),
|
...uni.getStorageSync('location'),
|
||||||
// ...this.filterData
|
// ...this.filterData
|
||||||
@@ -494,6 +519,7 @@
|
|||||||
// siteLevel: this.siteName ? '' : this.filterDatas
|
// siteLevel: this.siteName ? '' : this.filterDatas
|
||||||
siteLevel: this.filterDatas
|
siteLevel: this.filterDatas
|
||||||
.siteLevel ,
|
.siteLevel ,
|
||||||
|
sort:this.filterDatas.sort?this.filterDatas.sort:'juli',
|
||||||
provinceCode:this.filterDatas.provinceCode,
|
provinceCode:this.filterDatas.provinceCode,
|
||||||
cityCode:this.filterDatas.cityCode,
|
cityCode:this.filterDatas.cityCode,
|
||||||
areaCode:this.filterDatas.areaCode,
|
areaCode:this.filterDatas.areaCode,
|
||||||
|
|||||||
Reference in New Issue
Block a user