refactor pages struct

This commit is contained in:
Timi
2026-01-28 14:11:54 +08:00
parent 8adc28ae9c
commit 965743be38
73 changed files with 234 additions and 176 deletions

View File

@@ -0,0 +1,9 @@
{
"component": true,
"usingComponents": {
"t-icon": "tdesign-miniprogram/icon/icon",
"t-button": "tdesign-miniprogram/button/button",
"t-navbar": "tdesign-miniprogram/navbar/navbar",
"snowflake": "/components/background/snowflake"
}
}

View File

@@ -0,0 +1,106 @@
/* pages/info/info.less */
page {
display: flex;
flex-direction: column;
}
.info {
height: 100%;
display: flex;
padding: 100rpx 0;
box-sizing: border-box;
flex-direction: column;
.cotainer {
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
.header {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
.logo {
width: 128px;
height: 128px;
display: block;
border-radius: 4px;
box-shadow: 2px 2px 8px var(--theme-shadow-medium);
margin-bottom: 1rem;
}
.name {
margin: 0 .5rem;
display: inline-block;
&.gao {
color: var(--theme-brand-gao);
}
&.yeyu {
color: var(--theme-brand-yeyu);
}
}
}
.text {
color: var(--theme-text-secondary);
font-size: 12px;
text-align: center;
.love {
color: transparent;
font-size: 1.25rem;
animation: loveGradient 1000ms linear infinite;
text-align: center;
background: linear-gradient(90deg, var(--theme-brand-gao-light), var(--theme-brand-gao), var(--theme-brand-gao-dark), var(--theme-brand-gao), var(--theme-brand-gao-light));
font-weight: bold;
font-family: "Arial", sans-serif;
margin-bottom: 1rem;
background-size: 200% 100%;
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
@keyframes loveGradient {
0% {
background-position: 0% 50%;
}
100% {
background-position: 200% 50%;
}
}
}
.footer {
display: flex;
align-items: center;
flex-direction: column;
.exit {
color: var(--theme-error);
width: 10rem;
margin-bottom: 1rem;
}
.item {
font-size: 14px;
text-align: center;
.label {
color: var(--theme-text-secondary);
}
&.copyright {
display: flex;
font-size: 12px;
flex-direction: column;
}
}
}
}
}

View File

@@ -0,0 +1,64 @@
// pages/info/info.ts
import Time from "../../../../utils/Time";
import config from "../../../../config/index"
interface IAboutData {
timer?: number;
total?: number;
beginFriendText: string;
}
Page({
data: <IAboutData>{
copyright: `Copyright © 2017 - ${new Date().getFullYear()} imyeyu.com`,
timer: undefined,
total: undefined,
beginFriendText: "相识 -- 天 -- 小时 -- 分钟 -- 秒",
beginLoveText: "相恋 -- 天 -- 小时 -- 分钟 -- 秒"
},
onShow() {
const beginLove = new Date("2025/11/10 00:10:00");
const beginFriend = new Date("2025/06/28 16:00:00");
const timer = setInterval(() => {
{
const r = Time.between(beginLove)
this.setData({
beginLoveText: `相恋 ${r.d}${r.h} 小时 ${r.m.toString().padStart(2, "0")} 分钟 ${r.s.toString().padStart(2, "0")}`
})
}
{
const r = Time.between(beginFriend)
this.setData({
beginFriendText: `相识 ${r.d}${r.h} 小时 ${r.m.toString().padStart(2, "0")} 分钟 ${r.s.toString().padStart(2, "0")}`
})
}
}, 1000)
this.setData({
timer
});
wx.request({
url: `${config.url}/journal/total`,
method: "GET",
header: {
Key: wx.getStorageSync("key")
},
success: (resp: any) => {
this.setData({
total: resp.data.data
});
}
});
},
onHide() {
this.data.timer && clearInterval(this.data.timer);
},
exit() {
wx.redirectTo({
"url": "/pages/index/index?from=info"
})
}
})

View File

@@ -0,0 +1,37 @@
<!--pages/info/info.wxml-->
<snowflake />
<t-navbar title="关于我们" placeholder />
<scroll-view class="info" scroll-y>
<view class="cotainer">
<view class="header">
<image class="logo" src="/assets/image/logo.png"></image>
<view>
<text>记录</text>
<text class="name gao">小糕</text>
<text>和</text>
<text class="name yeyu">夜雨</text>
<text>的美好回忆</text>
</view>
</view>
<view class="text">
<view class="love">{{beginLoveText}}</view>
<view>{{beginFriendText}}</view>
<view wx:if="{{total}}">已留住 {{total}} 个我们的瞬间</view>
</view>
<view class="footer">
<t-button class="exit" bind:tap="exit">退出</t-button>
<view class="item">
<text class="label">开发者:</text>
<text>夜雨</text>
</view>
<view class="item">
<text class="label">版本:</text>
<text>1.6.6</text>
</view>
<view class="item copyright">
<text>{{copyright}}</text>
<text>All Rights Reserved 夜雨 版权所有</text>
</view>
</view>
</view>
</scroll-view>