hookehuyr

fix(AdPage): 添加默认广告图片并在加载失败时显示

当广告图片URL为空时显示默认图片,避免空白页面
1 <!-- 1 <!--
2 * @Date: 2022-09-19 14:11:06 2 * @Date: 2022-09-19 14:11:06
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2025-09-26 17:20:49 4 + * @LastEditTime: 2025-09-28 14:03:53
5 * @FilePath: /lls_program/src/pages/AdPage/index.vue 5 * @FilePath: /lls_program/src/pages/AdPage/index.vue
6 * @Description: 广告页面 6 * @Description: 广告页面
7 --> 7 -->
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
36 <!-- 背景图片 --> 36 <!-- 背景图片 -->
37 <image 37 <image
38 v-show="!imageLoading && !imageLoadError" 38 v-show="!imageLoading && !imageLoadError"
39 - :src="adImageUrl" 39 + :src="adImageUrl || defaultAdImage"
40 class="ad-background" 40 class="ad-background"
41 mode="scaleToFill" 41 mode="scaleToFill"
42 @tap="handleImageClick" 42 @tap="handleImageClick"
...@@ -75,6 +75,9 @@ import { getMyFamiliesAPI } from "@/api/family"; ...@@ -75,6 +75,9 @@ import { getMyFamiliesAPI } from "@/api/family";
75 import { silentAuth } from "@/utils/authRedirect"; 75 import { silentAuth } from "@/utils/authRedirect";
76 import "./index.less"; 76 import "./index.less";
77 77
78 +// 默认广告图片
79 +const defaultAdImage = 'https://cdn.ipadbiz.cn/space_34093/%E5%BC%95%E5%AF%BC%E9%A1%B51_Fu2ZY_Tm6TL1OzbyrqQkeVRAdVfU.jpg?imageMogr2/strip/quality/60';
80 +
78 // 定义响应式数据 81 // 定义响应式数据
79 const adImageUrl = ref(''); 82 const adImageUrl = ref('');
80 const loading = ref(true); 83 const loading = ref(true);
......