张田田 пре 11 месеци
родитељ
комит
0231713bd3
22 измењених фајлова са 219 додато и 164 уклоњено
  1. 25 3
      miniprogram/app.config.ts
  2. 4 14
      miniprogram/components/tabbar/tabbar.ts
  3. 1 1
      miniprogram/components/tabbar/tabbar.wxml
  4. 13 12
      miniprogram/module/chats/components/message-again/message-again.scss
  5. 75 82
      miniprogram/module/chats/components/message-again/message-again.ts
  6. 23 27
      miniprogram/module/chats/components/message-again/message-again.wxml
  7. 3 0
      miniprogram/module/chats/components/message-follow/message-follow.scss
  8. 2 1
      miniprogram/module/chats/components/message-select/message-select.ts
  9. 6 4
      miniprogram/module/chats/components/questionnaire/questionnaire.ts
  10. 1 1
      miniprogram/module/chats/components/questionnaire/questionnaire.wxml
  11. 7 5
      miniprogram/module/chats/pages/analysis/analysis.ts
  12. 1 0
      miniprogram/module/chats/pages/index/index.scss
  13. 39 7
      miniprogram/module/chats/pages/index/index.ts
  14. 3 2
      miniprogram/module/chats/pages/index/index.wxml
  15. 0 1
      miniprogram/module/follow/pages/evaluation/report.ts
  16. 6 0
      miniprogram/module/health/components/follow-evaluation/follow-evaluation.ts
  17. 1 1
      miniprogram/module/health/components/follow-evaluation/follow-evaluation.wxml
  18. 3 0
      miniprogram/module/health/components/follow-record/follow-record.ts
  19. 1 1
      miniprogram/module/health/components/follow-record/follow-record.wxml
  20. 2 0
      miniprogram/module/health/pages/home/home.wxml
  21. 2 0
      miniprogram/pages/home/home.ts
  22. 1 2
      miniprogram/pages/home/home.wxml

+ 25 - 3
miniprogram/app.config.ts

@@ -1,6 +1,28 @@
 import { getAccountInfoSync } from "./lib/wx/open-api";
 
 const miniProgram = getAccountInfoSync();
-const port = miniProgram.envVersion === 'release' ? 433 : 4433;
-export const Base_URL = `https://wx.hzliuzhi.com:${port}/manager/fdhb-mobile` as const;
-export const Upload_URL = `https://wx.hzliuzhi.com:${port}/manager/file` as const;
+// 测试环境
+let BaseURL = "";
+let UploadURL = "";
+const url = "https://test.hzliuzhi.com/manager/";
+if (miniProgram.envVersion === "trial") {
+  BaseURL = url + "fdhb-mobile";
+  UploadURL = url + "file";
+} else {
+  const port = miniProgram.envVersion === "release" ? 433 : 4433;
+  BaseURL = `https://wx.hzliuzhi.com:${port}/manager/fdhb-mobile` as const;
+  UploadURL = `https://wx.hzliuzhi.com:${port}/manager/file` as const;
+}
+console.log(
+  miniProgram.envVersion,
+  "小程序的版本",
+  "BaseURL:",
+  BaseURL,
+  "UploadURL:",
+  UploadURL
+);
+export const Base_URL = BaseURL;
+export const Upload_URL = UploadURL;
+// const port = miniProgram.envVersion === 'release' ? 433 : 4433;
+// export const Base_URL = `https://wx.hzliuzhi.com:${port}/manager/fdhb-mobile` as const;
+// export const Upload_URL = `https://wx.hzliuzhi.com:${port}/manager/file` as const;

+ 4 - 14
miniprogram/components/tabbar/tabbar.ts

@@ -3,6 +3,7 @@ import Tabbar from "../../miniprogram_npm/tdesign-miniprogram/tab-bar/tab-bar";
 
 Component({
   data: {
+    tabbarHeight: 0,
     pageHeight: "100vh",
     value: "/pages/home/home",
     list: [
@@ -57,22 +58,12 @@ Component({
         .exec();
     },
     toChatsPage(page: string) {
-      // console.log(this.data.patientId, "patientId", page);
-      // if (!this.data?.patientId) {
-      //   wx.showModal({
-      //     title: "出错了",
-      //     content: "错误,请重试",
-      //     showCancel: false,
-      //   });
-      //   return;
-      // }
       wx.redirectTo({
         url: `${page}?component=guide&isShowGuide=true`,
       });
       wx.setStorageSync("isAnalysis", 3);
     },
-    onChange(e) {
-      // console.log(e, "e");
+    onChange(e:any) {
       this.setData({
         value: e.detail.value,
       });
@@ -93,9 +84,8 @@ Component({
     },
   },
   lifetimes: {
-    attached(options: string) {
-      // console.log(options,"tabbar")
-      // console.log(this.data.tabbarValue, "tabbarValuetabbarValue");
+    attached() {
+      // 赋值
       this.setData({
         value: this.data.tabbarValue,
       });

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

@@ -1,4 +1,4 @@
-<t-tab-bar t-class="t-tab-bar" 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}}">
     {{item.label}}
   </t-tab-bar-item>

+ 13 - 12
miniprogram/module/chats/components/message-again/message-again.scss

@@ -64,11 +64,11 @@
 }
 .input-panel {
   display: flex;
-  background: #dddddd;
-  height: 60px;
+  background: #F3F3F3;
+  height: 120rpx;
   position: fixed;
   width:100%;
-  padding:0px 10px;
+  padding:0px 20px;
   align-items: center;
   box-sizing: border-box;
   // border: 1px solid red;
@@ -90,7 +90,7 @@
   display: inline-block;
   padding: 0px 10px;
   color: #fff;
-  background: green;
+  background: #1D6FF6;
   border-radius: 3px;
   line-height:40px;
   margin-left:5px;
@@ -110,9 +110,7 @@
   // border: 3rpx solid var(--td-bg-color-container, #fff);
 }
 
-.card-active {
-  border-color: var(--td-brand-color, #0052d9);
-}
+
 
 .card-active::after {
   content: '';
@@ -123,7 +121,8 @@
   width: 0;
   border-width: 28px 28px 28px 0;
   border-style: solid;
-  border-color: var(--td-brand-color, #1B4F34) transparent transparent transparent;
+  // border-color: var(--td-brand-color, #1B4F34) transparent transparent transparent;
+  border-color: var(--td-brand-color, #1D6FF6) transparent transparent transparent;
 }
 .not-change {
   width: 100%;
@@ -226,7 +225,7 @@
 
       &--confirm {
         // color: var(--primary-color);
-        color: black;
+        color: #1D6FF6;
       }
     }
   }
@@ -256,7 +255,7 @@
 
   &--active {
     // border-color: var(--td-bg-color-container, #9ea1a5);
-    border: 1px solid #EEEEEE;
+    border: 1px solid #1D6FF6;
 
     &::after {
       content: '';
@@ -269,7 +268,8 @@
       border-width: 28px 28px 28px 0;
       border-style: solid;
       border-color: var(--td-bg-color-container) transparent transparent transparent;
-      border: 14px solid var(--td-bg-color-container, #0052d9);
+      // border: 14px solid var(--td-bg-color-container, #0052d9);
+      border: 14px solid #1D6FF6;
       border-bottom-color: transparent;
       border-right-color: transparent;
     }
@@ -281,7 +281,8 @@
 
   &__icon {
     // color: var(--primary-color, #fff);
-    color: black;
+    // color: black;
+    color: white  ;
     position: absolute;
     left: 1.5px;
     top: 1.5px;

+ 75 - 82
miniprogram/module/chats/components/message-again/message-again.ts

@@ -1,8 +1,5 @@
 // module/chats/components/message-select/message-select.ts
-import { Message } from "tdesign-miniprogram";
-import { getTickleContext } from "../../../../core/behavior/tickle.behavior";
 import { Get, Post } from "../../../../lib/request/method";
-import Input from "../../../../miniprogram_npm/tdesign-miniprogram/input/input";
 interface Option {
   id: string;
   name: string;
@@ -16,7 +13,6 @@ interface HandleEvent {
     item: Option;
   };
 }
-const app = getApp();
 Component({
   properties: {
     payload: {
@@ -28,11 +24,12 @@ Component({
     workId: { type: Number, value: 0 },
   },
   data: {
+    placeholder: "请输入",
+    safeBottomRpx: 0,
     // 键盘逻辑
-    inputBoxBottom: 0,
+    inputBoxBottom: 0, //初始华底部的值
     inputText: "",
     messages: [],
-    scrollTop: 0, // 滚动位置
     showrePlenish: false,
     inputFocus: false,
     // end
@@ -65,39 +62,25 @@ Component({
     symptomsList: [],
     isHaveNewSyndrome: "",
     isAnalysis: 0,
-    shows: false,
+    InputHeight:0,
   },
-  attached(options: any) {
+  attached() {
     this.setData({
       isAnalysis: wx.getStorageSync("isAnalysis"),
     });
-    if (wx.getSystemInfoSync().platform === "ios") {
-      this.setData({
-        inputBoxBottom: 10,
-      });
-    } else {
-      this.setData({
-        inputBoxBottom: 0,
-      });
-    }
-    // 键盘===========================
-    wx.onKeyboardHeightChange((res) => {
-      console.log(res, "res1111111111111");
-      const height = res.height;
-      if (height > 0) {
-        this.setData({
-          // 某些机型需要在此处也设置键盘高度
-          inputBoxBottom: height,
-        });
-      } else {
-        this.setData({
-          // 某些机型需要在此处也设置键盘高度
-          inputBoxBottom: 0,
-        });
-      }
+    const systemInfo = wx.getSystemInfoSync();
+    const windowHeight = systemInfo.windowHeight;
+    const safeAreaBottom = systemInfo.safeArea?.bottom ?? windowHeight; // 没有safeArea时,bottom等于windowHeight
+    const safeBottom = windowHeight - safeAreaBottom; // 安全区底部距离(px)
+    const tabBarHeight = 100; // 底部tabbar的高度
+    const safeBottomRpx = (750 / systemInfo.windowWidth) * safeBottom; // rpx
+    // 初始的底部bottom   底部安全区的高度+tabbar的高度
+    this.setData({
+      inputBoxBottom: safeBottomRpx + tabBarHeight,
+      safeBottomRpx: safeBottomRpx,
+      InputHeight:safeBottomRpx + tabBarHeight,
     });
-    console.log(this.data.inputBoxBottom, "刚进页面的高度");
-    // end======================
+
     this.setData({
       hasSelected: this.data.options
         .filter((option) => !option.hide)
@@ -114,36 +97,23 @@ Component({
           .some((option) => option.checked),
       });
     },
-    // 'messages':function(value: any) {
-    //   console.log(value, "messages11111");
-    //   if(value.length>0){
-
-    //   }
-    // },
   },
+
   methods: {
-    // 滚动到底部
-    // scrollToBottom() {
-    //   // 创建一个选择器获取消息容器高度
-    //   const query = wx.createSelectorQuery();
-    //   query.select(".messages").boundingClientRect();
-    //   query.exec((res) => {
-    //     if (res && res[0]) {
-    //       this.setData({
-    //         scrollTop: res[0].height,
-    //       });
-    //     }
-    //   });
-    // },
     handleInput(e: any) {
-      // console.log(e, "输入框输入内容");
       this.setData({ inputText: e.detail.value });
     },
     // 发送信息
     send() {
       const text = this.data.inputText.trim();
+      // 如果输入框内容为空,则不发送信息
       if (!text) {
         wx.showToast({ title: "发送的信息不能为空", icon: "none" });
+        if (this.data.inputFocus) {
+          this.setData({
+            inputFocus: true,
+          });
+        }
         return;
       }
       const userMessage = {
@@ -154,22 +124,15 @@ Component({
         status: "sending",
       };
       this.setData({
-        inputBoxBottom: 0,
         messages: [...this.data.messages, userMessage],
-        inputText: "",
-      });
-      this.triggerEvent("boxBottom", {
-        inputBoxBottom: this.data.inputBoxBottom,
       });
-      // 保持键盘打开状态
-      this.setData({ inputFocus: true });
       if (this.data.messages.length === 2 && this.data.symptomResult === "有") {
         this.setData({
           showrePlenish: false,
         });
         this.triggerEvent("nextType", { MessageType: 2 });
         this.triggerEvent("boxBottom", {
-          inputBoxBottom: this.data.inputBoxBottom - 50,
+          inputBoxBottom: this.data.InputHeight - 60,
         });
       } else if (
         this.data.messages.length === 1 &&
@@ -179,32 +142,52 @@ Component({
           showrePlenish: false,
         });
         this.triggerEvent("nextType", { MessageType: 2 });
+        this.triggerEvent("boxBottom", {
+          inputBoxBottom: this.data.InputHeight - 60,
+        });
+      } else if (
+        this.data.messages.length === 1 &&
+        this.data.symptomResult === "有"
+      ) {
+        this.setData({
+          placeholder: "请问还有其他要补充的吗?",
+          inputBoxBottom: this.data.InputHeight,
+        });
+        this.triggerEvent("boxBottom", {
+          inputBoxBottom: this.data.InputHeight,
+        });
       }
-      // 滚动到底部
-      // this.scrollToBottom();
+      this.triggerEvent("scroll", { id: "bottom" });
+      // 发送信息之后 输入框内容清空
+      this.setData({
+        inputText: "",
+      });
     },
     // 键盘聚焦
-    onInputFocus(e) {
+    onInputFocus(e: any) {
+      const systemInfo = wx.getSystemInfoSync();
+      const height = (750 / systemInfo.windowWidth) * e.detail.height; // 转为rpx
       this.setData({
-        inputFocus: false,
-        // 某些机型需要在此处也设置键盘高度
-        inputBoxBottom: e.detail.height || this.data.inputBoxBottom,
+        inputFocus: true,
+        inputBoxBottom: height,
       });
       this.triggerEvent("boxBottom", {
-        inputBoxBottom: this.data.inputBoxBottom,
+        inputBoxBottom: height,
       });
+      this.triggerEvent("scroll", { id: "bottom" });
     },
     // 键盘失焦
-    onInputBlur() {
+    onInputBlur(e: any) {
+      // 输入框失焦之后 底部高度是tabbar高度+安全区的高度
       this.setData({
         inputFocus: false,
-        inputBoxBottom: 0,
+        inputBoxBottom: this.data.InputHeight,
       });
       this.triggerEvent("boxBottom", {
-        inputBoxBottom: this.data.inputBoxBottom,
+        inputBoxBottom: this.data.InputHeight,
       });
+      this.triggerEvent("scroll", { id: "bottom" });
     },
-    // end ============================
     // 在字典中取症状的状态
     async getStatus() {
       const dict = await Get("/dict/getDicts", {
@@ -263,29 +246,36 @@ Component({
         wx.showToast({ title: error.errMsg, icon: "error" });
       }
     },
-    onChangeValue(e) {
+    // 选择有或没有
+    onChangeValue(e: any) {
       this.setData({ value1: e.detail.value });
+      // 输入框底部的bottom也还是最初的inputBoxBottom就可以了
       this.triggerEvent("boxBottom", {
         inputBoxBottom: this.data.inputBoxBottom,
       });
       this.setData({
         symptomResult: this.data.radioList.find(
-          (item) => item.value === e.detail.value
+          (item: any) => item.value === e.detail.value
         )?.label,
         isHaveNewSyndrome: this.data.radioList.find(
-          (item) => item.value === e.detail.value
+          (item: any) => item.value === e.detail.value
         )?.id,
       });
       let followObj: any = {
         isHaveNewSyndrome: this.data.isHaveNewSyndrome,
-        symptomList: this.data.symptomsList,
+        symptomsList: this.data.symptomsList,
       };
-      // console.log(this.data.isHaveNewSyndrome, "this.data.isHaveNewSyndrome");
+      if (this.data.isHaveNewSyndrome === "N") {
+        this.setData({ placeholder: "请问还有其他要补充的吗?" });
+      } else {
+        this.setData({ placeholder: "请描述新的症状?" });
+      }
       this.setData({ btnDisabled: true });
       wx.setStorageSync("followObj", followObj);
       this.setData({
         showrePlenish: true,
       });
+      this.triggerEvent("scroll", { id: "bottom" });
     },
     handleTop(event: HandleEvent) {
       if (this.data.result) return;
@@ -340,7 +330,6 @@ Component({
       multiple?: boolean
     ) {
       const checked = !item.checked;
-      console.log(checked, multiple, "_handle");
       if (checked) {
         const fn = () => {
           if (multiple) {
@@ -358,12 +347,10 @@ Component({
             subOptions: item.options,
             subMultiple: true,
           });
-          // console.log(this.data.subMultiple, "subOptions", item.css);
           this.onCancel = () => {
             this.setData({ subOptions: [] });
           };
           this.onConfirm = () => {
-            // console.log(this.data.subOptions, "subOptions", item.css);
             if (!this.data.subOptions.some((option) => option.checked)) {
               wx.showToast({ title: "请至少选择一项", icon: "error" });
             } else {
@@ -418,15 +405,21 @@ Component({
           }
         });
         this.setData({ symptomsList });
-        this.triggerEvent("next", { options: this.data.options });
+        this.triggerEvent("scroll", { id: "bottom" });
       }
     },
+
     onSkip() {
       if (this.data.result || this.data.hasSelected) return;
       if (!this.data.payload.required) {
         this.setData({ result: "无变化" });
         this.triggerEvent("next", { options: this.data.options });
       }
+      this.triggerEvent("scroll", { id: "bottom" });
+      this.setData({ placeholder: "请问还有其他要补充的吗?" });
     },
   },
+  onUnload() {
+    wx.offKeyboardHeightChange(); // 解绑键盘高度变化监听
+  },
 });

+ 23 - 27
miniprogram/module/chats/components/message-again/message-again.wxml

@@ -1,4 +1,3 @@
-
 <!--module/chats/components/message-again/message-again.wxml-->
 <wxs module="_">
   module.exports.getClassName = function (option) {
@@ -31,7 +30,7 @@
   </view>
 
   <view class="chat-card__content">
-   <t-cell t-class="cell-border-gradient" title="您好,您于{{followObj.medicalTime}}在我院{{followObj.medicalDepartment}}因为{{followObj.diagnosis}}就诊。接下来,我们将对您进行一个随访,请依据您目前的实际情况回答。"></t-cell>
+    <t-cell t-class="cell-border-gradient" title="您好,您于{{followObj.medicalTime}}在我院{{followObj.medicalDepartment}}因为{{followObj.diagnosis}}就诊。接下来,我们将对您进行一个随访,请依据您目前的实际情况回答。"></t-cell>
   </view>
 </view>
 <view class="chat-card left">
@@ -53,7 +52,7 @@
         <view class="not-change">无变化</view>
       </view>
       <view wx:if="{{multiple}}" class="item" bind:tap="onSubmit">
-      <view class="sub-btn">选好了</view>
+        <view class="sub-btn">选好了</view>
       </view>
     </view>
   </view>
@@ -69,20 +68,20 @@
   <t-loading wx:if="{{active}}" t-class="loading" theme="spinner" size="40rpx" class="wrapper" />
 </view>
 
-<view class="chat-card left"  wx:if="{{result}}"> 
+<view class="chat-card left" wx:if="{{result}}">
   <view class="chat-card__avatar ">
     <image src="../../assets/robot.png" mode="aspectFill" />
   </view>
   <view class="chat-card__content">
-     <t-cell t-class="cell-border-gradient" title="请问有没有出现新的症状?"></t-cell>
-      <t-radio-group t-class="horizontal-box" value="{{value1}}" bind:change="onChangeValue" disabled="{{btnDisabled}}">
-  <view wx:for="{{radioList}}" wx:key="index" class="radio-card {{value1 == index ? 'card-active' : ''}}">
-    <t-icon wx:if="{{value1 == index}}" name="check" t-class="card__icon" ariaHidden="{{true}}" />
-    <t-radio value="{{index}}" label="{{item.label}}" icon="none" borderless  />
-  </view>
-</t-radio-group>
-     </view>
+    <t-cell t-class="cell-border-gradient" title="请问有没有出现新的症状?"></t-cell>
+    <t-radio-group t-class="horizontal-box" value="{{value1}}" bind:change="onChangeValue" disabled="{{btnDisabled}}">
+      <view wx:for="{{radioList}}" wx:key="index" class="radio-card {{value1 == index ? 'card-active' : ''}}">
+        <t-icon wx:if="{{value1 == index}}" name="check" t-class="card__icon" ariaHidden="{{true}}" />
+        <t-radio value="{{index}}" label="{{item.label}}" icon="none" borderless />
+      </view>
+    </t-radio-group>
   </view>
+</view>
 
 
 
@@ -96,16 +95,16 @@
   <t-loading wx:if="{{active}}" t-class="loading" theme="spinner" size="40rpx" class="wrapper" />
 </view>
 
-<view class="chat-card left" wx:if="{{symptomResult==='有'}}"> 
+<view class="chat-card left" wx:if="{{symptomResult==='有'}}">
   <view class="chat-card__avatar ">
     <image src="../../assets/robot.png" mode="aspectFill" />
   </view>
   <view class="chat-card__content">
-     <t-cell t-class="cell-border-gradient" title="请描述新的症状?"></t-cell>
-     </view>
+    <t-cell t-class="cell-border-gradient" title="请描述新的症状?"></t-cell>
   </view>
+</view>
 
-    <view class="chat-card right" wx:if="{{messages[0].content && symptomResult==='有'}}">
+<view class="chat-card right" wx:if="{{messages[0].content && symptomResult==='有'}}" >
   <view class="chat-card__avatar ">
     <user-avatar></user-avatar>
   </view>
@@ -116,16 +115,16 @@
 </view>
 
 
-<view class="chat-card left" wx:if="{{messages.length>0 || symptomResult==='没有' }}"> 
+<view class="chat-card left" wx:if="{{messages.length>0 || symptomResult==='没有' }}">
   <view class="chat-card__avatar ">
     <image src="../../assets/robot.png" mode="aspectFill" />
   </view>
   <view class="chat-card__content">
-     <t-cell t-class="cell-border-gradient" title="请问还有其他要补充的吗?"></t-cell>
-     </view>
+    <t-cell t-class="cell-border-gradient" title="请问还有其他要补充的吗?"></t-cell>
   </view>
+</view>
 
-    <view class="chat-card right" wx:if="{{symptomResult==='有'?messages[1].content:false || symptomResult==='没有'?messages[0].content:false}}">
+<view class="chat-card right" wx:if="{{symptomResult==='有'?messages[1].content:false || symptomResult==='没有'?messages[0].content:false}}">
   <view class="chat-card__avatar ">
     <user-avatar></user-avatar>
   </view>
@@ -138,9 +137,9 @@
 
 
 
-<view class="input-panel" style="bottom:{{inputBoxBottom}}px;" wx:if="{{showrePlenish}}" >
-  <input bind:input="handleInput" value="{{inputText}}" adjust-position="{{false}}" placeholder="请输入"  bind:focus="onInputFocus" bind:blur="onInputBlur"
-   confirm-type="send" />
+<view class="input-panel" style="bottom:{{inputBoxBottom}}rpx;" wx:if="{{showrePlenish}}">
+  <input bind:input="handleInput" value="{{inputText}}" adjust-position="{{false}}" placeholder="{{placeholder}}" 
+  bind:focus="onInputFocus" bind:blur="onInputBlur" confirm-type="send" focus="{{inputFocus}}" />
   <view class="send-btn" bind:tap="send">发送</view>
 </view>
 
@@ -161,7 +160,4 @@
       </grid-builder>
     </scroll-view>
   </view>
-</t-popup>
-
-
-
+</t-popup>

+ 3 - 0
miniprogram/module/chats/components/message-follow/message-follow.scss

@@ -7,4 +7,7 @@
 .chat-card__handle .item {
   width: 280px * 0.5;
   height: 52px * 0.5;
+}
+.health-report{
+  color: #1D6FF6 !important;
 }

+ 2 - 1
miniprogram/module/chats/components/message-select/message-select.ts

@@ -104,7 +104,7 @@ Component({
       if (!this.data.hasSelected) {
         wx.showToast({ title: '请至少选择一项', icon: 'error' })
       } else {
-        console.log(this.data.options);
+        console.log(this.data.options,"提交");
         const result = this.data.options
           .filter((item: any) => item?.checked && !item?.hide)
           .map((option: any) => {
@@ -116,6 +116,7 @@ Component({
           })
           .join('; ');
         this.setData({ result })
+
         this.triggerEvent('next', { options: this.data.options });
       }
     },

+ 6 - 4
miniprogram/module/chats/components/questionnaire/questionnaire.ts

@@ -80,11 +80,13 @@ Component({
       this.setData({ messageType: event.detail.MessageType });
       this._next();
     },
+    scroll(option: { id: string }) {
+      this.triggerEvent("to", option.detail.id);
+    },
     boxBottom(event: boxBottom) {
-      console.log(event, "监听页面高度event");
       this.setData({ inputBoxBottom: event.detail.inputBoxBottom });
       this.triggerEvent("boxBottom", {
-        inputBoxBottom: this.data.inputBoxBottom,
+        inputBoxBottom: this.data.inputBoxBottom+100,
       });
       console.log(this.data.inputBoxBottom, "监听页面高度boxbottom");
     },
@@ -99,7 +101,7 @@ Component({
         this._next();
       } else {
         this._createMessage({
-          id: 2,
+          id: `follow.${Date.now()}`,
           type: "follow",
           payload: { title: "" },
         });
@@ -178,7 +180,7 @@ Component({
       try {
         if (this.data.messageType === 1) {
           this._createMessage({
-            id: 1,
+            id: `again.${Date.now()}`,
             type: "again",
             payload: { title: "" },
           });

+ 1 - 1
miniprogram/module/chats/components/questionnaire/questionnaire.wxml

@@ -8,7 +8,7 @@
 </wxs>
 <!--module/chats/components/questionnaire/questionnaire.wxml-->
 <block wx:for="{{messages}}" wx:key="id">
-  <message-again wx:if="{{_.show(item,'again')}}" bind:nextType="nextType" workId="{{workId}}" bind:boxBottom="boxBottom" />
+  <message-again wx:if="{{_.show(item,'again')}}" bind:nextType="nextType" workId="{{workId}}" bind:boxBottom="boxBottom" bind:scroll="scroll"/>
   <message-count wx:elif="{{_.show(item,'count')}}" payload="{{item.payload}}" id="{{item.id}}" active="{{_.active(lastId,item.id)}}" bind:next="handle" /> 
   <message-analysis wx:elif="{{_.show(item,'analysis')}}" active="{{_.active(lastId,item.id)}}" id="{{item.id}}" payload="{{item.payload}}" bind:next="handle" messageType="{{messageType}}" />
   <message-follow wx:elif="{{_.show(item,'follow')}}" bind:nextType="nextType" workId="{{workId}}" bind:boxBottom="boxBottom" />

+ 7 - 5
miniprogram/module/chats/pages/analysis/analysis.ts

@@ -175,19 +175,21 @@ Component({
           });
       }
       let imageObj: any = {
-        upImg: this.data.thumbnail[0],
-        downImg: this.data.thumbnail[1],
-        faceImg: this.data.thumbnail[2],
+        upImg: this.data.original[0],
+        downImg: this.data.original[1],
+        faceImg: this.data.original[2],
       };
+      
+      // console.log(this.data.followObj, "this.data.followObj");
       this.setData({
         activeObj: { ...imageObj, ...this.data.followObj },
       });
-      console.log({ ...this.data.activeObj }, "activeObj");
+      // console.log({ ...this.data.activeObj }, "activeObj");
       let isAnalysis: number;
       if (this.data.messageType === 2) {
         isAnalysis = wx.getStorageSync("isAnalysis");
       }
-      console.log(this.data.messageType, "messageType", isAnalysis);
+      // console.log(this.data, "messageType", isAnalysis);
       if (isAnalysis === 2) {
         // 提交随访提醒
         try {

+ 1 - 0
miniprogram/module/chats/pages/index/index.scss

@@ -5,6 +5,7 @@
 .page-scroll__container {
   box-sizing: border-box;
   overflow-y: auto;
+
 }
 
 .chats-container {

+ 39 - 7
miniprogram/module/chats/pages/index/index.ts

@@ -31,7 +31,19 @@ Component({
       });
       const component = this.data.component as "guide" | "questionnaire";
       this.handle({ detail: { component, scroll: true } });
-      console.log("id-index",this.data);
+      // 计算底部bottom
+      const systemInfo = wx.getSystemInfoSync();
+      const windowHeight = systemInfo.windowHeight;
+      const safeAreaBottom = systemInfo.safeArea?.bottom ?? windowHeight; // 没有safeArea时,bottom等于windowHeight
+      const safeBottom = windowHeight - safeAreaBottom; // 安全区底部距离(px)
+      const safeBottomRpx = (750 / systemInfo.windowWidth) * safeBottom; // rpx
+      console.log(safeBottom, "safeBottom");
+      // const tabbarHeight = 40; // 你的tabbar高度,单位px(如80rpx转px,或直接用rpx)
+      // let paddingBottom = tabbarHeight + safeBottom;
+      this.setData({
+        paddingBottom: this.data.paddingBottom+safeBottomRpx,
+      });
+      console.log(this.data.paddingBottom, "paddingBottom");
     },
     ready() {
       wx.createSelectorQuery()
@@ -52,20 +64,28 @@ Component({
     date: "",
     messages: {} as Record<number, Message>,
     lastId: "",
-    inputBoxBottom:0,
-    tabbarValue:"/module/chats/pages/index/index",
+    inputBoxBottom: 0,
+    tabbarValue: "/module/chats/pages/index/index",
     analysisCount: 0,
+    paddingBottom: 100,  // 底部tabbar高度是100
   },
   observers: {
     "messages.**"(messages) {
       const message = Object.values(messages).pop() as Message;
       this.setData({ lastId: message?.id });
     },
+    // calc(100rpx + env(safe-area-inset-bottom))
   },
   methods: {
     boxBottom(event: boxBottom) {
-      console.log(event, "监听页面index高度event");
-      this.setData({ inputBoxBottom: event.detail.inputBoxBottom+60 });
+      console.log(event.detail.inputBoxBottom, "监听页面index高度boxbottom");
+      this.setData({
+        inputBoxBottom: event.detail.inputBoxBottom,
+      });
+      // const bottom=this.data.paddingBottom;
+      this.setData({
+        paddingBottom: event.detail.inputBoxBottom,
+      });
       console.log(this.data.inputBoxBottom, "监听页面index高度boxbottom");
     },
     nextType(event: NextTypeEvent) {
@@ -86,12 +106,24 @@ Component({
       if (event.detail?.scroll) this.scrollIntoView();
     },
     scrollIntoView(event?: ScrollIntoViewEvent) {
+      console.log(event, "index-scrollIntoView");
       clearTimeout(getScrollcontext.call(this).timer);
       const id = event?.detail ?? this.data.lastId;
+      console.log(id, "index-scrollIntoView");
+
       getScrollcontext.call(this).timer = setTimeout(() => {
-        getScrollcontext
+        const scroll = getScrollcontext
           .call(this)
-          .scroll?.scrollIntoView(`#${id}`, { alignment: "end" });
+          .scroll;
+
+        if(id === "bottom"){
+          scroll?.scrollTo({
+            top: Number.MAX_SAFE_INTEGER,
+            animated: true
+           })
+        }else{
+          scroll?.scrollIntoView(`#${id}`, { alignment: "end" });
+        }
       }, 300);
     },
   },

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

@@ -18,7 +18,7 @@
     enable-passive 
     scroll-into-view="{{lastId}}" 
     scroll-into-view-alignment="end" 
-    style="height: calc(100vh - 180rpx); padding-bottom: calc(100rpx + env(safe-area-inset-bottom));"
+    style="height: calc(100vh - 180rpx); padding-bottom:{{paddingBottom}}rpx;"
   >
     <view class="system-wrapper">
       <view class="date">{{date}}</view>
@@ -27,7 +27,8 @@
     
     <block wx:for="{{messages}}" wx:key="id">
       <chat-guide wx:if="{{(_.show(item, 'guide') && isShowGuide)}}" id="{{item.id}}" active="{{_.active(lastId, item.id)}}" bind:next="handle" bind:to="scrollIntoView" bind:nextType="nextType" bind:getCount="getCount" analysisCount="{{analysisCount}}" />
-      <chat-questionnaire wx:if="{{_.show(item, 'questionnaire') && messageType}}" id="{{item.id}}" active="{{_.active(lastId, item.id)}}" bind:next="handle" bind:to="scrollIntoView" bind:nextType="nextType" messageType="{{messageType}}" workId="{{id}}" bind:boxBottom="boxBottom" />
+      <chat-questionnaire wx:if="{{_.show(item, 'questionnaire') && messageType}}" id="{{item.id}}" active="{{_.active(lastId, item.id)}}" bind:next="handle" 
+      bind:to="scrollIntoView" bind:nextType="nextType" messageType="{{messageType}}" workId="{{id}}" bind:boxBottom="boxBottom" />
     </block>
   </scroll-view>
 

+ 0 - 1
miniprogram/module/follow/pages/evaluation/report.ts

@@ -2,7 +2,6 @@ import { Get } from "../../../../lib/request/method";
 
 Page({
   onLoad(options: { id: number }) {
-    console.log("options", options);
     if (options.id) {
       this.getReport(options.id);
     }

+ 6 - 0
miniprogram/module/health/components/follow-evaluation/follow-evaluation.ts

@@ -46,5 +46,11 @@ Component({
         });
       }
     },
+    goFollowEvaluation() {
+      console.log("评估详情");
+      // wx.navigateTo({
+      //   url: `/module/follow/pages/evaluation/report`,
+      // });
+    },
   },
 });

+ 1 - 1
miniprogram/module/health/components/follow-evaluation/follow-evaluation.wxml

@@ -20,7 +20,7 @@
         <view class="table-cell">随访计划</view>
         <view class="table-cell">评估结果</view>
       </view>
-      <view class="table-row" wx:for="{{followEvaluationList}}" wx:key="id">
+      <view class="table-row" wx:for="{{followEvaluationList}}" wx:key="id" bindtap="goFollowEvaluation">
         <view class="table-cell truncate">{{item.evaluateTime}}</view>
         <view class="table-cell truncate">{{item.followupPlanName}}</view>
         <view class="table-cell truncate">{{item.evaluate.evaluateDeal==='1'?'复诊 ':item.evaluate.evaluateDeal==='2'?'中医调养':''}}</view>

+ 3 - 0
miniprogram/module/health/components/follow-record/follow-record.ts

@@ -15,6 +15,9 @@ Component({
         followEvaluationList: res.data,
       });
     },
+    goFollowRecord(e: any) {
+      console.log(e, "记录列表");
+    },
   },
   properties: {},
 

+ 1 - 1
miniprogram/module/health/components/follow-record/follow-record.wxml

@@ -20,7 +20,7 @@
         <view class="table-cell">随访计划</view>
         <view class="table-cell">状态</view>
       </view>
-      <view class="table-row" wx:for="{{followEvaluationList}}" wx:key="id">
+      <view class="table-row" wx:for="{{followEvaluationList}}" wx:key="id" bindtap="goFollowRecord">
         <view class="table-cell">{{item.arrangeTime}}</view>
         <view class="table-cell">{{item.followupPlanName}}</view>
         <view class="table-cell">{{item.progress==='1'?'未完成':item.progress==='2'?'已完成':item.progress==='0'?'未开始':''}}</view>

+ 2 - 0
miniprogram/module/health/pages/home/home.wxml

@@ -17,7 +17,9 @@
     </report-health-index>
     <!--我的调养方案-->
     <care-scheme></care-scheme>
+      <!--随访记录-->
     <follow-record></follow-record>
+      <!--随访评估-->
     <follow-evaluation></follow-evaluation>
     <!--调养记录-->
     <care-record></care-record>

+ 2 - 0
miniprogram/pages/home/home.ts

@@ -213,6 +213,8 @@ Page({
     wx.setStorageSync("isAnalysis", 2);
     let page = e.currentTarget.dataset.page;
     let id = e.currentTarget.dataset.id;
+    // let page = '/module/chats/pages/index/index';
+    // let id = 1;
     if (page === "/module/chats/pages/index/index") {
       wx.setStorageSync("workId", id);
       wx.navigateTo({

+ 1 - 2
miniprogram/pages/home/home.wxml

@@ -3,9 +3,8 @@ v<!--pages/home/home.wxml-->
 
 <t-navbar title="中医健康管家" t-class-title="nav-title" />
 
-<scroll-view class="page-scroll__container" type="list" scroll-y style="height: {{pageHeight}};">
+<scroll-view class="page-scroll__container" type="list" scroll-y style="height: {{pageHeight}};"> 
 <view class="follow-container">
-
 <view class="follow-box" bind:tap="showFollowPopup"><image src="../../assets/bg/icon_notice@3x.png"  mode="heightFix" class="notice-icon" /> <view class="pieces">{{popupList.length}}</view> <view class="follow-text">诊疗随访提醒</view></view>
   <view class="tool-bar-wrapper">
       <view class="tool" wx:if="{{location.description}}">