fix: daily page
This commit is contained in:
@@ -23,8 +23,7 @@
|
||||
<!-- Main Card -->
|
||||
<view class="main-card-container">
|
||||
<view
|
||||
class="greeting-card"
|
||||
id="shareCard"
|
||||
class="quote-card"
|
||||
:style="
|
||||
backgroundUrl
|
||||
? {
|
||||
@@ -35,86 +34,29 @@
|
||||
: {}
|
||||
"
|
||||
>
|
||||
<view class="card-icon">
|
||||
<uni-icons type="star-filled" size="32" color="#e6b800" />
|
||||
<view class="sparkle s1">✨</view>
|
||||
<view class="sparkle s2">✨</view>
|
||||
<view class="quote-icon">❝</view>
|
||||
<view class="quote-content">
|
||||
<text class="quote-text">{{ content }}</text>
|
||||
<text class="quote-highlight" v-if="highlight">{{ highlight }}</text>
|
||||
</view>
|
||||
|
||||
<view class="card-content">
|
||||
<text class="card-text">{{ content }}</text>
|
||||
<text class="card-highlight" v-if="highlight">{{ highlight }}</text>
|
||||
</view>
|
||||
|
||||
<view class="card-divider"></view>
|
||||
|
||||
<view class="card-footer">
|
||||
<text class="footer-label">SIGNATURE</text>
|
||||
<text class="footer-name">—— {{ author || "专属问候" }}</text>
|
||||
<view class="quote-divider"></view>
|
||||
<view class="quote-author">
|
||||
<text>—— {{ author ? ` ${author} 的专属问候` : "专属问候" }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- Action Buttons -->
|
||||
<view class="action-buttons">
|
||||
<button class="btn secondary" @tap="navToMake">
|
||||
<view class="btn-icon red-icon">
|
||||
<uni-icons type="paperplane-filled" size="18" color="#d81e06" />
|
||||
</view>
|
||||
<button class="btn primary-btn" @tap="navToMake">
|
||||
<uni-icons type="paperplane-filled" size="20" color="#fff" />
|
||||
<text>我也要送问候</text>
|
||||
</button>
|
||||
<button class="btn secondary" @tap="savePoster">
|
||||
<view class="btn-icon">
|
||||
<uni-icons type="camera-filled" size="18" color="#666" />
|
||||
</view>
|
||||
<text>保存为海报</text>
|
||||
</button>
|
||||
</view>
|
||||
|
||||
<!-- Hot List -->
|
||||
<view class="hot-list-section">
|
||||
<view class="section-header">
|
||||
<view class="title-bar"></view>
|
||||
<text class="section-title">大家都在送的温暖</text>
|
||||
<view class="footer-tip safe-area-bottom">
|
||||
<text>愿每一天都充满阳光与希望</text>
|
||||
</view>
|
||||
|
||||
<view class="hot-list">
|
||||
<view
|
||||
v-for="(item, index) in hotList"
|
||||
:key="index"
|
||||
class="hot-item"
|
||||
@tap="useHotItem(item)"
|
||||
>
|
||||
<view class="item-icon-box" :style="{ background: item.bg }">
|
||||
<text class="item-emoji">{{ item.emoji }}</text>
|
||||
</view>
|
||||
<view class="item-content">
|
||||
<text class="item-text">{{ item.text }}</text>
|
||||
<text class="item-count">{{ item.count }} 人已收藏</text>
|
||||
</view>
|
||||
<uni-icons type="right" size="14" color="#ccc" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- Floating Lucky Button -->
|
||||
<view class="lucky-btn-container safe-area-bottom">
|
||||
<button class="lucky-btn" @tap="navToDaily">
|
||||
<view class="btn-content">
|
||||
<view class="stars">✨</view>
|
||||
<text>抽一句我的今日好运</text>
|
||||
<view class="badge">LUCKY</view>
|
||||
</view>
|
||||
</button>
|
||||
</view>
|
||||
|
||||
<!-- Canvas for Poster -->
|
||||
<canvas
|
||||
type="2d"
|
||||
id="posterCanvas"
|
||||
class="hidden-canvas"
|
||||
style="width: 375px; height: 600px"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -136,21 +78,6 @@ const author = ref("陈小明");
|
||||
const highlight = ref("");
|
||||
const backgroundUrl = ref("");
|
||||
|
||||
const hotList = ref([
|
||||
{
|
||||
text: "新的一年,愿灵马带走烦恼,留下...",
|
||||
count: "3.2k",
|
||||
emoji: "🌅",
|
||||
bg: "#fff8e1",
|
||||
},
|
||||
{
|
||||
text: "星光不问赶路人,时光不负有心人。",
|
||||
count: "1.8k",
|
||||
emoji: "✨",
|
||||
bg: "#e8f5e9",
|
||||
},
|
||||
]);
|
||||
|
||||
onLoad(async (options) => {
|
||||
if (options.shareToken) {
|
||||
const detail = await getPageDetail(options.shareToken);
|
||||
@@ -172,39 +99,15 @@ onLoad(async (options) => {
|
||||
author.value = detail.signature || "专属问候";
|
||||
backgroundUrl.value = detail.imageUrl || "";
|
||||
}
|
||||
} else {
|
||||
// Fallback to query params if no shareToken (legacy support or direct link)
|
||||
if (options.content) content.value = decodeURIComponent(options.content);
|
||||
if (options.author) author.value = decodeURIComponent(options.author);
|
||||
if (options.fromUser) fromUser.value = decodeURIComponent(options.fromUser);
|
||||
if (options.fromAvatar)
|
||||
fromAvatar.value = decodeURIComponent(options.fromAvatar);
|
||||
}
|
||||
});
|
||||
|
||||
const navToMake = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pages/make/index?scene=daily",
|
||||
});
|
||||
};
|
||||
|
||||
const navToDaily = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pages/greeting/daily",
|
||||
});
|
||||
};
|
||||
|
||||
const useHotItem = (item) => {
|
||||
uni.navigateTo({
|
||||
url: `/pages/make/index?scene=daily&content=${encodeURIComponent(item.text)}`,
|
||||
});
|
||||
};
|
||||
|
||||
const savePoster = () => {
|
||||
uni.showToast({ title: "海报生成功能开发中", icon: "none" });
|
||||
// Implementation for poster generation would go here
|
||||
};
|
||||
|
||||
onShareAppMessage(() => {
|
||||
return {
|
||||
title: `${fromUser.value || "好友"}给你发来了一份今日问候`,
|
||||
@@ -258,281 +161,125 @@ onShareAppMessage(() => {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/* Greeting Card */
|
||||
/* Greeting Card - Adapted from daily.vue quote-card */
|
||||
.main-card-container {
|
||||
padding: 0 40rpx;
|
||||
margin-bottom: 60rpx;
|
||||
margin-bottom: 80rpx;
|
||||
}
|
||||
|
||||
.greeting-card {
|
||||
.quote-card {
|
||||
background: #fff;
|
||||
border-radius: 40rpx;
|
||||
padding: 60rpx 40rpx;
|
||||
padding: 60rpx 40rpx 40rpx;
|
||||
box-shadow: 0 20rpx 60rpx rgba(0, 0, 0, 0.08);
|
||||
border: 4rpx solid #f5e6d3; /* Gold-ish border */
|
||||
position: relative;
|
||||
min-height: 700rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 20rpx 60rpx rgba(0, 0, 0, 0.06);
|
||||
border: 2rpx solid #fff;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.card-icon {
|
||||
position: relative;
|
||||
margin-bottom: 60rpx;
|
||||
|
||||
.sparkle {
|
||||
/* Inner Border Effect */
|
||||
&::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.s1 {
|
||||
top: -10rpx;
|
||||
right: -20rpx;
|
||||
opacity: 0.8;
|
||||
}
|
||||
.s2 {
|
||||
bottom: -10rpx;
|
||||
left: -20rpx;
|
||||
opacity: 0.6;
|
||||
font-size: 20rpx;
|
||||
inset: 12rpx;
|
||||
border: 2rpx solid #f9f3e8;
|
||||
border-radius: 32rpx;
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
|
||||
.card-content {
|
||||
margin-bottom: 60rpx;
|
||||
.quote-icon {
|
||||
font-size: 80rpx;
|
||||
color: #f5e6d3;
|
||||
margin-bottom: 40rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.quote-content {
|
||||
text-align: center;
|
||||
margin-bottom: 60rpx;
|
||||
}
|
||||
|
||||
.card-text {
|
||||
font-size: 44rpx;
|
||||
.quote-text {
|
||||
font-size: 40rpx;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
line-height: 1.8;
|
||||
line-height: 1.6;
|
||||
font-family: "Songti SC", serif;
|
||||
display: block;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.card-highlight {
|
||||
.quote-highlight {
|
||||
display: block;
|
||||
font-size: 48rpx;
|
||||
font-size: 44rpx;
|
||||
color: #d81e06;
|
||||
font-weight: 800;
|
||||
margin-top: 20rpx;
|
||||
font-family: "Songti SC", serif;
|
||||
}
|
||||
|
||||
.card-divider {
|
||||
width: 60rpx;
|
||||
.quote-divider {
|
||||
width: 80rpx;
|
||||
height: 2rpx;
|
||||
background: #f0f0f0;
|
||||
background: #eee;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.card-footer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.footer-label {
|
||||
font-size: 20rpx;
|
||||
color: #d4a017;
|
||||
letter-spacing: 2rpx;
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.footer-name {
|
||||
.quote-author {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
color: #999;
|
||||
font-style: italic;
|
||||
font-family: "Songti SC", serif;
|
||||
}
|
||||
|
||||
/* Action Buttons */
|
||||
.action-buttons {
|
||||
padding: 0 40rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 24rpx;
|
||||
margin-bottom: 60rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
height: 100rpx;
|
||||
border-radius: 50rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
border: none;
|
||||
position: relative;
|
||||
|
||||
&::after {
|
||||
border: none;
|
||||
}
|
||||
&:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
}
|
||||
|
||||
.btn.secondary {
|
||||
background: #fff;
|
||||
color: #333;
|
||||
box-shadow: 0 8rpx 20rpx rgba(0, 0, 0, 0.03);
|
||||
|
||||
.btn-icon {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 50%;
|
||||
background: #f5f5f5;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 20rpx;
|
||||
|
||||
&.red-icon {
|
||||
background: #ffebee;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Hot List */
|
||||
.hot-list-section {
|
||||
padding: 0 40rpx;
|
||||
padding: 0 60rpx;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.section-header {
|
||||
.btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.title-bar {
|
||||
width: 8rpx;
|
||||
height: 28rpx;
|
||||
background: #d4a017;
|
||||
border-radius: 4rpx;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 30rpx;
|
||||
justify-content: center;
|
||||
gap: 12rpx;
|
||||
height: 96rpx;
|
||||
border-radius: 48rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.hot-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.hot-item {
|
||||
background: #fff;
|
||||
padding: 24rpx;
|
||||
border-radius: 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
|
||||
&:active {
|
||||
background: #f9f9f9;
|
||||
}
|
||||
}
|
||||
|
||||
.item-icon-box {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 16rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.item-emoji {
|
||||
font-size: 40rpx;
|
||||
}
|
||||
|
||||
.item-content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.item-text {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.item-count {
|
||||
font-size: 22rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/* Lucky Button */
|
||||
.lucky-btn-container {
|
||||
position: fixed;
|
||||
bottom: 40rpx;
|
||||
left: 40rpx;
|
||||
right: 40rpx;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.lucky-btn {
|
||||
background: linear-gradient(135deg, #a33b3b 0%, #8e0000 100%);
|
||||
color: #fff;
|
||||
height: 110rpx;
|
||||
border-radius: 55rpx;
|
||||
border: none;
|
||||
box-shadow: 0 10rpx 30rpx rgba(142, 0, 0, 0.3);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: all 0.2s;
|
||||
|
||||
&::after {
|
||||
border: none;
|
||||
}
|
||||
|
||||
&:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
}
|
||||
|
||||
.btn-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
.primary-btn {
|
||||
background: linear-gradient(135deg, #8e0000 0%, #600000 100%);
|
||||
color: #fff;
|
||||
box-shadow: 0 8rpx 24rpx rgba(142, 0, 0, 0.3);
|
||||
|
||||
.stars {
|
||||
font-size: 36rpx;
|
||||
}
|
||||
|
||||
.badge {
|
||||
background: #ffd700;
|
||||
color: #8e0000;
|
||||
font-size: 20rpx;
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: 20rpx;
|
||||
font-weight: 800;
|
||||
margin-left: 8rpx;
|
||||
&:active {
|
||||
box-shadow: 0 4rpx 12rpx rgba(142, 0, 0, 0.2);
|
||||
}
|
||||
}
|
||||
|
||||
.hidden-canvas {
|
||||
position: fixed;
|
||||
left: 9999px;
|
||||
top: 0;
|
||||
.footer-tip {
|
||||
text-align: center;
|
||||
padding: 40rpx 0;
|
||||
|
||||
text {
|
||||
font-size: 24rpx;
|
||||
color: #ccc;
|
||||
letter-spacing: 4rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import { ref, onMounted } from "vue";
|
||||
import NavBar from "@/components/NavBar/NavBar.vue";
|
||||
import { trackRecord } from "@/utils/common.js";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user