From 8ca30697376b7280a56f0089cf731262a903d530 Mon Sep 17 00:00:00 2001 From: caoliancun <572275724@qq.com> Date: Wed, 15 Feb 2023 21:00:15 +0800 Subject: [PATCH] 12121212 --- App.vue | 39 ++- BagAuth/pages/login/login.vue | 2 +- BagAuth/pages/login/oldLogin.vue | 13 +- BagAuth/pages/login/register.vue | 2 +- BagSetup/setup/setup.vue | 2 +- .../pages/components/price-select-tab.vue | 42 +-- BagStation/pages/components/price-tab.vue | 4 +- BagStation/pages/makeOrder/orderPaying.vue | 11 +- colorui/main.css | 6 +- components/sl-filter/filter-view.vue | 22 +- main.js | 73 +++- package-lock.json | 43 ++- pages.json | 12 +- pages/components/showModels.vue | 3 +- pages/index/startPage/startPage.vue | 15 +- pages/tabbar/home/home.vue | 1 + pages/tabbar/order/orderList/orderList.vue | 3 +- pages/tabbar/qrCenter/qrCenter.vue | 2 +- pages/tabbar/station/stationList.vue | 320 ++++++++++-------- pages/tabbar/user/user.vue | 11 +- utils/request.js | 2 +- 21 files changed, 406 insertions(+), 222 deletions(-) diff --git a/App.vue b/App.vue index d06c90b..f82fa64 100644 --- a/App.vue +++ b/App.vue @@ -8,6 +8,35 @@ export default { data() { return { + 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: "" + }] + } + ], loginStatus: 'online', msg: '' } @@ -69,11 +98,13 @@ this.menuList[1].detailList = this.menuList[1].detailList.concat(productCodes) this.menuList[2].detailList = this.menuList[2].detailList.concat(siteBrands) uni.setStorageSync('filterData', this.menuList) + console.log(uni.getStorageSync('filterData'),'pppppppppppppppppppppppp') // this.$refs.slFilter.resetMenuList(this.menuList) } }) }, onShareAppMessage() { + let that = this wx.onAppRoute(() => { let white = ['BagStation/pages/stationDetail/stationDetail'] // console.log('当前页面路由发生变化 触发该事件onShareAppMessage') @@ -86,7 +117,7 @@ // data.isOverShare = true view.onShareAppMessage = () => { //重写分享配置 return { - title: '百川加油', + title: '中品加油', path: "/pages/index/startPage/startPage", //若无path 默认跳转分享页 // imageUrl:'/image/onshowMessage.png' //若无imageUrl 截图当前页面 imageUrl: 'https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/login-bg.png', @@ -121,8 +152,12 @@ clearTimeout(onlineTimer) } }) + }else{ + // if(!uni.getStorageSync('filterData')){ + // that.getFilterData() + // } } - }, 1000) + }, 500) } else { // loginTimer = setTimeout(() => { diff --git a/BagAuth/pages/login/login.vue b/BagAuth/pages/login/login.vue index cfeee55..8d18d54 100644 --- a/BagAuth/pages/login/login.vue +++ b/BagAuth/pages/login/login.vue @@ -25,7 +25,7 @@ - + diff --git a/BagAuth/pages/login/oldLogin.vue b/BagAuth/pages/login/oldLogin.vue index 4a56641..b098323 100644 --- a/BagAuth/pages/login/oldLogin.vue +++ b/BagAuth/pages/login/oldLogin.vue @@ -7,9 +7,9 @@ :style="'background-image: url('+imgURL+'login-bg-top.png);height: 480upx;'"> - - - + + {{ 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/main.js b/main.js index 56e81ff..6293d4b 100644 --- a/main.js +++ b/main.js @@ -15,7 +15,7 @@ import global from '@/api/global.js' import Empty from '@/components/Empty.vue' import {share} from './mixins/index.js' - +import oilSiteApi from '@/api/oil-site.js' Vue.mixin(share) // Vue.component('home', home) // Vue.component('user', user) @@ -33,6 +33,77 @@ Vue.prototype.moneyIntercept = function(value){ return Number(value).toFixed(2) } } +Vue.prototype.SetFilterData = function(value){ + return new Promise((re,rj)=>{ + 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: "" + }] + } + ] + if(uni.getStorageSync('filterData')){ + re('ok') + }else{ + oilSiteApi.getCheckInfo().then(res => { + if (res.code == 20000) { + 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 + }) + }) + console.log(channelCodes, productCodes, siteBrands) + 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); + re('ok') + }else{ + rj('no') + } + }) + } + + }) +} let qqmapsdk = new QQMapWX({ // key: 'IUKBZ-5MKL3-HXB3P-3OS7U-6MHX3-MYBI3' key:'NYEBZ-YURY3-XTU3N-YBR54-PKW6E-ROB2F' diff --git a/package-lock.json b/package-lock.json index 14853a8..8ca7c4d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,37 +1,62 @@ { "name": "wechat-oil", "version": "1.0.0", - "lockfileVersion": 1, + "lockfileVersion": 3, "requires": true, - "dependencies": { - "axios": { + "packages": { + "": { + "name": "wechat-oil", + "version": "1.0.0", + "license": "ISC", + "devDependencies": { + "axios": "^0.21.3", + "crypto-js": "^4.0.0", + "js-cookie": "^2.2.1", + "js-md5": "^0.7.3" + } + }, + "node_modules/axios": { "version": "0.21.3", "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.3.tgz", "integrity": "sha512-JtoZ3Ndke/+Iwt5n+BgSli/3idTvpt5OjKyoCmz4LX5+lPiY5l7C1colYezhlxThjNa/NhngCUWZSZFypIFuaA==", "dev": true, - "requires": { + "dependencies": { "follow-redirects": "^1.14.0" } }, - "crypto-js": { + "node_modules/crypto-js": { "version": "4.0.0", "resolved": "https://registry.nlark.com/crypto-js/download/crypto-js-4.0.0.tgz", "integrity": "sha1-KQSrJnep0EKFai6i74DekuSjbcw=", "dev": true }, - "follow-redirects": { + "node_modules/follow-redirects": { "version": "1.14.3", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.3.tgz", "integrity": "sha512-3MkHxknWMUtb23apkgz/83fDoe+y+qr0TdgacGIA7bew+QLBo3vdgEN2xEsuXNivpFy4CyDhBBZnNZOtalmenw==", - "dev": true + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } }, - "js-cookie": { + "node_modules/js-cookie": { "version": "2.2.1", "resolved": "https://registry.npm.taobao.org/js-cookie/download/js-cookie-2.2.1.tgz", "integrity": "sha1-aeEG3F1YBolFYpAqpbrsN0Tpsrg=", "dev": true }, - "js-md5": { + "node_modules/js-md5": { "version": "0.7.3", "resolved": "https://registry.npm.taobao.org/js-md5/download/js-md5-0.7.3.tgz", "integrity": "sha1-tPL7sLMnRV9ZjWcn447Ccs0Jw/I=", diff --git a/pages.json b/pages.json index 247acaf..ad7786d 100644 --- a/pages.json +++ b/pages.json @@ -3,20 +3,20 @@ { "path": "pages/index/startPage/startPage", "style": { - "navigationBarTitleText": "佰川加油" + "navigationBarTitleText": "中品加油" } }, { "path": "pages/tabbar/home/home", "style": { - "navigationBarTitleText": "佰川加油" // "enablePullDownRefresh": true + "navigationBarTitleText": "中品加油" // "enablePullDownRefresh": true } }, { "path": "pages/tabbar/order/orderList/orderList", "style": { - "navigationBarTitleText": "佰川加油", // "enablePullDownRefresh": true + "navigationBarTitleText": "中品加油", // "enablePullDownRefresh": true "enablePullDownRefresh": true } }, @@ -24,7 +24,7 @@ { "path": "pages/tabbar/station/stationList", "style": { - "navigationBarTitleText": "佰川加油", // "enablePullDownRefresh": true + "navigationBarTitleText": "中品加油", // "enablePullDownRefresh": true "enablePullDownRefresh": true } }, @@ -32,7 +32,7 @@ { "path": "pages/tabbar/user/user", "style": { - "navigationBarTitleText": "佰川加油" // "enablePullDownRefresh": true + "navigationBarTitleText": "中品加油" // "enablePullDownRefresh": true } } @@ -275,7 +275,7 @@ "allowsBounceVertical": "NO" }, "navigationBarBackgroundColor": "#f33e54", - "navigationBarTitleText": "佰川加油", + "navigationBarTitleText": "中品加油", "navigationStyle": "custom", "navigationBarTextStyle": "white" }, diff --git a/pages/components/showModels.vue b/pages/components/showModels.vue index ba382ce..2b9a8f0 100644 --- a/pages/components/showModels.vue +++ b/pages/components/showModels.vue @@ -6,7 +6,7 @@ - + @@ -83,6 +83,7 @@ }, data() { return { + otherImgURL: this.global.otherImgURL, imgURL: this.global.imgURL, showPlateList: true, showInputList: false, diff --git a/pages/index/startPage/startPage.vue b/pages/index/startPage/startPage.vue index 6bd4b7b..f2dd3a5 100644 --- a/pages/index/startPage/startPage.vue +++ b/pages/index/startPage/startPage.vue @@ -53,11 +53,11 @@ key = '离线' } if (key == '在线') { - if (!uni.getStorageSync('filterData')) { - this.getFilterData() - } else if (uni.getStorageSync('filterData')[0].detailList.length < 2) { - this.getFilterData() - } + // if (!uni.getStorageSync('filterData')) { + // this.getFilterData() + // } else if (uni.getStorageSync('filterData')[0].detailList.length < 2) { + // this.getFilterData() + // } } // 在页面中定义插屏广告 let interstitialAd = null @@ -142,8 +142,10 @@ }, methods: { getFilterData() { + console.log('在线') oilSiteApi.getCheckInfo().then(res => { if (res.code == 20000) { + console.log('接口返回正常') let channelCodes = [] res.data.channelCodes.map(item => { channelCodes.push({ @@ -169,7 +171,8 @@ this.menuList[0].detailList = this.menuList[0].detailList.concat(channelCodes) this.menuList[1].detailList = this.menuList[1].detailList.concat(productCodes) this.menuList[2].detailList = this.menuList[2].detailList.concat(siteBrands) - uni.setStorageSync('filterData', this.menuList) + uni.setStorageSync('filterData', this.menuList); + console.log('存入',this.menuList) // this.$refs.slFilter.resetMenuList(this.menuList) } }) diff --git a/pages/tabbar/home/home.vue b/pages/tabbar/home/home.vue index 12bc10c..8ed9477 100644 --- a/pages/tabbar/home/home.vue +++ b/pages/tabbar/home/home.vue @@ -517,6 +517,7 @@ currentPage: 1, pageSize: 10, params: { //类型:Object 必有字段 备注:// 筛选对象 + clientBelong:'ZHONGPIN', 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 83fd3ba..6ff5643 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() @@ -242,6 +242,7 @@ pageSize: 10, //类型:Number 必有字段 备注:无 index: (page - 1) * 10, params: { //类型:Object 必有字段 备注:无 + clientBelong:'ZHONGPIN', orderStatus: id == '全部' ? '' : (id +''), //类型:String 必有字段 备注:订单状态 0:待支付, 1:已支付 ,-1:支付失败 ,2:已取消,3:已退款 search: this.search //类型:String 必有字段 备注:搜索 ( 油站名称/ 订单编号/ 油品) }, diff --git a/pages/tabbar/qrCenter/qrCenter.vue b/pages/tabbar/qrCenter/qrCenter.vue index af237df..6d5d47d 100644 --- a/pages/tabbar/qrCenter/qrCenter.vue +++ b/pages/tabbar/qrCenter/qrCenter.vue @@ -1,7 +1,7 @@