fix: daily page
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="daily-page">
|
<view class="daily-page">
|
||||||
<NavBar title="每日精选" :transparent="true" color="#333" />
|
<NavBar title="每日精选" color="#333" />
|
||||||
|
|
||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<view class="page-header" :style="{ paddingTop: navBarHeight + 'px' }">
|
<view class="page-header">
|
||||||
<view class="header-left">
|
<view class="header-left">
|
||||||
<uni-icons type="sun-filled" size="24" color="#ff9800" />
|
<uni-icons type="sun-filled" size="24" color="#ff9800" />
|
||||||
<text class="header-title">{{ greetingTitle }}</text>
|
<text class="header-title">{{ greetingTitle }}</text>
|
||||||
@@ -15,9 +15,6 @@
|
|||||||
<text class="fire-icon">🔥</text>
|
<text class="fire-icon">🔥</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="sub-header">
|
|
||||||
<text>{{ dateStr }} 灵马送福 · 每日精选</text>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- Main Card -->
|
<!-- Main Card -->
|
||||||
<view class="main-card-container">
|
<view class="main-card-container">
|
||||||
@@ -30,8 +27,8 @@
|
|||||||
}}</text>
|
}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="quote-divider"></view>
|
<view class="quote-divider"></view>
|
||||||
<view class="quote-author">
|
<view class="quote-author" v-if="authorName">
|
||||||
<text>—— {{ currentQuote.author }} 的专属问候</text>
|
<text>—— {{ authorName }} 的专属问候</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="card-actions">
|
<view class="card-actions">
|
||||||
@@ -39,8 +36,15 @@
|
|||||||
<uni-icons type="loop" size="16" color="#666" />
|
<uni-icons type="loop" size="16" color="#666" />
|
||||||
<text>换一句</text>
|
<text>换一句</text>
|
||||||
</view>
|
</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>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -131,7 +135,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onMounted } from "vue";
|
import { ref, computed, onMounted, watch } from "vue";
|
||||||
import { getBavBarHeight } from "@/utils/system";
|
import { getBavBarHeight } from "@/utils/system";
|
||||||
import NavBar from "@/components/NavBar/NavBar.vue";
|
import NavBar from "@/components/NavBar/NavBar.vue";
|
||||||
|
|
||||||
@@ -206,6 +210,16 @@ const quotes = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const currentQuote = ref(quotes.vitality[0]);
|
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([
|
const hotList = ref([
|
||||||
{ text: "新的一年,愿灵马带走烦恼...", count: "2.4" },
|
{ text: "新的一年,愿灵马带走烦恼...", count: "2.4" },
|
||||||
@@ -237,7 +251,9 @@ const saveCard = () => {
|
|||||||
|
|
||||||
const sendGreeting = () => {
|
const sendGreeting = () => {
|
||||||
uni.navigateTo({
|
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>
|
</script>
|
||||||
@@ -254,7 +270,7 @@ const sendGreeting = () => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 8rpx;
|
margin-bottom: 15rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-left {
|
.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 */
|
/* Categories */
|
||||||
.category-section {
|
.category-section {
|
||||||
padding: 0 32rpx;
|
padding: 0 32rpx;
|
||||||
|
|||||||
@@ -966,6 +966,13 @@ onLoad((options) => {
|
|||||||
scenePopup.value.open();
|
scenePopup.value.open();
|
||||||
}, 200);
|
}, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.content) {
|
||||||
|
blessingText.value = { content: decodeURIComponent(options.content) };
|
||||||
|
}
|
||||||
|
if (options.author) {
|
||||||
|
signatureName.value = decodeURIComponent(options.author);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const loadData = () => {
|
const loadData = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user