diff --git a/miniprogram/src/components/TopInset.jsx b/miniprogram/src/components/TopInset.jsx index 9b33710..4bdda3b 100644 --- a/miniprogram/src/components/TopInset.jsx +++ b/miniprogram/src/components/TopInset.jsx @@ -25,8 +25,9 @@ export function getTopInset() { } /** 统一固定标题区(fixed 不随滚动):像素字 kicker + 彩虹渐变标题 + 像素字注脚。 + * back:传入函数=自定义返回;true=自动返回(无上一页则回首页 Tab)。 * 占位高度由 createSelectorQuery 实测 navbar 真实高度,绝无空白/覆盖/重复。 */ -export function PageHeader({ no, title, en, sub }) { +export function PageHeader({ no, title, en, sub, back }) { const { navH, windowWidth } = getTopInset(); // 标题区整体上移 65rpx:从状态栏让位空间中扣除(不是容器偏移,占位实测自动跟随,无空白) const SHIFT_PX = Math.round((65 * (windowWidth || 375)) / 750); @@ -40,7 +41,14 @@ export function PageHeader({ no, title, en, sub }) { .boundingClientRect((r) => { if (r && r.height) setH(r.height); }) .exec(); }); - }, [no, title, en, sub]); + }, [no, title, en, sub, back]); + + const goBack = () => { + if (typeof back === 'function') { back(); return; } + const pages = Taro.getCurrentPages ? Taro.getCurrentPages() : []; + if (pages.length > 1) Taro.navigateBack({ delta: 1 }); + else Taro.switchTab({ url: '/pages/index/index' }); + }; return ( <> @@ -48,6 +56,11 @@ export function PageHeader({ no, title, en, sub }) { {no ? {no} : null} + {back ? ( + + + + ) : null} {title} {sub ? {sub} : null} diff --git a/miniprogram/src/pages/policy/index.config.js b/miniprogram/src/pages/policy/index.config.js index bdaf238..55498dd 100644 --- a/miniprogram/src/pages/policy/index.config.js +++ b/miniprogram/src/pages/policy/index.config.js @@ -1 +1 @@ -export default { navigationBarTitleText: '政策测评' }; +export default { navigationBarTitleText: '政策测评', navigationStyle: 'custom' }; diff --git a/miniprogram/src/pages/policy/index.jsx b/miniprogram/src/pages/policy/index.jsx index 0ec5ff5..b077960 100644 --- a/miniprogram/src/pages/policy/index.jsx +++ b/miniprogram/src/pages/policy/index.jsx @@ -5,6 +5,7 @@ import { getUser } from '@/utils/auth'; import { request, cachedRequest } from '@/utils/api'; import { useTabIndex } from '@/utils/tab'; import Skeleton from '@/components/skeleton'; +import { PageHeader } from '@/components/TopInset'; import './index.scss'; export default function Policy() { @@ -76,6 +77,7 @@ export default function Policy() { if (!loaded) { return ( + 正在加载测评… @@ -85,6 +87,7 @@ export default function Policy() { if (result) { return ( + {result.summary} 适配政策 @@ -141,9 +144,9 @@ export default function Policy() { return ( + - 政策适配测评5 题 {current + 1} / {QUESTIONS.length} 题 diff --git a/miniprogram/src/pages/survey/index.config.js b/miniprogram/src/pages/survey/index.config.js index 9dea222..01f5ddb 100644 --- a/miniprogram/src/pages/survey/index.config.js +++ b/miniprogram/src/pages/survey/index.config.js @@ -1 +1 @@ -export default { navigationBarTitleText: 'OPC 创业伙伴调研' }; +export default { navigationBarTitleText: 'OPC 创业伙伴调研', navigationStyle: 'custom' }; diff --git a/miniprogram/src/pages/survey/index.jsx b/miniprogram/src/pages/survey/index.jsx index cf0dd6f..ca1a0f9 100644 --- a/miniprogram/src/pages/survey/index.jsx +++ b/miniprogram/src/pages/survey/index.jsx @@ -4,6 +4,7 @@ import { useState, useEffect } from 'react'; import { getUser } from '@/utils/auth'; import { request, cachedRequest } from '@/utils/api'; import Skeleton from '@/components/skeleton'; +import { PageHeader } from '@/components/TopInset'; import './index.scss'; /* 题目/区域/Likert 由后端 /api/survey/questions 下发填充 */ @@ -113,11 +114,7 @@ export default function Survey() { if (stage === 'welcome') { return ( - - 00 - 云南 OPC 创业伙伴调研 - Survey - + 聊聊你在云南做的行业、遇到的难题、AI 赋能与政策诉求。共 {loaded ? SURVEY_QUESTIONS.length : '…'} 题,约 5–8 分钟,匿名提交,用于云南 OPC 创业生态建设与政策研究。 @@ -141,11 +138,7 @@ export default function Survey() { if (stage === 'done') { return ( - - 06 - 提交成功,感谢参与! - Thank you - + 你的回答已匿名记录,将用于云南 OPC 创业生态建设与政策研究。我们正在组织 OPC 伙伴社群与调研回访,欢迎继续参与。 @@ -165,9 +158,9 @@ export default function Survey() { return ( + { setStage('welcome'); scrollTop(); }} /> - OPC 创业伙伴调研 {current + 1} / {SURVEY_QUESTIONS.length} diff --git a/miniprogram/src/pages/test/index.jsx b/miniprogram/src/pages/test/index.jsx index 0034045..5852af2 100644 --- a/miniprogram/src/pages/test/index.jsx +++ b/miniprogram/src/pages/test/index.jsx @@ -143,12 +143,9 @@ export default function Test() { return ( + - - ‹ 返回 - OPC 创业基因测评{version === 'quick' ? '快速版' : '完整版'} - {current + 1} / {questions.length} 题 @@ -191,13 +188,8 @@ export default function Test() { const level = r.adaptLevel || {}; return ( - - {/* 头部:类型码 + 人设 + 适配指数 */} - - 02 - 你的 OPC 画像 - Report - + {/* 头部:类型码 + 人设 + 适配指数(复用统一标题区) */} + {r.typeCode}