附件回显相关

This commit is contained in:
ChuShiZ 2024-09-20 17:00:33 +08:00
parent 212d8ece1f
commit e30a907fa7
6 changed files with 78 additions and 70 deletions

View File

@ -2,6 +2,8 @@ import App from './App'
import config from '@/config' import config from '@/config'
const baseUrl = config.baseUrl const baseUrl = config.baseUrl
Vue.prototype.$baseUrl = baseUrl; Vue.prototype.$baseUrl = baseUrl;
const baseImageUrl = config.baseImageUrl
Vue.prototype.$baseImageUrl = baseImageUrl
const wsUrl = config.wsUrl const wsUrl = config.wsUrl
Vue.prototype.$wsUrl = wsUrl; Vue.prototype.$wsUrl = wsUrl;

View File

@ -9,7 +9,7 @@
</view> --> </view> -->
<view class="touxiang"> <view class="touxiang">
<image :src=" baseUrl + uesrInfo.avatar" mode=""></image> <image :src="baseImageUrl + uesrInfo.avatar" mode=""></image>
</view> </view>
<view> <view>
<view class="t-zi1">{{uesrInfo.realName || '用户昵称'}}</view> <view class="t-zi1">{{uesrInfo.realName || '用户昵称'}}</view>
@ -226,6 +226,7 @@
id: '', id: '',
value5: '', value5: '',
baseUrl: this.$baseUrl, baseUrl: this.$baseUrl,
baseImageUrl: this.$baseImageUrl,
fileList1: [], fileList1: [],
uesrInfo: {}, uesrInfo: {},
show: false, show: false,

View File

@ -16,7 +16,7 @@
width="60" width="60"
height="60" height="60"
> >
<image :src=" baseUrl + userInfo.avatar " v-if="userInfo.avatar != '' " style="width: 60px; height: 60px; border-radius: 50%; z-index: 99;" mode="" ></image> <image :src="baseImageUrl + userInfo.avatar " v-if="userInfo.avatar != '' " style="width: 60px; height: 60px; border-radius: 50%; z-index: 99;" mode="" ></image>
</u-upload> </u-upload>
</view> </view>
<view > <view >
@ -134,6 +134,7 @@
{text:'已完成',id:3} {text:'已完成',id:3}
], ],
baseUrl:this.$baseUrl, baseUrl:this.$baseUrl,
baseImageUrl: this.$baseImageUrl,
userInfo:{}, userInfo:{},
tabindex:0, tabindex:0,
title: 'user', title: 'user',

View File

@ -143,7 +143,7 @@
filePath: url, filePath: url,
}).then((res) => { }).then((res) => {
console.log('images', res.fileName); console.log('images', res.fileName);
this.showImage = res.fileName this.showImage = this.$baseImageUrl + res.data.url
}) })
}, },

View File

@ -179,7 +179,7 @@
</view> </view>
<view class="img-boxs"> <view class="img-boxs">
<view class="g-img" v-for="(item,index) in detailsData.rescueSceneImageList" :key="index"> <view class="g-img" v-for="(item,index) in detailsData.rescueSceneImageList" :key="index">
<image :src=" baseUrl + item " mode=""></image> <image :src="baseImageUrl + item " mode=""></image>
</view> </view>
</view> </view>
@ -203,7 +203,7 @@
<view class="wrap-box" style="margin-left: 20px;" v-if="item.images"> <view class="wrap-box" style="margin-left: 20px;" v-if="item.images">
<view class="img-box" v-for="(items,index) in item.images.split(',') " <view class="img-box" v-for="(items,index) in item.images.split(',') "
@click="lookimg(index,item.images.split(','))" :key="index"> @click="lookimg(index,item.images.split(','))" :key="index">
<image :src="baseUrl + items " mode=""></image> <image :src="baseImageUrl + items " mode=""></image>
</view> </view>
</view> </view>
</view> </view>
@ -256,6 +256,7 @@
rescueDetail: '', rescueDetail: '',
id: 0, id: 0,
baseUrl: this.$baseUrl, baseUrl: this.$baseUrl,
baseImageUrl: this.$baseImageUrl,
type: 'center', type: 'center',
msgType: 'success', msgType: 'success',
imageList: [], imageList: [],
@ -394,7 +395,7 @@
let resList = []; let resList = [];
tmpList.forEach(it => { tmpList.forEach(it => {
resList.push(this.baseUrl + it) resList.push(this.baseImageUrl + it)
}) })
uni.previewImage({ uni.previewImage({

View File

@ -184,15 +184,18 @@
}, },
uploadFilePromise(url) { uploadFilePromise(url) {
console.log(url); console.log(url);
upload({ return new Promise(resolve => {
url:'/common/upload', upload({
filePath: url, url:'/common/upload',
filePath: url,
}).then((res)=>{ }).then((res)=>{
console.log(res); console.log(res);
}) resolve(this.$baseImageUrl + res.data.url)
})
})
// return new Promise((resolve, reject) => { // return new Promise((resolve, reject) => {
// let a = uni.uploadFile({ // let a = uni.uploadFile({
// url: 'http://192.168.1.2:8080/common/upload', // // url: 'http://192.168.1.2:8080/common/upload', //
@ -203,7 +206,7 @@
// }, // },
// success: (res) => { // success: (res) => {
// setTimeout(() => { // setTimeout(() => {
// resolve(res.data.data) // resolve(this.$baseImageUrl + res.data.url)
// }, 1000) // }, 1000)
// } // }
// }); // });