feat: migrate static pages to native tabbar

This commit is contained in:
2026-04-23 21:25:24 +08:00
parent f3cd0c3a98
commit cd30f57f2c
116 changed files with 7143 additions and 311 deletions

View File

@@ -0,0 +1,42 @@
const { resolveScene } = require('../../../../utils/static-ux/shared')
const { ROUTES, openStaticRoute } = require('../../../../utils/static-ux/route-map')
function createMingliInterpretPageData(rawScene) {
const scene = resolveScene(rawScene, ['default', 'result'], 'default')
return {
title: '命理解读',
scene,
contextText: '围绕命理问题或盘面结果,保留一个学习型解释区块。',
result:
scene === 'result'
? {
title: '学习型命理解读',
summary: '当前静态结果围绕“甲木日主”的基本气象来展示结果版式和引用层级。',
references: ['《滴天髓》重视日主气势', '先看时令,再看格局与用神']
}
: null,
primaryActionText: scene === 'result' ? '重新解读' : '提交解读',
secondaryActionText: '查看排盘'
}
}
Page({
data: createMingliInterpretPageData('default'),
onLoad(options) {
this.setData(createMingliInterpretPageData(options.scene))
},
handlePrimaryTap() {
this.setData(createMingliInterpretPageData(this.data.scene === 'result' ? 'default' : 'result'))
},
handleSecondaryTap() {
openStaticRoute(`${ROUTES.mingli.bazi}?scene=result`, wx)
}
})
module.exports = {
createMingliInterpretPageData
}

View File

@@ -0,0 +1,5 @@
{
"navigationBarTitleText": "命理解读",
"navigationBarBackgroundColor": "#f8f0ee",
"navigationBarTextStyle": "black"
}

View File

@@ -0,0 +1,24 @@
<view class="interpret-page">
<view class="hero-card">
<text class="hero-card__title">{{title}}</text>
<text class="hero-card__desc">{{contextText}}</text>
</view>
<view class="form-card">
<textarea class="form-card__textarea" placeholder="例如:如何理解滴天髓的入门结构?" disabled="{{true}}"></textarea>
<input class="form-card__input" placeholder="解读焦点(可选)" disabled="{{true}}" />
<view class="action-button" bindtap="handlePrimaryTap">{{primaryActionText}}</view>
<view class="action-button action-button--ghost" bindtap="handleSecondaryTap">
{{secondaryActionText}}
</view>
</view>
<view wx:if="{{result}}" class="result-card">
<text class="result-card__title">{{result.title}}</text>
<text class="result-card__desc">{{result.summary}}</text>
<view class="reference-item" wx:for="{{result.references}}" wx:key="index">
<text class="reference-item__dot">·</text>
<text class="reference-item__text">{{item}}</text>
</view>
</view>
</view>

View File

@@ -0,0 +1,91 @@
page {
min-height: 100%;
background: linear-gradient(180deg, #f9f7f5 0%, #f3ebe8 100%);
}
.interpret-page {
box-sizing: border-box;
min-height: 100vh;
padding: 28rpx 20rpx 72rpx;
}
.hero-card,
.form-card,
.result-card {
margin-top: 18rpx;
padding: 24rpx;
border: 1rpx solid rgba(139, 59, 49, 0.08);
border-radius: 28rpx;
background: rgba(255, 252, 248, 0.94);
box-shadow: 0 10rpx 26rpx rgba(139, 59, 49, 0.06);
}
.hero-card {
margin-top: 0;
}
.hero-card__title,
.result-card__title {
display: block;
color: #2c2621;
font-family: 'STSong', 'Songti SC', serif;
font-size: 36rpx;
font-weight: 700;
line-height: 1.3;
}
.hero-card__desc,
.result-card__desc,
.reference-item__text {
display: block;
margin-top: 10rpx;
color: #7a6f64;
font-size: 24rpx;
line-height: 1.7;
}
.form-card__textarea,
.form-card__input {
box-sizing: border-box;
width: 100%;
padding: 18rpx 20rpx;
border: 1rpx solid rgba(139, 90, 60, 0.12);
border-radius: 18rpx;
background: #fff;
color: #5a4335;
font-size: 24rpx;
line-height: 1.6;
}
.form-card__input {
margin-top: 12rpx;
}
.action-button {
margin-top: 16rpx;
padding: 22rpx 24rpx;
border-radius: 22rpx;
background: linear-gradient(135deg, #a64e44 0%, #7a342b 100%);
color: #fff;
font-size: 26rpx;
line-height: 1;
text-align: center;
}
.action-button--ghost {
background: rgba(139, 59, 49, 0.08);
color: #8b3b31;
}
.reference-item {
display: flex;
align-items: flex-start;
margin-top: 10rpx;
}
.reference-item__dot {
margin-right: 10rpx;
color: #8b3b31;
font-size: 26rpx;
line-height: 1.6;
}