feat: migrate static pages to native tabbar
This commit is contained in:
50
packages/tcm/pages/bianzheng/index.js
Normal file
50
packages/tcm/pages/bianzheng/index.js
Normal file
@@ -0,0 +1,50 @@
|
||||
const { resolveScene } = require('../../../../utils/static-ux/shared')
|
||||
const { ROUTES, openStaticRoute } = require('../../../../utils/static-ux/route-map')
|
||||
|
||||
function createTcmBianzhengPageData(rawScene) {
|
||||
const scene = resolveScene(rawScene, ['default', 'result'], 'default')
|
||||
|
||||
return {
|
||||
title: '辨证分析',
|
||||
scene,
|
||||
eyebrow: 'AI 辨证分析',
|
||||
intro: '把症状整理成结构化输入,再输出学习型辨证结果。',
|
||||
fields: [
|
||||
{ key: 'mainSymptoms', label: '核心症状', placeholder: '主要症状,用逗号分隔' },
|
||||
{ key: 'tongue', label: '舌象', placeholder: '舌象' },
|
||||
{ key: 'pulse', label: '脉象', placeholder: '脉象' },
|
||||
{ key: 'constitution', label: '体质', placeholder: '体质' },
|
||||
{ key: 'duration', label: '病程', placeholder: '病程' }
|
||||
],
|
||||
result:
|
||||
scene === 'result'
|
||||
? {
|
||||
title: '学习型辨证结果',
|
||||
summary: '当前静态结果以“脾虚湿困”为例,用于承接老页面的信息层级和结果区块。',
|
||||
references: ['《素问》重视脾胃运化', '症见困倦乏力、纳呆便溏可作为学习型线索']
|
||||
}
|
||||
: null,
|
||||
primaryActionText: scene === 'result' ? '重新整理症状' : '提交辨证分析',
|
||||
secondaryActionText: '返回 AI'
|
||||
}
|
||||
}
|
||||
|
||||
Page({
|
||||
data: createTcmBianzhengPageData('default'),
|
||||
|
||||
onLoad(options) {
|
||||
this.setData(createTcmBianzhengPageData(options.scene))
|
||||
},
|
||||
|
||||
handlePrimaryTap() {
|
||||
this.setData(createTcmBianzhengPageData(this.data.scene === 'result' ? 'default' : 'result'))
|
||||
},
|
||||
|
||||
handleSecondaryTap() {
|
||||
openStaticRoute(ROUTES.tabs.ai, wx)
|
||||
}
|
||||
})
|
||||
|
||||
module.exports = {
|
||||
createTcmBianzhengPageData
|
||||
}
|
||||
Reference in New Issue
Block a user