From e30a907fa71747263571e75d9707af0e3ab418c1 Mon Sep 17 00:00:00 2001 From: ChuShiZ Date: Fri, 20 Sep 2024 17:00:33 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=84=E4=BB=B6=E5=9B=9E=E6=98=BE=E7=9B=B8?= =?UTF-8?q?=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 4 +- pages/index/index.vue | 3 +- pages/my/my.vue | 49 +++++++++++----------- pages/my/newrefuel.vue | 4 +- pages/orderDetails/details.vue | 13 +++--- pages/rescue/initiate.vue | 75 ++++++++++++++++++---------------- 6 files changed, 78 insertions(+), 70 deletions(-) diff --git a/main.js b/main.js index 44f261d..82fb947 100644 --- a/main.js +++ b/main.js @@ -2,6 +2,8 @@ import App from './App' import config from '@/config' const baseUrl = config.baseUrl Vue.prototype.$baseUrl = baseUrl; +const baseImageUrl = config.baseImageUrl +Vue.prototype.$baseImageUrl = baseImageUrl const wsUrl = config.wsUrl Vue.prototype.$wsUrl = wsUrl; @@ -93,4 +95,4 @@ export function createApp() { app } } -// #endif \ No newline at end of file +// #endif diff --git a/pages/index/index.vue b/pages/index/index.vue index 23c604f..f830b12 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -9,7 +9,7 @@ --> - + {{uesrInfo.realName || '用户昵称'}} @@ -226,6 +226,7 @@ id: '', value5: '', baseUrl: this.$baseUrl, + baseImageUrl: this.$baseImageUrl, fileList1: [], uesrInfo: {}, show: false, diff --git a/pages/my/my.vue b/pages/my/my.vue index 303e33a..cf5a887 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -6,7 +6,7 @@ - + @@ -30,14 +30,14 @@ - + 300 累计完成(单) - + 5.0 当前星级 @@ -45,9 +45,9 @@ - + - + @@ -107,7 +107,7 @@ - + @@ -134,6 +134,7 @@ {text:'已完成',id:3} ], baseUrl:this.$baseUrl, + baseImageUrl: this.$baseImageUrl, userInfo:{}, tabindex:0, title: 'user', @@ -158,7 +159,7 @@ lists.map((item) => { this[`fileList${event.name}`].push({ ...item, - + }) }) for (let i = 0; i < lists.length; i++) { @@ -189,18 +190,18 @@ }); }, async getUserinfo(){ - + let res = await request({ url: '/rescue/getRescueDriverInfo', method: 'get', - + }) console.log('司机13',res); if(res.code == 200){ uni.setStorageSync('userinfo',res.data.user) this.userInfo = res.data.user } - + }, gorefuel(){ uni.navigateTo({ @@ -240,13 +241,13 @@ display: flex; align-items: center; } - + .htzit{ display: flex; align-items: center; font-size: 15px; color: #999999; - + } .yey{ font-size: 24px; @@ -323,7 +324,7 @@ padding-bottom: 15px; border-bottom: 1px solid #EEEEEE; } - + .dis-tt{ display: flex; align-items: center; @@ -356,7 +357,7 @@ border-radius: 50%; overflow: hidden; // background-color: #E3E3E3; - border:1px solid white; + border:1px solid white; margin-right: 15px; } } @@ -375,7 +376,7 @@ text-align: center; } .t-right{ - + } .t-zi2{ font-size: 14px; @@ -398,7 +399,7 @@ height: 100%; border-right: 1px solid #EEEEEE; text-align: center; - + } .t-lan{ font-size: 28px; @@ -418,7 +419,7 @@ padding-top: 90px; display: flex; justify-content: space-around; - + } .anniu{ width: 95%; @@ -462,7 +463,7 @@ justify-content: space-between; box-sizing: border-box; padding: 15px; - + } .right-box{ width: 85%; @@ -476,7 +477,7 @@ .ddis{ display: flex; margin-top: 10px; - + } .hui-twotwo{ width: 90%; @@ -487,10 +488,10 @@ margin: 10px auto; border-radius: 8px; margin-top: 0px; - + box-sizing: border-box; padding: 15px; - + } .content-box{ width: 100%; @@ -518,9 +519,9 @@ font-weight: 400; color: #FFFFFF; } - + .hui-zi{ - + font-size: 14px; font-weight: 400; color: #AAAAAA; diff --git a/pages/my/newrefuel.vue b/pages/my/newrefuel.vue index 22d953b..ba22ad6 100644 --- a/pages/my/newrefuel.vue +++ b/pages/my/newrefuel.vue @@ -143,7 +143,7 @@ filePath: url, }).then((res) => { console.log('images', res.fileName); - this.showImage = res.fileName + this.showImage = this.$baseImageUrl + res.data.url }) }, @@ -379,4 +379,4 @@ border-radius: 4px; margin-top: 20px; } - \ No newline at end of file + diff --git a/pages/orderDetails/details.vue b/pages/orderDetails/details.vue index adc2fab..f2a8353 100644 --- a/pages/orderDetails/details.vue +++ b/pages/orderDetails/details.vue @@ -179,7 +179,7 @@ - + @@ -203,7 +203,7 @@ - + @@ -256,6 +256,7 @@ rescueDetail: '', id: 0, baseUrl: this.$baseUrl, + baseImageUrl: this.$baseImageUrl, type: 'center', msgType: 'success', imageList: [], @@ -394,7 +395,7 @@ let resList = []; tmpList.forEach(it => { - resList.push(this.baseUrl + it) + resList.push(this.baseImageUrl + it) }) uni.previewImage({ @@ -437,7 +438,7 @@ console.log('fee_type', res); this.qdList = res.data }) - + request({ url: '/rescue/dict/data/type/rescue_car_type', method: 'get', @@ -445,7 +446,7 @@ this.carList = res.data console.log('rescue_car_type', res); }) - + }, getcarindex(index) { this.carindex = index @@ -1052,4 +1053,4 @@ background: #0D2E8D !important; color: white; } - \ No newline at end of file + diff --git a/pages/rescue/initiate.vue b/pages/rescue/initiate.vue index f74e50a..caa9ee8 100644 --- a/pages/rescue/initiate.vue +++ b/pages/rescue/initiate.vue @@ -81,7 +81,7 @@ - + * 备注 @@ -92,7 +92,7 @@ * 现场图片 - + - - + + 发起 - + @@ -124,9 +124,9 @@ data(){ return{ fileList1: [], - + id:1, - carzhi:0, + carzhi:0, car:[ {text:'大'}, {text:'中'}, @@ -136,7 +136,7 @@ manei:[ {text:'现金'}, {text:'签单'}, - + ], province:'', city:'', @@ -146,7 +146,7 @@ city1:'', area1:'', four1:'', - + } }, onLoad(option) { @@ -168,7 +168,7 @@ lists.map((item) => { this[`fileList${event.name}`].push({ ...item, - + }) }) for (let i = 0; i < lists.length; i++) { @@ -184,15 +184,18 @@ }, uploadFilePromise(url) { console.log(url); - upload({ - url:'/common/upload', - filePath: url, - - - - }).then((res)=>{ - console.log(res); - }) + return new Promise(resolve => { + upload({ + url:'/common/upload', + filePath: url, + + + + }).then((res)=>{ + console.log(res); + resolve(this.$baseImageUrl + res.data.url) + }) + }) // return new Promise((resolve, reject) => { // let a = uni.uploadFile({ // url: 'http://192.168.1.2:8080/common/upload', // 仅为示例,非真实的接口地址 @@ -203,14 +206,14 @@ // }, // success: (res) => { // setTimeout(() => { - // resolve(res.data.data) + // resolve(this.$baseImageUrl + res.data.url) // }, 1000) // } // }); // }) }, // 以下为重点 - + getmap(){ let that =this uni.chooseLocation({ @@ -238,10 +241,10 @@ that.four = address.replace(that.province,'').replace(that.city,'').replace(that.area,''); }; console.log(that.four); - + } }); - + }, getmap1(){ let that =this @@ -252,8 +255,8 @@ console.log('纬度:' + res.latitude); console.log('经度:' + res.longitude); console.log(res) - - + + var address = res.address; var reg = /.+?(省|市|自治区|自治州|县|区)/g; let addressList=address.match(reg).toString().split(","); @@ -269,15 +272,15 @@ that.four1 = address.replace(that.province,'').replace(that.city,'').replace(that.area,''); }; console.log(that.four1); - + } }); - + }, getback(){ uni.navigateBack({ delta:1, - }) + }) }, getzhi(index){ this.carzhi = index @@ -286,16 +289,16 @@ this.maneizhi = index }, // 获取上传状态 - + // 获取上传进度 - + // 上传成功 - - + + // 上传失败 - + } - + } @@ -370,7 +373,7 @@ margin-top: 5px; font-size: 12px; font-weight: 400; - + } .tinput{ width: 100%; @@ -425,4 +428,4 @@ border-radius: 4px; margin-top: 20px; } - \ No newline at end of file +