fix: record page

This commit is contained in:
zzc
2026-02-09 01:43:50 +08:00
parent 7e0ba078b0
commit 30d7a74fb5
2 changed files with 27 additions and 19 deletions

View File

@@ -15,9 +15,8 @@
</view>
<!-- 新春提示栏 -->
<view class="notice-bar">
<view v-if="noticeList && noticeList.length > 0" class="notice-bar">
<view class="notice-left">
<text class="notice-tag">新品</text>
<swiper
class="notice-swiper"
vertical
@@ -32,6 +31,7 @@
class="notice-swiper-item"
@tap="onNoticeTap(tip)"
>
<text v-if="tip.tag" class="notice-tag">{{ getTagText(tip.tag) }}</text>
<text class="notice-text">{{ tip.text }}</text>
</swiper-item>
</swiper>
@@ -135,7 +135,7 @@ import {
onShow,
} from "@dcloudio/uni-app";
import { getBavBarHeight } from "@/utils/system";
import { getRecommendList, getRandomGreeting } from "@/api/system";
import { getRecommendList, getRandomGreeting, getTipsList } from "@/api/system";
import { getShareToken, saveViewRequest } from "@/utils/common.js";
const countdownText = ref("");
@@ -177,6 +177,7 @@ const dailyGreeting = ref("");
onShow(() => {
updateCountdown();
getIndexTips();
const date = new Date();
todayDate.value = `${date.getMonth() + 1}${date.getDate()}`;
});
@@ -216,6 +217,12 @@ onShareTimeline(() => {
};
});
const getIndexTips = async () => {
const res = await getTipsList();
noticeList.value = res || [];
};
const getRandomGreetingText = async () => {
const content = await getRandomGreeting();
dailyGreeting.value =
@@ -229,27 +236,21 @@ const useGreeting = () => {
});
};
const noticeList = ref([
{
text: "新春祝福上新品了,点击查看",
url: "https://mp.weixin.qq.com/s/mK438jWsYzsccJ2dDJG15A",
},
{
text: "新春祝福上新品了3点击查看",
url: "https://mp.weixin.qq.com/s/mK438jWsYzsccJ2dDJG15A",
},
{
text: "新春祝福上新品了3点击查看",
url: "https://mp.weixin.qq.com/s/mK438jWsYzsccJ2dDJG15A",
},
]);
const noticeList = ref([]);
const onNoticeTap = (tip) => {
if (!tip.url) return;
uni.navigateTo({
if (tip.type === "path") {
uni.navigateTo({ url: tip.url });
} else if (tip.type === "switchTab") {
uni.switchTab({ url: tip.url });
} else {
// 默认跳转 webview (公众号文章)
uni.navigateTo({
url: "/pages/webview/index?url=" + encodeURIComponent(tip.url),
});
}
};
const features = ref([
@@ -322,7 +323,7 @@ const fetchRecommendList = async (isRefresh = false) => {
const getTagText = (tag) => {
const map = {
hot: "热门",
new: "新",
new: "新",
featured: "精选",
hot2: "爆款",
};