Selaa lähdekoodia

优化小程序

yanj 3 kuukautta sitten
vanhempi
commit
f990b07fab

+ 2 - 1
pages/exhibitor/components/exhibit-item.vue

@@ -3,7 +3,8 @@
 		<view class="exhibit-body">
 			<view class="exhibitor-body">
 				<view class="exhibitor-logo">
-					<image :src="item.pic + '?x-oss-process=image/resize,w_400'" mode="aspectFit" />
+          <image v-if="item && item.pic" :src="item.pic + '?x-oss-process=image/resize,w_400'" mode="aspectFit" />
+          <image v-else src="https://onlinecatelogue.productronicachina.com.cn/assets/image/normal-logo.jpg" mode="aspectFit" />
 				</view>
 				<view class="exhibitor-name">{{ item.name }}</view>
 				<view class="exhibitor-number">

+ 2 - 1
pages/exhibitor/components/exhibitor-card.vue

@@ -4,7 +4,8 @@
       <view class="exhibitor-card">
         <view class="exhibitor-info">
           <view class="exhibitor-logo">
-            <image :src="exhibit.exhibitors_logo + '?x-oss-process=image/resize,w_400'" mode="widthFix" />
+            <image v-if="exhibit && exhibit.exhibitors_logo" :src="exhibit.exhibitors_logo + '?x-oss-process=image/resize,w_400'" mode="aspectFit" />
+            <image v-else src="https://onlinecatelogue.productronicachina.com.cn/assets/image/normal-logo.jpg" mode="aspectFit" />
           </view>
           <view class="exhibitor-name-cn">{{ exhibit.exhibitors_name_zh_cn }}</view>
           <view class="exhibitor-name-en">{{ exhibit.exhibitors_name_en_us }}</view>

+ 4 - 1
pages/exhibitor/components/exhibitor-item.vue

@@ -1,7 +1,10 @@
 <template>
 	<view class="exhibitor-item" hover-class="active" @click="onClickExhibitor(item)">
 		<view class="exhibitor-body">
-			<view class="exhibitor-logo"><image :src="item.logo" mode="aspectFit" /></view>
+			<view class="exhibitor-logo">
+        <image v-if="item && item.pic" :src="item.pic + '?x-oss-process=image/resize,w_400'" mode="aspectFit" />
+        <image v-else src="https://onlinecatelogue.productronicachina.com.cn/assets/image/normal-logo.jpg" mode="aspectFit" />
+      </view>
 			<view class="exhibitor-name">
 				<view class="exhibitor-name-cn">{{ item.name_zh_cn }}</view>
 				<view class="exhibitor-name-en">{{ item.name_en_us }}</view>

+ 3 - 2
pages/exhibitor/detail.vue

@@ -5,7 +5,8 @@
       <view class="main-container">
         <view class="exhibitor-main">
           <view class="exhibitor-logo">
-            <image :src="exhibitor.logo + '?x-oss-process=image/resize,w_200'" mode="aspectFit"/>
+            <image v-if="exhibitor && exhibitor.exhibitors_logo" :src="exhibitor.exhibitors_logo + '?x-oss-process=image/resize,w_400'" mode="aspectFit" />
+            <image v-else src="https://onlinecatelogue.productronicachina.com.cn/assets/image/normal-logo.jpg" mode="aspectFit" />
           </view>
           <view class="exhibitor-title">
             <view class="exhibitor-title-1">
@@ -14,7 +15,7 @@
             <view class="exhibitor-title-2">
               {{ exhibitor.name_en_us }}
             </view>
-            <view class="exhibitor-title-3">
+            <view class="exhibitor-title-3" v-if="exhibitor.country_name">
               {{ exhibitor.country_name }}
             </view>
           </view>

+ 2 - 2
pages/exhibitor/exhibit.vue

@@ -49,7 +49,7 @@
           </view>
 
         </view>
-				<view class="ad-space" @tap="navigateToAdLink(adInfo.ad_link)">
+				<view class="ad-space" v-if="adInfo && adInfo.ad_file" @tap="navigateToAdLink(adInfo.ad_link)">
 					<image :src="adInfo.ad_file" mode="widthFix" />
 				</view>
 				<van-empty v-if="exhibitList.length === 0" description="暂无数据" />
@@ -144,7 +144,7 @@
 				total: 0,
 				baseUrl: 'https://mp-test-onlinecatelogue.matchexpo.cn',
 				adInfo: {
-					ad_file: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da70a6c76a.png?x-oss-process=image/resize,w_200'
+					ad_file: ''
 				}
 			}
 		},

+ 2 - 2
pages/exhibitor/index.vue

@@ -50,7 +50,7 @@
             </view>
           </view>
         </view>
-        <view class="ad-space" @tap="navigateToAdLink(adInfo.ad_link)">
+        <view class="ad-space" v-if="adInfo && adInfo.ad_file" @tap="navigateToAdLink(adInfo.ad_link)">
           <image :src="adInfo.ad_file" mode="widthFix"/>
         </view>
         <van-empty v-if="exhibitorList.length === 0" description="暂无数据"/>
@@ -156,7 +156,7 @@ export default {
       total: 0,
       baseUrl: 'https://mp-test-onlinecatelogue.matchexpo.cn',
       adInfo: {
-        ad_file: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da70a6c76a.png?x-oss-process=image/resize,w_200'
+        ad_file: ''
       }
     }
   },

+ 2 - 2
pages/index/home.vue

@@ -94,7 +94,7 @@
 		<van-overlay :show="isShow">
 			<view class="ad-wrapper">
 				<view class="img-btn-box">
-					<view class="ad-space" @tap="navigateToAdLink(adInfo.ad_link)">
+					<view class="ad-space" v-if="adInfo && adInfo.ad_file" @tap="navigateToAdLink(adInfo.ad_link)">
 						<image show-menu-by-longpress :src="adInfo.ad_file" mode="widthFix" class="ad-img" />
 					</view>
 					<view class="home-ad-close" @click="closeAd()">
@@ -195,7 +195,7 @@
 				part2: [],
 				part3: [],
 				adInfo: {
-					ad_file: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da70a6c76a.png?x-oss-process=image/resize,w_200'
+					ad_file: ''
 				},
 				isShow: false
 			}

+ 2 - 2
pages/user/index.vue

@@ -46,7 +46,7 @@
             </van-cell>
           </van-cell-group>
         </view>
-        <view class="ad-space" @tap="navigateToAdLink(adInfo.ad_link)">
+        <view class="ad-space" v-if="adInfo && adInfo.ad_file" @tap="navigateToAdLink(adInfo.ad_link)">
           <image :src="adInfo.ad_file" mode="widthFix"/>
         </view>
       </view>
@@ -106,7 +106,7 @@ export default {
   data() {
     return {
       adInfo: {
-        ad_file: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da70a6c76a.png?x-oss-process=image/resize,w_200'
+        ad_file: ''
       }
     }
   },