Просмотр исходного кода

【健康分析】没有健康分析的用户,点击首页的“请完成健康评估”直接打开健康分析

张田田 8 месяцев назад
Родитель
Сommit
a5832d178e

+ 16 - 1
miniprogram/module/chats/components/guide/guide.ts

@@ -2,7 +2,22 @@
 import { getPatients } from "../../../../pages/home/request";
 import { toCertificationPage } from "../../../../pages/home/router";
 Component({
-  lifetimes: {},
+  lifetimes: {
+   attached() {
+   const showGuideActive = wx.getStorageSync("showGuideActive");
+  //  从主页点击健康评估进来的
+    if(showGuideActive){
+      this.handleA();
+      wx.removeStorageSync("showGuideActive");
+    }
+   },
+   
+  },
+  observers: {
+    active(newVal,oldVal) {
+      console.log("active=>>>",newVal,oldVal);
+    },
+  },
   properties: {
     id: { type: String, value: "" },
     active: { type: Boolean, value: false },

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

@@ -803,6 +803,8 @@ Page({
     wx.redirectTo({
       url: `/module/chats/pages/index/index?component=guide&isShowGuide=true`,
     });
+    wx.setStorageSync("showGuideActive", 1);
     wx.setStorageSync("isAnalysis", 3);
+
   },
 });

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

@@ -47,7 +47,7 @@
           </view>
         </view>
       </view>
-       <view class="healthyAnalyze" bindtap="goHealthAnalyze" wx:if="{{isShowComplete}}"  >
+       <view class="healthyAnalyze" bindtap="goHealthAnalyze" wx:if="{{true}}">
    请完成健康评估
      </view>
       <view class="report-container" bind:tap="toReportPage" wx:if="{{healthReport.data.reportTime}}">