Эх сурвалжийг харах

健康分析从健康评估进去最后一个问题不滑动,以及首页不是新用户不弹窗

张田田 7 сар өмнө
parent
commit
e3ce2dfc27

+ 1 - 1
miniprogram/module/article/pages/order-detail/order-detail.wxml

@@ -47,7 +47,7 @@
         </view>
         <view class="table-row {{idx % 2 === 1 ? 'table-row-alt' : ''}}" wx:for="{{orderDetail.items}}" wx:for-index="idx" wx:key="name">
           <text class="table-cell">{{item.conditioningProgramDetail.name}}</text>
-          <text class="table-cell">{{item.frequencyType==='不限'?'不限':item.totalMeasure}}{{item.conditioningProgramDetail.cpFixedPricingRule.pricingUnit ?? '次'}}</text>
+          <text class="table-cell">{{item.frequencyType==='不限'?'不限':item.totalMeasure}}{{item.conditioningProgramDetail.cpFixedPricingRule.pricingUnit || '次'}}</text>
           <text class="table-cell">{{item.totalPrice}}</text>
         </view>
         <view class="table-row table-total">

+ 4 - 1
miniprogram/module/article/pages/science-info/science-info.ts

@@ -22,7 +22,10 @@ Component({
 
         this.setData({ title: data?.title ?? "" });
       });
-      this.load();
+      if (this.data.id) {
+        this.load();
+      }
+      // this.load();
     },
   },
   properties: {

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

@@ -156,8 +156,28 @@ Component({
         [`_next.dialogId`]: "",
         [`_next.questions`]: [],
       });
-      this.triggerEvent("to", "bottom");
-      this.triggerEvent("next", { component: "guide", scroll: true });
+      // 对于 isAnalysis === 4 的情况,不创建新的 guide 组件,直接触发滚动
+      // 对于 isAnalysis === 3 的情况,仍然创建 guide 组件显示三个业务选项
+      const isAnalysis = wx.getStorageSync("isAnalysis");
+      if (isAnalysis === 4) {
+        // 触发滚动到当前 questionnaire 组件,让父页面滚动到这个组件
+        setTimeout(() => {
+          this.triggerEvent("to");
+        }, 100);
+      } else {
+        this.triggerEvent("next", { component: "guide", scroll: true });
+        // 对于 isAnalysis === 3 的情况,延迟触发滚动,确保报告消息和业务选项都渲染完成
+        if (isAnalysis === 3) {
+          setTimeout(() => {
+            this.triggerEvent("to");
+          }, 300);
+        } else {
+          // 额外触发一次滚动到底部,确保页面滚动到最新内容
+          setTimeout(() => {
+            this.triggerEvent("to", { detail: "bottom" });
+          }, 200);
+        }
+      }
     },
     async _next() {
       let isAnalysis: number;
@@ -289,8 +309,17 @@ Component({
                   url: `/module/health/pages/report/report?id=${data.healthAnalysisReportId}`,
                 },
               });
+              // 立即触发一次滚动,确保在最后一个问题生成报告卡片后页面滚动到底部
+              this.triggerEvent("to");
+            }
+            if (data.over) {
+              console.log("结束触发", data, isAnalysis);
+              // 延迟触发滚动,确保报告消息已经渲染完成
+              setTimeout(() => {
+                this.triggerEvent("to");
+              }, 100);
+              return this._end();
             }
-            if (data.over) return this._end();
           }
           this.setData({
             [`_next.classify`]: data.classify,

+ 3 - 3
miniprogram/module/chats/pages/index/index.ts

@@ -114,12 +114,12 @@ Component({
         } else if (id) {
           scroll.scrollIntoView(`#${id}`, { alignment: "end" });
         }
+        // 再补一次,处理内容异步渲染晚于滚动触发的情况
         setTimeout(() => {
           if (id === "bottom") {
-            // scroll.scrollTo({ top: Number.MAX_SAFE_INTEGER, animated: true });
-            scroll.scrollIntoView(`#${id}`, { alignment: "end", animated: false as any });
+            scroll.scrollTo({ top: Number.MAX_SAFE_INTEGER, animated: true });
           } else if (id) {
-            scroll.scrollIntoView(`#${id}`, { alignment: "end", animated: false as any });
+            scroll.scrollIntoView(`#${id}`, { alignment: "end" });
           }
         }, 200);
       };

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

@@ -16,6 +16,8 @@
     scroll-y 
     enhanced="{{true}}" 
     enable-passive 
+    scroll-into-view="{{lastId}}" 
+    scroll-into-view-alignment="end" 
     style="height: calc(100vh - 180rpx); padding-bottom:{{paddingBottom}}rpx;"
   >
     <view class="system-wrapper">

+ 6 - 4
miniprogram/module/health/model/health.model.ts

@@ -125,12 +125,14 @@ function faceAnalysisModel(data: AnyObject): AnalysisModel {
         faceException(data?.faceColor, '面色'),
         faceException(data?.mainColor, '主色'),
         faceException(data?.shine, '光泽'),
-        faceException(data?.leftBlackEye, '左黑眼圈'),
-        faceException(data?.rightBlackEye, '右黑眼圈'),
+        // faceException(data?.leftBlackEye, '左黑眼圈'),
+        // faceException(data?.rightBlackEye, '右黑眼圈'),
+        faceException(data?.blackEye, '黑眼圈'),
         faceException(data?.lipColor, '唇色'),
         faceException(data?.eyeContact, '眼神'),
-        faceException(data?.leftEyeColor, '左目色'),
-        faceException(data?.rightEyeColor, '右目色'),
+        // faceException(data?.leftEyeColor, '左目色'),
+        // faceException(data?.rightEyeColor, '右目色'),
+        faceException(data?.eyeColor, '目色'),
         faceException(data?.hecticCheek, '两颧红'),
         faceException(data?.noseFold, '鼻褶'),
         faceException(data?.cyanGlabella, '眉间/鼻柱青色'),

+ 4 - 4
miniprogram/module/health/pages/scheme/scheme.ts

@@ -42,11 +42,11 @@ Component({
     // 去购买
     goBuy(this: any, e: any) {
       const item = e.currentTarget.dataset.item || {};
-      const type: string = (item.type || item.jumpType || '').toLowerCase();
+      const type: string = (item.buyType || '').toLowerCase();
       const appId: string = item.appId || item.appID || item.appid || '';
       const miniPath: string = item.path || item.miniPath || '';
-      const url: string = item.url || item.link || '';
-
+      const url: string = item.buyUrl || '';
+console.log(item, 'item',type);
       // 优先按显式类型判断
       if (type === 'miniprogram' || (!!appId && !type)) {
         wx.navigateToMiniProgram({
@@ -60,7 +60,7 @@ Component({
         return;
       }
 
-      if (type === 'h5' || (!!url && !type)) {
+      if (type === 'url' || (!!url && !type)) {
         if (!url) {
           getTickleContext.call(this).showWarnMessage('无有效链接');
           return;

+ 1 - 1
miniprogram/module/health/pages/scheme/scheme.wxml

@@ -20,7 +20,7 @@
           <view class="buy-container">
             <view class="scheme__item-title scheme__title" wx:if="{{item.title}}">{{item.title}}</view>
             <view class="scheme__item-title scheme__title" wx:else></view>
-            <view class="buy-box" bindtap="goBuy" data-item="{{item}}" wx:if="{{false}}">去购买</view>
+            <view class="buy-box" bindtap="goBuy" data-item="{{item}}" wx:if="{{item.buyUrl}}">去购买</view>
           </view>
           <horizontal-scrollable dataset="{{item.children}}"></horizontal-scrollable>
           <view class="scheme__description" wx:if="{{item.description}}">{{item.description}}</view>

+ 2 - 0
miniprogram/module/health/request.ts

@@ -85,6 +85,8 @@ export function healthSchemeMethod(id: string) {
           title: item?.type || '',
           children: item?.groups?.map((item: AnyObject, j: number) => {
             return {
+              buyUrl: item?.buyUrl || '',
+              buyType: item?.buyType || '',
               title: item?.name || '',
               descriptions: item?.attrs?.map((attr: AnyArray, k: number) => {
                 return { ...attr, id: `description-${i}-${j}-${k}`, }

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

@@ -219,10 +219,11 @@ Page({
   async onShow() {
     wx.showShareMenu({ withShareTicket: true, menus }).then();
     await this.load();
+    console.log(this.data.patient, "获取用户信息patient");
     // console.log(this.data.patient, "获取用户信息patient");
     // 如果用户没有手机号每次进入页面都提示  点击跳到注册页补充
     // todo 要先判断用户有没有手机号 isPerfectInfo是true 就出来弹窗提示用户
-    if (this.data.patient?.isPerfectInfo) {
+    if (this.data.patient?.isPerfectInfo ?? true) {
       wx.showModal({
         title: "提示",
         content: "手机号为空,请补充",