Selaa lähdekoodia

修复 healthReportMethod() 方法入参 不正确,导致无法加载健康分析报告

fix 8888603
cc12458 1 vuosi sitten
vanhempi
commit
b58fd0b883

+ 1 - 1
miniprogram/module/health/pages/home/home.ts

@@ -55,7 +55,7 @@ Component({
     async getHealthReport(id?: string) {
       this.setData({ 'healthReport.loading': true, })
       try {
-        const data = await healthReportMethod(id);
+        const data = await healthReportMethod({id, scene: void 0});
         this.setData({
           'healthReport.data': data,
           'healthReport.loading': false,

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

@@ -19,7 +19,7 @@ export function healthReportListMethod() {
   return Get(`/analysisManage/getHarsTid`, { transform })
 }
 
-export function healthReportMethod({id, ...query}: Record<'id' | 'scene', string>) {
+export function healthReportMethod({ id, scene, ...query }: Record<'id' | 'scene', string | void>) {
   const transform = ({ data }: AnyObject) => {
     if (Array.isArray(data?.conditProgram?.types)) {
       data.conditProgram.types = data.conditProgram.types.map((item: AnyObject) => (item.summary = item.summary?.replace(/null/g, '') || '', item))
@@ -30,7 +30,10 @@ export function healthReportMethod({id, ...query}: Record<'id' | 'scene', string
   let params = { ...query } as any;
   if (id) { params.healthAnalysisReportId = id; }
 
-  if (query.scene) { return Get(`/analysisManage/getHealRepDetailByScene`, { params, transform }); }
+  if (scene) {
+    params.scene = decodeURIComponent(scene);
+    return Get(`/analysisManage/getHealRepDetailByScene`, { params, transform });
+  }
 
   return id
     ? Get(`/analysisManage/getHealRepDetailById`, { params, transform })