图片地址拼接

This commit is contained in:
ChuShiZ 2024-09-19 19:55:35 +08:00
parent 10d72c6955
commit b372a20e03
12 changed files with 102 additions and 80 deletions

View File

@ -63,10 +63,10 @@ export function loginApp(data) {
// 使用租户域名(标识),获得租户编号 // 使用租户域名(标识),获得租户编号
export function getTenantIdByWebsite(website) { export function getTenantIdByWebsite(website) {
return request({ return request({
url: '/system/tenant/get-by-website', url: '/system/tenant/getListByWebsite',
method: 'get', method: 'get',
params: { params: {
website website
} }
}) })
} }

View File

@ -1,10 +1,12 @@
// 应用全局配置 // 应用全局配置
module.exports = { module.exports = {
baseUrl: 'http://localhost:48080/admin-api', baseUrl: 'http://192.168.31.29:48080/admin-api',
// baseUrl: 'http://47.94.122.58:8011/rescue',
// baseUrl: 'http://47.95.206.185:8011/rescue', // baseUrl: 'http://47.95.206.185:8011/rescue',
//baseUrl: 'http://47.95.206.185:8011/rescue', //baseUrl: 'http://47.95.206.185:8011/rescue',
imagesUrl: 'http://shequ.0315e.com/static/images/pages/', imagesUrl: 'https://www.nuoyunr.com/minio',
wsUrl: 'ws://47.95.206.185:8011/rescue', baseImageUrl: 'https://www.nuoyunr.com/minio/',
wsUrl: 'ws://192.168.1.8:48080',
// 应用信息 // 应用信息
appInfo: { appInfo: {
// 应用名称 // 应用名称

View File

@ -37,6 +37,8 @@ Vue.prototype.$getclearInterval = getclearInterval;
const baseUrl = config.baseUrl const baseUrl = config.baseUrl
Vue.prototype.$baseUrl = baseUrl; Vue.prototype.$baseUrl = baseUrl;
const baseImageUrl = config.baseImageUrl
Vue.prototype.$baseImageUrl = baseImageUrl;
// #ifndef VUE3 // #ifndef VUE3
import Vue from 'vue' import Vue from 'vue'
import './uni.promisify.adaptor' import './uni.promisify.adaptor'
@ -62,4 +64,4 @@ export function createApp() {
app app
} }
} }
// #endif // #endif

View File

@ -51,7 +51,7 @@
<view class="box-title" v-if="detailsinfo.rescueInfo.rescueStatus == 6">待取车</view> --> <view class="box-title" v-if="detailsinfo.rescueInfo.rescueStatus == 6">待取车</view> -->
<view v-if="detailsinfo.rescueInfo.rescueStatus > 2" class="touxiang"> <view v-if="detailsinfo.rescueInfo.rescueStatus > 2" class="touxiang">
<image :src="baseUrl + detailsinfo.driverInfo.avatar" mode="aspectFit"></image> <image :src="baseImageUrl + detailsinfo.driverInfo.avatar" mode="aspectFit"></image>
</view> </view>
<view class="box-bs" v-if="detailsinfo.driverInfo != '' "> <view class="box-bs" v-if="detailsinfo.driverInfo != '' ">
<view class="orderCardStatusData" v-if="detailsinfo.rescueInfo.rescueStatus == 3"> <view class="orderCardStatusData" v-if="detailsinfo.rescueInfo.rescueStatus == 3">
@ -141,7 +141,7 @@
<view class="wrap-box" v-if="item.images"> <view class="wrap-box" v-if="item.images">
<view class="img-box" v-for="(items,index) in item.images.split(',') " :key="index" <view class="img-box" v-for="(items,index) in item.images.split(',') " :key="index"
@click="previewImage(items)"> @click="previewImage(items)">
<image :src="baseUrl + items " mode=""></image> <image :src="baseImageUrl + items " mode=""></image>
</view> </view>
</view> </view>
</view> </view>
@ -164,7 +164,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(',') " :key="index" <view class="img-box" v-for="(items,index) in item.images.split(',') " :key="index"
@click="previewImage(items)"> @click="previewImage(items)">
<image :src="baseUrl + items " mode=""></image> <image :src="baseImageUrl + items " mode=""></image>
</view> </view>
</view> </view>
</view> --> </view> -->
@ -196,7 +196,7 @@
compass: true, compass: true,
marker: [], marker: [],
urlList: [], urlList: [],
baseUrl: this.$baseUrl, baseImageUrl: this.$baseImageUrl,
detailsinfo: null, detailsinfo: null,
timerId: null, timerId: null,
currentIndicator: 'none', currentIndicator: 'none',
@ -254,7 +254,7 @@
}, },
methods: { methods: {
previewImage(url) { previewImage(url) {
let newsurl = this.baseUrl + url let newsurl = this.baseImageUrl + url
this.urlList.push(newsurl) this.urlList.push(newsurl)
console.log(); console.log();
uni.previewImage({ uni.previewImage({
@ -836,4 +836,4 @@
height: 100%; height: 100%;
} }
} }
</style> </style>

View File

@ -10,7 +10,7 @@
<!-- 可选项 --> <!-- 可选项 -->
<view class="bt-box" v-for="(item,index) in arr" :key="index" @click="getlist(item.id)"> <view class="bt-box" v-for="(item,index) in arr" :key="index" @click="getlist(item.id)">
<view class="bt-img"> <view class="bt-img">
<image :src="item.icon" mode=""></image> <image :src="baseImageUrl + item.icon" mode=""></image>
</view> </view>
<view class="zi" :class="{'sy' :ggindex == item.id }">{{item.title}}</view> <view class="zi" :class="{'sy' :ggindex == item.id }">{{item.title}}</view>
</view> </view>
@ -32,7 +32,7 @@
<!-- 渲染的数据 --> <!-- 渲染的数据 -->
<view class="dz-box" v-for="(item,index) in arrlist" :key="index" @click="godetails(item.id)"> <view class="dz-box" v-for="(item,index) in arrlist" :key="index" @click="godetails(item.id)">
<view class="dz-left"> <view class="dz-left">
<image :src="item.imgs[0]" mode=""></image> <image :src="baseImageUrl + item.imgs[0]" mode=""></image>
</view> </view>
<view class="dz-right"> <view class="dz-right">
<view class="dz-title">{{item.title}}</view> <view class="dz-title">{{item.title}}</view>
@ -67,6 +67,7 @@
scale: 13, // scale: 13, //
compass: true, compass: true,
marker: [], marker: [],
baseImageUrl: this.$baseImageUrl
} }
}, },
onLoad() { onLoad() {
@ -346,4 +347,4 @@
color: #5BA8FF !important; color: #5BA8FF !important;
font-weight: bold !important; font-weight: bold !important;
} }
</style> </style>

View File

@ -2,7 +2,7 @@
<view class="container"> <view class="container">
<headers title="地图详情"></headers> <headers title="地图详情"></headers>
<view class="c-top"> <view class="c-top">
<image :src="imgs" mode=""></image> <image :src="baseImageUrl + imgs" mode=""></image>
<!-- p --> <!-- p -->
<view class="c-box"> <view class="c-box">
<!-- --> <!-- -->
@ -57,7 +57,8 @@
return { return {
id: '', id: '',
arr: {}, arr: {},
imgs: '' imgs: '',
baseImageUrl: this.$baseImageUrl,
} }
}, },
onLoad(option) { onLoad(option) {
@ -160,7 +161,7 @@
.biaoq { .biaoq {
// width: 136rpx; // width: 136rpx;
height: 40rpx; height: 40rpx;
background: #E5EEF5; background: #E5EEF5;
border-radius: 20rpx 20rpx 20rpx 20rpx; border-radius: 20rpx 20rpx 20rpx 20rpx;
@ -168,7 +169,7 @@
background: #E5EEF5; background: #E5EEF5;
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
margin: 20rpx 0rpx; margin: 20rpx 0rpx;
padding: 5px 20px; padding: 5px 20px;
display: inline-block; display: inline-block;
@ -274,4 +275,4 @@
height: 44rpx; height: 44rpx;
} }
} }
</style> </style>

View File

@ -122,7 +122,7 @@
yzm: '', yzm: '',
wrod: '', wrod: '',
activeid: 0, activeid: 0,
tenantCode: 'lighting' tenantCode: 'lanan'
} }
}, },
computed: { computed: {
@ -141,12 +141,6 @@
}, },
}, },
mounted(){ mounted(){
getTenantIdByWebsite(this.tenantCode).then(res => {
const tenantId = res.data;
if (tenantId && tenantId >= 0) {
setTenantId(tenantId)
}
})
}, },
methods: { methods: {
@ -275,41 +269,58 @@
uni.setStorageSync('identity', this.sfindex); uni.setStorageSync('identity', this.sfindex);
if (this.activeid == 0) { const loginFun = () => {
const data = { if (this.activeid == 0) {
username: this.tel, const data = {
password: this.wrod, username: this.tel,
type: 0 password: this.wrod,
} type: 0
loginApp(data).then(res => { }
setToken(res.data.accessToken) loginApp(data).then(res => {
this.userinfo()
})
}
if (this.activeid == 1) {
const data = {
phone: this.tel,
code: this.yzm,
type: 1
}
request({
url: '/loginApp',
method: 'post',
data: data
}).then((res) => {
console.log('验证码请求', res);
if (res.code == 0) {
uni.showToast({
title: '登录成功',
icon: 'none'
})
setToken(res.data.accessToken) setToken(res.data.accessToken)
this.userinfo() this.userinfo()
})
}
if (this.activeid == 1) {
const data = {
phone: this.tel,
code: this.yzm,
type: 1
}
request({
url: '/loginApp',
method: 'post',
data: data
}).then((res) => {
console.log('验证码请求', res);
if (res.code == 0) {
uni.showToast({
title: '登录成功',
icon: 'none'
})
setToken(res.data.accessToken)
this.userinfo()
} }
}) })
} }
}
getTenantIdByWebsite(this.tenantCode).then(res => {
if (res.code === 200 && res.data && res.data.length > 0) {
uni.showActionSheet({
itemList: res.data.map(m => m.name),
success: ({tapIndex}) => {
setTenantId(res.data[tapIndex].id)
loginFun()
}
})
} else {
setTenantId('')
loginFun()
}
})
}, },
userinfo() { userinfo() {
if (this.sfindex == 'user') { if (this.sfindex == 'user') {

View File

@ -10,7 +10,7 @@
<view class="_box" v-for="(item,index) in carList" :key="index" @click="goupdata(item.id)"> <view class="_box" v-for="(item,index) in carList" :key="index" @click="goupdata(item.id)">
<view class="_box-content"> <view class="_box-content">
<view class="img_"> <view class="img_">
<image :src="baseUrl+item.carImage" mode="aspectFill"></image> <image :src="baseImageUrl + item.carImage" mode="aspectFill"></image>
</view> </view>
<view class="right_"> <view class="right_">
<view class="cphInfo" style=""> <view class="cphInfo" style="">
@ -59,6 +59,7 @@
data() { data() {
return { return {
baseUrl: this.$baseUrl, baseUrl: this.$baseUrl,
baseImageUrl: this.$baseImageUrl,
carList: [], carList: [],
searchName: null, searchName: null,
pageNum: 1, pageNum: 1,
@ -235,4 +236,4 @@
bottom: 30px; bottom: 30px;
right: 15px; right: 15px;
} }
</style> </style>

View File

@ -72,7 +72,7 @@
<!-- <u-button type="error" v-if="carId" @click="delItem()" text="删除"></u-button> --> <!-- <u-button type="error" v-if="carId" @click="delItem()" text="删除"></u-button> -->
<view class="deleteBtn" v-if="carId" @click="delItem()">删除</view> <view class="deleteBtn" v-if="carId" @click="delItem()">删除</view>
<view class="saveBtn" @click="saveOrUpdate" >保存</view> <view class="saveBtn" @click="saveOrUpdate" >保存</view>
</view> </view>
</view> </view>
</view> </view>
@ -120,7 +120,7 @@
carCheckTime: "", // carCheckTime: "", //
carLicenseColor: "", // carLicenseColor: "", //
carUseNature: "", //使 carUseNature: "", //使
frameNumber: "" // frameNumber: "" //
}, },
carUseNature: [], //使 carUseNature: [], //使
jycType: [], // jycType: [], //
@ -150,7 +150,7 @@
setTimeout(function() { setTimeout(function() {
uni.navigateBack() uni.navigateBack()
}.bind(this), 1000); // 2000 }.bind(this), 1000); // 2000
}) })
}, },
// //
@ -220,7 +220,7 @@
url: '/common/upload', url: '/common/upload',
filePath: res.tempFilePath, filePath: res.tempFilePath,
}).then((res) => { }).then((res) => {
this.imageList1.push(res.fileName) this.imageList1.push(this.$baseImageUrl + res.data.url)
console.log(res); console.log(res);
}) })
@ -239,7 +239,7 @@
url: '/common/upload', url: '/common/upload',
filePath: res.tempFilePath, filePath: res.tempFilePath,
}).then((res) => { }).then((res) => {
this.imageList2.push(res.fileName) this.imageList2.push(this.$baseImageUrl + res.data.url)
console.log(res); console.log(res);
}) })
@ -319,7 +319,7 @@
setTimeout(function() { setTimeout(function() {
uni.navigateBack() uni.navigateBack()
}.bind(this), 1000); // 2000 }.bind(this), 1000); // 2000
}) })
} else { } else {
console.log(this.carInfo, 'update'); console.log(this.carInfo, 'update');
@ -335,7 +335,7 @@
}) })
setTimeout(function() { setTimeout(function() {
uni.navigateBack() uni.navigateBack()
}.bind(this), 1000); // 2000 }.bind(this), 1000); // 2000
}) })
} }
@ -490,7 +490,7 @@
font-size: 24rpx; font-size: 24rpx;
} }
} }
.uploadBtn { .uploadBtn {
width: 120rpx; width: 120rpx;
height: 120rpx; height: 120rpx;
@ -540,4 +540,4 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
</style> </style>

View File

@ -14,7 +14,7 @@
:maxCount="1" width="60" height="60"> :maxCount="1" width="60" height="60">
<image src="http://www.nuoyunr.com/lananRsc/detection/touxiang.png" class="tximg" mode="" <image src="http://www.nuoyunr.com/lananRsc/detection/touxiang.png" class="tximg" mode=""
v-if="!userinfo.avatar"></image> v-if="!userinfo.avatar"></image>
<image :src=" baseUrl +userinfo.avatar " class="tximg" mode="" v-if="userinfo.avatar"></image> <image :src="baseImageUrl + userinfo.avatar " class="tximg" mode="" v-if="userinfo.avatar"></image>
</u-upload> </u-upload>
</view> </view>
<view class="c-title" v-if="!userinfo" @click="gologin">立即登录</view> <view class="c-title" v-if="!userinfo" @click="gologin">立即登录</view>
@ -185,7 +185,8 @@
}, },
msg: '4', msg: '4',
value: '', value: '',
baseUrl: this.$baseUrl baseUrl: this.$baseUrl,
baseImageUrl: this.$baseImageUrl,
} }
}, },
mounted() { mounted() {
@ -227,7 +228,7 @@
async getUserinfo() { async getUserinfo() {
await request({ await request({
url: '/getAppInfo', url: '/rescue/getJcAppInfo',
method: 'get', method: 'get',
}).then((res) => { }).then((res) => {
if (res.code == 200) { if (res.code == 200) {
@ -282,7 +283,7 @@
}).then((res) => { }).then((res) => {
console.log(res.fileName); console.log(res.fileName);
this.onChooseavatar(res.fileName) this.onChooseavatar(this.$baseImageUrl + res.data.url)
// this.releasebox.imageList.push(res.fileName) // this.releasebox.imageList.push(res.fileName)
// console.log(this.releasebox.imageList); // console.log(this.releasebox.imageList);
}) })
@ -360,7 +361,7 @@
return return
} }
let res = await request({ let res = await request({
url: '/getAppInfo', url: '/rescue/getJcAppInfo',
method: 'get', method: 'get',
}) })
console.log('个人信息', res); console.log('个人信息', res);

View File

@ -285,7 +285,7 @@
this.car = res.data this.car = res.data
console.log(res); console.log(res);
}) })
request({ request({
url: '/rescue/dict/data/type/kcRescueRoad-1', url: '/rescue/dict/data/type/kcRescueRoad-1',
method: 'get' method: 'get'
@ -461,7 +461,9 @@
url: '/common/upload', url: '/common/upload',
filePath: res.tempFilePath, filePath: res.tempFilePath,
}).then((res) => { }).then((res) => {
this.imageList.push(res.fileName) console.log('res.fileName', res.data.url)
this.imageList.push(this.$baseImageUrl + res.data.url)
console.log('this.imageList', this.imageList)
console.log(res); console.log(res);
}) })
@ -777,4 +779,4 @@
background: #327DFB; background: #327DFB;
border-radius: 12rpx; border-radius: 12rpx;
} }
</style> </style>

View File

@ -57,7 +57,8 @@
label: '扣车', label: '扣车',
icon: require('@/static/icons/order/tuoche.png') icon: require('@/static/icons/order/tuoche.png')
}, },
] ],
baseImageUrl: this.$baseImageUrl,
} }
}, },
components: { components: {
@ -234,4 +235,4 @@
// #y5 { // #y5 {
// background-image: url('../../static/kc.png'); // background-image: url('../../static/kc.png');
// } // }
</style> </style>