feat: migrate static pages to native tabbar
This commit is contained in:
42
packages/mingli/pages/interpret/index.js
Normal file
42
packages/mingli/pages/interpret/index.js
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user