This commit is contained in:
2026-04-22 18:54:52 +08:00
commit bc8986e3b2
49 changed files with 20987 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
const { sessionStore } = require('../../../../stores')
const MODULES = [
{
title: 'Request Layer',
description: '统一超时、重试、鉴权失效和重复提交控制,页面不直接碰 wx.request。',
badge: 'service',
actionText: '查看首页',
actionPath: '/pages/home/index'
},
{
title: 'Session Store',
description: '跨页共享的登录态只保留在 store本页的筛选和列表状态仍然是页面本地状态。',
badge: 'store',
actionText: '打开登录页',
actionPath: '/pages/login/index'
}
]
Page({
data: {
modules: MODULES,
currentUser: '访客',
localTodos: [
'把 /services/api 替换成真实后端接口',
'按业务域继续拆 packages/<domain>',
'接入 miniprogram-ci 上传非生产环境'
]
},
onLoad() {
const state = sessionStore.getState()
this.setData({
currentUser: state.userInfo?.nickname || state.userInfo?.name || '访客'
})
},
handleEntryAction(event) {
const { path } = event.detail
if (!path) {
return
}
wx.navigateTo({
url: path
})
}
})

View File

@@ -0,0 +1,7 @@
{
"navigationBarTitleText": "工作台",
"usingComponents": {
"entry-card": "../../../../components/biz/entry-card/index",
"t-tag": "tdesign-miniprogram/tag/tag"
}
}

View File

@@ -0,0 +1,29 @@
<view class="page-shell">
<view class="panel workbench-hero">
<t-tag theme="success" variant="light">Subpackage</t-tag>
<text class="workbench-hero__title">业务工作台示例</text>
<text class="section-copy">
当前用户:{{currentUser}}。这个页面位于分包中,用来承接持续增长的业务,而不是继续把主包做胖。
</text>
</view>
<view class="entry-list">
<entry-card
wx:for="{{modules}}"
wx:key="title"
title="{{item.title}}"
description="{{item.description}}"
badge="{{item.badge}}"
actionText="{{item.actionText}}"
actionPath="{{item.actionPath}}"
bind:action="handleEntryAction"
></entry-card>
</view>
<view class="panel todo-panel">
<text class="section-title">下一步扩展</text>
<view class="todo-list">
<text wx:for="{{localTodos}}" wx:key="*this" class="todo-item">{{index + 1}}. {{item}}</text>
</view>
</view>
</view>

View File

@@ -0,0 +1,37 @@
.workbench-hero {
display: flex;
flex-direction: column;
gap: 20rpx;
padding: 32rpx;
}
.workbench-hero__title {
font-size: 40rpx;
font-weight: 700;
line-height: 1.3;
}
.entry-list {
display: flex;
flex-direction: column;
gap: 24rpx;
}
.todo-panel {
display: flex;
flex-direction: column;
gap: 24rpx;
padding: 32rpx;
}
.todo-list {
display: flex;
flex-direction: column;
gap: 20rpx;
}
.todo-item {
font-size: 24rpx;
line-height: 1.7;
color: #475569;
}