feat: 完善见素起名小程序功能
- 添加收藏锦囊功能,支持查看和删除收藏 - 实现积分系统,每日赠送5次灵感次数 - 添加静心阅读功能,阅读15秒可获得额外次数 - 实现灵感广场,展示用户分享的名字 - 添加字源溯源组件,长按汉字查看详情 - 优化空状态和结语卡片样式统一 - 添加音频控制(静音/风铃/雨落/古琴/白噪音/森林/溪流) - 优化名字生成逻辑,确保每次返回5个不重复名字 - 修复卡片翻转样式问题 - 移除首页动态提醒气泡
This commit is contained in:
@@ -11,8 +11,19 @@ Page({
|
||||
]
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
onLoad(options) {
|
||||
// 页面加载时检查是否需要重置状态
|
||||
// 处理从其他页面传入的参数
|
||||
if (options.keyword) {
|
||||
this.setData({
|
||||
keyword: decodeURIComponent(options.keyword)
|
||||
});
|
||||
}
|
||||
if (options.mode) {
|
||||
this.setData({
|
||||
activeMode: options.mode
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
onShow() {
|
||||
@@ -22,6 +33,13 @@ Page({
|
||||
});
|
||||
},
|
||||
|
||||
// 跳转到灵感广场
|
||||
goToSquare() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/square/square'
|
||||
});
|
||||
},
|
||||
|
||||
// 选择模式
|
||||
selectMode(e) {
|
||||
const mode = e.currentTarget.dataset.mode;
|
||||
@@ -89,7 +107,7 @@ Page({
|
||||
if (activeMode === 'baby' && surname) {
|
||||
url += `&surname=${encodeURIComponent(surname)}`;
|
||||
}
|
||||
|
||||
|
||||
wx.navigateTo({
|
||||
url: url
|
||||
});
|
||||
|
||||
@@ -52,6 +52,12 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 灵感广场入口 -->
|
||||
<view class="square-entry {{isGenerating ? 'fade-out' : ''}}" bindtap="goToSquare">
|
||||
<text class="entry-text">入林搜寻灵感</text>
|
||||
<view class="entry-arrow"></view>
|
||||
</view>
|
||||
|
||||
<view class="footer {{isGenerating ? 'fade-out' : ''}}">
|
||||
<text>© 见素 · 审美溢价</text>
|
||||
</view>
|
||||
|
||||
@@ -231,3 +231,42 @@ page {
|
||||
70% { opacity: 0; }
|
||||
100% { opacity: 1; }
|
||||
}
|
||||
|
||||
/* 灵感广场入口 */
|
||||
.square-entry {
|
||||
position: fixed;
|
||||
bottom: 140rpx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 20rpx 40rpx;
|
||||
opacity: 0.5;
|
||||
transition: opacity 0.3s ease;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.square-entry:active {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.square-entry.fade-out {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.entry-text {
|
||||
font-size: 24rpx;
|
||||
color: #888888;
|
||||
letter-spacing: 4rpx;
|
||||
font-family: "Noto Serif SC", serif;
|
||||
}
|
||||
|
||||
.entry-arrow {
|
||||
width: 10rpx;
|
||||
height: 10rpx;
|
||||
border-right: 1rpx solid #888888;
|
||||
border-top: 1rpx solid #888888;
|
||||
transform: rotate(45deg);
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user