Browse Source

增加埋点

dev2.0
kola-web 2 weeks ago
parent
commit
d4cf78f398
  1. 310
      .trae/documents/igg4-tracking-implementation-plan.md
  2. 0
      doc/api.md
  3. 0
      doc/api_doctor_msg_task.md
  4. 216
      doc/track.md
  5. 2
      src/api/request.ts
  6. 2
      src/app.ts
  7. 4
      src/doctor/pages/d_changeDoctor/index.ts
  8. 2
      src/doctor/pages/d_createTask/index.ts
  9. 1
      src/doctor/pages/d_customExport/index.ts
  10. 4
      src/doctor/pages/d_home/index.ts
  11. 3
      src/doctor/pages/d_interactive/index.ts
  12. 2
      src/doctor/pages/d_interactiveDoctor/index.ts
  13. 2
      src/doctor/pages/d_invite/index.ts
  14. 1
      src/doctor/pages/d_my/index.ts
  15. 3
      src/doctor/pages/d_patient/index.ts
  16. 1
      src/doctor/pages/d_patientDetail/index.ts
  17. 1
      src/doctor/pages/d_taskDetail/index.ts
  18. 3
      src/doctor/pages/d_taskList/index.ts
  19. 1
      src/doctor/pages/d_userInfo/index.ts
  20. 4
      src/gift/pages/record/index.ts
  21. 5
      src/gift/pages/recordDetail/index.ts
  22. 3
      src/gift/pages/recordList/index.ts
  23. BIN
      src/images/avatar1.png
  24. 5
      src/pages/cancellation/index.ts
  25. 5
      src/pages/caseReport/index.ts
  26. 2
      src/pages/certReslove/index.ts
  27. 4
      src/pages/changeUser/index.ts
  28. 1
      src/pages/doctorDetail/index.ts
  29. 4
      src/pages/doctorDetailBak/index.ts
  30. 3
      src/pages/familyScan/index.ts
  31. 6
      src/pages/feedback/index.ts
  32. 12
      src/pages/getUserInfo/index.ts
  33. 7
      src/pages/index/index.ts
  34. 7
      src/pages/interactivePatient/index.ts
  35. 2
      src/pages/liveResult/index.ts
  36. 11
      src/pages/my/index.ts
  37. 1
      src/pages/mySave/index.ts
  38. 1
      src/pages/personalInformation/index.ts
  39. 1
      src/pages/qaForm/index.ts
  40. 1
      src/pages/qaFormDetail/index.ts
  41. 7
      src/pages/repository/index.ts
  42. 1
      src/pages/repositoryDetail/index.ts
  43. 8
      src/pages/smallPage/index.ts
  44. 4
      src/pages/storyDetail/index.ts
  45. 2
      src/pages/storyEnterResult/index.ts
  46. 2
      src/pages/thePublic/index.ts
  47. 4
      src/pages/uploadCert/index.ts
  48. 8
      src/pages/vipLogin/index.ts
  49. 2
      src/pages/vipLoginReject/index.ts
  50. 2
      typings/index.d.ts

310
.trae/documents/igg4-tracking-implementation-plan.md

@ -0,0 +1,310 @@
# IGG4 小程序埋点实施计划
## 概要
基于 `doc/track.md` 文档和信达项目的成熟埋点模式,为 IGG4 项目实施页面级 PV 埋点和点击级事件埋点。采用信达项目已验证的 `PG_` / `BTN_` 双层命名体系,复用现有 `app.mpBehavior()` 基础设施。
## 现状分析
| 维度 | 现状 |
|------|------|
| 埋点函数 | `app.mpBehavior({ PageName, doctor? })` — 仅 1 处调用 (`MINI_PROGRAM_VISIT`) |
| API 接口 | 患者端 `?r=igg4/mp-behavior/add`,医生端 `?r=igg4/doctor/mp-behavior/add` |
| 类型签名 | `{ PageName: string; doctor?: boolean }` — 需扩展以支持 `detailId` 等可选参数 |
| 页面级埋点 | 完全未实现(track.md 中 25+ 页面均未添加调用) |
| 点击级埋点 | 完全未实现 |
| 命名规范 | 无(信达项目使用 `PG_`/`BTN_` 前缀命名体系) |
## 命名规范(参照信达项目)
| 类别 | 前缀 | 格式 | 示例 |
|------|------|------|------|
| 页面浏览(患者端) | `PG_` | `PG_Patient{功能名}` | `PG_PatientHome`、`PG_PatientRepository` |
| 页面浏览(医生端) | `PG_` | `PG_Doctor{功能名}` | `PG_DoctorHome`、`PG_DoctorPatient` |
| 点击事件(患者端) | `BTN_` | `BTN_Patient{功能名}{操作}` | `BTN_PatientHomeDoctorCard`、`BTN_PatientMyVip` |
| 点击事件(医生端) | `BTN_` | `BTN_Doctor{功能名}{操作}` | `BTN_DoctorHomeInvite`、`BTN_DoctorPatientDetail` |
### PageName 与 track.md 页面对照表
**患者端页面级埋点(PG_):**
| track.md 页面路径 | PageName |
|-------------------|----------|
| pages/index/index | `PG_PatientHome` |
| gift/pages/recordList/index | `PG_PatientRecordList` |
| gift/pages/record/index | `PG_PatientRecordAdd` |
| gift/pages/recordDetail/index | `PG_PatientRecordDetail` |
| pages/interactivePatient/index | `PG_PatientInteractive` |
| pages/doctorDetail/index | `PG_PatientDoctorDetail` |
| pages/repository/index | `PG_PatientRepository` |
| pages/repositoryDetail/index | `PG_PatientRepositoryDetail` |
| pages/my/index | `PG_PatientMy` |
| pages/qaFormDetail/index | `PG_PatientQaFormDetail` |
| pages/qaForm/index | `PG_PatientQaForm` |
| pages/caseReport/index | `PG_PatientCaseReport` |
| pages/personalInformation/index | `PG_PatientPersonalInfo` |
| pages/cancellation/index | `PG_PatientCancellation` |
| pages/mySave/index | `PG_PatientMySave` |
| pages/feedback/index | `PG_PatientFeedback` |
**医生端页面级埋点(PG_):**
| track.md 页面路径 | PageName |
|-------------------|----------|
| doctor/pages/d_home/index | `PG_DoctorHome` |
| doctor/pages/d_invite/index | `PG_DoctorInvite` |
| doctor/pages/d_patient/index | `PG_DoctorPatient` |
| doctor/pages/d_patientDetail/index | `PG_DoctorPatientDetail` |
| doctor/pages/d_taskList/index | `PG_DoctorTaskList` |
| doctor/pages/d_taskDetail/index | `PG_DoctorTaskDetail` |
| doctor/pages/d_createTask/index | `PG_DoctorCreateTask` |
| doctor/pages/d_interactive/index | `PG_DoctorInteractive` |
| doctor/pages/d_interactiveDoctor/index | `PG_DoctorInteractiveDoctor` |
| doctor/pages/d_my/index | `PG_DoctorMy` |
| doctor/pages/d_userInfo/index | `PG_DoctorUserInfo` |
| doctor/pages/d_changeDoctor/index | `PG_DoctorChangeDoctor` |
## 实施步骤
### 第 1 步:扩展 mpBehavior 类型签名
**文件**: `src/app.ts` + `typings/index.d.ts`
扩展 `mpBehavior` 方法签名,支持可选的 `detailId` 参数(用于详情页等场景):
```ts
// typings/index.d.ts
mpBehavior: (data: { PageName: string; doctor?: boolean; detailId?: string }) => void
// src/app.ts — 实现签名同步更新
mpBehavior(data: { PageName: string; doctor?: boolean; detailId?: string }) {
// ... 现有逻辑不变,detailId 会随 data 对象一起 POST 到后端
}
```
> 说明:与信达项目一致,`detailId` 等额外字段作为 POST data 的一部分直接发送给后端,无需在 `mpBehavior` 函数内做特殊处理。
### 第 2 步:实施患者端页面级埋点(16 个页面)
在每个页面的 `onShow` 中(有 `waitLogin` 的在 `waitLogin().then()` 内),调用 `app.mpBehavior()`
**通用模式:**
```ts
// 患者端页面(无 waitLogin)
onShow() {
app.mpBehavior({ PageName: 'PG_PatientXxx' })
}
// 患者端页面(有 waitLogin)
onShow() {
app.waitLogin().then(() => {
app.mpBehavior({ PageName: 'PG_PatientXxx' })
// ... 原有业务逻辑
})
}
```
**修改文件清单:**
| # | 文件路径 | PageName | 嵌入位置 |
|---|---------|----------|---------|
| 1 | `src/pages/index/index.ts` | `PG_PatientHome` | `onShow``waitLogin().then()` 内首行 |
| 2 | `src/gift/pages/recordList/index.ts` | `PG_PatientRecordList` | `onShow``waitLogin().then()` 内首行 |
| 3 | `src/gift/pages/record/index.ts` | `PG_PatientRecordAdd` | `onShow``waitLogin().then()` 内首行 |
| 4 | `src/gift/pages/recordDetail/index.ts` | `PG_PatientRecordDetail` | `onShow``waitLogin().then()` 内首行,带 `detailId` |
| 5 | `src/pages/interactivePatient/index.ts` | `PG_PatientInteractive` | `onLoad``waitLogin().then()` 内首行 |
| 6 | `src/pages/doctorDetail/index.ts` | `PG_PatientDoctorDetail` | `onShow``waitLogin().then()` 内首行,带 `detailId` |
| 7 | `src/pages/repository/index.ts` | `PG_PatientRepository` | `onShow``waitLogin().then()` 内首行 |
| 8 | `src/pages/repositoryDetail/index.ts` | `PG_PatientRepositoryDetail` | `onShow``waitLogin().then()` 内首行,带 `detailId` |
| 9 | `src/pages/my/index.ts` | `PG_PatientMy` | `onShow``waitLogin().then()` 内首行 |
| 10 | `src/pages/qaFormDetail/index.ts` | `PG_PatientQaFormDetail` | `onShow``waitLogin().then()` 内首行,带 `detailId` |
| 11 | `src/pages/qaForm/index.ts` | `PG_PatientQaForm` | `onShow``waitLogin().then()` 内首行 |
| 12 | `src/pages/caseReport/index.ts` | `PG_PatientCaseReport` | `onShow``waitLogin().then()` 内首行 |
| 13 | `src/pages/personalInformation/index.ts` | `PG_PatientPersonalInfo` | `onShow``waitLogin().then()` 内首行 |
| 14 | `src/pages/cancellation/index.ts` | `PG_PatientCancellation` | `onShow``waitLogin().then()` 内首行 |
| 15 | `src/pages/mySave/index.ts` | `PG_PatientMySave` | `onShow``waitLogin().then()` 内首行 |
| 16 | `src/pages/feedback/index.ts` | `PG_PatientFeedback` | `onShow``waitLogin().then()` 内首行 |
### 第 3 步:实施医生端页面级埋点(12 个页面)
医生端埋点需传入 `doctor: true`,API 路径切换为 `?r=igg4/doctor/mp-behavior/add`
**通用模式:**
```ts
// 医生端页面
onShow() {
app.waitLogin().then(() => {
app.mpBehavior({ doctor: true, PageName: 'PG_DoctorXxx' })
// ... 原有业务逻辑
})
}
```
**修改文件清单:**
| # | 文件路径 | PageName | 嵌入位置 |
|---|---------|----------|---------|
| 1 | `src/doctor/pages/d_home/index.ts` | `PG_DoctorHome` | `onLoad``waitLogin().then()` 内首行 |
| 2 | `src/doctor/pages/d_invite/index.ts` | `PG_DoctorInvite` | `onShow``waitLogin().then()` 内首行 |
| 3 | `src/doctor/pages/d_patient/index.ts` | `PG_DoctorPatient` | `onShow``waitLogin().then()` 内首行 |
| 4 | `src/doctor/pages/d_patientDetail/index.ts` | `PG_DoctorPatientDetail` | `onShow``waitLogin().then()` 内首行,带 `detailId` |
| 5 | `src/doctor/pages/d_taskList/index.ts` | `PG_DoctorTaskList` | `onShow``waitLogin().then()` 内首行 |
| 6 | `src/doctor/pages/d_taskDetail/index.ts` | `PG_DoctorTaskDetail` | `onShow``waitLogin().then()` 内首行,带 `detailId` |
| 7 | `src/doctor/pages/d_createTask/index.ts` | `PG_DoctorCreateTask` | `onShow``waitLogin().then()` 内首行 |
| 8 | `src/doctor/pages/d_interactive/index.ts` | `PG_DoctorInteractive` | `onShow``waitLogin().then()` 内首行 |
| 9 | `src/doctor/pages/d_interactiveDoctor/index.ts` | `PG_DoctorInteractiveDoctor` | `onShow``waitLogin().then()` 内首行,带 `detailId` |
| 10 | `src/doctor/pages/d_my/index.ts` | `PG_DoctorMy` | `onShow``waitLogin().then()` 内首行 |
| 11 | `src/doctor/pages/d_userInfo/index.ts` | `PG_DoctorUserInfo` | `onShow``waitLogin().then()` 内首行 |
| 12 | `src/doctor/pages/d_changeDoctor/index.ts` | `PG_DoctorChangeDoctor` | `onShow``waitLogin().then()` 内首行 |
### 第 4 步:实施点击级埋点(BTN_)
在关键交互的事件处理函数首行,插入 `app.mpBehavior()` 调用。
#### 患者端点击埋点
**首页 — `src/pages/index/index.ts`**
| 方法 | PageName | 说明 |
|------|----------|------|
| `routerTo(e)` 中 doctor 类卡片 | `BTN_PatientHomeDoctorCard` | 迷你医生卡片点击 |
| `routerTo(e)` 中功能入口 | `BTN_PatientHomeFunctionCard` | 功能卡片跳转 |
| `handleNextVisit()` | `BTN_PatientHomeNextVisit` | 下次复诊入口 |
| `handleArticleView(e)` | `BTN_PatientHomeArticle` | 文章点击 |
| `handleArticleSave(e)` | `BTN_PatientHomeArticleSave` | 文章收藏 |
| `handleToastOk()`(绑定医生确认) | `BTN_PatientHomeBindDoctor` | 绑定医生弹窗确认 |
| `handlePublic()` | `BTN_PatientHomeFollowPublic` | 关注公众号 |
**我的页面 — `src/pages/my/index.ts`**
| 方法 | PageName | 说明 |
|------|----------|------|
| `routerVipTo()` | `BTN_PatientMyVip` | VIP 认证入口 |
| `handleMyHealthRecord(e)` | `BTN_PatientMyHealthRecord` | 健康档案 |
| `handleQaForm()` | `BTN_PatientMyQaForm` | 健康问卷 |
| `routerTo(e)` 中 mySave | `BTN_PatientMySave` | 我的收藏 |
| `routerTo(e)` 中 personalInfo | `BTN_PatientMyPersonalInfo` | 个人信息 |
| `routerTo(e)` 中 feedback | `BTN_PatientMyFeedback` | 问题反馈 |
| `handleMiniDoctor()` | `BTN_PatientMyMiniDoctor` | 迷你医生 |
**医患互动 — `src/pages/interactivePatient/index.ts`**
| 方法 | PageName | 说明 |
|------|----------|------|
| `handleHot(e)` | `BTN_PatientInteractiveHotQuestion` | 热门问题点击 |
| `handleQuestion(e)` | `BTN_PatientInteractiveQuestion` | 快捷问题点击 |
| `handleConfirm()` | `BTN_PatientInteractiveSend` | 发送消息 |
| `handleAdl()` | `BTN_PatientInteractiveAdl` | ADL 评估入口 |
| `handleQol()` | `BTN_PatientInteractiveQol` | QoL 入口 |
| `handleDoctorDetail()` | `BTN_PatientInteractiveDoctorDetail` | 查看医生详情 |
**知识库 — `src/pages/repository/index.ts`**
| 方法 | PageName | 说明 |
|------|----------|------|
| `tabChange(e)` | `BTN_PatientRepositoryTab` | Tab 切换 |
| `handleSearch()` | `BTN_PatientRepositorySearch` | 搜索 |
| `handleCate(e)` | `BTN_PatientRepositoryCategory` | 分类筛选 |
| `handleDetail(e)` | `BTN_PatientRepositoryArticle` | 文章详情 |
| `handleStar(e)` | `BTN_PatientRepositoryStar` | 点赞 |
| `handleToggleSave(e)` | `BTN_PatientRepositorySave` | 收藏 |
**就诊记录列表 — `src/gift/pages/recordList/index.ts`**
| 方法 | PageName | 说明 |
|------|----------|------|
| 新增就诊记录入口 | `BTN_PatientRecordListAdd` | 新增记录按钮 |
| 点击记录项 | `BTN_PatientRecordListItem` | 记录列表项点击 |
**就诊记录新增 — `src/gift/pages/record/index.ts`**
| 方法 | PageName | 说明 |
|------|----------|------|
| 提交/保存按钮 | `BTN_PatientRecordAddSubmit` | 保存记录 |
**医生详情 — `src/pages/doctorDetail/index.ts`**
| 方法 | PageName | 说明 |
|------|----------|------|
| 查看互动 | `BTN_PatientDoctorDetailInteractive` | 进入互动页 |
#### 医生端点击埋点
**医生首页 — `src/doctor/pages/d_home/index.ts`**
| 方法 | PageName | 说明 |
|------|----------|------|
| `handlePatient(e)` | `BTN_DoctorHomePatient` | 患者列表入口 |
| `handleInvite()` | `BTN_DoctorHomeInvite` | 邀约按钮 |
| `handleSelectYear1()` | `BTN_DoctorHomeSelectYear` | 年份筛选 |
**邀约患者 — `src/doctor/pages/d_invite/index.ts`**
| 方法 | PageName | 说明 |
|------|----------|------|
| 发送邀约按钮 | `BTN_DoctorInviteSend` | 发送邀约 |
**患者列表 — `src/doctor/pages/d_patient/index.ts`**
| 方法 | PageName | 说明 |
|------|----------|------|
| 搜索 | `BTN_DoctorPatientSearch` | 搜索患者 |
| 点击患者项 | `BTN_DoctorPatientItem` | 患者列表项 |
**互动列表 — `src/doctor/pages/d_interactive/index.ts`**
| 方法 | PageName | 说明 |
|------|----------|------|
| 搜索 | `BTN_DoctorInteractiveSearch` | 搜索互动 |
| 点击互动项 | `BTN_DoctorInteractiveItem` | 互动列表项 |
**互动页 — `src/doctor/pages/d_interactiveDoctor/index.ts`**
| 方法 | PageName | 说明 |
|------|----------|------|
| 发送消息 | `BTN_DoctorInteractiveSend` | 发送消息 |
**群发列表 — `src/doctor/pages/d_taskList/index.ts`**
| 方法 | PageName | 说明 |
|------|----------|------|
| 新增群发 | `BTN_DoctorTaskListAdd` | 新增群发入口 |
| 点击群发项 | `BTN_DoctorTaskListItem` | 群发列表项 |
**群发新增 — `src/doctor/pages/d_createTask/index.ts`**
| 方法 | PageName | 说明 |
|------|----------|------|
| 提交群发 | `BTN_DoctorCreateTaskSubmit` | 创建群发 |
**切换医生 — `src/doctor/pages/d_changeDoctor/index.ts`**
| 方法 | PageName | 说明 |
|------|----------|------|
| 选择医生 | `BTN_DoctorChangeDoctorSelect` | 切换医生选择 |
> **注意**:以上点击埋点 PageName 是基于代码探索的预定义清单。实施时需逐页确认实际的方法名和交互行为,如有差异需现场调整。
### 第 5 步:更新 doc/track.md 文档
将完整的 PageName 对照表(页面级 + 点击级)更新到 `doc/track.md`,作为埋点实施的参考文档。
## 假设与决策
1. **命名规范**:采用信达项目的 `PG_/BTN_` 前缀体系,患者端用 `Patient` 前缀,医生端用 `Doctor` 前缀。这样命名清晰且便于后端区分数据来源。
2. **detailId 参数**:扩展 `mpBehavior` 类型签名以支持可选 `detailId`,用于详情页场景。实际在 JS 层该字段会随 data 对象一起 POST,无需函数内额外处理。
3. **页面级埋点位置**:有 `waitLogin` 的页面在 `.then()` 内首行调用;无 `waitLogin` 的在 `onShow` 首行调用。确保用户登录后才上报,避免无效数据。
4. **点击级埋点位置**:在事件处理函数首行调用 `mpBehavior`,先上报再执行业务逻辑(与信达项目一致)。
5. **医生端 `doctor: true`**:所有医生端埋点均传入 `doctor: true`,确保 API 路径正确切换。
6. **MINI_PROGRAM_VISIT 保留**:`app.ts` 中现有的 `MINI_PROGRAM_VISIT` 埋点保留不变,它记录小程序整体打开事件,与页面级 PV 埋点互不冲突。
7. **无集中常量文件**:PageName 采用硬编码字符串(与信达项目一致),不创建额外的常量/枚举文件,避免增加维护成本。
## 验证步骤
1. 编译检查:确保 `pnpm run lint:fix` 无新增错误
2. 逐页验证:在微信开发者工具中打开每个页面,检查 console 中 mpBehavior POST 请求是否正常发出
3. 参数验证:确认患者端请求路径为 `?r=igg4/mp-behavior/add`,医生端为 `?r=igg4/doctor/mp-behavior/add`
4. doctor 参数验证:确认 `doctor` 字段在发送前被正确删除(不出现在 POST body 中)
5. detailId 验证:确认详情页的 `detailId` 正确传入 POST body

0
api.md → doc/api.md

0
api_doctor_msg_task.md → doc/api_doctor_msg_task.md

216
doc/track.md

@ -0,0 +1,216 @@
# 埋点文档
## 命名规范
| 类别 | 前缀 | 格式 | 示例 |
|------|------|------|------|
| 页面浏览(患者端) | `PG_` | `PG_Patient{功能名}` | `PG_PatientHome` |
| 页面浏览(医生端) | `PG_` | `PG_Doctor{功能名}` | `PG_DoctorHome` |
| 点击事件(患者端) | `BTN_` | `BTN_Patient{功能名}{操作}` | `BTN_PatientHomeNextVisit` |
| 点击事件(医生端) | `BTN_` | `BTN_Doctor{功能名}{操作}` | `BTN_DoctorHomeInvite` |
## 埋点示例
### 患者端页面访问埋点
```ts
// 页面级 PV
app.waitLogin().then(() => {
app.mpBehavior({ PageName: 'PG_PatientHome' })
})
// 详情页带 detailId
app.waitLogin().then(() => {
app.mpBehavior({ PageName: 'PG_PatientDoctorDetail', detailId: options.id })
})
```
### 医生端页面访问埋点
```ts
app.waitLogin().then(() => {
app.mpBehavior({ doctor: true, PageName: 'PG_DoctorHome' })
})
```
### 患者端点击埋点
```ts
handleNextVisit() {
app.mpBehavior({ PageName: 'BTN_PatientHomeNextVisit' })
// ... 业务逻辑
}
```
### 医生端点击埋点
```ts
handleInvite() {
app.mpBehavior({ doctor: true, PageName: 'BTN_DoctorHomeInvite' })
// ... 业务逻辑
}
```
### 全局访问埋点
```ts
// app.ts onShow 中,记录小程序整体打开事件
app.mpBehavior({ PageName: 'MINI_PROGRAM_VISIT' })
```
## 页面级埋点(PG_)
### 患者端
| 页面路径 | 页面名称 | PageName | detailId |
|---------|---------|----------|----------|
| pages/index/index | 首页 | `PG_PatientHome` | - |
| gift/pages/recordList/index | 就诊记录列表页 | `PG_PatientRecordList` | - |
| gift/pages/record/index | 就诊记录新增页 | `PG_PatientRecordAdd` | - |
| gift/pages/recordDetail/index | 就诊记录详情页 | `PG_PatientRecordDetail` | `options.id` |
| pages/interactivePatient/index | 医患互动页 | `PG_PatientInteractive` | - |
| pages/doctorDetail/index | 医生详情页 | `PG_PatientDoctorDetail` | `options.id` |
| pages/repository/index | 知识库 | `PG_PatientRepository` | - |
| pages/repositoryDetail/index | 知识库详情页 | `PG_PatientRepositoryDetail` | `id` |
| pages/my/index | 我的 | `PG_PatientMy` | - |
| pages/qaFormDetail/index | 健康档案页 | `PG_PatientQaFormDetail` | - |
| pages/qaForm/index | 健康档案编辑页 | `PG_PatientQaForm` | - |
| pages/caseReport/index | 病例报告页 | `PG_PatientCaseReport` | - |
| pages/personalInformation/index | 个人信息页 | `PG_PatientPersonalInfo` | - |
| pages/cancellation/index | 注销账号页 | `PG_PatientCancellation` | - |
| pages/mySave/index | 我的收藏页 | `PG_PatientMySave` | - |
| pages/feedback/index | 问题反馈页 | `PG_PatientFeedback` | - |
### 医生端
| 页面路径 | 页面名称 | PageName | detailId |
|---------|---------|----------|----------|
| doctor/pages/d_home/index | 首页 | `PG_DoctorHome` | - |
| doctor/pages/d_invite/index | 邀约患者页 | `PG_DoctorInvite` | - |
| doctor/pages/d_patient/index | 患者列表页 | `PG_DoctorPatient` | - |
| doctor/pages/d_patientDetail/index | 患者详情页 | `PG_DoctorPatientDetail` | `this.data.id` |
| doctor/pages/d_taskList/index | 群发列表页 | `PG_DoctorTaskList` | - |
| doctor/pages/d_taskDetail/index | 群发详情页 | `PG_DoctorTaskDetail` | `this.data.id` |
| doctor/pages/d_createTask/index | 群发新增页 | `PG_DoctorCreateTask` | - |
| doctor/pages/d_interactive/index | 互动列表页 | `PG_DoctorInteractive` | - |
| doctor/pages/d_interactiveDoctor/index | 互动页 | `PG_DoctorInteractiveDoctor` | `this.data.patientId` |
| doctor/pages/d_my/index | 我的 | `PG_DoctorMy` | - |
| doctor/pages/d_userInfo/index | 个人信息页 | `PG_DoctorUserInfo` | - |
| doctor/pages/d_changeDoctor/index | 切换医生页 | `PG_DoctorChangeDoctor` | - |
## 点击级埋点(BTN_)
### 患者端
#### 首页(pages/index/index)
| 方法 | PageName | 说明 |
|------|----------|------|
| `routerTo(e)` | `BTN_PatientHomeFunctionCard` | 功能卡片跳转 |
| `handleNextVisit()` | `BTN_PatientHomeNextVisit` | 下次复诊入口 |
| `handleArticleView(e)` | `BTN_PatientHomeArticle` | 文章点击 |
| `handleArticleSave(e)` | `BTN_PatientHomeArticleSave` | 文章收藏 |
| `handleToastOk()` | `BTN_PatientHomeBindDoctor` | 绑定医生弹窗确认 |
| `handlePublic()` | `BTN_PatientHomeFollowPublic` | 关注公众号 |
#### 我的(pages/my/index)
| 方法 | PageName | 说明 |
|------|----------|------|
| `routerVipTo()` | `BTN_PatientMyVip` | VIP 认证入口 |
| `handleMyHealthRecord(e)` | `BTN_PatientMyHealthRecord` | 健康档案 |
| `handleQaForm()` | `BTN_PatientMyQaForm` | 健康问卷 |
| `routerTo(e)` → mySave | `BTN_PatientMySave` | 我的收藏 |
| `routerTo(e)` → personalInfo | `BTN_PatientMyPersonalInfo` | 个人信息 |
| `handleMiniDoctor()` | `BTN_PatientMyMiniDoctor` | 迷你医生 |
| `handleFeedback()` | `BTN_PatientMyFeedback` | 问题反馈 |
#### 医患互动(pages/interactivePatient/index)
| 方法 | PageName | 说明 |
|------|----------|------|
| `handleHot(e)` | `BTN_PatientInteractiveHotQuestion` | 热门问题点击 |
| `handleQuestion(e)` | `BTN_PatientInteractiveQuestion` | 快捷问题点击 |
| `handleConfirm()` | `BTN_PatientInteractiveSend` | 发送消息 |
| `handleAdl()` | `BTN_PatientInteractiveAdl` | ADL 评估入口 |
| `handleQol()` | `BTN_PatientInteractiveQol` | QoL 入口 |
| `handleDoctorDetail()` | `BTN_PatientInteractiveDoctorDetail` | 查看医生详情 |
#### 知识库(pages/repository/index)
| 方法 | PageName | 说明 |
|------|----------|------|
| `tabChange(e)` | `BTN_PatientRepositoryTab` | Tab 切换 |
| `handleSearch()` | `BTN_PatientRepositorySearch` | 搜索 |
| `handleCate(e)` | `BTN_PatientRepositoryCategory` | 分类筛选 |
| `handleDetail(e)` | `BTN_PatientRepositoryArticle` | 文章详情 |
| `handleStar(e)` | `BTN_PatientRepositoryStar` | 点赞 |
| `handleToggleSave(e)` | `BTN_PatientRepositorySave` | 收藏 |
#### 就诊记录列表(gift/pages/recordList/index)
| 方法 | PageName | 说明 |
|------|----------|------|
| `handleAdd()` | `BTN_PatientRecordListAdd` | 新增记录 |
| `handleDetail(e)` | `BTN_PatientRecordListItem` | 记录列表项 |
#### 就诊记录新增(gift/pages/record/index)
| 方法 | PageName | 说明 |
|------|----------|------|
| `handleSubmit()` | `BTN_PatientRecordAddSubmit` | 保存记录 |
### 医生端
#### 医生首页(doctor/pages/d_home/index)
| 方法 | PageName | 说明 |
|------|----------|------|
| `handlePatient(e)` | `BTN_DoctorHomePatient` | 患者列表入口 |
| `handleInvite()` | `BTN_DoctorHomeInvite` | 邀约按钮 |
| `handleSelectYear1()` | `BTN_DoctorHomeSelectYear` | 年份筛选 |
#### 邀约患者(doctor/pages/d_invite/index)
| 方法 | PageName | 说明 |
|------|----------|------|
| `handleDownload()` | `BTN_DoctorInviteSend` | 发送邀约(海报保存/分享) |
#### 患者列表(doctor/pages/d_patient/index)
| 方法 | PageName | 说明 |
|------|----------|------|
| `handleSearch()` | `BTN_DoctorPatientSearch` | 搜索患者 |
| `handleDetail(e)` | `BTN_DoctorPatientItem` | 患者列表项 |
#### 互动列表(doctor/pages/d_interactive/index)
| 方法 | PageName | 说明 |
|------|----------|------|
| `handleSearch()` | `BTN_DoctorInteractiveSearch` | 搜索互动 |
| `handleDetail(e)` | `BTN_DoctorInteractiveItem` | 互动列表项 |
#### 互动页(doctor/pages/d_interactiveDoctor/index)
| 方法 | PageName | 说明 |
|------|----------|------|
| `handleConfirm()` | `BTN_DoctorInteractiveSend` | 发送消息 |
#### 群发列表(doctor/pages/d_taskList/index)
| 方法 | PageName | 说明 |
|------|----------|------|
| `handleCreate()` | `BTN_DoctorTaskListAdd` | 新增群发 |
| `handleDetail(e)` | `BTN_DoctorTaskListItem` | 群发列表项 |
#### 群发新增(doctor/pages/d_createTask/index)
| 方法 | PageName | 说明 |
|------|----------|------|
| `handleSubmit()` | `BTN_DoctorCreateTaskSubmit` | 创建群发 |
#### 切换医生(doctor/pages/d_changeDoctor/index)
| 方法 | PageName | 说明 |
|------|----------|------|
| `handleSubmit()` | `BTN_DoctorChangeDoctorSelect` | 切换医生选择 |

2
src/api/request.ts

@ -20,7 +20,7 @@ export const request = function (
...header, ...header,
}, },
url: gUrl + url, url: gUrl + url,
method: method, method,
data: { data: {
loginState: getApp().globalData.loginState, loginState: getApp().globalData.loginState,
...(data as object), ...(data as object),

2
src/app.ts

@ -411,7 +411,7 @@ App<IAppOption>({
callback(res) callback(res)
}) })
}, },
mpBehavior(data: { PageName: string; doctor?: boolean }) { mpBehavior(data: { PageName: string; doctor?: boolean; detailId?: string }) {
let url = '?r=igg4/mp-behavior/add' let url = '?r=igg4/mp-behavior/add'
if (data.doctor) { if (data.doctor) {
url = '?r=igg4/doctor/mp-behavior/add' url = '?r=igg4/doctor/mp-behavior/add'

4
src/doctor/pages/d_changeDoctor/index.ts

@ -14,6 +14,9 @@ Page({
timer = null timer = null
this.setData({ codeText: '发送验证码' }) this.setData({ codeText: '发送验证码' })
} }
app.waitLogin().then(() => {
app.mpBehavior({ doctor: true, PageName: 'PG_DoctorChangeDoctor' })
})
}, },
onUnload() { onUnload() {
if (timer) { if (timer) {
@ -67,6 +70,7 @@ Page({
}) })
}, },
handleSubmit() { handleSubmit() {
app.mpBehavior({ doctor: true, PageName: 'BTN_DoctorChangeDoctorSelect' })
if (!this.data.mobile) { if (!this.data.mobile) {
wx.showToast({ wx.showToast({
icon: 'none', icon: 'none',

2
src/doctor/pages/d_createTask/index.ts

@ -62,6 +62,7 @@ Page({
}) })
app.waitLogin().then(() => { app.waitLogin().then(() => {
app.mpBehavior({ doctor: true, PageName: 'PG_DoctorCreateTask' })
if (this.data.step === 2) { if (this.data.step === 2) {
this.getTaskNum() this.getTaskNum()
} }
@ -245,6 +246,7 @@ Page({
this.handleViewMp() this.handleViewMp()
}, },
handleSubmit() { handleSubmit() {
app.mpBehavior({ doctor: true, PageName: 'BTN_DoctorCreateTaskSubmit' })
const { const {
SelectAll, SelectAll,
ConfirmedIgg4, ConfirmedIgg4,

1
src/doctor/pages/d_customExport/index.ts

@ -1,4 +1,3 @@
import dayjs from 'dayjs'
const app = getApp<IAppOption>() const app = getApp<IAppOption>()
Page({ Page({

4
src/doctor/pages/d_home/index.ts

@ -35,6 +35,7 @@ Page({
} }
echarts = await require.async('../../../resource/components/echart/echarts.js') echarts = await require.async('../../../resource/components/echart/echarts.js')
app.waitLogin().then((_res) => { app.waitLogin().then((_res) => {
app.mpBehavior({ doctor: true, PageName: 'PG_DoctorHome' })
this.getDoctorInfo() this.getDoctorInfo()
this.getDetail() this.getDetail()
this.getList1_1() this.getList1_1()
@ -65,6 +66,7 @@ Page({
}) })
}, },
handleSelectYear1() { handleSelectYear1() {
app.mpBehavior({ doctor: true, PageName: 'BTN_DoctorHomeSelectYear' })
this.getList1_1() this.getList1_1()
}, },
getList1_1() { getList1_1() {
@ -203,6 +205,7 @@ Page({
} as any) } as any)
}, },
handlePatient(e) { handlePatient(e) {
app.mpBehavior({ doctor: true, PageName: 'BTN_DoctorHomePatient' })
const { type, name } = e.currentTarget.dataset const { type, name } = e.currentTarget.dataset
wx.navigateTo({ wx.navigateTo({
@ -210,6 +213,7 @@ Page({
}) })
}, },
handleInvite() { handleInvite() {
app.mpBehavior({ doctor: true, PageName: 'BTN_DoctorHomeInvite' })
wx.navigateTo({ wx.navigateTo({
url: '/doctor/pages/d_invite/index', url: '/doctor/pages/d_invite/index',
}) })

3
src/doctor/pages/d_interactive/index.ts

@ -14,6 +14,7 @@ Page({
}, },
onShow() { onShow() {
app.waitLogin().then((_res) => { app.waitLogin().then((_res) => {
app.mpBehavior({ doctor: true, PageName: 'PG_DoctorInteractive' })
this.getList() this.getList()
app.setTabbarNoticeMessage() app.setTabbarNoticeMessage()
}) })
@ -21,6 +22,7 @@ Page({
handleTapSearch() { handleTapSearch() {
}, },
handleSearch() { handleSearch() {
app.mpBehavior({ doctor: true, PageName: 'BTN_DoctorInteractiveSearch' })
this.setData({ this.setData({
list: [], list: [],
pagination: { pagination: {
@ -67,6 +69,7 @@ Page({
} }
}, },
handleDetail(e) { handleDetail(e) {
app.mpBehavior({ doctor: true, PageName: 'BTN_DoctorInteractiveItem' })
const { index } = e.currentTarget.dataset const { index } = e.currentTarget.dataset
const { list } = this.data const { list } = this.data
const listItem: any = list[index] const listItem: any = list[index]

2
src/doctor/pages/d_interactiveDoctor/index.ts

@ -66,6 +66,7 @@ Page({
}, },
onShow() { onShow() {
app.waitLogin().then((_res) => { app.waitLogin().then((_res) => {
app.mpBehavior({ doctor: true, PageName: 'PG_DoctorInteractiveDoctor', detailId: this.data.patientId })
this.getDoctorDetail() this.getDoctorDetail()
this.getPatientDetail() this.getPatientDetail()
this.getMessageList() this.getMessageList()
@ -332,6 +333,7 @@ Page({
} }
}, },
handleConfirm() { handleConfirm() {
app.mpBehavior({ doctor: true, PageName: 'BTN_DoctorInteractiveSend' })
const { customMessage } = this.data const { customMessage } = this.data
this.handleHideKeyboard() this.handleHideKeyboard()
this.handleSendCustomMessage(customMessage) this.handleSendCustomMessage(customMessage)

2
src/doctor/pages/d_invite/index.ts

@ -18,6 +18,7 @@ Page({
}) })
} }
app.waitLogin().then((_res) => { app.waitLogin().then((_res) => {
app.mpBehavior({ doctor: true, PageName: 'PG_DoctorInvite' })
wx.showLoading({ wx.showLoading({
title: '加载中', title: '加载中',
}) })
@ -57,6 +58,7 @@ Page({
}) })
}, },
handleDownload() { handleDownload() {
app.mpBehavior({ doctor: true, PageName: 'BTN_DoctorInviteSend' })
wx.showToast({ wx.showToast({
title: '请长按海报图片进行保存', title: '请长按海报图片进行保存',
icon: 'none', icon: 'none',

1
src/doctor/pages/d_my/index.ts

@ -20,6 +20,7 @@ Page({
}, },
onShow() { onShow() {
app.waitLogin().then((_res) => { app.waitLogin().then((_res) => {
app.mpBehavior({ doctor: true, PageName: 'PG_DoctorMy' })
this.getDetail() this.getDetail()
}) })
}, },

3
src/doctor/pages/d_patient/index.ts

@ -57,6 +57,7 @@ Page({
IsThisWeekAdl: Number(options.IsThisWeekAdl || ''), IsThisWeekAdl: Number(options.IsThisWeekAdl || ''),
}) })
app.waitLogin().then((_res) => { app.waitLogin().then((_res) => {
app.mpBehavior({ doctor: true, PageName: 'PG_DoctorPatient' })
this.getList() this.getList()
}) })
}, },
@ -105,6 +106,7 @@ Page({
this.handleSearch() this.handleSearch()
}, },
handleSearch() { handleSearch() {
app.mpBehavior({ doctor: true, PageName: 'BTN_DoctorPatientSearch' })
this.getList() this.getList()
}, },
getList(newPage = 1) { getList(newPage = 1) {
@ -180,6 +182,7 @@ Page({
}) })
}, },
handleDetail(e: any) { handleDetail(e: any) {
app.mpBehavior({ doctor: true, PageName: 'BTN_DoctorPatientItem' })
const { index } = e.currentTarget.dataset const { index } = e.currentTarget.dataset
const item = this.data.list[index] const item = this.data.list[index]

1
src/doctor/pages/d_patientDetail/index.ts

@ -189,6 +189,7 @@ Page({
echarts = await require.async('../../../resource/components/echart/echarts.js') echarts = await require.async('../../../resource/components/echart/echarts.js')
this.ecDataTrendComponent = this.selectComponent('#chart1') this.ecDataTrendComponent = this.selectComponent('#chart1')
app.waitLogin().then(async (_res) => { app.waitLogin().then(async (_res) => {
app.mpBehavior({ doctor: true, PageName: 'PG_DoctorPatientDetail', detailId: this.data.id })
this.getDoctorDetail() this.getDoctorDetail()
await this.getDetail() await this.getDetail()
this.getIndicatorHistory() this.getIndicatorHistory()

1
src/doctor/pages/d_taskDetail/index.ts

@ -39,6 +39,7 @@ Page({
id: options.id, id: options.id,
}) })
app.waitLogin().then(() => { app.waitLogin().then(() => {
app.mpBehavior({ doctor: true, PageName: 'PG_DoctorTaskDetail', detailId: this.data.id })
this.getDetail() this.getDetail()
}) })
}, },

3
src/doctor/pages/d_taskList/index.ts

@ -47,6 +47,7 @@ Page({
}, },
onShow() { onShow() {
app.waitLogin().then(() => { app.waitLogin().then(() => {
app.mpBehavior({ doctor: true, PageName: 'PG_DoctorTaskList' })
this.getList() this.getList()
}) })
}, },
@ -96,11 +97,13 @@ Page({
}) })
}, },
handleCreate() { handleCreate() {
app.mpBehavior({ doctor: true, PageName: 'BTN_DoctorTaskListAdd' })
wx.navigateTo({ wx.navigateTo({
url: '/doctor/pages/d_createTask/index', url: '/doctor/pages/d_createTask/index',
}) })
}, },
handleDetail(e) { handleDetail(e) {
app.mpBehavior({ doctor: true, PageName: 'BTN_DoctorTaskListItem' })
const { id } = e.currentTarget.dataset const { id } = e.currentTarget.dataset
wx.navigateTo({ wx.navigateTo({
url: `/doctor/pages/d_taskDetail/index?id=${id}`, url: `/doctor/pages/d_taskDetail/index?id=${id}`,

1
src/doctor/pages/d_userInfo/index.ts

@ -57,6 +57,7 @@ Page({
onLoad() {}, onLoad() {},
onShow() { onShow() {
app.waitLogin().then((_res) => { app.waitLogin().then((_res) => {
app.mpBehavior({ doctor: true, PageName: 'PG_DoctorUserInfo' })
this.getDetail() this.getDetail()
}) })
}, },

4
src/gift/pages/record/index.ts

@ -76,6 +76,9 @@ Page({
_saveDraftDebounced: null as any, _saveDraftDebounced: null as any,
onLoad(options: any) { onLoad(options: any) {
_app.waitLogin().then(() => {
_app.mpBehavior({ PageName: 'PG_PatientRecordAdd' })
})
if (options.id) { if (options.id) {
this.setData({ draftId: Number(options.id) }) this.setData({ draftId: Number(options.id) })
_app.waitLogin().then(() => { _app.waitLogin().then(() => {
@ -418,6 +421,7 @@ Page({
}, },
handleSubmit() { handleSubmit() {
_app.mpBehavior({ PageName: 'BTN_PatientRecordAddSubmit' })
const hasData = const hasData =
this.data.igG4Value || this.data.igG4Value ||
this.data.medicationsUsed.length || this.data.medicationsUsed.length ||

5
src/gift/pages/recordDetail/index.ts

@ -27,6 +27,8 @@ const IMAGE_TYPE_LABELS: Record<string, string> = {
immuneFunction: '外周血免疫功能评估', immuneFunction: '外周血免疫功能评估',
} }
const app = getApp<IAppOption>()
Page({ Page({
data: { data: {
id: 0, id: 0,
@ -41,6 +43,9 @@ Page({
}, },
onLoad(options: any) { onLoad(options: any) {
app.waitLogin().then(() => {
app.mpBehavior({ PageName: 'PG_PatientRecordDetail', detailId: String(options.id) })
})
if (options.id) { if (options.id) {
this.setData({ id: Number(options.id) }) this.setData({ id: Number(options.id) })
this.getDetail() this.getDetail()

3
src/gift/pages/recordList/index.ts

@ -59,6 +59,7 @@ Page({
echarts = mod echarts = mod
}) })
_app.waitLogin().then(() => { _app.waitLogin().then(() => {
_app.mpBehavior({ PageName: 'PG_PatientRecordList' })
this.getLatestRecord() this.getLatestRecord()
this.getList() this.getList()
this.getIndicatorHistory() this.getIndicatorHistory()
@ -324,6 +325,7 @@ Page({
// ========== 导航 ========== // ========== 导航 ==========
handleDetail(e: any) { handleDetail(e: any) {
_app.mpBehavior({ PageName: 'BTN_PatientRecordListItem' })
const { id, status } = e.currentTarget.dataset const { id, status } = e.currentTarget.dataset
if (status === 1) { if (status === 1) {
wx.navigateTo({ url: `/gift/pages/record/index?id=${id}` }) wx.navigateTo({ url: `/gift/pages/record/index?id=${id}` })
@ -333,6 +335,7 @@ Page({
}, },
handleAdd() { handleAdd() {
_app.mpBehavior({ PageName: 'BTN_PatientRecordListAdd' })
wx.navigateTo({ url: '/gift/pages/record/index' }) wx.navigateTo({ url: '/gift/pages/record/index' })
}, },

BIN
src/images/avatar1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

5
src/pages/cancellation/index.ts

@ -5,9 +5,12 @@ Page({
durgInfo: {}, durgInfo: {},
}, },
onLoad() { onLoad() {
app.waitLogin().then(() => {
app.mpBehavior({ PageName: 'PG_PatientCancellation' })
})
const _this = this; const _this = this;
const eventChannel = this.getOpenerEventChannel(); const eventChannel = this.getOpenerEventChannel();
eventChannel.on("durgInfo", function (data) { eventChannel.on("durgInfo", (data) => {
console.log(data); console.log(data);
_this.setData({ _this.setData({
durgInfo: data, durgInfo: data,

5
src/pages/caseReport/index.ts

@ -1,3 +1,5 @@
const app = getApp<IAppOption>()
Page({ Page({
data: { data: {
imageField: '', imageField: '',
@ -6,6 +8,9 @@ Page({
}, },
onLoad(options: any) { onLoad(options: any) {
app.waitLogin().then(() => {
app.mpBehavior({ PageName: 'PG_PatientCaseReport' })
})
if (options.name) { if (options.name) {
wx.setNavigationBarTitle({ title: options.name }) wx.setNavigationBarTitle({ title: options.name })
} }

2
src/pages/certReslove/index.ts

@ -1,5 +1,5 @@
const app = getApp<IAppOption>(); const app = getApp<IAppOption>();
let timer = null as null | number; const timer = null as null | number;
Page({ Page({
data: { data: {

4
src/pages/changeUser/index.ts

@ -32,7 +32,7 @@ Page({
return; return;
} }
// 验证手机号 // 验证手机号
if (!/^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/.test(mobile)) { if (!/^(13\d|14[579]|15[0-3,5-9]|166|17[0135-8]|18\d|19[89])\d{8}$/.test(mobile)) {
wx.showToast({ wx.showToast({
title: "手机号格式不正确", title: "手机号格式不正确",
icon: "none", icon: "none",
@ -55,7 +55,7 @@ Page({
timer = setInterval(() => { timer = setInterval(() => {
time--; time--;
this.setData({ this.setData({
codeText: time + "s后重新发送", codeText: `${time }s后重新发送`,
}); });
if (time <= 0) { if (time <= 0) {
clearInterval(timer as number); clearInterval(timer as number);

1
src/pages/doctorDetail/index.ts

@ -23,6 +23,7 @@ Page({
}) })
} }
app.waitLogin().then((_res) => { app.waitLogin().then((_res) => {
app.mpBehavior({ PageName: 'PG_PatientDoctorDetail', detailId: options.id })
this.setData({ this.setData({
id: options.id, id: options.id,
}) })

4
src/pages/doctorDetailBak/index.ts

@ -40,7 +40,7 @@ Page({
title: "请求授权当前位置", title: "请求授权当前位置",
content: "需要获取您的地理位置,请确认授权", content: "需要获取您的地理位置,请确认授权",
confirmColor: "#cf5375", confirmColor: "#cf5375",
success: function (res) { success (res) {
if (res.cancel) { if (res.cancel) {
//取消授权 //取消授权
wx.showToast({ wx.showToast({
@ -51,7 +51,7 @@ Page({
} else if (res.confirm) { } else if (res.confirm) {
//确定授权,通过wx.openSetting发起授权请求 //确定授权,通过wx.openSetting发起授权请求
wx.openSetting({ wx.openSetting({
success: function (res) { success (res) {
if (res.authSetting["scope.userFuzzyLocation"] == true) { if (res.authSetting["scope.userFuzzyLocation"] == true) {
// wx.showToast({ // wx.showToast({
// title: '授权成功', // title: '授权成功',

3
src/pages/familyScan/index.ts

@ -1,5 +1,4 @@
const app = getApp<IAppOption>(); const app = getApp<IAppOption>();
import { parseScene } from "@/utils/util";
Page({ Page({
data: { data: {
@ -40,7 +39,7 @@ Page({
}, },
loading: true, loading: true,
}).then((res) => { }).then((res) => {
let RelationType = res.HasSelf == 1 ? "2" : ""; const RelationType = res.HasSelf == 1 ? "2" : "";
if (!res.PatientId) { if (!res.PatientId) {
if (!this.data.ignoreAgreement) { if (!this.data.ignoreAgreement) {
if (UserType >= 2) { if (UserType >= 2) {

6
src/pages/feedback/index.ts

@ -6,7 +6,11 @@ Page({
toastType: '', toastType: '',
toastParams: {}, toastParams: {},
}, },
onLoad() {}, onLoad() {
_app.waitLogin().then(() => {
_app.mpBehavior({ PageName: 'PG_PatientFeedback' })
})
},
handleTel() { handleTel() {
// wx.navigateTo({ // wx.navigateTo({
// url: '/pages/feedbackTel/index', // url: '/pages/feedbackTel/index',

12
src/pages/getUserInfo/index.ts

@ -12,7 +12,7 @@ Page({
if (SystemInfo) { if (SystemInfo) {
const { bottom } = SystemInfo.capsulePosition; const { bottom } = SystemInfo.capsulePosition;
this.setData({ this.setData({
bottom: bottom, bottom,
}); });
} }
}, },
@ -24,17 +24,17 @@ Page({
onChooseAvatar(e) { onChooseAvatar(e) {
const { avatarUrl } = e.detail; const { avatarUrl } = e.detail;
const that = this; const that = this;
let url = `${app.globalData.upFileUrl}?r=file-service/upload-img`; const url = `${app.globalData.upFileUrl}?r=file-service/upload-img`;
wx.showLoading({ wx.showLoading({
title: "上传中", title: "上传中",
}); });
wx.uploadFile({ wx.uploadFile({
url: url, url,
filePath: avatarUrl, filePath: avatarUrl,
name: "file", name: "file",
success(res) { success(res) {
let data = JSON.parse(res.data); const data = JSON.parse(res.data);
let avatarUrl = data.data.Url; const avatarUrl = data.data.Url;
wx.ajax({ wx.ajax({
method: "POST", method: "POST",
url: "?r=igg4/account/update-user-img", url: "?r=igg4/account/update-user-img",
@ -49,7 +49,7 @@ Page({
icon: "none", icon: "none",
}); });
that.setData({ that.setData({
["userInfo.UserImg"]: avatarUrl, "userInfo.UserImg": avatarUrl,
}); });
}) })
.catch(() => { .catch(() => {

7
src/pages/index/index.ts

@ -62,6 +62,7 @@ Page({
}, },
onShow() { onShow() {
app.waitLogin({}).then(() => { app.waitLogin({}).then(() => {
app.mpBehavior({ PageName: 'PG_PatientHome' })
this.setData({ this.setData({
anyWhere: app.globalData.anyWhere, anyWhere: app.globalData.anyWhere,
}) })
@ -328,6 +329,7 @@ Page({
}) })
}, },
routerTo(e) { routerTo(e) {
app.mpBehavior({ PageName: 'BTN_PatientHomeFunctionCard' })
let { url, active, code } = e.currentTarget.dataset let { url, active, code } = e.currentTarget.dataset
if (!url) return if (!url) return
@ -352,6 +354,7 @@ Page({
}) })
}, },
handleNextVisit() { handleNextVisit() {
app.mpBehavior({ PageName: 'BTN_PatientHomeNextVisit' })
const nextVisitDays = this.data.nextVisitDays const nextVisitDays = this.data.nextVisitDays
app.permissionVerification(3, 0, '').then(() => { app.permissionVerification(3, 0, '').then(() => {
wx.navigateTo({ wx.navigateTo({
@ -385,6 +388,7 @@ Page({
handleToastOk() { handleToastOk() {
const { toastType } = this.data const { toastType } = this.data
if (toastType === 'dedicatedDoctor' || toastType === 'recommendBindDoctor') { if (toastType === 'dedicatedDoctor' || toastType === 'recommendBindDoctor') {
app.mpBehavior({ PageName: 'BTN_PatientHomeBindDoctor' })
wx.ajax({ wx.ajax({
method: 'POST', method: 'POST',
url: '?r=igg4/popup/close-popup', url: '?r=igg4/popup/close-popup',
@ -426,12 +430,14 @@ Page({
}) })
}, },
handleArticleView(e: any) { handleArticleView(e: any) {
app.mpBehavior({ PageName: 'BTN_PatientHomeArticle' })
const { id } = e.currentTarget.dataset const { id } = e.currentTarget.dataset
wx.navigateTo({ wx.navigateTo({
url: `/pages/repositoryDetail/index?id=${id}`, url: `/pages/repositoryDetail/index?id=${id}`,
}) })
}, },
handleArticleSave(e: any) { handleArticleSave(e: any) {
app.mpBehavior({ PageName: 'BTN_PatientHomeArticleSave' })
const { id, saved } = e.currentTarget.dataset const { id, saved } = e.currentTarget.dataset
const url = saved ? '?r=igg4/pic-text/cancel-collection' : '?r=igg4/pic-text/collection' const url = saved ? '?r=igg4/pic-text/cancel-collection' : '?r=igg4/pic-text/collection'
app.permissionVerification(3, 3, `/pages/index/index`, id).then(() => { app.permissionVerification(3, 3, `/pages/index/index`, id).then(() => {
@ -456,6 +462,7 @@ Page({
}) })
}, },
handlePublic() { handlePublic() {
app.mpBehavior({ PageName: 'BTN_PatientHomeFollowPublic' })
this.setData({ this.setData({
toastShow: true, toastShow: true,
toastType: 'public-toast', toastType: 'public-toast',

7
src/pages/interactivePatient/index.ts

@ -65,6 +65,7 @@ Page({
this.setData({ pageTop }) this.setData({ pageTop })
app.waitLogin({}).then(() => { app.waitLogin({}).then(() => {
app.mpBehavior({ PageName: 'PG_PatientInteractive' })
this.getDoctorDetail() this.getDoctorDetail()
this.getQuestionList() this.getQuestionList()
this.getMessageList() this.getMessageList()
@ -165,6 +166,7 @@ Page({
} }
}, },
handleHot(e) { handleHot(e) {
app.mpBehavior({ PageName: 'BTN_PatientInteractiveHotQuestion' })
if (this.data.sending) return if (this.data.sending) return
const { index, mindex } = e.currentTarget.dataset const { index, mindex } = e.currentTarget.dataset
const { messageList } = this.data const { messageList } = this.data
@ -188,6 +190,7 @@ Page({
this.sendQuestion(hot?.questionId) this.sendQuestion(hot?.questionId)
}, },
handleQuestion(e) { handleQuestion(e) {
app.mpBehavior({ PageName: 'BTN_PatientInteractiveQuestion' })
if (this.data.sending) return if (this.data.sending) return
const { index } = e.currentTarget.dataset const { index } = e.currentTarget.dataset
const { questionActiveList, messageList } = this.data const { questionActiveList, messageList } = this.data
@ -280,6 +283,7 @@ Page({
}) })
}, },
handleDoctorDetail() { handleDoctorDetail() {
app.mpBehavior({ PageName: 'BTN_PatientInteractiveDoctorDetail' })
const { doctorId } = this.data.doctorDetail const { doctorId } = this.data.doctorDetail
wx.navigateTo({ wx.navigateTo({
url: `/pages/doctorDetail/index?id=${doctorId}`, url: `/pages/doctorDetail/index?id=${doctorId}`,
@ -352,6 +356,7 @@ Page({
this.handleSendCustomMessage(message) this.handleSendCustomMessage(message)
}, },
handleConfirm() { handleConfirm() {
app.mpBehavior({ PageName: 'BTN_PatientInteractiveSend' })
const { customMessage } = this.data const { customMessage } = this.data
this.handleFooter() this.handleFooter()
this.handleSendCustomMessage(customMessage) this.handleSendCustomMessage(customMessage)
@ -408,11 +413,13 @@ Page({
}) })
}, },
handleAdl() { handleAdl() {
app.mpBehavior({ PageName: 'BTN_PatientInteractiveAdl' })
wx.navigateTo({ wx.navigateTo({
url: '/pages/adl/index', url: '/pages/adl/index',
}) })
}, },
handleQol() { handleQol() {
app.mpBehavior({ PageName: 'BTN_PatientInteractiveQol' })
wx.navigateTo({ wx.navigateTo({
url: '/pages/qaForm/index', url: '/pages/qaForm/index',
}) })

2
src/pages/liveResult/index.ts

@ -1,5 +1,5 @@
const app = getApp<IAppOption>();
import dayjs from "dayjs"; import dayjs from "dayjs";
const app = getApp<IAppOption>();
let live_time: null | number = null; let live_time: null | number = null;
Page({ Page({

11
src/pages/my/index.ts

@ -29,6 +29,7 @@ Page({
}, },
onShow() { onShow() {
app.waitLogin().then(() => { app.waitLogin().then(() => {
app.mpBehavior({ PageName: 'PG_PatientMy' })
app.getUserInfo(this, true, () => {}) app.getUserInfo(this, true, () => {})
this.getScore() this.getScore()
}) })
@ -45,6 +46,7 @@ Page({
}) })
}, },
handleMyHealthRecord(e) { handleMyHealthRecord(e) {
app.mpBehavior({ PageName: 'BTN_PatientMyHealthRecord' })
const { url } = e.currentTarget.dataset const { url } = e.currentTarget.dataset
app.permissionVerification(3, 0, url).then(() => { app.permissionVerification(3, 0, url).then(() => {
wx.navigateTo({ wx.navigateTo({
@ -73,6 +75,11 @@ Page({
}, },
routerTo(e) { routerTo(e) {
const { url } = e.currentTarget.dataset const { url } = e.currentTarget.dataset
if (url?.includes('mySave')) {
app.mpBehavior({ PageName: 'BTN_PatientMySave' })
} else if (url?.includes('personalInformation')) {
app.mpBehavior({ PageName: 'BTN_PatientMyPersonalInfo' })
}
if (!url) { if (!url) {
wx.showToast({ wx.showToast({
icon: 'none', icon: 'none',
@ -84,6 +91,7 @@ Page({
}) })
}, },
handleQaForm() { handleQaForm() {
app.mpBehavior({ PageName: 'BTN_PatientMyQaForm' })
wx.ajax({ wx.ajax({
method: 'GET', method: 'GET',
url: '?r=igg4/health-question/get-patient-questionnaire', url: '?r=igg4/health-question/get-patient-questionnaire',
@ -103,6 +111,7 @@ Page({
}) })
}, },
routerVipTo() { routerVipTo() {
app.mpBehavior({ PageName: 'BTN_PatientMyVip' })
const { UseDrugsAuditStatus, UserType } = this.data.userInfo const { UseDrugsAuditStatus, UserType } = this.data.userInfo
if (!UserType) { if (!UserType) {
app.getUserInfo(this, true, () => { app.getUserInfo(this, true, () => {
@ -126,11 +135,13 @@ Page({
}, },
handleMiniDoctor() { handleMiniDoctor() {
app.mpBehavior({ PageName: 'BTN_PatientMyMiniDoctor' })
wx.navigateTo({ wx.navigateTo({
url: '/pages/webview/index', url: '/pages/webview/index',
}) })
}, },
handleFeedback() { handleFeedback() {
app.mpBehavior({ PageName: 'BTN_PatientMyFeedback' })
wx.navigateTo({ wx.navigateTo({
url: '/pages/feedback/index', url: '/pages/feedback/index',
}) })

1
src/pages/mySave/index.ts

@ -13,6 +13,7 @@ Page({
}, },
onLoad() { onLoad() {
app.waitLogin().then(() => { app.waitLogin().then(() => {
app.mpBehavior({ PageName: 'PG_PatientMySave' })
wx.ajax({ wx.ajax({
method: 'GET', method: 'GET',
url: '?r=igg4/common/get-config', url: '?r=igg4/common/get-config',

1
src/pages/personalInformation/index.ts

@ -31,6 +31,7 @@ Page({
}) })
app.waitLogin().then(() => { app.waitLogin().then(() => {
app.mpBehavior({ PageName: 'PG_PatientPersonalInfo' })
const that = this const that = this
app.getUserInfo(that, true, that.formatUserInfo.bind(that)) app.getUserInfo(that, true, that.formatUserInfo.bind(that))
}) })

1
src/pages/qaForm/index.ts

@ -41,6 +41,7 @@ Page({
backPage: options.backPage || '', backPage: options.backPage || '',
}) })
app.waitLogin({}).then(() => { app.waitLogin({}).then(() => {
app.mpBehavior({ PageName: 'PG_PatientQaForm' })
this.loadQuestionnaire() this.loadQuestionnaire()
}) })
}, },

1
src/pages/qaFormDetail/index.ts

@ -65,6 +65,7 @@ Page({
onLoad() { onLoad() {
app.waitLogin({}).then(() => { app.waitLogin({}).then(() => {
app.mpBehavior({ PageName: 'PG_PatientQaFormDetail' })
this.loadData() this.loadData()
}) })
}, },

7
src/pages/repository/index.ts

@ -18,6 +18,7 @@ Page({
}, },
onLoad(options) { onLoad(options) {
app.waitLogin().then(() => { app.waitLogin().then(() => {
app.mpBehavior({ PageName: 'PG_PatientRepository' })
this.getConfig(options) this.getConfig(options)
this.getBanner() this.getBanner()
app.getUserInfo(this, true) app.getUserInfo(this, true)
@ -58,6 +59,7 @@ Page({
}) })
}, },
tabChange(e) { tabChange(e) {
app.mpBehavior({ PageName: 'BTN_PatientRepositoryTab' })
const { storyCateId } = this.data const { storyCateId } = this.data
this.setData({ this.setData({
active: e.detail.index, active: e.detail.index,
@ -79,6 +81,7 @@ Page({
this.handleSearch() this.handleSearch()
}, },
handleSearch() { handleSearch() {
app.mpBehavior({ PageName: 'BTN_PatientRepositorySearch' })
this.getList() this.getList()
}, },
getList() { getList() {
@ -134,6 +137,7 @@ Page({
}) })
}, },
handleStar(e) { handleStar(e) {
app.mpBehavior({ PageName: 'BTN_PatientRepositoryStar' })
const { id, index } = e.currentTarget.dataset const { id, index } = e.currentTarget.dataset
wx.ajax({ wx.ajax({
method: 'POST', method: 'POST',
@ -150,6 +154,7 @@ Page({
}) })
}, },
handleCate(e: WechatMiniprogram.CustomEvent) { handleCate(e: WechatMiniprogram.CustomEvent) {
app.mpBehavior({ PageName: 'BTN_PatientRepositoryCategory' })
const { id } = e.currentTarget.dataset const { id } = e.currentTarget.dataset
this.setData({ this.setData({
CateId: id, CateId: id,
@ -157,12 +162,14 @@ Page({
this.getList() this.getList()
}, },
handleDetail(e: WechatMiniprogram.CustomEvent) { handleDetail(e: WechatMiniprogram.CustomEvent) {
app.mpBehavior({ PageName: 'BTN_PatientRepositoryArticle' })
const { id } = e.currentTarget.dataset const { id } = e.currentTarget.dataset
wx.navigateTo({ wx.navigateTo({
url: `/pages/repositoryDetail/index?id=${id}`, url: `/pages/repositoryDetail/index?id=${id}`,
}) })
}, },
handleToggleSave(e: WechatMiniprogram.CustomEvent) { handleToggleSave(e: WechatMiniprogram.CustomEvent) {
app.mpBehavior({ PageName: 'BTN_PatientRepositorySave' })
const { id, collect, index } = e.currentTarget.dataset const { id, collect, index } = e.currentTarget.dataset
const { list, active } = this.data const { list, active } = this.data
const title = list[index].Title const title = list[index].Title

1
src/pages/repositoryDetail/index.ts

@ -33,6 +33,7 @@ Page({
id, id,
}) })
app.waitLogin().then(() => { app.waitLogin().then(() => {
app.mpBehavior({ PageName: 'PG_PatientRepositoryDetail', detailId: id })
this.getDetail(true) this.getDetail(true)
}) })
}, },

8
src/pages/smallPage/index.ts

@ -49,9 +49,9 @@ Page({
}, },
], ],
}, },
onLoad: function (options) { onLoad (options) {
if (options.scene || app.globalData.newPageId) { if (options.scene || app.globalData.newPageId) {
let scene = app.filterUrlParam(decodeURIComponent(options.scene)); const scene = app.filterUrlParam(decodeURIComponent(options.scene));
console.log(scene.pageId || app.globalData.newPageId); console.log(scene.pageId || app.globalData.newPageId);
this.setData({ this.setData({
pageId: scene.pageId || app.globalData.newPageId, pageId: scene.pageId || app.globalData.newPageId,
@ -83,7 +83,7 @@ Page({
success(res) { success(res) {
const dataInfo = res.data.data; const dataInfo = res.data.data;
that.setData({ that.setData({
dataInfo: dataInfo, dataInfo,
}); });
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: dataInfo.WeiTitle, title: dataInfo.WeiTitle,
@ -100,7 +100,7 @@ Page({
handleSex(e) { handleSex(e) {
const { value } = e.currentTarget.dataset; const { value } = e.currentTarget.dataset;
this.setData({ this.setData({
["form.sex"]: value, "form.sex": value,
}); });
}, },
handleCllaNo() { handleCllaNo() {

4
src/pages/storyDetail/index.ts

@ -13,7 +13,7 @@ Page({
if (SystemInfo) { if (SystemInfo) {
const { bottom } = SystemInfo.capsulePosition; const { bottom } = SystemInfo.capsulePosition;
this.setData({ this.setData({
bottom: bottom, bottom,
}); });
} }
this.setData({ this.setData({
@ -82,7 +82,7 @@ Page({
handleOk() { handleOk() {
const id = this.data.detail.Id; const id = this.data.detail.Id;
const type = this.data.toastType; const type = this.data.toastType;
let url = type === "withdraw" ? "?r=igg4/story/cancel-publish" : "?r=igg4/story/recovery-publish"; const url = type === "withdraw" ? "?r=igg4/story/cancel-publish" : "?r=igg4/story/recovery-publish";
wx.ajax({ wx.ajax({
method: "POST", method: "POST",
url, url,

2
src/pages/storyEnterResult/index.ts

@ -11,7 +11,7 @@ Page({
if (SystemInfo) { if (SystemInfo) {
const { bottom } = SystemInfo.capsulePosition; const { bottom } = SystemInfo.capsulePosition;
this.setData({ this.setData({
bottom: bottom, bottom,
}); });
} }
this.setData({ this.setData({

2
src/pages/thePublic/index.ts

@ -10,7 +10,7 @@ Page({
if (SystemInfo) { if (SystemInfo) {
const { bottom } = SystemInfo.capsulePosition; const { bottom } = SystemInfo.capsulePosition;
this.setData({ this.setData({
bottom: bottom, bottom,
}); });
} }
app.waitLogin().then((_res) => { app.waitLogin().then((_res) => {

4
src/pages/uploadCert/index.ts

@ -75,7 +75,7 @@ Page({
} else { } else {
urlKey = 'reslove' urlKey = 'reslove'
} }
let navUrl = { const navUrl = {
reslove: '/pages/certReslove/index', reslove: '/pages/certReslove/index',
pending: '/pages/certPending/index', pending: '/pages/certPending/index',
nopending: '/pages/startPending/index', nopending: '/pages/startPending/index',
@ -123,7 +123,7 @@ Page({
} else { } else {
urlKey = 'reslove' urlKey = 'reslove'
} }
let navUrl = { const navUrl = {
reslove: '/pages/certReslove/index', reslove: '/pages/certReslove/index',
pending: '/pages/certPending/index', pending: '/pages/certPending/index',
nopending: '/pages/startPending/index', nopending: '/pages/startPending/index',

8
src/pages/vipLogin/index.ts

@ -33,7 +33,7 @@ Page({
}, },
bindScanCode(res: WechatMiniprogram.CustomEvent) { bindScanCode(res: WechatMiniprogram.CustomEvent) {
const { result } = res.detail; const { result } = res.detail;
this.setData({ result: result }); this.setData({ result });
this.getDurgInfo(result); this.getDurgInfo(result);
}, },
onHide() { onHide() {
@ -45,7 +45,7 @@ Page({
getDurgInfo(DrugsCode: string) { getDurgInfo(DrugsCode: string) {
const that = this; const that = this;
const { registrationSource, registChannel, regBusinessId } = app.globalData; const { registrationSource, registChannel, regBusinessId } = app.globalData;
let scaned = this.data.scaned; const scaned = this.data.scaned;
if (!scaned) { if (!scaned) {
that.setData({ that.setData({
scaned: !0, scaned: !0,
@ -69,7 +69,7 @@ Page({
} else { } else {
urlKey = "reslove"; urlKey = "reslove";
} }
let navUrl = { const navUrl = {
reslove: "/pages/certReslove/index?drug=1", reslove: "/pages/certReslove/index?drug=1",
pending: "/pages/certPending/index", pending: "/pages/certPending/index",
nopending: "/pages/startPending/index", nopending: "/pages/startPending/index",
@ -136,7 +136,7 @@ Page({
}, },
openSetting() { openSetting() {
const _this = this; const _this = this;
let promise = new Promise((resolve) => { const promise = new Promise((resolve) => {
wx.showModal({ wx.showModal({
title: "授权", title: "授权",
content: "请先授权获取摄像头权限", content: "请先授权获取摄像头权限",

2
src/pages/vipLoginReject/index.ts

@ -12,7 +12,7 @@ Page({
onLoad() { onLoad() {
const _this = this; const _this = this;
const eventChannel = this.getOpenerEventChannel(); const eventChannel = this.getOpenerEventChannel();
eventChannel.on("durgInfo", function (data) { eventChannel.on("durgInfo", (data) => {
_this.setData({ _this.setData({
durgInfo: data, durgInfo: data,
}); });

2
typings/index.d.ts vendored

@ -71,7 +71,7 @@ interface IAppOption {
waitLogin: (obj?: { isReg?: boolean; loginPage?: boolean; pub?: boolean }) => Promise<any> waitLogin: (obj?: { isReg?: boolean; loginPage?: boolean; pub?: boolean }) => Promise<any>
startLogin: () => Promise<void> startLogin: () => Promise<void>
getUserInfo: (self?, update?: boolean, callback?: (userinfo) => void) => void getUserInfo: (self?, update?: boolean, callback?: (userinfo) => void) => void
mpBehavior: (data: { PageName: string; doctor?: boolean }) => void mpBehavior: (data: { PageName: string; doctor?: boolean; detailId?: string }) => void
globalSystemInfo?: globalSystemInfo globalSystemInfo?: globalSystemInfo
[propName: string]: any [propName: string]: any
} }

Loading…
Cancel
Save