fix: daily page

This commit is contained in:
zzc
2026-03-01 22:58:21 +08:00
parent 99cf4249db
commit f4004da994
2 changed files with 70 additions and 12 deletions

View File

@@ -1,9 +1,9 @@
<template>
<view class="daily-page">
<NavBar title="每日精选" :transparent="true" color="#333" />
<NavBar title="每日精选" color="#333" />
<!-- Header -->
<view class="page-header" :style="{ paddingTop: navBarHeight + 'px' }">
<view class="page-header">
<view class="header-left">
<uni-icons type="sun-filled" size="24" color="#ff9800" />
<text class="header-title">{{ greetingTitle }}</text>
@@ -15,9 +15,6 @@
<text class="fire-icon">🔥</text>
</view>
</view>
<view class="sub-header">
<text>{{ dateStr }} 灵马送福 · 每日精选</text>
</view>
<!-- Main Card -->
<view class="main-card-container">
@@ -30,8 +27,8 @@
}}</text>
</view>
<view class="quote-divider"></view>
<view class="quote-author">
<text> {{ currentQuote.author }} 的专属问候</text>
<view class="quote-author" v-if="authorName">
<text> {{ authorName }} 的专属问候</text>
</view>
<view class="card-actions">
@@ -39,8 +36,15 @@
<uni-icons type="loop" size="16" color="#666" />
<text>换一句</text>
</view>
<!-- Placeholder for layout balance -->
<view style="width: 160rpx"></view>
<view class="author-edit-box">
<input
class="input"
type="text"
v-model="authorName"
placeholder="输入名字生成专属问候"
/>
</view>
</view>
</view>
</view>
@@ -131,7 +135,7 @@
</template>
<script setup>
import { ref, computed, onMounted } from "vue";
import { ref, computed, onMounted, watch } from "vue";
import { getBavBarHeight } from "@/utils/system";
import NavBar from "@/components/NavBar/NavBar.vue";
@@ -206,6 +210,16 @@ const quotes = {
};
const currentQuote = ref(quotes.vitality[0]);
const authorName = ref("");
// Remove automatic sync with quote author to allow custom input to persist
// watch(
// currentQuote,
// (newVal) => {
// authorName.value = newVal.author;
// },
// { deep: true }
// );
const hotList = ref([
{ text: "新的一年,愿灵马带走烦恼...", count: "2.4" },
@@ -237,7 +251,9 @@ const saveCard = () => {
const sendGreeting = () => {
uni.navigateTo({
url: `/pages/make/index?scene=daily&content=${encodeURIComponent(currentQuote.value.text)}`,
url: `/pages/make/index?scene=daily&content=${encodeURIComponent(
currentQuote.value.text,
)}&author=${encodeURIComponent(authorName.value)}`,
});
};
</script>
@@ -254,7 +270,7 @@ const sendGreeting = () => {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8rpx;
margin-bottom: 15rpx;
}
.header-left {
@@ -400,6 +416,41 @@ const sendGreeting = () => {
}
}
.author-edit-box {
flex: 1;
margin-left: 24rpx;
background: #f9f9f9;
border: 2rpx solid #eee;
border-radius: 40rpx;
height: 80rpx;
display: flex;
align-items: center;
padding: 0 24rpx;
transition: all 0.3s ease;
&:active,
&:focus-within {
background: #fff;
border-color: #ff9800;
box-shadow: 0 4rpx 16rpx rgba(255, 152, 0, 0.15);
}
.label {
font-size: 24rpx;
color: #999;
margin-right: 12rpx;
font-weight: 500;
white-space: nowrap;
}
.input {
flex: 1;
height: 100%;
font-size: 28rpx;
color: #333;
}
}
/* Categories */
.category-section {
padding: 0 32rpx;

View File

@@ -966,6 +966,13 @@ onLoad((options) => {
scenePopup.value.open();
}, 200);
}
if (options.content) {
blessingText.value = { content: decodeURIComponent(options.content) };
}
if (options.author) {
signatureName.value = decodeURIComponent(options.author);
}
});
const loadData = () => {