feat: migrate static pages to native tabbar
This commit is contained in:
99
packages/tcm/pages/placeholder/index.js
Normal file
99
packages/tcm/pages/placeholder/index.js
Normal file
@@ -0,0 +1,99 @@
|
||||
const { ROUTES, openStaticRoute } = require('../../../../utils/static-ux/route-map')
|
||||
|
||||
const PLACEHOLDER_SURFACES = Object.freeze({
|
||||
membership: {
|
||||
title: '开通会员',
|
||||
eyebrow: 'Membership',
|
||||
description: '会员页当前只承接静态展示,后续接入新的权益体系时保持当前信息层级。',
|
||||
tips: [
|
||||
'保留老页面的会员引导区块和 CTA 位置',
|
||||
'不迁移旧项目的付费逻辑、订单状态和接口',
|
||||
'后续只在这里接新的会员说明与权益列表'
|
||||
]
|
||||
},
|
||||
feedback: {
|
||||
title: '意见反馈',
|
||||
eyebrow: 'Feedback',
|
||||
description: '反馈入口先保留为静态说明页,用来承接“我的”页的跳转。',
|
||||
tips: [
|
||||
'后续可接表单或工单系统',
|
||||
'当前不提交任何内容',
|
||||
'只保留页面层级和提示文案'
|
||||
]
|
||||
},
|
||||
share: {
|
||||
title: '分享 APP',
|
||||
eyebrow: 'Share',
|
||||
description: '分享页先保留 UI 占位,不接旧项目的传播逻辑。',
|
||||
tips: [
|
||||
'后续可接小程序分享卡片',
|
||||
'当前只展示说明与返回入口',
|
||||
'不接邀请码、海报或裂变结构'
|
||||
]
|
||||
},
|
||||
about: {
|
||||
title: '关于我们',
|
||||
eyebrow: 'About',
|
||||
description: '关于页保持静态信息卡片结构,为后续新内容预留容器。',
|
||||
tips: [
|
||||
'保留页面标题和说明卡片',
|
||||
'后续可以接版本信息与项目介绍',
|
||||
'当前不复用旧工程中的关于数据结构'
|
||||
]
|
||||
},
|
||||
settings: {
|
||||
title: '设置',
|
||||
eyebrow: 'Settings',
|
||||
description: '设置页先只保留静态说明,不接旧登录态和缓存策略。',
|
||||
tips: [
|
||||
'后续可接新账号体系下的设置项',
|
||||
'当前不读写 storage',
|
||||
'不迁移旧项目的 session 或偏好逻辑'
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
function createTcmPlaceholderPageData(kind) {
|
||||
const activeKind = Object.prototype.hasOwnProperty.call(PLACEHOLDER_SURFACES, kind) ? kind : 'about'
|
||||
const surface = PLACEHOLDER_SURFACES[activeKind]
|
||||
|
||||
return {
|
||||
kind: activeKind,
|
||||
title: surface.title,
|
||||
eyebrow: surface.eyebrow,
|
||||
description: surface.description,
|
||||
tips: [...surface.tips],
|
||||
actions: [
|
||||
{
|
||||
key: 'back-home',
|
||||
title: '返回首页',
|
||||
actionType: 'tab',
|
||||
route: ROUTES.tabs.home
|
||||
},
|
||||
{
|
||||
key: 'go-profile',
|
||||
title: '去我的页',
|
||||
actionType: 'tab',
|
||||
route: ROUTES.tabs.profile
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Page({
|
||||
data: createTcmPlaceholderPageData('about'),
|
||||
|
||||
onLoad(options) {
|
||||
this.setData(createTcmPlaceholderPageData(options.kind))
|
||||
},
|
||||
|
||||
handleActionTap(event) {
|
||||
const { route } = event.currentTarget.dataset
|
||||
|
||||
openStaticRoute(route, wx)
|
||||
}
|
||||
})
|
||||
|
||||
module.exports = {
|
||||
createTcmPlaceholderPageData
|
||||
}
|
||||
5
packages/tcm/pages/placeholder/index.json
Normal file
5
packages/tcm/pages/placeholder/index.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"navigationBarTitleText": "说明页",
|
||||
"navigationBarBackgroundColor": "#f8ecd8",
|
||||
"navigationBarTextStyle": "black"
|
||||
}
|
||||
26
packages/tcm/pages/placeholder/index.wxml
Normal file
26
packages/tcm/pages/placeholder/index.wxml
Normal file
@@ -0,0 +1,26 @@
|
||||
<view class="placeholder-page">
|
||||
<view class="hero-card">
|
||||
<text class="hero-card__eyebrow">{{eyebrow}}</text>
|
||||
<text class="hero-card__title">{{title}}</text>
|
||||
<text class="hero-card__description">{{description}}</text>
|
||||
</view>
|
||||
|
||||
<view class="tips-card">
|
||||
<text class="tips-card__title">当前状态</text>
|
||||
<view class="tips-card__item" wx:for="{{tips}}" wx:key="index">
|
||||
<text class="tips-card__dot">•</text>
|
||||
<text class="tips-card__text">{{item}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view
|
||||
class="action-row__button {{item.key === 'go-profile' ? 'action-row__button--ghost' : ''}}"
|
||||
wx:for="{{actions}}"
|
||||
wx:key="key"
|
||||
data-action-type="{{item.actionType}}"
|
||||
data-route="{{item.route}}"
|
||||
bindtap="handleActionTap"
|
||||
>
|
||||
{{item.title}}
|
||||
</view>
|
||||
</view>
|
||||
83
packages/tcm/pages/placeholder/index.wxss
Normal file
83
packages/tcm/pages/placeholder/index.wxss
Normal file
@@ -0,0 +1,83 @@
|
||||
page {
|
||||
min-height: 100%;
|
||||
background: linear-gradient(180deg, #faf3e8 0%, #f1e9dd 100%);
|
||||
}
|
||||
|
||||
.placeholder-page {
|
||||
box-sizing: border-box;
|
||||
min-height: 100vh;
|
||||
padding: 28rpx 20rpx 72rpx;
|
||||
}
|
||||
|
||||
.hero-card,
|
||||
.tips-card {
|
||||
margin-top: 18rpx;
|
||||
padding: 28rpx;
|
||||
border: 1rpx solid rgba(118, 83, 42, 0.08);
|
||||
border-radius: 32rpx;
|
||||
background: rgba(255, 250, 242, 0.92);
|
||||
box-shadow: 0 18rpx 42rpx rgba(86, 58, 25, 0.08);
|
||||
}
|
||||
|
||||
.hero-card {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.hero-card__eyebrow {
|
||||
display: inline-block;
|
||||
padding: 8rpx 16rpx;
|
||||
border-radius: 999rpx;
|
||||
background: rgba(111, 66, 22, 0.08);
|
||||
color: #6f4216;
|
||||
font-size: 22rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.hero-card__title,
|
||||
.tips-card__title {
|
||||
display: block;
|
||||
margin-top: 18rpx;
|
||||
color: #2c2419;
|
||||
font-family: 'STSong', 'Songti SC', serif;
|
||||
font-size: 36rpx;
|
||||
font-weight: 700;
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.hero-card__description,
|
||||
.tips-card__text {
|
||||
display: block;
|
||||
margin-top: 12rpx;
|
||||
color: #7c705e;
|
||||
font-size: 26rpx;
|
||||
line-height: 1.75;
|
||||
}
|
||||
|
||||
.tips-card__item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
|
||||
.tips-card__dot {
|
||||
margin-right: 10rpx;
|
||||
color: #9a622d;
|
||||
font-size: 28rpx;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.action-row__button {
|
||||
margin-top: 16rpx;
|
||||
padding: 22rpx 24rpx;
|
||||
border-radius: 24rpx;
|
||||
background: linear-gradient(135deg, #9e652f 0%, #75441a 100%);
|
||||
color: #fff7eb;
|
||||
font-size: 28rpx;
|
||||
line-height: 1;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.action-row__button--ghost {
|
||||
background: rgba(111, 66, 22, 0.08);
|
||||
color: #6f4216;
|
||||
}
|
||||
Reference in New Issue
Block a user