瀏覽代碼

fix: 图片问题修复

szr190 2 周之前
父節點
當前提交
4054c3fc6e

+ 1 - 0
src/base/base.scss

@@ -30,6 +30,7 @@
30 30
     background-color: #fff;
31 31
     border-radius: 14rpx;
32 32
     margin-bottom: 24rpx;
33
+    overflow: hidden;
33 34
     .common-card-title {
34 35
       font-size: 31rpx;
35 36
       color: #333;

+ 4 - 1
src/base/common/charge.vue

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <view class="common-details-container" v-if="chargeInfo?.title">
3 3
     <view class="common-header-wrapper">
4
-      <image :src="content.image" mode="aspectFill" />
4
+      <image :src="pathPre + content.image" mode="aspectFill" />
5 5
     </view>
6 6
     <view class="common-content-wrapper">
7 7
       <view class="common-card">
@@ -36,6 +36,9 @@
36 36
 import { ref } from 'vue'
37 37
 import { onLoad } from '@dcloudio/uni-app'
38 38
 import { getParkServicePower } from '@/api/home'
39
+import { useGlobal } from '@/composables/index'
40
+
41
+const { pathPre } = useGlobal()
39 42
 
40 43
 const chargeInfo = ref<any>({})
41 44
 const content = ref<any>({})

+ 5 - 2
src/base/common/driversHome.vue

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <view class="common-details-container" v-if="driverInfo?.title">
3 3
     <view class="common-header-wrapper">
4
-      <image :src="content.image" mode="aspectFill" />
4
+      <image :src="pathPre + content.image" mode="aspectFill" />
5 5
     </view>
6 6
     <view class="common-content-wrapper">
7 7
       <view class="common-card">
@@ -16,7 +16,7 @@
16 16
         </view>
17 17
         <view class="common-card-title u-margin-top-45">设施配置</view>
18 18
         <view class="u-flex u-col-center u-margin-top-24">
19
-          <HyTag v-for="(item, index) in content.facilities" :key="index" :text="item.name" :imgUrl="item.img" />
19
+          <HyTag v-for="(item, index) in content.facilities" :key="index" :text="item.name" :imgUrl="pathPre + item.img" />
20 20
         </view>
21 21
       </view>
22 22
     </view>
@@ -30,6 +30,9 @@
30 30
 import { ref } from 'vue'
31 31
 import { onLoad } from '@dcloudio/uni-app'
32 32
 import { getParkServiceDriver } from '@/api/home'
33
+import { useGlobal } from '@/composables/index'
34
+
35
+const { pathPre } = useGlobal()
33 36
 
34 37
 const driverInfo = ref<any>({})
35 38
 const content = ref<any>({})

+ 4 - 1
src/base/common/join.vue

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <view class="common-details-container" v-if="content?.intro || content?.image">
3 3
     <view class="common-header-wrapper join">
4
-      <image :src="content.image" mode="aspectFill" />
4
+      <image :src="pathPre + content.image" mode="aspectFill" />
5 5
     </view>
6 6
     <view class="common-content-wrapper">
7 7
       <view class="common-card">
@@ -20,6 +20,9 @@
20 20
 import { ref } from 'vue'
21 21
 import { onLoad } from '@dcloudio/uni-app'
22 22
 import { getParkServiceInvestment } from '@/api/home'
23
+import { useGlobal } from '@/composables/index'
24
+
25
+const { pathPre } = useGlobal()
23 26
 
24 27
 // 招商加盟详情
25 28
 const joinInfo = ref<any>({})

+ 5 - 2
src/base/common/nursingRoom.vue

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <view class="common-details-container" v-if="boyInfo?.title">
3 3
     <view class="common-header-wrapper">
4
-      <image :src="content.image" mode="aspectFill" />
4
+      <image :src="pathPre + content.image" mode="aspectFill" />
5 5
     </view>
6 6
     <view class="common-content-wrapper">
7 7
       <view class="common-card">
@@ -16,7 +16,7 @@
16 16
         </view>
17 17
         <view class="common-card-title u-margin-top-45">设施配置</view>
18 18
         <view class="bottom-box-wrap">
19
-          <HyTag v-for="item in content?.facilities" :key="item" :text="item.name" :imgUrl="item.img" />
19
+          <HyTag v-for="item in content?.facilities" :key="item" :text="item.name" :imgUrl="pathPre + item.img" />
20 20
         </view>
21 21
       </view>
22 22
     </view>
@@ -30,6 +30,9 @@
30 30
 import { ref } from 'vue'
31 31
 import { onLoad } from '@dcloudio/uni-app'
32 32
 import { getParkServiceBoy } from '@/api/home'
33
+import { useGlobal } from '@/composables/index'
34
+
35
+const { pathPre } = useGlobal()
33 36
 
34 37
 const boyInfo = ref<any>({})
35 38
 const content = ref<any>({})

+ 4 - 1
src/base/common/refuel.vue

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <view class="common-details-container" v-if="refuelInfo?.title">
3 3
     <view class="common-header-wrapper">
4
-      <image :src="content.image" mode="aspectFill" />
4
+      <image :src="pathPre + content.image" mode="aspectFill" />
5 5
     </view>
6 6
     <view class="common-content-wrapper">
7 7
       <view class="common-card">
@@ -28,6 +28,9 @@
28 28
 import { ref } from 'vue'
29 29
 import { onLoad } from '@dcloudio/uni-app'
30 30
 import { getParkServiceOil } from '@/api/home'
31
+import { useGlobal } from '@/composables/index'
32
+
33
+const { pathPre } = useGlobal()
31 34
 
32 35
 // 我要加油
33 36
 const refuelInfo = ref<any>({})

+ 4 - 1
src/base/common/repair.vue

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <view class="common-details-container" v-if="carInfo?.title">
3 3
     <view class="common-header-wrapper">
4
-      <image :src="content.image" mode="aspectFill" />
4
+      <image :src="pathPre + content.image" mode="aspectFill" />
5 5
     </view>
6 6
     <view class="common-content-wrapper">
7 7
       <view class="common-card">
@@ -25,6 +25,9 @@
25 25
 import { ref } from 'vue'
26 26
 import { onLoad } from '@dcloudio/uni-app'
27 27
 import { getParkServiceCar } from '@/api/home'
28
+import { useGlobal } from '@/composables/index'
29
+
30
+const { pathPre } = useGlobal()
28 31
 
29 32
 const carInfo = ref<any>({})
30 33
 const content = ref<any>({})

+ 2 - 2
src/base/common/spot.vue

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <view class="common-details-container">
3 3
     <view class="common-header-wrapper">
4
-      <image :src="content.image" mode="aspectFill" />
4
+      <image :src="pathPre + content.image" mode="aspectFill" />
5 5
     </view>
6 6
     <view class="common-content-wrapper">
7 7
       <view class="common-card">
@@ -31,7 +31,7 @@ import { ref } from 'vue'
31 31
 import { onLoad } from '@dcloudio/uni-app'
32 32
 import { getParkServiceScenicDetail } from '@/api/home'
33 33
 import { useGlobal } from '../../composables/index'
34
-const { minioUrl } = useGlobal()
34
+const { minioUrl, pathPre } = useGlobal()
35 35
 
36 36
 const id = ref<string>('')
37 37
 const details = ref<any>({})

+ 5 - 2
src/base/shop/details.vue

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <view class="common-details-container">
3 3
     <view class="common-header-wrapper">
4
-      <image :src="content.image" mode="aspectFill" />
4
+      <image :src="pathPre + content.image" mode="aspectFill" />
5 5
     </view>
6 6
     <view class="common-content-wrapper">
7 7
       <view class="common-card">
@@ -24,7 +24,7 @@
24 24
         <view class="common-card-list" v-if="content.facilities?.length > 0">
25 25
           <view class="card-list-item" v-for="(item, index) in content.facilities" :key="index">
26 26
             <view class="item-img-wrap">
27
-              <image :src="item.img" mode="aspectFill" />
27
+              <image :src="pathPre + item.img" mode="aspectFill" />
28 28
             </view>
29 29
             <view class="list-text">{{ item.name }}</view>
30 30
           </view>
@@ -41,6 +41,9 @@
41 41
 import { ref } from 'vue'
42 42
 import { onLoad } from '@dcloudio/uni-app'
43 43
 import { getParkServiceEatDetail } from '@/api/home'
44
+import { useGlobal } from '@/composables/index'
45
+
46
+const { pathPre } = useGlobal()
44 47
 
45 48
 const id = ref<string>('')
46 49
 const details = ref<any>({})

+ 4 - 1
src/base/shop/detailsShop.vue

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <view class="common-details-container">
3 3
     <view class="common-header-wrapper">
4
-      <image :src="content.image" mode="aspectFill" />
4
+      <image :src="pathPre + content.image" mode="aspectFill" />
5 5
     </view>
6 6
     <view class="common-content-wrapper">
7 7
       <view class="common-card">
@@ -41,6 +41,9 @@
41 41
 import { ref } from 'vue'
42 42
 import { onLoad } from '@dcloudio/uni-app'
43 43
 import { getParkServiceShopDetail } from '@/api/home'
44
+import { useGlobal } from '@/composables/index'
45
+
46
+const { pathPre } = useGlobal()
44 47
 
45 48
 const id = ref<string>('')
46 49
 const details = ref<any>({})

+ 4 - 1
src/base/suggest/record.vue

@@ -6,7 +6,7 @@
6 6
           <view class="title u-line-2">{{ item.content }}</view>
7 7
           <view class="pic-list">
8 8
             <view class="pic-wrap" v-for="(pic, index) in item.albumPics" :key="index">
9
-              <image :src="pic" mode="aspectFill" @click="previewImage(item.albumPics, index)" />
9
+              <image :src="pathPre + pic" mode="aspectFill" @click="previewImage(item.albumPics, index)" />
10 10
             </view>
11 11
           </view>
12 12
           <view class="time-status-wrap">
@@ -28,6 +28,9 @@ import { ref } from 'vue'
28 28
 import { onLoad, onPageScroll } from '@dcloudio/uni-app'
29 29
 import { getQuestionFeedbackList } from '@/api/home'
30 30
 import { useListLoader } from '@/composables/useListLoader'
31
+import { useGlobal } from '@/composables/index'
32
+
33
+const { pathPre } = useGlobal()
31 34
 
32 35
 const angle = ref(45)
33 36
 // 监听页面滚动

+ 2 - 2
src/base/suggest/suggest.vue

@@ -89,8 +89,8 @@ const submit = () => {
89 89
   // 处理上传的图片
90 90
   const files = proxy?.$refs?.uploadRef?.lists.filter((v: any) => v.progress == 100) || []
91 91
   files.forEach((file: any) => {
92
-    if (file.response && file.response.data && file.response.data.url) {
93
-      pics.value.push(file.response.data.url)
92
+    if (file.response && file.response.data && file.response.data.filePath) {
93
+      pics.value.push(file.response.data.filePath)
94 94
     }
95 95
   })
96 96
   // 构造提交参数

+ 2 - 2
src/components/HyService.vue

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <view class="service-item-wrapper">
3 3
     <view class="item-left-wrap">
4
-      <image :src="item.content.image" mode="aspectFill" />
4
+      <image :src="pathPre + item.content.image" mode="aspectFill" />
5 5
       <text>{{ item.title }}</text>
6 6
     </view>
7 7
     <view class="item-right-wrap" :style="{ backgroundImage: `url(${minioUrl}/bg_service_03.png)` }">
@@ -19,7 +19,7 @@
19 19
 
20 20
 <script lang="ts" setup>
21 21
 import { useGlobal } from '@/composables/index'
22
-const { minioUrl } = useGlobal()
22
+const { minioUrl, pathPre } = useGlobal()
23 23
 
24 24
 defineProps({
25 25
   item: {

+ 5 - 1
src/components/HyShopItem.vue

@@ -2,7 +2,7 @@
2 2
 <template>
3 3
   <view class="shop-item-wrapper" @click="navigateToDetails(item)">
4 4
     <view class="item-left-wrap">
5
-      <image :src="item.content?.image" mode="aspectFill" />
5
+      <image :src="pathPre + item.content?.image" mode="aspectFill" />
6 6
     </view>
7 7
     <view class="item-right-wrap">
8 8
       <view class="top">
@@ -21,6 +21,10 @@
21 21
 </template>
22 22
 
23 23
 <script lang="ts" setup>
24
+import { useGlobal } from '@/composables/index'
25
+
26
+const { pathPre } = useGlobal()
27
+
24 28
 const props = defineProps({
25 29
   price: {
26 30
     type: Boolean,

+ 3 - 3
src/pages/index.vue

@@ -15,7 +15,7 @@ import { useListLoader } from '@/composables/useListLoader'
15 15
 import { useGlobal } from '@/composables/index'
16 16
 import { user } from '@/stores/modules/user'
17 17
 
18
-const { minioUrl } = useGlobal()
18
+const { minioUrl, pathPre } = useGlobal()
19 19
 const userStore = user()
20 20
 
21 21
 const angle = ref(45)
@@ -385,7 +385,7 @@ const callPhone = (phone: string) => {
385 385
         <view class="index-shop-wrapper" v-if="shopList.length > 0">
386 386
           <view class="shop-item" v-for="(item, index) in shopList" :key="index" @click="navigateToShopDetail(item.id)">
387 387
             <view class="img-wrap">
388
-              <image :src="item.content.image" mode="aspectFill" />
388
+              <image :src="pathPre + item.content.image" mode="aspectFill" />
389 389
             </view>
390 390
             <view class="item-text u-line-1">{{ item.title }}</view>
391 391
           </view>
@@ -399,7 +399,7 @@ const callPhone = (phone: string) => {
399 399
         <view class="index-spot-wrapper" v-if="scenicList.length > 0">
400 400
           <view class="spot-item" v-for="(item, index) in scenicList" :key="index" @click="navigateToSpot(item.id)">
401 401
             <view class="spot-img-wrap">
402
-              <image :src="item.content.image" mode="aspectFill" />
402
+              <image :src="pathPre + item.content.image" mode="aspectFill" />
403 403
             </view>
404 404
             <view class="spot-right-wrap">
405 405
               <view class="right-header">

+ 2 - 2
src/pages/service.vue

@@ -5,7 +5,7 @@ import { useListLoader } from '@/composables/useListLoader'
5 5
 import { getParkServiceList } from '@/api/home'
6 6
 import { useGlobal } from '@/composables/index'
7 7
 
8
-const { minioUrl } = useGlobal()
8
+const { minioUrl, pathPre } = useGlobal()
9 9
 
10 10
 const angle = ref(45)
11 11
 // 监听页面滚动
@@ -58,7 +58,7 @@ const goToNavigation = (longitude: string, latitude: string, name: string) => {
58 58
         <view class="service-item">
59 59
           <view class="item-header-wrap">
60 60
             <view class="header-img-box">
61
-              <image :src="item.content.image" mode="aspectFill" />
61
+              <image :src="pathPre + item.content.image" mode="aspectFill" />
62 62
               <view class="header-status-tag" :class="{ 'open-tag': item.content.status !== '建设中' }">{{ item.content.status }}</view>
63 63
             </view>
64 64
             <view class="header-right-box">