Browse Source

去除打印 以及 修改注册 如果是从一体机扫码过来并且没手机号就直接跳到注册页让用户注册

张田田 7 tháng trước cách đây
mục cha
commit
03f279cd4b

+ 0 - 1
miniprogram/app.config.ts

@@ -7,7 +7,6 @@ let host = "wx2.hzliuzhi.com";
 if (env === "trial") {
   host = "test.hzliuzhi.com";
 } else if (env === "develop") {
-  console.log("develop")
   // host = "wx2.hzliuzhi.com";
   host = "wx.hzliuzhi.com:4433";
 }

+ 0 - 5
miniprogram/components/button/button.ts

@@ -9,7 +9,6 @@ Component({
   },
   lifetimes: {
     attached(this: any) {
-      console.log("[Button] attached, initializing...");
       const mode = this.data.block ? "block" : "line";
       const index = this.data.index;
       this.setData({
@@ -17,10 +16,6 @@ Component({
         className: this.data.block ? "block" : `line-${index}`,
         isDisabled: false,
       });
-      console.log(
-        "[Button] initialized with isDisabled:",
-        this.data.isDisabled
-      );
     },
   },
   properties: {

+ 0 - 3
miniprogram/lib/use/use-phone.ts

@@ -27,11 +27,8 @@ export function usePhoneNumber() {
       callback(status)
     },
     getPhoneNumber(event: WechatMiniprogram.ButtonGetPhoneNumber) {
-      console.log('getPhoneNumber-->', event);
       const code = event.detail.code;
-      console.log('getPhoneNumber-->code', code);
       if (!code) return;
-      console.log('getPhoneNumber-->');
       _updateStatus.forEach(cb => cb('loading'))
       request({
         url: `/mobileAccountManage/getAccountPhone`,

+ 0 - 2
miniprogram/module/charts/components/record-index/request.ts

@@ -4,7 +4,6 @@ const careId=wx.getStorageSync('careId')
 export function healthIndexReportMethod() {
   if(careId)
   {
-    console.log(careId, '服务包详情');
     return Post(`/patientCrManage/getPcrProcessById/${careId}`, {}, {
       transform({ data }: any) { 
         return transformHealthIndex2Chart(<any[]>data.patientQuotaGroups)
@@ -12,7 +11,6 @@ export function healthIndexReportMethod() {
     })
 
   }else{
-    console.log('获取健康评估记录');
     return Post(`/patientQuota/getQuovalRecord`, {}, {
       transform({ data }) { return transformHealthIndex2Chart(<any[]>data) }
     })

+ 0 - 1
miniprogram/module/charts/record-care/record-care.ts

@@ -27,7 +27,6 @@ Component({
         {},
         {
           transform({ data }: any) {
-            console.log(data, "获取健康评分数据");
             return data;
           },
         }

+ 0 - 2
miniprogram/module/charts/record-index/health-index.ts

@@ -84,11 +84,9 @@ export function healthIndex2Chart(model: App.Health.Index.Model, index = 0): Any
 
 export function transformHealthIndex2Chart(data: App.Health.Index.Data[]): AnyObject[] {
   const list = gather(data, healthIndex2Chart)
-  // console.log(list, 'transformHealthIndex2Chart-->list');
 
   const charts = [];
   for (const item of list) {
-    // console.log(item, 'item111');
     const xAxis = { type: 'category', axisLabel: { overflow: 'breakAll' } }
     const yAxis = [], series = [], visualMap = [];
     for (const option of item.options) {

+ 0 - 2
miniprogram/module/charts/record-index/request.ts

@@ -4,7 +4,6 @@ const careId=wx.getStorageSync('careId')
 export function healthIndexReportMethod() {
   if(careId)
   {
-    console.log(careId, '服务包详情');
     return Post(`/patientCrManage/getPcrProcessById/${careId}`, {}, {
       transform({ data }: any) { 
         return transformHealthIndex2Chart(<any[]>data.patientQuotaGroups)
@@ -12,7 +11,6 @@ export function healthIndexReportMethod() {
     })
 
   }else{
-    console.log('获取健康评估记录');
     return Post(`/patientQuota/getQuovalRecord`, {}, {
       transform({ data }) { return transformHealthIndex2Chart(<any[]>data) }
     })

+ 0 - 1
miniprogram/module/chats/components/message-analysis/message-analysis.ts

@@ -42,7 +42,6 @@ attached(){
    */
   methods: {
     onConfirm() {
-   console.log(this.data.messageType,"this.data.messageType")
       if (this.data.source.length) return;
       wx.navigateTo({
         url: '/module/chats/pages/analysis/analysis?messageType=' + this.data.messageType,

+ 0 - 1
miniprogram/module/chats/components/message-follow/message-follow.ts

@@ -23,7 +23,6 @@ Component({
     seeReport(){
       // const id = 1819;
      const id = wx.getStorageSync("tonguefaceAnalysisReportId");
-     console.log("查看舌面像报告", id);
      wx.navigateTo({ url: "/module/health/pages/analysis/analysis?id=" + id });
    },
   }

+ 0 - 2
miniprogram/module/chats/components/message-report/message-report.ts

@@ -6,8 +6,6 @@ Component({
   data: {},
   methods: {
     handle() {
-      console.log(this.data.payload);
-      
       wx.navigateTo({ url: this.data.payload.url })
     }
   }

+ 19 - 30
miniprogram/module/chats/components/message-select/message-select.ts

@@ -37,7 +37,6 @@ Component({
   },
   lifetimes: {
     attached() {
-      console.log("attached", this.data.payload.belongNew,this.data.payload);
       if (this.data.payload.belongNew) {
         this.setData({
           leftTitle: "都没有",
@@ -59,14 +58,16 @@ Component({
       this.setData({ initialOptions });
     },
     options(options: AnyArray) {
-      console.log("options", options);
       const hasSelected = options
         .filter((option: any) => !option.hide)
         .some((option: any) => option.checked);
-      
+
       // 检测是否与初始状态不同
-      const hasChanged = this._checkOptionsChanged(options, this.data.initialOptions);
-      
+      const hasChanged = this._checkOptionsChanged(
+        options,
+        this.data.initialOptions
+      );
+
       this.setData({
         hasSelected,
         hasChanged,
@@ -75,50 +76,49 @@ Component({
   },
   methods: {
     // 检测选项是否发生变化
-    _checkOptionsChanged(currentOptions: Option[], initialOptions: Option[]): boolean {
+    _checkOptionsChanged(
+      currentOptions: Option[],
+      initialOptions: Option[]
+    ): boolean {
       if (!initialOptions || initialOptions.length === 0) {
         return false;
       }
-      
+
       // 比较主选项的选中状态
       for (let i = 0; i < currentOptions.length; i++) {
         const current = currentOptions[i];
         const initial = initialOptions[i];
-        
+
         if (!initial) continue;
-        
+
         // 比较主选项的checked状态
         if (current.checked !== initial.checked) {
           return true;
         }
-        
+
         // 如果有子选项,比较子选项的选中状态
         if (current.options && initial.options) {
           for (let j = 0; j < current.options.length; j++) {
             const currentSub = current.options[j];
             const initialSub = initial.options[j];
-            
+
             if (!initialSub) continue;
-            
+
             if (currentSub.checked !== initialSub.checked) {
               return true;
             }
           }
         }
       }
-      
+
       return false;
     },
 
-
-    
     handleTop(event: HandleEvent) {
       const {
         mark: { item },
       } = event;
-      console.log("handleTop", item, this.data.active);
       if (!item || !this.data.active) return;
-      console.log("handleTop", this.data.subOptions);
       const index = this.data.options.findIndex(
         (option) => option.id === item.id
       );
@@ -130,7 +130,6 @@ Component({
       const hasAnySubChecked = itemInState?.options?.some(
         (o: any) => o?.checked
       );
-      console.log("itemInState", itemInState, hasSubOptions, hasAnySubChecked);
       if (itemInState?.checked && hasSubOptions && hasAnySubChecked) {
         this.setData({
           subTitle: itemInState.name,
@@ -165,18 +164,14 @@ Component({
       }
     },
 
-
     handleSub(event: HandleEvent) {
       const {
         mark: { item },
       } = event;
-      console.log("handleSub", item, this.data.active);
       if (!item || !this.data.active) return;
-      console.log("this.data.subOptions", this.data.subOptions);
       const index = this.data.subOptions.findIndex(
         (option) => option.id === item.id
       );
-      console.log("index", index);
       const multiple = this.data.subMultiple;
       const checked = !item.checked;
       const subOptions = this._handle(
@@ -186,8 +181,6 @@ Component({
         multiple
       );
       this.setData({ subOptions });
-      console.log(this.data.subOptions, "suboptions111");
-
       // 检查是否所有症状程度都被取消选中
       const hasAnySubChecked = subOptions.some((option) => option.checked);
       if (!hasAnySubChecked) {
@@ -271,12 +264,10 @@ Component({
     onCancel() {},
     onConfirm() {},
     onSubmit() {
-      console.log("onSubmit", this.data.result, this.data.hasSelected);
       if (this.data.result) return;
       if (!this.data.hasSelected) {
         wx.showToast({ title: "请至少选择一项", icon: "error" });
       } else {
-        console.log(this.data.options);
         const result = this.data.options
           .filter((item: any) => item?.checked && !item?.hide)
           .map((option: any) => {
@@ -287,15 +278,13 @@ Component({
             return [option.name, sub].filter(Boolean).join(": ");
           })
           .join("; ");
-        console.log("result", result);
         this.setData({ result });
         this.triggerEvent("next", { options: this.data.options });
       }
     },
     onSkip() {
-      console.log("onSkip", this.data.result, this.data.hasSelected);
       if (this.data.result) return;
-      
+
       // 如果是新用户(belongNew为true),使用原来的逻辑
       if (this.data.payload.belongNew) {
         if (this.data.hasSelected) return;
@@ -310,7 +299,7 @@ Component({
           // wx.showToast({ title: "症状已发生变化,请重新选择", icon: "none" });
           return;
         }
-        
+
         // 如果没有变化,允许点击"无变化"
         this.setData({ result: "无变化" });
         this.triggerEvent("next", { options: this.data.options });

+ 0 - 2
miniprogram/module/chats/pages/analysis/analysis.ts

@@ -85,7 +85,6 @@ Component({
   methods: {
     handle(event: WechatMiniprogram.TouchEvent) {
       const { handle, index } = event.mark as AnyObject;
-      console.log(handle, index, handle === "upload:delete", event.mark);
       switch (handle) {
         case "preview":
           break;
@@ -221,7 +220,6 @@ Component({
           this.setData({ _submitting: false });
         }
       } else {
-        // console.log("对话管家",data)
         // 对话管家
         this.getOpenerEventChannel().emit("update", data);
         wx.navigateBack();

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

@@ -35,20 +35,15 @@ Component({
         this.setData({ isShowGuide: true });
       }
       this.handle({ detail: { component, scroll: true } });
-      console.log("id-index",this.data.messages);
       // 计算底部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()
@@ -82,7 +77,6 @@ Component({
   },
   methods: {
     boxBottom(event: boxBottom) {
-      console.log(event.detail.inputBoxBottom, "监听页面index高度boxbottom");
       this.setData({
         inputBoxBottom: event.detail.inputBoxBottom + 60,
       });
@@ -90,7 +84,6 @@ Component({
       this.setData({
         paddingBottom: event.detail.inputBoxBottom,
       });
-      console.log(this.data.inputBoxBottom, "监听页面index高度boxbottom");
     },
     nextType(event: NextTypeEvent) {
       this.setData({ messageType: event.detail.MessageType });

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

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

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

@@ -10,13 +10,11 @@ Component({
   methods: {
     async getFollowRecordList() {
       const res = await getFollowRecordListMethod();
-      console.log(res,"记录列表");
       this.setData({
         followEvaluationList: res.data,
       });
     },
     goFollowRecord(e: any) {
-      console.log(e, "记录列表");
     },
   },
   properties: {},

+ 0 - 2
miniprogram/module/health/components/horizontal-scrollable/horizontal-scrollable.ts

@@ -32,8 +32,6 @@ Component({
     },
 
     start() {
-      console.log('触发');
-
       const query = this.createSelectorQuery()
       query.select('.scrollable').boundingClientRect();
       query.selectAll('.scheme__card').boundingClientRect();

+ 8 - 2
miniprogram/module/health/pages/analysis/analysis.ts

@@ -17,10 +17,16 @@ Page({
     tongue: null as unknown as AnalysisModel,
     face: null as unknown as AnalysisModel,
     dataset: null as unknown as AnyObject,
+    switchType: "",
   },
   onLoad(query: any) {
-    console.log(query,"query1111")
     this._load(query);
+    if (query.scene) {
+      this.setData({
+        switchType: query.scene,
+      });
+    }
+    console.log(this.data.switchType,"query1111",query)
   },
 
   async _load(query: Record<'id' | 'scene', string>) {
@@ -36,5 +42,5 @@ Page({
     wx.hideLoading();
   },
 
-  toHomePage() { toHomePage(); },
+  toHomePage() { toHomePage(this.data.switchType as string); },
 });

+ 40 - 27
miniprogram/module/health/pages/report/report.ts

@@ -1,44 +1,53 @@
 import PageContainerBehavior from "../../../../core/behavior/page-container.behavior";
-import TickleBehavior, { getTickleContext } from "../../../../core/behavior/tickle.behavior";
+import TickleBehavior, {
+  getTickleContext,
+} from "../../../../core/behavior/tickle.behavior";
 
 // module/health/pages/report/report.ts
-import { toSchemePage, toHomePage } from '../../router';
+import { toSchemePage, toHomePage } from "../../router";
 import { healthIndexMethod, healthReportMethod } from "../../request";
 import { healthIndex2Progress } from "../../tools/health-index";
 
-
 Page({
-  behaviors: [
-    PageContainerBehavior,
-    TickleBehavior
-  ],
+  behaviors: [PageContainerBehavior, TickleBehavior],
   data: {
-    id: '',
+    id: "",
     dataset: null as unknown as AnyObject,
     showScheme: false,
-    schemeId: '',
-    healthIndex: { data: [], loading: false, message: '' },
+    schemeId: "",
+    healthIndex: { data: [], loading: false, message: "" },
     tongueAnalysis: [] as AnyArray,
+    switchType: "",
   },
   onLoad(query: any) {
-    this._load(query).then((id: string) => { if (id) this.getHealthIndex(id); });
+    this._load(query).then((id: string) => {
+      if (id) this.getHealthIndex(id);
+    });
+    if (query.scene) {
+      this.setData({
+        switchType: query.scene,
+      });
+    }
+    console.log(this.data.switchType, "这是onload页面report", query);
   },
 
-  async _load(query: Record<'id' | 'scene', string>) {
-    let id = '';
-    wx.showLoading({ title: '加载中' });
+  async _load(query: Record<"id" | "scene", string>) {
+    let id = "";
+    wx.showLoading({ title: "加载中" });
     try {
       const { __origin__, ...dataset } = await healthReportMethod(query);
       id = dataset.id;
-      const showScheme = __origin__?.isHaveConditioningProgram === 'Y';
-      const schemeId = __origin__?.isConfirmConditioningProgram === 'Y' ? id : '';
+      const showScheme = __origin__?.isHaveConditioningProgram === "Y";
+      const schemeId =
+        __origin__?.isConfirmConditioningProgram === "Y" ? id : "";
       this.setData({
-        showScheme, schemeId,
+        showScheme,
+        schemeId,
         dataset: {
           ...dataset,
           factorItems: __origin__?.factorItems,
           diagnoseSyndromes: __origin__?.diagnoseSyndromes,
-        }
+        },
       });
     } catch (error) {
       getTickleContext.call(this).showErrorMessage(error.errMsg, 0);
@@ -49,21 +58,25 @@ Page({
   },
 
   async getHealthIndex(id?: string) {
-    this.setData({ 'healthIndex.loading': true, })
+    this.setData({ "healthIndex.loading": true });
     try {
       const data = await healthIndexMethod(id);
       this.setData({
-        'healthIndex.data': healthIndex2Progress(data),
-        'healthIndex.loading': false,
+        "healthIndex.data": healthIndex2Progress(data),
+        "healthIndex.loading": false,
       });
     } catch (error) {
       this.setData({
-        'healthIndex.data': [],
-        'healthIndex.loading': false,
-        'healthIndex.message': error.errMsg,
+        "healthIndex.data": [],
+        "healthIndex.loading": false,
+        "healthIndex.message": error.errMsg,
       });
     }
   },
-  toHomePage() { toHomePage(); },
-  toSchemePage() { toSchemePage(this.data.schemeId); },
-});
+  toHomePage() {
+    toHomePage(this.data.switchType as string);
+  },
+  toSchemePage() {
+    toSchemePage(this.data.schemeId);
+  },
+});

+ 2 - 2
miniprogram/module/health/router.ts

@@ -1,5 +1,5 @@
-export function toHomePage() {
-  wx.reLaunch({ url: '/pages/home/home' })
+export function toHomePage(switchType?: string) {
+  wx.reLaunch({ url: `/pages/home/home?switchType=${switchType}` })
 }
 export function toSchemePage(id?: string) {
   if (!id) {

+ 23 - 14
miniprogram/pages/home/home.ts

@@ -186,30 +186,39 @@ Page({
     }
   },
   async onLoad(options) {
+    console.log("这是onload页面", options);
     appUpdate();
     const query = useRouteQuery(options.scene!);
     if (query.ys) wx.setStorageSync("doctorId", query.ys);
-
     this.initFabAnimated();
+    // 如果是从一体机扫码进来的  有switchType值就直接跳转到注册页面
+    if (
+      options.switchType &&
+      ((this.data.patient as any)?.isPerfectInfo ?? true)
+    ) {
+      wx.navigateTo({
+        url: "/module/user/pages/user-certification/user-certification?type=home",
+      });
+    }
   },
   async onShow() {
     wx.showShareMenu({ withShareTicket: true, menus }).then();
     await this.load();
     // 如果用户没有手机号每次进入页面都提示  点击跳到注册页补充
     // todo 要先判断用户有没有手机号 isPerfectInfo是true 就出来弹窗提示用户
-    if ((this.data.patient as any)?.isPerfectInfo ?? true) {
-      wx.showModal({
-        title: "提示",
-        content: "手机号为空,请补充",
-        success: (res) => {
-          if (res.confirm) {
-            wx.navigateTo({
-              url: "/module/user/pages/user-certification/user-certification?type=home",
-            });
-          }
-        },
-      });
-    }
+    // if ((this.data.patient as any)?.isPerfectInfo ?? true) {
+    //   wx.showModal({
+    //     title: "提示",
+    //     content: "手机号为空,请补充",
+    //     success: (res) => {
+    //       if (res.confirm) {
+    //         wx.navigateTo({
+    //           url: "/module/user/pages/user-certification/user-certification?type=home",
+    //         });
+    //       }
+    //     },
+    //   });
+    // }
   },
   onHide() {
     wx.hideShareMenu({ menus }).then();