Merge pull request 'xiugai' (#5) from lixuan into master

Reviewed-on: #5
This commit was merged in pull request #5.
This commit is contained in:
2022-12-09 08:01:42 +00:00
4 changed files with 18 additions and 15 deletions

View File

@@ -158,17 +158,16 @@
console.log(this.menuList,'打印列表列表')
this.setingFn()
setTimeout(()=>{
if(this.areaCodeList1.length == 0){
if(this.areaCodeList1.length<1){
this.areaCodeList = uni.getStorageSync('areaCodeList')
console.log('0000000000000')
}else{
this.areaCodeList = this.areaCodeList1
console.log('11111111111111')
}
// this.areaCodeList = this.areaCodeList1
console.log(this.areaCodeList,this.areaCodeList1,'11111111111111')
this.areaCodeList.unshift({areaName:'全部'})
},1000)
},3000)
console.log('%c 子组件参数','font-size:30px;color:red')
console.log(this.areaCodeList,uni.getStorageSync('areaCodeList'),this.areaCodeList1,'ssssssssssssss')
},
computed: {
selectedTitleObj() {
@@ -198,6 +197,7 @@
// 用于对比滑动的是哪一列数据
const val = e.detail.value
this.areaIndex = val
this.region = val
console.log(this.areaIndex,val,'省市区下标')
if(this.areaIndex[0] !== val[0]) {
// 如果滑动的是第一列数据让二三列恢复到0
@@ -216,9 +216,11 @@
if(this.areaCodeList[val[0]].childList[0].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.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
@@ -234,7 +236,8 @@
}else{
this.seleIdex = e + '/'+ w + '/' + j
}
this.oilCode = this.seleIdex
// this.oilCode = this.seleIdex
console.log(e,w,j,'aaaaaaaaaaaaaaaaa')
},
setingFn(){
if(this.productCodeList){
@@ -697,14 +700,14 @@
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
console.log(obj,'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')
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.titles.oilProductCode = obj.result.oilProductCode?obj.result.oilProductCode:'全部'
this.oilCode = obj.result.oilProductCode
console.log(obj,'look me!2')
this.$emit("confirm", obj);
return

View File

@@ -128,7 +128,7 @@
this.titleList = titleArr;
this.tempTitleObj = r;
this.areaCodeList1 = this.areaCodeList
console.log(this.productCodeList,this.areaCodeList1,'-------------------')
console.log(this.productCodeList,this.areaCodeList1,uni.getStorageSync('areaCodeList'),'-------------------')
},
// #endif
@@ -165,6 +165,7 @@
this.statusList = arr;
this.titleList = titleArr;
this.tempTitleObj = r;
this.areaCodeList1 = this.areaCodeList
console.log(this.titleList,this.areaCodeList1,'-------------------ddd')
},
// #endif

View File

@@ -132,7 +132,7 @@
</view>
</view>
<!-- 广告图片开始 -->
<view class=" padding" style=" background-color: #f1f1f1;">
<!-- <view class=" padding" style=" background-color: #f1f1f1;">
<view class="">
<swiper autoplay interval='5000' style="width: 100%;height: 204rpx;" class="swiper" circular>
<swiper-item @click="swiperClick(item,index)" v-for="(item,index) in swiperArray">
@@ -140,7 +140,7 @@
</swiper-item>
</swiper>
</view>
</view>
</view> -->
<!-- 筛选开始 -->
<view class="screentop bg-white " @tap="scrollScreen">
<!-- <view class="">

View File

@@ -394,7 +394,6 @@
if (res.code == 20000) {
uni.setStorageSync('productCodeList', res.data.productCodeList)
uni.setStorageSync('areaCodeList', res.data.areaCodeList)
this.areaCodeList = uni.getStorageSync('areaCodeList')
if(uni.getStorageSync('areaCodeList')){
this.areaCodeList = uni.getStorageSync('areaCodeList')
}else{
@@ -447,7 +446,7 @@
// // console.log(channelCodes, productCodes, siteBrands)
// this.$refs.slFilter.resetMenuList(this.menuList)
}
console.log(this.menuList,'----')
console.log(this.menuList,uni.getStorageSync('areaCodeList'),'----')
})
},
onSelected(e) {