diff --git a/AGENTS.md b/AGENTS.md
index 4f554db..8ab5ddc 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -2,7 +2,9 @@
## 项目概述
-IGG4 重症肌无力(MG)患者社区微信小程序。两种用户角色:患者(loginType=1)和医生(loginType=2)。基于 TypeScript + SCSS 构建,无测试框架。
+愈见昕生(原 gMG给力加油站/重症肌无力加油站)— MG 患者社区微信小程序。两种用户角色:患者(loginType=1)和医生(loginType=2)。基于 TypeScript + SCSS 构建,无测试框架。
+
+信达小程序项目位置 C:\Users\kola\project\xinda-miniprogram
### 技术栈
@@ -31,10 +33,43 @@ IGG4 重症肌无力(MG)患者社区微信小程序。两种用户角色:
- **源码根目录**:`src/`(在 project.config.json 中设为 `miniprogramRoot`)
- **入口**:`src/app.ts` + `src/app.json`
- **路径别名**:`@/*` 映射到 `src/*`(tsconfig paths + app.json resolveAlias)
-- **自定义 Page 包装器**:`src/utils/page.ts` 在 `app.ts` onLaunch 时全局替换 `Page()` — 注入 `imageUrl`/`Timestamp` 数据、滚动导航栏变色、默认分享行为、`handleMakePhoneCall`。所有页面都经过此包装器。
+- **自定义 Page 包装器**:`src/utils/page.ts` 在 `app.ts` onLaunch 时全局替换 `Page()` — 注入 `imageUrl`/`Timestamp`/`theme` 数据、滚动导航栏变色、默认分享行为、`handleMakePhoneCall`。所有页面都经过此包装器。
- **HTTP 请求**:`src/api/request.ts` 将 `wx.request` 封装为 `wx.ajax`(通过 `licia.curry` 柯里化基础 URL)。所有 API 调用使用 `wx.ajax()`,而非 `wx.request()`。自动在 header 和 body 中注入 `loginState`。
- **npm 包**:由微信开发者工具构建到 `src/miniprogram_npm/`(packNpmManually 配置)。不要直接编辑 miniprogram_npm。
+### 主题系统(DRUG / PATIENT)
+
+用药患者(VIP,UserType >= 4)使用紫色 DRUG 主题,非用药患者使用绿色 PATIENT 主题。
+
+- **`app.getTheme()`**:异步获取用户主题,返回 `'DRUG'` 或 `'PATIENT'`。内部轮询等待 `userInfo` 加载完成。
+- **`page.ts` 全局注入**:在 `setImageParams` 中为所有非医生端页面注入 `data.theme`,初始值 `'PATIENT'`,异步通过 `getTheme()` 更新为 `'DRUG'`(如适用)。医生端页面不注入 `theme`。
+- **页面根元素 id**:所有患者端 WXML 页面根 `` 添加 `id="{{theme === 'DRUG' && 'drug-page'}}"`,用药患者时 id 为 `drug-page`,非用药患者时 id 为空。
+- **CSS 覆盖方式**:在 SCSS 中通过 `#drug-page` 选择器覆盖用药患者样式,无需修改原有绿色样式。
+
+#### 用药患者(DRUG)主题色值
+
+| 类型 | 色值 |
+|------|------|
+| 文字色 | `rgba(89, 86, 233, 1)` |
+| 按钮渐变 | `linear-gradient(270deg, #5956E9 0%, #B384F4 100%)` |
+| 浅色背景 | `rgba(89, 86, 233, 0.1)` |
+
+#### 主题使用示例(SCSS)
+
+```scss
+.btn { background: #0eb66d; }
+#drug-page .btn { background: linear-gradient(270deg, #5956E9 0%, #B384F4 100%); }
+
+.text { color: #0eb66d; }
+#drug-page .text { color: rgba(89, 86, 233, 1); }
+```
+
+#### 主题使用示例(WXML)
+
+```xml
+
+```
+
### 登录与权限系统(app.ts)
- **登录流程**:`onShow` → `startLogin()` → `wx.login` 获取 code → 后端 `init-login` 返回 `loginState`
@@ -42,7 +77,7 @@ IGG4 重症肌无力(MG)患者社区微信小程序。两种用户角色:
- 1:空白用户 → 跳转登录页
- 2:已注册用户 → 需完善资料
- 3:已确诊患者 → 需上传认证
- - 4:已用药患者(VIP)→ 完整权限
+ - 4:已用药患者(VIP)→ 完整权限,使用 DRUG 主题
- **路由守卫**:`verifySys(pub)` 检查登录状态和角色,自动重定向:
- 未登录 + 医生端页面 → 医生登录页
- 未登录 + 患者端页面 → 患者登录页(若 anyWhere 为 true 则"随便看看"模式)
@@ -68,11 +103,27 @@ IGG4 重症肌无力(MG)患者社区微信小程序。两种用户角色:
| 4 | `/pages/story/index` | 向往的生活 |
| 5 | `/pages/my/index` | 我的 |
-- 自定义 TabBar 使用 Vant `van-tabbar` 组件
+- **患者端 TabBar**(`src/custom-tab-bar/`):使用 Vant `van-tabbar` 组件,额外包含"用药提醒"自定义按钮(`item.custom=true`),仅 `theme === 'DRUG'` 时展示
+- **医生端 TabBar**(`src/doctor/components/tabbar/`):自定义组件(非 Vant),纯 HTML/CSS 实现
- Tab 4(向往的生活)在 `anyWhere` 为 true 时隐藏(浏览模式)
- Tab 2(MG全知道)在 `config.picTextEbookStatus === 1` 时可能重定向到 webview
- Tab 5(我的)需要 `permissionVerification(grade=2)`
-- 主题支持:DRUG / PATIENT(当前始终解析为 PATIENT)
+- 患者 TabBar 通过 `app.registerListener` 监听全局事件更新 `theme`
+
+### 医患互动消息类型
+
+互动页面(`d_interactive`/`d_interactiveDoctor`/`interactivePatient`)仅支持以下消息类型:
+
+| msgContentType | 类型 | 说明 |
+|----------------|------|------|
+| 1 | 文本(患者发送) | 患者发送的标准消息 |
+| 2 | 出诊时间 | 医生出诊时间信息 |
+| 5 | 欢迎语 | 欢迎引导消息 |
+| 10 | ADL | ADL 评估相关消息 |
+| 11 | 文本(患者) | 患者文本消息 |
+| 12 | 文本(医生自定义) | 医生自定义文本回复 |
+
+已移除的类型:audio(4)、info(6)、info(7)、referral(8)、referral-replay(9)。
### HTTP 响应约定(api/request.ts)
@@ -106,7 +157,8 @@ IGG4 重症肌无力(MG)患者社区微信小程序。两种用户角色:
- **个人中心**:`my`、`mySave`、`personalInformation`、`changePhone`、`changeUser`、`cancellation`
- **家庭**:`family`、`familyList`、`familyScan`
- **医疗**:`hospital`、`doctor`、`doctorDetail`、`drugRecord`、`infusionCenter`、`nrdl`、`nrdlDetail`、`nrdlTable`
-- **其他**:`thePublic`、`privacyAgreement`、`taskAgreement`、`comIns`、`signIn`、`smallPage`、`webview`、`referral`、`interactivePatient`、`demo`
+- **互动**:`interactivePatient`
+- **其他**:`thePublic`、`privacyAgreement`、`taskAgreement`、`comIns`、`signIn`、`smallPage`、`webview`、`referral`、`demo`、`qaForm`
### 医生端分包页面(src/doctor/)
@@ -155,11 +207,17 @@ IGG4 重症肌无力(MG)患者社区微信小程序。两种用户角色:
| `viewFile` | 文件查看 |
| `viewVideo` | 视频播放器 |
+### 医生端组件(src/doctor/components/)
+
+| 组件 | 说明 |
+|------|------|
+| `tabbar` | 医生端自定义 TabBar(非 Vant,纯 HTML/CSS) |
+
## 工具函数(src/utils/)
| 文件 | 说明 |
|------|------|
-| `page.ts` | Page() 全局替换:注入 imageUrl/Timestamp、滚动导航栏变色、默认分享、handleMakePhoneCall |
+| `page.ts` | Page() 全局替换:注入 imageUrl/Timestamp/theme、滚动导航栏变色、默认分享、handleMakePhoneCall。医生端页面不注入 theme。 |
| `util.ts` | formatTime、formatNumber、getCurrentPageUrl、getCurrentPageUrlWithArgs、parseScene |
| `promisify.ts` | 基于 Proxy 的 wx API Promise 化(同步方法保留,异步方法返回 Promise) |
| `watch.ts` | 基于 Object.defineProperty 的页面级数据监听(setWatcher) |
@@ -169,7 +227,7 @@ IGG4 重症肌无力(MG)患者社区微信小程序。两种用户角色:
## 类型定义(typings/index.d.ts)
-- `IAppOption` — App 实例接口,包含 globalData 结构和方法签名
+- `IAppOption` — App 实例接口,包含 globalData 结构和方法签名(含 `getTheme()`)
- `IAgaxParams` — 扩展的请求选项,含 `showMsg`、`loading`、`isJSON`
- `Response` — 通用 API 响应结构
- `globalSystemInfo` — 扩展的系统信息,含胶囊按钮位置
@@ -187,6 +245,7 @@ IGG4 重症肌无力(MG)患者社区微信小程序。两种用户角色:
- 主包页面 → `pages` 数组
- 分包页面 → `subpackages` 中对应分包的 `pages` 数组
4. 如页面使用组件,在页面的 `index.json` 的 `usingComponents` 中注册
+5. **患者端页面**:根 `` 需添加 `id="{{theme === 'DRUG' && 'drug-page'}}"` 以支持 DRUG 主题覆盖
### 新增组件
@@ -197,6 +256,7 @@ IGG4 重症肌无力(MG)患者社区微信小程序。两种用户角色:
## 关键约定
+- **品牌名称**:项目品牌名"愈见昕生",不再使用"重症肌无力加油站"或"gMG给力加油站"
- **JSX/F2 图表**:Babel 插件 `@babel/plugin-transform-react-jsx`,`jsxImportSource: "@antv/f2"` — 页面中的 `.jsx` 文件使用 F2 图表语法,由 beforeCompile 脚本转译
- **微信全局变量**:`wx`、`App`、`Page`、`Component`、`getCurrentPages`、`getApp` 已在 ESLint globals 中声明
- **CSS 单位**:使用 `rpx`(微信响应式像素),布局中不用 `px`
@@ -204,9 +264,11 @@ IGG4 重症肌无力(MG)患者社区微信小程序。两种用户角色:
- **`noImplicitAny: false`** — 允许隐式 any
- **`removeComments: true`**(tsconfig)— 编译输出移除注释
- **Prettier**:无分号、单引号、尾逗号、120 字符宽度;`.wxml` 按 HTML 解析,`.wxss` 按 CSS 解析,`.wxs` 按 babel 解析
-- **API URL 格式**:所有 API 调用使用 `?r=模块/动作` 格式(如 `?r=igg4/user/init-login`、`?r=igg4/account/info`)
-- **默认分享**:患者端页面分享到 `/pages/index/index`,医生端页面分享到 `/doctor/pages/d_home/index`,标题:"重症肌无力加油站,重拾生活掌控感!"
+- **API URL 格式**:所有 API 调用使用 `?r=模块/动作` 格式(如 `?r=zd/user/init-login`、`?r=zd/account/info`)
+- **默认分享**:患者端页面分享到 `/pages/index/index`,医生端页面分享到 `/doctor/pages/d_home/index`,标题:"愈见昕生,重拾生活掌控感!"
- **客服电话**:全局 `handleMakePhoneCall` 拨打 `4008102299`
+- **医生端页面禁止调用 `getTheme()`**:`getTheme()` 仅在 `page.ts` 和患者端组件(如 `custom-tab-bar`)中使用
+- **患者端页面禁止重复调用 `getTheme()`**:`page.ts` 已全局注入 `theme`,页面中无需再次调用
## 环境 / 部署
diff --git a/src/components/toast/index.scss b/src/components/toast/index.scss
index f1d599c..62e0fb9 100644
--- a/src/components/toast/index.scss
+++ b/src/components/toast/index.scss
@@ -2431,7 +2431,7 @@
}
.popup-patient-detail-safe-doctor {
- .badge{
+ .badge {
position: relative;
z-index: 1;
display: block;
@@ -2446,7 +2446,7 @@
width: 670rpx;
box-sizing: border-box;
border-radius: 24rpx;
- background: linear-gradient(180deg, #E5FFF4 0%, #FFFFFF 22.89%, #FFFFFF 100%);
+ background: linear-gradient(180deg, #e5fff4 0%, #ffffff 22.89%, #ffffff 100%);
.content {
font-size: 36rpx;
color: rgba(34, 34, 34, 1);
@@ -3568,6 +3568,35 @@
}
}
+.popup-feedback {
+ .popup-container {
+ padding: 332rpx 0;
+ width: 630rpx;
+ height: 818rpx;
+ box-sizing: border-box;
+ .code {
+ display: block;
+ width: 310rpx;
+ height: 310rpx;
+ margin: 0 auto;
+ }
+ }
+}
+.popup-follow {
+ .popup-container {
+ padding: 316rpx 0;
+ width: 630rpx;
+ height: 814rpx;
+ box-sizing: border-box;
+ .code {
+ display: block;
+ width: 340rpx;
+ height: 340rpx;
+ margin: 0 auto;
+ }
+ }
+}
+
.close {
margin: 48rpx auto 0;
display: block;
diff --git a/src/components/toast/index.ts b/src/components/toast/index.ts
index 90fedfc..1a03d9c 100644
--- a/src/components/toast/index.ts
+++ b/src/components/toast/index.ts
@@ -42,6 +42,12 @@ Component({
if (['storyLead', 'storyStar', 'storyShare'].includes(this.data.type)) {
this.getSettingInfo()
}
+ if (this.data.type === 'feedback') {
+ this.getFeedbackCode()
+ }
+ if (this.data.type === 'follow') {
+ this.getFollowCode()
+ }
}
this.setData({
userInfo: app.globalData.userInfo,
@@ -61,6 +67,8 @@ Component({
userInfo: {},
openPatientList: {},
popup1Check1: false,
+ feedbackQrCode: '',
+ followQrCode: '',
},
lifetimes: {
attached() {
@@ -134,6 +142,34 @@ Component({
})
})
},
+ getFeedbackCode() {
+ wx.ajax({
+ method: 'GET',
+ url: '?r=igg4/common/get-channel-wx-code',
+ data: {
+ ChannelType: '11',
+ Id: '',
+ },
+ }).then((res) => {
+ this.setData({
+ feedbackQrCode: res,
+ })
+ })
+ },
+ getFollowCode() {
+ wx.ajax({
+ method: 'GET',
+ url: '?r=igg4/common/get-channel-wx-code',
+ data: {
+ ChannelType: '11',
+ Id: '',
+ },
+ }).then((res) => {
+ this.setData({
+ followQrCode: res,
+ })
+ })
+ },
handleProtocolChange() {
this.setData({
protocol: !this.data.protocol,
diff --git a/src/components/toast/index.wxml b/src/components/toast/index.wxml
index be7a272..1336281 100644
--- a/src/components/toast/index.wxml
+++ b/src/components/toast/index.wxml
@@ -660,14 +660,17 @@
+
+
diff --git a/src/doctor/pages/d_interactiveDoctor/index.wxml b/src/doctor/pages/d_interactiveDoctor/index.wxml
index 3b7459f..29b5426 100644
--- a/src/doctor/pages/d_interactiveDoctor/index.wxml
+++ b/src/doctor/pages/d_interactiveDoctor/index.wxml
@@ -77,7 +77,7 @@