修改完成待测试
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view
|
||||
v-if="promotionState === 'error' || promotions.length"
|
||||
v-if="showEmpty || promotionState === 'error' || promotions.length"
|
||||
class="promotion-strip"
|
||||
:aria-label="title"
|
||||
>
|
||||
@@ -8,10 +8,16 @@
|
||||
<view class="promotion-strip__mark" aria-hidden="true"></view>
|
||||
<text>{{ title }}</text>
|
||||
</view>
|
||||
<view v-if="promotionState === 'error'" class="promotion-strip__error">
|
||||
<view v-if="promotionState === 'loading'" class="promotion-strip__state">
|
||||
<text>正在加载广告内容…</text>
|
||||
</view>
|
||||
<view v-else-if="promotionState === 'error'" class="promotion-strip__error">
|
||||
<text>推荐内容暂时没有显示</text>
|
||||
<button @click="loadPromotions">重新加载</button>
|
||||
</view>
|
||||
<view v-else-if="!promotions.length" class="promotion-strip__state">
|
||||
<text>暂无广告内容</text>
|
||||
</view>
|
||||
<scroll-view v-else class="promotion-strip__scroll" scroll-x :show-scrollbar="false">
|
||||
<view class="promotion-strip__list">
|
||||
<view
|
||||
@@ -63,6 +69,7 @@ import { openSiteContentTarget } from "@/utils/navigation/gateway.js";
|
||||
const props = defineProps({
|
||||
placement: { type: String, required: true },
|
||||
title: { type: String, default: "推荐内容" },
|
||||
showEmpty: { type: Boolean, default: false },
|
||||
});
|
||||
|
||||
const promotions = ref([]);
|
||||
@@ -216,6 +223,13 @@ onBeforeUnmount(() => {
|
||||
font-size: clamp(13px, 21rpx, 16px);
|
||||
}
|
||||
|
||||
.promotion-strip__state {
|
||||
padding: 12rpx 22rpx 18rpx;
|
||||
color: #766252;
|
||||
font-size: clamp(13px, 21rpx, 16px);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.promotion-strip__error button {
|
||||
margin: 0;
|
||||
padding: 8rpx 18rpx;
|
||||
|
||||
Reference in New Issue
Block a user