From 1f249bc07d608abc434a4e9c5206c4869618decd Mon Sep 17 00:00:00 2001 From: caolc <572275724@qq.com> Date: Wed, 15 Feb 2023 19:57:59 +0800 Subject: [PATCH 1/2] ii --- pages/tabbar/home/home.vue | 1 + pages/tabbar/order/orderList/orderList.vue | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pages/tabbar/home/home.vue b/pages/tabbar/home/home.vue index 0fae3c8..e0ba313 100644 --- a/pages/tabbar/home/home.vue +++ b/pages/tabbar/home/home.vue @@ -533,6 +533,7 @@ currentPage: 1, pageSize: 10, params: { //类型:Object 必有字段 备注:// 筛选对象 + clientBelong:'BAICHUAN', sort: "juli", //类型:String 必有字段 备注:// 智能排序 ( price:价格最低 juli:距离最近 ) 默认距离排序 // longitude: 117.157817, // 必有字段 备注:// 当前位置经度 // latitude: 31.802472, // 必有字段 备注:// 当前位置维度 diff --git a/pages/tabbar/order/orderList/orderList.vue b/pages/tabbar/order/orderList/orderList.vue index 041edf9..daca160 100644 --- a/pages/tabbar/order/orderList/orderList.vue +++ b/pages/tabbar/order/orderList/orderList.vue @@ -136,7 +136,7 @@ } }, onShow() { - this.initList() + // this.initList() }, onLoad() { this.initList() @@ -168,6 +168,7 @@ }, 500) }, initList() { + console.log('initList') if (this.TabCur == 0 && this.list.length == 0) { this.getOrder('全部', this.currentPage.currentPage,'initList') } else if (this.TabCur == 1 && this.list0.length == 0) { @@ -242,6 +243,7 @@ pageSize: 10, //类型:Number 必有字段 备注:无 index: (page - 1) * 10, params: { //类型:Object 必有字段 备注:无 + clientBelong:'BAICHUAN', orderStatus: id == '全部' ? '' : (id +''), //类型:String 必有字段 备注:订单状态 0:待支付, 1:已支付 ,-1:支付失败 ,2:已取消,3:已退款 search: this.search //类型:String 必有字段 备注:搜索 ( 油站名称/ 订单编号/ 油品) }, @@ -253,7 +255,7 @@ // 0:待支付, 1:已支付 ,-1:支付失败 ,2:已取消,3:已退款 if (id == '0') { // 0:待支付 list0 - this.list0 = this.list0.concat(res.data.list) + this.list0 = this.list0.concat(res.data.list); if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页 this.status.loadOrderStatus0 = 'nomore' uni.showToast({ From 5b2587bdfe8dc4c7e302fa25cad3185c1795fea6 Mon Sep 17 00:00:00 2001 From: caoliancun <572275724@qq.com> Date: Wed, 15 Feb 2023 20:59:22 +0800 Subject: [PATCH 2/2] 11 --- components/sl-filter/filter-view.vue | 22 +- pages/tabbar/station/stationList.vue | 320 +++++++++++++++------------ 2 files changed, 191 insertions(+), 151 deletions(-) diff --git a/components/sl-filter/filter-view.vue b/components/sl-filter/filter-view.vue index 8d5f097..1d6f656 100644 --- a/components/sl-filter/filter-view.vue +++ b/components/sl-filter/filter-view.vue @@ -34,8 +34,8 @@ --> - - + + {{ item.areaName }} @@ -119,16 +119,18 @@ } }, created() { - setTimeout(()=>{ - if(this.areaCodeList1.length == 0){ - this.areaCodeList = uni.getStorageSync('areaCodeList') - }else{ - this.areaCodeList = this.areaCodeList1 - } - this.areaCodeList.unshift({areaName:'全部'}) - },1000) + console.log('%c 子组件参数↓','font-size:30px;color:red') }, + mounted() { + if(this.areaCodeList1.length == 0){ + this.areaCodeList = uni.getStorageSync('areaCodeList') + }else{ + this.areaCodeList = this.areaCodeList1 + } + this.areaCodeList.unshift({areaName:'全部'}) + this.$forceUpdate(); + }, computed: { selectedTitleObj() { let obj = {} diff --git a/pages/tabbar/station/stationList.vue b/pages/tabbar/station/stationList.vue index 46c6f71..e9f856b 100644 --- a/pages/tabbar/station/stationList.vue +++ b/pages/tabbar/station/stationList.vue @@ -33,12 +33,13 @@ - + - + @@ -71,111 +72,111 @@ filterData: { // oilProductCode: '0#' }, - contentTitle:'您当前位置附近没有油站,可以点击左上角-距离-选择其他省市进行查看。', + isFilterData:false, + contentTitle: '您当前位置附近没有油站,可以点击左上角-距离-选择其他省市进行查看。', loadStatus: 'load', - listHeight:160, - areaCodeList:[], + listHeight: 160, + areaCodeList: [], siteName: '', - menuList:[ + menuList: [{ + title: '距离', + isMutiple: false, + key: 'distance', + detailList: [{ + title: "全部", + value: '' + }, + { + title: "20Km", + value: 20 + }, + { + title: "30Km", + value: 30 + }, + { + title: "50Km", + value: 50 + }, + { + title: "省市", + value: 10 + } + ] + }, { - title: '距离', - isMutiple: false, - key: 'distance', - detailList: [ - { - title: "全部", - value: '' - }, - { - title: "20Km", - value: 20 - }, - { - title: "30Km", - value: 30 - }, - { - title: "50Km", - value: 50 - }, - { - title: "省市", - value: 10 - } - ] - }, - { - title: '油品', - key: 'oilProductCode', - isMutiple: false, - detailList: [{ - title: "全部", - value: "" - }, - { - title: "0#", - value: "0#" - }, - { - title: "-10#", - value: "-10#" - }, - { - title: "-20#", - value: "-20#" - }, - { - title: "-35#", - value: "-35#" - }, - { - title: "LNG", - value: "LNG" - }] + title: '油品', + key: 'oilProductCode', + isMutiple: false, + detailList: [{ + title: "全部", + value: "" + }, + { + title: "0#", + value: "0#" + }, + { + title: "-10#", + value: "-10#" + }, + { + title: "-20#", + value: "-20#" }, - // { - // title: '油品', - // key: 'oilProductCode', - // isMutiple: false, - // detailList: {全部:[{ - // title: "全部", - // value: "" - // }], - // 柴油:[{ - // title: "0#", - // value: "0#" - // }, - // { - // title: "-10#", - // value: "-10#" - // }, - // { - // title: "-20#", - // value: "-20#" - // }, - // { - // title: "-35#", - // value: "-35#" - // }], - // 天然气:[{ - // title: "LNG", - // value: "LNG" - // }]} - // }, { - title: '距离优先', - isMutiple: false, - key: 'comprehensiveSort', - detailList: [{ - title: "距离优先", - value: 1 - }, - { - title: "价格优先", - value: 2 - } - ] - }, + title: "-35#", + value: "-35#" + }, + { + title: "LNG", + value: "LNG" + } + ] + }, + // { + // title: '油品', + // key: 'oilProductCode', + // isMutiple: false, + // detailList: {全部:[{ + // title: "全部", + // value: "" + // }], + // 柴油:[{ + // title: "0#", + // value: "0#" + // }, + // { + // title: "-10#", + // value: "-10#" + // }, + // { + // title: "-20#", + // value: "-20#" + // }, + // { + // title: "-35#", + // value: "-35#" + // }], + // 天然气:[{ + // title: "LNG", + // value: "LNG" + // }]} + // }, + { + title: '距离优先', + isMutiple: false, + key: 'comprehensiveSort', + detailList: [{ + title: "距离优先", + value: 1 + }, + { + title: "价格优先", + value: 2 + } + ] + }, ], // menuList: uni.getStorageSync('filterData') ? uni.getStorageSync('filterData') : [ // { @@ -258,10 +259,12 @@ this.refreshLocation() if (!uni.getStorageSync('filterData')) { this.getFilterData() + } else { + this.isFilterData=true } this.getSiteList() }, - + onPullDownRefresh() { this.filterRes(this.filterData) setTimeout(function() { @@ -288,39 +291,73 @@ this.getSiteList() }, getFilterData() { + let menuList = [{ + title: '渠道', + isMutiple: false, + key: 'channelCode', + detailList: [{ + title: "全部", + value: "" + }] + }, + { + title: '0#轻柴油', + key: 'oilProductCode', + isMutiple: false, + detailList: [{ + title: "全部", + value: "" + }] + }, + { + title: '品牌', + key: 'siteBrand', + isSort: true, + isMutiple: false, + detailList: [{ + title: "全部", + value: "" + }] + } + ] oilSiteApi.getCheckInfo().then(res => { 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')){ + let channelCodes = [] + res.data.channelCodes.map(item => { + channelCodes.push({ + title: item.name, + value: item.id + }) + }) + let productCodes = [] + res.data.productCodes.map(item => { + productCodes.push({ + title: item.name, + value: item.id + }) + }) + let siteBrands = [] + res.data.siteBrands.map(item => { + siteBrands.push({ + title: item.name, + value: item.id + }) + }) + menuList[0].detailList = menuList[0].detailList.concat(channelCodes) + menuList[1].detailList = menuList[1].detailList.concat(productCodes) + menuList[2].detailList = menuList[2].detailList.concat(siteBrands) + uni.setStorageSync('filterData', this.menuList); + if (uni.getStorageSync('areaCodeList')) { this.areaCodeList = uni.getStorageSync('areaCodeList') - }else{ + } else { this.areaCodeList = res.data.areaCodeList } - // this.productCodeList = uni.getStorageSync('productCodeList') - // res.data.channelCodes.map(item => { - // this.menuList[0].detailList.push({ - // title: item.name, - // value: item.id - // }) - // }) - // res.data.productCodes.map(item => { - // this.menuList[1].detailList.push({ - // title: item.name, - // value: item.id - // }) - // }) - // res.data.siteBrands.map(item => { - // this.menuList[2].detailList.push({ - // title: item.name, - // value: item.id - // }) - // }) - // // console.log(channelCodes, productCodes, siteBrands) - - // this.$refs.slFilter.resetMenuList(this.menuList) + // this.$forceUpdate(); } + this.isFilterData = true }) }, onSelected(e) { @@ -342,21 +379,22 @@ currentPage: this.currentPage, pageSize: 10, params: { //类型:Object 必有字段 备注:// 筛选对象 + clientBelong:'BAICHUAN', sort: "juli", //类型:String 必有字段 备注:// 智能排序 ( price:价格最低 juli:距离最近 ) 默认距离排序 siteName: this.siteName, ...uni.getStorageSync('location'), // ...this.filterData siteBrand: this.siteName ? '' : this.filterData - .siteBrand, // 备注:// 石油品牌 ( 1-中国石油 2-中国石化 3-壳牌 4-民营 5-中海油 6-京博 7-中化石油 8-其他 ) + .siteBrand, // 备注:// 石油品牌 ( 1-中国石油 2-中国石化 3-壳牌 4-民营 5-中海油 6-京博 7-中化石油 8-其他 ) channelCode: this.siteName ? '' : this.filterData - .channelCode, // 备注:// 渠道编码 ( OIL:星油 WJY:万金油 LV:老吕(找油网) TY:团油 YDJY:一点加油(壳牌)) + .channelCode, // 备注:// 渠道编码 ( OIL:星油 WJY:万金油 LV:老吕(找油网) TY:团油 YDJY:一点加油(壳牌)) oilProductCode: this.siteName ? '' : this.filterData .oilProductCode, // 备注:// 油号选择 ( 0# 92# 92#) - provinceCode:this.filterData.provinceCode, - cityCode:this.filterData.cityCode, - areaCode:this.filterData.areaCode, - distance:this.filterData.distance, - comprehensiveSort:this.filterData.comprehensiveSort?this.filterData.comprehensiveSort:1 + provinceCode: this.filterData.provinceCode, + cityCode: this.filterData.cityCode, + areaCode: this.filterData.areaCode, + distance: this.filterData.distance, + comprehensiveSort: this.filterData.comprehensiveSort ? this.filterData.comprehensiveSort : 1 } } @@ -388,7 +426,7 @@ }, toDetail(item) { - let itemS = encodeURIComponent(JSON.stringify(item)) + let itemS = encodeURIComponent(JSON.stringify(item)) if (uni.getStorageSync('user')) { uni.navigateTo({ url: `/BagStation/pages/stationDetail/stationDetail?item=${itemS}`, @@ -401,13 +439,13 @@ }) } else { uni.showModal({ - title:'请您登录', - content:"登录小星加油才可以加油 |˛˙꒳​˙)♡", - confirmText:'去登陆', + title: '请您登录', + content: "登录小星加油才可以加油 |˛˙꒳​˙)♡", + confirmText: '去登陆', success: (res) => { - if(res.confirm){ + if (res.confirm) { uni.reLaunch({ - url:'../../../BagAuth/pages/login/login' + url: '../../../BagAuth/pages/login/login' }) } }