Przeglądaj źródła

page
- 首页 pages/home/home
- 我的 pages/mine/mine
- 健康管家 module/chats/pages/index/index
- 健康宣教 module/article/pages/science-list/science-list
- 中医茶饮/药膳 module/article/pages/diet-list/diet-list
- 咨询记录 module/chats/pages/consultation-record/consultation-record
- 线下非药物治疗 module/care/pages/offlineTreatment/offlineTreatment

component
- 操作业务 module/chats/components/guide/guide
- 健康分析(问卷) module/chats/components/questionnaire/questionnaire
- 消息卡片(报告) module/chats/components/message-report/message-report
- 消息卡片(咨询) module/chats/components/message-consult/message-consult

cc12458 3 miesięcy temu
rodzic
commit
95b86e2cbd

+ 7 - 2
miniprogram/components/tabbar/tabbar.ts

@@ -1,7 +1,9 @@
+import I18nBehavior from "../../i18n/behavior";
 import props from "../../miniprogram_npm/tdesign-miniprogram/action-sheet/props";
 import props from "../../miniprogram_npm/tdesign-miniprogram/action-sheet/props";
 import Tabbar from "../../miniprogram_npm/tdesign-miniprogram/tab-bar/tab-bar";
 import Tabbar from "../../miniprogram_npm/tdesign-miniprogram/tab-bar/tab-bar";
 
 
 Component({
 Component({
+  behaviors: [I18nBehavior],
   data: {
   data: {
     tabbarHeight: 0,
     tabbarHeight: 0,
     pageHeight: "100vh",
     pageHeight: "100vh",
@@ -15,7 +17,7 @@ Component({
       },
       },
       {
       {
         value: "/module/chats/pages/index/index",
         value: "/module/chats/pages/index/index",
-        label: "健康管家",
+        label: "",
         icon: "app",
         icon: "app",
         path: "/module/chats/pages/index/index",
         path: "/module/chats/pages/index/index",
       },
       },
@@ -26,6 +28,9 @@ Component({
         path: "/pages/mine/mine",
         path: "/pages/mine/mine",
       },
       },
     ],
     ],
+    i18n: {
+      common: { title: '生活助理' }
+    }
   },
   },
   properties: {
   properties: {
     tabbarValue: {
     tabbarValue: {
@@ -63,7 +68,7 @@ Component({
       });
       });
       wx.setStorageSync("isAnalysis", 3);
       wx.setStorageSync("isAnalysis", 3);
     },
     },
-    onChange(e:any) {
+    onChange(e: any) {
       this.setData({
       this.setData({
         value: e.detail.value,
         value: e.detail.value,
       });
       });

+ 1 - 1
miniprogram/components/tabbar/tabbar.wxml

@@ -1,5 +1,5 @@
 <t-tab-bar t-class="my-tabbar" value="{{value}}" bindchange="onChange" theme="tag" split="{{false}}">
 <t-tab-bar t-class="my-tabbar" value="{{value}}" bindchange="onChange" theme="tag" split="{{false}}">
   <t-tab-bar-item wx:for="{{list}}" wx:key="value" value="{{item.value}}" icon="{{item.icon}}" data-id="{{item.id}}">
   <t-tab-bar-item wx:for="{{list}}" wx:key="value" value="{{item.value}}" icon="{{item.icon}}" data-id="{{item.id}}">
-    {{item.label}}
+    {{item.label || i18n.common.title}}
   </t-tab-bar-item>
   </t-tab-bar-item>
 </t-tab-bar>
 </t-tab-bar>

+ 7 - 2
miniprogram/module/article/pages/diet-list/diet-list.ts

@@ -1,9 +1,11 @@
 import PageContainerBehavior from "../../../../core/behavior/page-container.behavior";
 import PageContainerBehavior from "../../../../core/behavior/page-container.behavior";
+import I18nBehavior from "../../../../i18n/behavior";
 import tickleBehavior, { getTickleContext } from "../../../../core/behavior/tickle.behavior";
 import tickleBehavior, { getTickleContext } from "../../../../core/behavior/tickle.behavior";
 import { getDietListMethod } from "../../request";
 import { getDietListMethod } from "../../request";
 // module/diet/pages/diet-list/diet-list.ts
 // module/diet/pages/diet-list/diet-list.ts
 Component({
 Component({
   behaviors: [
   behaviors: [
+    I18nBehavior,
     PageContainerBehavior,
     PageContainerBehavior,
     tickleBehavior,
     tickleBehavior,
   ],
   ],
@@ -17,6 +19,9 @@ Component({
     classify: { type: String, value: '' },
     classify: { type: String, value: '' },
   },
   },
   data: {
   data: {
+    i18n: {
+      home: { tea: '茶', tonic: "菜谱" }
+    },
     keyword: '',
     keyword: '',
     searchInputProps: {
     searchInputProps: {
       placeholderStyle: 'color: #929292;',
       placeholderStyle: 'color: #929292;',
@@ -30,8 +35,8 @@ Component({
     page: 1, size: 20, total: 0, loading: false, isLastPage: false,
     page: 1, size: 20, total: 0, loading: false, isLastPage: false,
   },
   },
   observers: {
   observers: {
-    'classify'(value) {
-      const ref = { tonic: '药膳查询', tea: '中医茶饮' } as any;
+    'classify,i18n.home'(value, i18n) {
+      const ref = { tonic: i18n.tonic, tea: i18n.tea } as any;
       this.setData({ title: ref[value] || '' })
       this.setData({ title: ref[value] || '' })
     },
     },
     'page,size,total'(page, size, total) {
     'page,size,total'(page, size, total) {

+ 5 - 0
miniprogram/module/article/pages/science-list/science-list.ts

@@ -1,9 +1,11 @@
 import PageContainerBehavior from "../../../../core/behavior/page-container.behavior";
 import PageContainerBehavior from "../../../../core/behavior/page-container.behavior";
+import I18nBehavior from "../../../../i18n/behavior";
 import tickleBehavior, { getTickleContext } from "../../../../core/behavior/tickle.behavior";
 import tickleBehavior, { getTickleContext } from "../../../../core/behavior/tickle.behavior";
 import { getScienceListMethod } from "../../request";
 import { getScienceListMethod } from "../../request";
 // module/diet/pages/science-list/science-list.ts
 // module/diet/pages/science-list/science-list.ts
 Component({
 Component({
   behaviors: [
   behaviors: [
+    I18nBehavior,
     PageContainerBehavior,
     PageContainerBehavior,
     tickleBehavior,
     tickleBehavior,
   ],
   ],
@@ -17,6 +19,9 @@ Component({
     classify: { type: String, value: '' },
     classify: { type: String, value: '' },
   },
   },
   data: {
   data: {
+    i18n: {
+      healthTeach: { title: '分享文章' },
+    },
     keyword: '',
     keyword: '',
     searchInputProps: {
     searchInputProps: {
       placeholderStyle: 'color: #929292;',
       placeholderStyle: 'color: #929292;',

+ 1 - 1
miniprogram/module/article/pages/science-list/science-list.wxml

@@ -1,5 +1,5 @@
 <!--module/diet/pages/science-list/science-list.wxml-->
 <!--module/diet/pages/science-list/science-list.wxml-->
-<t-navbar title="健康宣教" left-arrow />
+<t-navbar title="{{i18n.healthTeach.title}}" left-arrow />
 <view class="search-wrapper" bindtap="onTapSearchInput">
 <view class="search-wrapper" bindtap="onTapSearchInput">
   <icon class="search-icon" data-button="focus" type="search" size="14" color="{{searchInputProps.iconColor}}"></icon>
   <icon class="search-icon" data-button="focus" type="search" size="14" color="{{searchInputProps.iconColor}}"></icon>
   <input class="search-input" value="{{keyword}}" focus="{{searchInputProps.focus}}" placeholder="{{searchInputProps.placeholder}}" placeholder-style="{{searchInputProps.placeholderStyle}}" cursor-color="{{searchInputProps.cursorColor}}" confirm-type="search" bindconfirm="onConfirmSearchInput" />
   <input class="search-input" value="{{keyword}}" focus="{{searchInputProps.focus}}" placeholder="{{searchInputProps.placeholder}}" placeholder-style="{{searchInputProps.placeholderStyle}}" cursor-color="{{searchInputProps.cursorColor}}" confirm-type="search" bindconfirm="onConfirmSearchInput" />

+ 5 - 0
miniprogram/module/care/pages/offlineTreatment/offlineTreatment.ts

@@ -1,7 +1,12 @@
+import I18nBehavior from "../../../../i18n/behavior";
 import { getOfflineTreatmentListMethod } from "../../request";
 import { getOfflineTreatmentListMethod } from "../../request";
 
 
 Page({
 Page({
+  behaviors: [I18nBehavior],
   data: {
   data: {
+    i18n: {
+      offlineTreatment: { title: '线下', ing: '进行中', finish: '完成' },
+    },
     currentTab: "",
     currentTab: "",
     treatmentList: [],
     treatmentList: [],
     isLoading: false,
     isLoading: false,

+ 3 - 3
miniprogram/module/care/pages/offlineTreatment/offlineTreatment.wxml

@@ -1,9 +1,9 @@
-<t-navbar title="线下非药物治疗" left-arrow />
+<t-navbar title="{{i18n.offlineTreatment.title}}" left-arrow />
 <view class="offline-treatment-page">
 <view class="offline-treatment-page">
   <t-tabs value="{{currentTab}}" bind:change="onTabChange">
   <t-tabs value="{{currentTab}}" bind:change="onTabChange">
     <t-tab-panel label="全部" value=""></t-tab-panel>
     <t-tab-panel label="全部" value=""></t-tab-panel>
-    <t-tab-panel label="治疗中" value="0"></t-tab-panel>
-    <t-tab-panel label="治疗完成" value="1"></t-tab-panel>
+    <t-tab-panel label="{{i18n.offlineTreatment.ing}}" value="0"></t-tab-panel>
+    <t-tab-panel label="{{i18n.offlineTreatment.finish}}" value="1"></t-tab-panel>
   </t-tabs>
   </t-tabs>
   <scroll-view class="page-container" scroll-y>
   <scroll-view class="page-container" scroll-y>
     <view wx:if="{{isLoading}}">
     <view wx:if="{{isLoading}}">

+ 10 - 0
miniprogram/module/chats/components/guide/guide.ts

@@ -2,10 +2,12 @@
 import { getPatients } from "../../../../pages/home/request";
 import { getPatients } from "../../../../pages/home/request";
 import { toCertificationPage } from "../../../../pages/home/router";
 import { toCertificationPage } from "../../../../pages/home/router";
 import { Post } from "../../../../lib/request/method";
 import { Post } from "../../../../lib/request/method";
+import I18nBehavior from "../../../../i18n/behavior";
 
 
 let next: "handleA" | "handleB" | "handleC";
 let next: "handleA" | "handleB" | "handleC";
 
 
 Component({
 Component({
+  behaviors: [I18nBehavior],
   lifetimes: {
   lifetimes: {
     attached(this: any) {
     attached(this: any) {
       const showGuideActive = wx.getStorageSync("showGuideActive");
       const showGuideActive = wx.getStorageSync("showGuideActive");
@@ -36,6 +38,14 @@ Component({
     active: { type: Boolean, value: false },
     active: { type: Boolean, value: false },
   },
   },
   data: {
   data: {
+    i18n: {
+      chats: { 
+        analysis: '测评',
+        healthData: '个人信息管理',
+        healthIndex: '数据信息管理',
+        consult: '',
+      },
+    },
     analysisCount: 0,
     analysisCount: 0,
     result: [] as string[],
     result: [] as string[],
     result2: false,
     result2: false,

+ 6 - 5
miniprogram/module/chats/components/guide/guide.wxml

@@ -18,7 +18,7 @@
       t-class="cell-border-gradient {{_.getClassName(active)}}" 
       t-class="cell-border-gradient {{_.getClassName(active)}}" 
       t-class-hover="custom-cell-hover"
       t-class-hover="custom-cell-hover"
       t-class-title="health-analysis-title"
       t-class-title="health-analysis-title"
-      title="1、健康分析(剩余{{analysisCount}}次)" 
+      title="1、{{i18n.chats.analysis}}(剩余{{analysisCount}}次)" 
       hover="{{active}}" 
       hover="{{active}}" 
       bind:tap="handleA"
       bind:tap="handleA"
       style="--td-cell-hover-color: #F5F5F5;"
       style="--td-cell-hover-color: #F5F5F5;"
@@ -29,7 +29,7 @@
       t-class="cell-border-gradient {{_.getClassName(active)}}" 
       t-class="cell-border-gradient {{_.getClassName(active)}}" 
       t-class-hover="custom-cell-hover"
       t-class-hover="custom-cell-hover"
        t-class-title="health-analysis-title"
        t-class-title="health-analysis-title"
-      title="2、指标信息管理" 
+      title="2、{{i18n.chats.healthIndex}}" 
       hover="{{active}}" 
       hover="{{active}}" 
       bind:tap="handleB"
       bind:tap="handleB"
       style="--td-cell-hover-color: #F5F5F5;"
       style="--td-cell-hover-color: #F5F5F5;"
@@ -40,18 +40,19 @@
       t-class="cell-border-gradient {{_.getClassName(active)}}" 
       t-class="cell-border-gradient {{_.getClassName(active)}}" 
       t-class-hover="custom-cell-hover"
       t-class-hover="custom-cell-hover"
        t-class-title="health-analysis-title"
        t-class-title="health-analysis-title"
-      title="3、健康信息管理" 
+      title="3、{{i18n.chats.healthData}}" 
       hover="{{active}}" 
       hover="{{active}}" 
       bind:tap="handleC"
       bind:tap="handleC"
       style="--td-cell-hover-color: #F5F5F5;"
       style="--td-cell-hover-color: #F5F5F5;"
     >
     >
       <t-icon name="chevron-right" color="#CCCCCC" size="40rpx" slot="note" />
       <t-icon name="chevron-right" color="#CCCCCC" size="40rpx" slot="note" />
     </t-cell>
     </t-cell>
-      <t-cell 
+    <t-cell 
+      wx:if="{{i18n.chats.consult}}"
       t-class="cell-border-gradient no-border {{_.getClassName(active)}}" 
       t-class="cell-border-gradient no-border {{_.getClassName(active)}}" 
       t-class-hover="custom-cell-hover"
       t-class-hover="custom-cell-hover"
        t-class-title="health-analysis-title"
        t-class-title="health-analysis-title"
-      title="4、在线咨询" 
+      title="4、{{i18n.chats.consult}}" 
       hover="{{active}}" 
       hover="{{active}}" 
       bind:tap="handleE"
       bind:tap="handleE"
       style="--td-cell-hover-color: #F5F5F5;"
       style="--td-cell-hover-color: #F5F5F5;"

+ 16 - 6
miniprogram/module/chats/components/message-consult/message-consult.ts

@@ -7,6 +7,7 @@ interface ConsultMessage {
   messageContent?: string; // 消息内容
   messageContent?: string; // 消息内容
   sendTime?: string; // 发送消息的时间
   sendTime?: string; // 发送消息的时间
 }
 }
+import I18nBehavior from "../../../../i18n/behavior";
 import { Post } from "../../../../lib/request/method";
 import { Post } from "../../../../lib/request/method";
 import { upload } from "../../../../lib/request/upload";
 import { upload } from "../../../../lib/request/upload";
 import dayjs from "dayjs";
 import dayjs from "dayjs";
@@ -57,8 +58,13 @@ function transformMessage(item: AnyObject): ConsultMessage {
 }
 }
 
 
 Component({
 Component({
+  behaviors: [I18nBehavior],
   properties: {},
   properties: {},
   data: {
   data: {
+    title: '',
+    i18n: {
+      consultChat: { _: '聊天' }
+    },
     messages: [] as ConsultMessage[],
     messages: [] as ConsultMessage[],
     inputText: "",
     inputText: "",
     inputFocus: true,
     inputFocus: true,
@@ -71,7 +77,11 @@ Component({
     _pollTimer: 0 as any, // 5秒轮询最新消息定时器
     _pollTimer: 0 as any, // 5秒轮询最新消息定时器
     textareaHeight: 80, // textarea 高度(rpx),初始值与 min-height 一致
     textareaHeight: 80, // textarea 高度(rpx),初始值与 min-height 一致
   },
   },
-
+  observers: {
+    'i18n.consultChat._'(this: any, title: string) {
+      this.setData({ title });
+    },
+  },
   lifetimes: {
   lifetimes: {
     async attached() {
     async attached() {
       const safeBottomRpx = calculateSafeBottomRpx();
       const safeBottomRpx = calculateSafeBottomRpx();
@@ -224,8 +234,8 @@ Component({
       this._hideKeyboardAndUpdatePosition();
       this._hideKeyboardAndUpdatePosition();
       wx.showModal({
       wx.showModal({
         title: "",
         title: "",
-        content: "确定要结束本次咨询?",
-        cancelText: "继续咨询",
+        content: `确定要结束本次?${this.data.title}`,
+        cancelText: `继续${this.data.title}`,
         confirmText: "结束",
         confirmText: "结束",
       }).then((res: any) => {
       }).then((res: any) => {
         if (res.confirm) {
         if (res.confirm) {
@@ -248,7 +258,7 @@ Component({
         sender: "system",
         sender: "system",
         sendType: "3",
         sendType: "3",
         messageType: "1",
         messageType: "1",
-        messageContent: "咨询结束",
+        messageContent: `${this.data.title}结束`,
         sendTime: endDate,
         sendTime: endDate,
       });
       });
 
 
@@ -258,7 +268,7 @@ Component({
           await Post(`/consultManage/end/${consultId}`);
           await Post(`/consultManage/end/${consultId}`);
         } catch (error: any) {
         } catch (error: any) {
           wx.showToast({
           wx.showToast({
-            title: error?.errMsg || "结束咨询失败",
+            title: error?.errMsg || `结束${this.data.title}失败`,
             icon: "none",
             icon: "none",
           });
           });
         }
         }
@@ -435,7 +445,7 @@ Component({
     async _sendMessage(messageType: "1" | "2", messageContent: string) {
     async _sendMessage(messageType: "1" | "2", messageContent: string) {
       const consultId = wx.getStorageSync("consultId");
       const consultId = wx.getStorageSync("consultId");
       if (!consultId) {
       if (!consultId) {
-        wx.showToast({ title: "咨询ID不存在", icon: "none" });
+        wx.showToast({ title: `${this.data.title}ID不存在`, icon: "none" });
         return;
         return;
       }
       }
       try {
       try {

+ 1 - 1
miniprogram/module/chats/components/message-consult/message-consult.wxml

@@ -57,7 +57,7 @@
 
 
 <view class="input-panel" style="bottom: {{inputBoxBottom}}rpx;" bind:tap="tapPanel" wx:if="{{!consultEnded}}">
 <view class="input-panel" style="bottom: {{inputBoxBottom}}rpx;" bind:tap="tapPanel" wx:if="{{!consultEnded}}">
   <view class="action-bar">
   <view class="action-bar">
-    <view class="action-btn danger" bind:tap="endConsult">结束咨询</view>
+    <view class="action-btn danger" bind:tap="endConsult">结束{{i18n.consultChat._}}</view>
   </view>
   </view>
   <view class="input-row">
   <view class="input-row">
     <textarea
     <textarea

+ 7 - 1
miniprogram/module/chats/components/message-report/message-report.ts

@@ -1,9 +1,15 @@
+import I18nBehavior from "../../../../i18n/behavior";
 // module/chats/components/message-report/message-report.ts
 // module/chats/components/message-report/message-report.ts
 Component({
 Component({
+  behaviors: [I18nBehavior],
   properties: {
   properties: {
     payload: { type: Object, value: { title: '', url: '' } }
     payload: { type: Object, value: { title: '', url: '' } }
   },
   },
-  data: {},
+  data: {
+    i18n: {
+      report: { title: '报告' },
+    }
+  },
   methods: {
   methods: {
     handle() {
     handle() {
       wx.navigateTo({ url: this.data.payload.url })
       wx.navigateTo({ url: this.data.payload.url })

+ 4 - 4
miniprogram/module/chats/components/message-report/message-report.wxml

@@ -8,10 +8,10 @@
     </t-cell>
     </t-cell>
     <view class="chat-card__handle report-handle">
     <view class="chat-card__handle report-handle">
       <view class="item" bind:tap="handle">
       <view class="item" bind:tap="handle">
-   <view class="report-box">
-<view><image src="../../../../assets/bg/icon_file@3x.png" class="report-img" /> </view>
-<view class="text-box">健康分析报告</view>
-</view>
+        <view class="report-box">
+          <view><image src="../../../../assets/bg/icon_file@3x.png" class="report-img" /></view>
+          <view class="text-box">{{i18n.report.title}}</view>
+        </view>
       </view>
       </view>
     </view>
     </view>
   </view>
   </view>

+ 7 - 3
miniprogram/module/chats/components/questionnaire/questionnaire.ts

@@ -1,4 +1,5 @@
 import dayjs from "dayjs";
 import dayjs from "dayjs";
+import I18nBehavior from "../../../../i18n/behavior";
 import { Post } from "../../../../lib/request/method";
 import { Post } from "../../../../lib/request/method";
 
 
 // module/chats/components/questionnaire/questionnaire.ts
 // module/chats/components/questionnaire/questionnaire.ts
@@ -30,6 +31,7 @@ interface MessageType {
 }
 }
 
 
 Component({
 Component({
+  behaviors: [I18nBehavior],
   lifetimes: {
   lifetimes: {
     attached: function () {
     attached: function () {
       let isAnalysis: number;
       let isAnalysis: number;
@@ -59,6 +61,9 @@ Component({
    * 组件的初始数据
    * 组件的初始数据
    */
    */
   data: {
   data: {
+    i18n: {
+      chats: { report: '' },
+    },
     inputBoxBottom: 0,
     inputBoxBottom: 0,
     messages: {} as Record<number, Message>,
     messages: {} as Record<number, Message>,
     lastId: "",
     lastId: "",
@@ -340,9 +345,8 @@ Component({
                 id: "report",
                 id: "report",
                 type: "report",
                 type: "report",
                 payload: {
                 payload: {
-                  title: `本次问答已结束,历时${
-                    diff || 1
-                  }分钟,非常感谢您的配合!请查看您本次的健康评估情况。`,
+                  title: `本次问答已结束,历时${diff || 1
+                    }分钟,非常感谢您的配合!${this.data.i18n.chats.report}`,
                   url: `/module/health/pages/report/report?id=${data.healthAnalysisReportId}`,
                   url: `/module/health/pages/report/report?id=${data.healthAnalysisReportId}`,
                 },
                 },
               });
               });

+ 5 - 1
miniprogram/module/chats/pages/consultation-record/consultation-record.ts

@@ -1,11 +1,15 @@
 import PageContainerBehavior from "../../../../core/behavior/page-container.behavior";
 import PageContainerBehavior from "../../../../core/behavior/page-container.behavior";
+import I18nBehavior from "../../../../i18n/behavior";
 import { Post } from "../../../../lib/request/method";
 import { Post } from "../../../../lib/request/method";
 // module/chats/pages/consultation-record/consultation-record.ts
 // module/chats/pages/consultation-record/consultation-record.ts
 
 
 Page({
 Page({
-  behaviors: [PageContainerBehavior],
+  behaviors: [I18nBehavior, PageContainerBehavior],
   properties: {},
   properties: {},
   data: {
   data: {
+    i18n: {
+      consultChat: { _: '聊天', title: '记录' },
+    },
     //有item传过来不分页
     //有item传过来不分页
     //是否分页
     //是否分页
     isPage: false,
     isPage: false,

+ 3 - 3
miniprogram/module/chats/pages/consultation-record/consultation-record.wxml

@@ -1,5 +1,5 @@
 <!--module/chats/pages/consultation-record/consultation-record.wxml-->
 <!--module/chats/pages/consultation-record/consultation-record.wxml-->
-<t-navbar title="咨询记录" left-arrow />
+<t-navbar title="{{i18n.consultChat.title}}" left-arrow />
 <scroll-view 
 <scroll-view 
   id="scrollview" 
   id="scrollview" 
   class="page-scroll__container" 
   class="page-scroll__container" 
@@ -16,7 +16,7 @@
       <!-- 开始咨询 -->
       <!-- 开始咨询 -->
       <view class="consultation-session">
       <view class="consultation-session">
         <view class="timestamp">{{item.startTime}}</view>
         <view class="timestamp">{{item.startTime}}</view>
-        <view class="status-message">开始咨询</view>
+        <view class="status-message">开始{{i18n.consultChat._}}</view>
         
         
         <!-- 消息列表 -->
         <!-- 消息列表 -->
         <view class="messages-list">
         <view class="messages-list">
@@ -63,7 +63,7 @@
         
         
         <!-- 咨询结束 -->
         <!-- 咨询结束 -->
         <view class="timestamp">{{item.endTime}}</view>
         <view class="timestamp">{{item.endTime}}</view>
-        <view class="status-message">咨询结束</view>
+        <view class="status-message">{{i18n.consultChat._}}结束</view>
       </view>
       </view>
     </block>
     </block>
     
     

+ 5 - 1
miniprogram/module/chats/pages/index/index.ts

@@ -1,5 +1,6 @@
 import dayjs from "dayjs";
 import dayjs from "dayjs";
 import PageContainerBehavior from "../../../../core/behavior/page-container.behavior";
 import PageContainerBehavior from "../../../../core/behavior/page-container.behavior";
+import I18nBehavior from "../../../../i18n/behavior";
 
 
 // module/chats/pages/index/index.ts
 // module/chats/pages/index/index.ts
 interface ScrollIntoViewEvent {
 interface ScrollIntoViewEvent {
@@ -23,7 +24,7 @@ function getScrollcontext(this: any) {
 }
 }
 
 
 Component({
 Component({
-  behaviors: [PageContainerBehavior],
+  behaviors: [I18nBehavior, PageContainerBehavior],
   lifetimes: {
   lifetimes: {
     attached() {
     attached() {
       this.setData({
       this.setData({
@@ -61,6 +62,9 @@ Component({
     id: { type: Number, value: 0 },
     id: { type: Number, value: 0 },
   },
   },
   data: {
   data: {
+    i18n: {
+      chats: { title: '聊天', analysis: '测评' },
+    },
     date: "",
     date: "",
     messages: {} as Record<number, Message>,
     messages: {} as Record<number, Message>,
     lastId: "",
     lastId: "",

+ 2 - 2
miniprogram/module/chats/pages/index/index.wxml

@@ -9,7 +9,7 @@
 
 
 <!--module/chats/pages/index/index.wxml-->
 <!--module/chats/pages/index/index.wxml-->
 <view class="chats-container">
 <view class="chats-container">
-  <t-navbar title="对话管家" />
+  <t-navbar title="{{i18n.chats.title}}" />
   <scroll-view 
   <scroll-view 
     id="scrollview" 
     id="scrollview" 
     class="page-scroll__container" 
     class="page-scroll__container" 
@@ -23,7 +23,7 @@
   >
   >
     <view class="system-wrapper">
     <view class="system-wrapper">
       <view class="date">{{date}}</view>
       <view class="date">{{date}}</view>
-      <view class="title">对话管家 已进入聊天</view>
+      <view class="title">{{i18n.chats.title}} 已进入聊天</view>
     </view>
     </view>
     
     
     <block wx:for="{{messages}}" wx:index="{{index}}" wx:key="id">
     <block wx:for="{{messages}}" wx:index="{{index}}" wx:key="id">

+ 9 - 1
miniprogram/pages/home/home.ts

@@ -1,4 +1,5 @@
 import PageContainerBehavior from "../../core/behavior/page-container.behavior";
 import PageContainerBehavior from "../../core/behavior/page-container.behavior";
+import I18nBehavior from "../../i18n/behavior";
 import {
 import {
   DraggableSheetBehavior,
   DraggableSheetBehavior,
   getDraggableSheetContext,
   getDraggableSheetContext,
@@ -30,6 +31,12 @@ import { Post } from "../../lib/request/method";
 
 
 Page({
 Page({
   data: {
   data: {
+    i18n: {
+      common: { title: '生活助理', zy: '' },
+      home: { analysis: '评估', consult: '聊天', __showRecord__: false, __showDisplay__: false },
+      report: { title: '报告' },
+      healthTeach: { title: '' },
+    },
     isShowComplete: true,
     isShowComplete: true,
     careList: [],
     careList: [],
     displayList: [] as {
     displayList: [] as {
@@ -83,7 +90,7 @@ Page({
 
 
     switchType: "",
     switchType: "",
 
 
-    carouselLoading: {} as Record<string | number, boolean>, 
+    carouselLoading: {} as Record<string | number, boolean>,
 
 
     carouselMediaList: [] as Array<{
     carouselMediaList: [] as Array<{
       type: "image" | "video";
       type: "image" | "video";
@@ -95,6 +102,7 @@ Page({
     hasNewMessage: false,
     hasNewMessage: false,
   },
   },
   behaviors: [
   behaviors: [
+    I18nBehavior,
     PageContainerBehavior,
     PageContainerBehavior,
     DraggableSheetBehavior(".draggable-sheet-wrapper"),
     DraggableSheetBehavior(".draggable-sheet-wrapper"),
   ],
   ],

+ 7 - 7
miniprogram/pages/home/home.wxml

@@ -1,7 +1,7 @@
 <!--pages/home/home.wxml-->
 <!--pages/home/home.wxml-->
 <view class="fullscreen-bg">
 <view class="fullscreen-bg">
 
 
-  <t-navbar title="中医健康管家" t-class-title="nav-title" />
+  <t-navbar title="{{i18n.common.zy}}{{i18n.common.title}}" t-class-title="nav-title" />
 
 
   <scroll-view 
   <scroll-view 
     class="page-scroll__container" 
     class="page-scroll__container" 
@@ -33,7 +33,7 @@
       <!-- 咨询中的状态-->
       <!-- 咨询中的状态-->
       <view class="chat-status" wx:if="{{isConsulting}}" bind:tap="goToConsultation">
       <view class="chat-status" wx:if="{{isConsulting}}" bind:tap="goToConsultation">
         <view class="chat-status__dot" wx:if="{{hasNewMessage}}"></view>
         <view class="chat-status__dot" wx:if="{{hasNewMessage}}"></view>
-        <text class="chat-status__text">咨询中...</text>
+        <text class="chat-status__text">{{i18n.home.consult}}中...</text>
       </view>
       </view>
       <!-- 使用 image 标签确保图片清晰度 -->
       <!-- 使用 image 标签确保图片清晰度 -->
       <image class="body-bg-image" src="../../assets/bg/pic_body@2x.png" mode="aspectFit" />
       <image class="body-bg-image" src="../../assets/bg/pic_body@2x.png" mode="aspectFit" />
@@ -54,9 +54,9 @@
         <t-loading theme="circular" size="48px" color="#2d92fd" />
         <t-loading theme="circular" size="48px" color="#2d92fd" />
       </view>
       </view>
       <view class="healthyAnalyze" bindtap="goHealthAnalyze" wx:elif="{{isShowComplete}}">
       <view class="healthyAnalyze" bindtap="goHealthAnalyze" wx:elif="{{isShowComplete}}">
-        请完成健康评估
+        请完成{{i18n.home.analysis}}
       </view>
       </view>
-      <view class="steps-container" wx:else>
+      <view class="steps-container" wx:elif="{{i18n.home.__showRecord__}}">
         <vertical-steps statusList="{{statusList}}" dataset="{{healthReport.data}}" bind:position="onBodyModel" />
         <vertical-steps statusList="{{statusList}}" dataset="{{healthReport.data}}" bind:position="onBodyModel" />
         <view class="warn-box" wx:if="{{healthIndex.data.length>0}}">
         <view class="warn-box" wx:if="{{healthIndex.data.length>0}}">
           <image src="../../assets/bg/icon_warning@3x.png" class="warn-img" />
           <image src="../../assets/bg/icon_warning@3x.png" class="warn-img" />
@@ -72,7 +72,7 @@
             <image src="../../assets/bg/icon_file@3x.png" class="report-img" />
             <image src="../../assets/bg/icon_file@3x.png" class="report-img" />
           </view>
           </view>
           <view class="text-box" wx:if="{{healthReport.data.reportTime}}">
           <view class="text-box" wx:if="{{healthReport.data.reportTime}}">
-            <view class="text-one">健康分析报告</view>
+            <view class="text-one">{{i18n.report.title}}</view>
             <view class="text-two">日期:{{healthReport.data.reportTime}}</view>
             <view class="text-two">日期:{{healthReport.data.reportTime}}</view>
           </view>
           </view>
         </view>
         </view>
@@ -80,7 +80,7 @@
     </view>
     </view>
 
 
 
 
-    <view class="care-container" wx:if="{{displayList.length>0}}">
+    <view class="care-container" wx:if="{{displayList.length>0 && i18n.home.__showDisplay__}}">
       <view class="care-box">
       <view class="care-box">
         <view class="care-header">
         <view class="care-header">
           <image src="../../assets/icon/icon_plan@3x.png" class="care-icon" />
           <image src="../../assets/icon/icon_plan@3x.png" class="care-icon" />
@@ -132,7 +132,7 @@
 
 
     <view class="science-list-wrapper" wx:if="{{scienceList.length}}">
     <view class="science-list-wrapper" wx:if="{{scienceList.length}}">
       <view class="list-title" bind:tap="toSciencePage">
       <view class="list-title" bind:tap="toSciencePage">
-        <view class="missionary">健康宣教</view>
+        <view class="missionary">{{i18n.healthTeach.title}}</view>
         <view class="title-box serch">
         <view class="title-box serch">
           <text>查询</text>
           <text>查询</text>
           <t-icon name="chevron-right-double"></t-icon>
           <t-icon name="chevron-right-double"></t-icon>

+ 13 - 0
miniprogram/pages/mine/mine.ts

@@ -1,8 +1,21 @@
+import I18nBehavior from "../../i18n/behavior";
 import { getPatients, getPatientPhone } from "../home/request";
 import { getPatients, getPatientPhone } from "../home/request";
 import { toCertificationPage } from "../home/router";
 import { toCertificationPage } from "../home/router";
 import { getOrderList, getRecordCountMethod } from "../home/request";
 import { getOrderList, getRecordCountMethod } from "../home/request";
 Page({
 Page({
+  behaviors: [I18nBehavior],
   data: {
   data: {
+    i18n: {
+      consultChat: { title: '记录' },
+      offlineTreatment: { title: '线下' },
+      healthTeach: { title: '分享文章' },
+      health: { title: '档案' },
+      home: {
+        __showRecord__: false,
+        tea: '茶',
+        tonic: '菜谱',
+      }
+    },
     patients: [] as (App.Patient.Model & { isDefault: "Y" | "N" })[],
     patients: [] as (App.Patient.Model & { isDefault: "Y" | "N" })[],
     patient: null as App.Patient.Model | null,
     patient: null as App.Patient.Model | null,
     patientDescription: "",
     patientDescription: "",

+ 6 - 6
miniprogram/pages/mine/mine.wxml

@@ -11,7 +11,7 @@
         </view>
         </view>
       </view>
       </view>
 
 
-      <view class="image-box" catch:tap="toHealthPage">
+      <view wx:if="{{i18n.home.__showRecord__}}" class="image-box" catch:tap="toHealthPage">
         <image src="../../assets/bg/health-file.bg.png" class="health-img" />
         <image src="../../assets/bg/health-file.bg.png" class="health-img" />
       </view>
       </view>
     </view>
     </view>
@@ -30,7 +30,7 @@
     </view>
     </view>
 
 
     <view class="knowledge-box" style="margin-top:12px">
     <view class="knowledge-box" style="margin-top:12px">
-      <view class="title">健康宣教</view>
+      <view class="title">{{i18n.healthTeach.title}}</view>
       <view class="content-container">
       <view class="content-container">
         <view class="content-box" catch:tap="toHealthEducationPage">
         <view class="content-box" catch:tap="toHealthEducationPage">
           <view>
           <view>
@@ -54,14 +54,14 @@
           <view>
           <view>
             <image src="../../assets/bg/icon_tea@3x.png" class="icon-img" />
             <image src="../../assets/bg/icon_tea@3x.png" class="icon-img" />
           </view>
           </view>
-          <view class="content-title">茶饮</view>
+          <view class="content-title">{{i18n.home.tea}}</view>
         </view>
         </view>
 
 
         <view class="content-box" catch:tap="toDietTonicPage">
         <view class="content-box" catch:tap="toDietTonicPage">
           <view>
           <view>
             <image src="../../assets/bg/icon_diet@3x.png" class="icon-img" />
             <image src="../../assets/bg/icon_diet@3x.png" class="icon-img" />
           </view>
           </view>
-          <view class="content-title">药膳</view>
+          <view class="content-title">{{i18n.home.tonic}}</view>
         </view>
         </view>
       </view>
       </view>
     </view>
     </view>
@@ -77,14 +77,14 @@
       <view class="item" catch:tap="onConsultationTap">
       <view class="item" catch:tap="onConsultationTap">
         <view class="item-box">
         <view class="item-box">
           <t-icon name="earphone" />
           <t-icon name="earphone" />
-          <text style="margin-left:10px">咨询记录</text>
+          <text style="margin-left:10px">{{i18n.consultChat.title}}</text>
         </view>
         </view>
         <t-icon name="chevron-right" color="#CCCCCC" size="40rpx" />
         <t-icon name="chevron-right" color="#CCCCCC" size="40rpx" />
       </view>
       </view>
       <view class="item" catch:tap="onTreatmentTap" style="border-bottom:none">
       <view class="item" catch:tap="onTreatmentTap" style="border-bottom:none">
         <view class="item-box">
         <view class="item-box">
           <t-icon name="hospital-1" />
           <t-icon name="hospital-1" />
-          <text style="margin-left:10px">线下非药物治疗</text>
+          <text style="margin-left:10px">{{i18n.offlineTreatment.title}}</text>
         </view>
         </view>
         <t-icon name="chevron-right" color="#CCCCCC" size="40rpx" />
         <t-icon name="chevron-right" color="#CCCCCC" size="40rpx" />
       </view>
       </view>