附件回显相关

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'
const baseUrl = config.baseUrl
Vue.prototype.$baseUrl = baseUrl;
const baseImageUrl = config.baseImageUrl
Vue.prototype.$baseImageUrl = baseImageUrl
const wsUrl = config.wsUrl
Vue.prototype.$wsUrl = wsUrl;

View File

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

View File

@ -16,7 +16,7 @@
width="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>
</view>
<view >
@ -134,6 +134,7 @@
{text:'已完成',id:3}
],
baseUrl:this.$baseUrl,
baseImageUrl: this.$baseImageUrl,
userInfo:{},
tabindex:0,
title: 'user',

View File

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

View File

@ -179,7 +179,7 @@
</view>
<view class="img-boxs">
<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>
@ -203,7 +203,7 @@
<view class="wrap-box" style="margin-left: 20px;" v-if="item.images">
<view class="img-box" v-for="(items,index) in item.images.split(',') "
@click="lookimg(index,item.images.split(','))" :key="index">
<image :src="baseUrl + items " mode=""></image>
<image :src="baseImageUrl + items " mode=""></image>
</view>
</view>
</view>
@ -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({

View File

@ -184,15 +184,18 @@
},
uploadFilePromise(url) {
console.log(url);
upload({
url:'/common/upload',
filePath: url,
return new Promise(resolve => {
upload({
url:'/common/upload',
filePath: url,
}).then((res)=>{
console.log(res);
})
}).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,7 +206,7 @@
// },
// success: (res) => {
// setTimeout(() => {
// resolve(res.data.data)
// resolve(this.$baseImageUrl + res.data.url)
// }, 1000)
// }
// });