import PageContainerBehavior from "../../../../core/behavior/page-container.behavior"; import TickleBehavior, { getTickleContext } from "../../../../core/behavior/tickle.behavior"; // module/health/pages/analysis/analysis.ts import { toHomePage } from "../../router"; import { healthAnalysisMethod } from "../../request"; import { AnalysisModel } from "../../model/health.model"; Page({ behaviors: [ PageContainerBehavior, TickleBehavior ], data: { id: '', tongue: null as unknown as AnalysisModel, face: null as unknown as AnalysisModel, dataset: null as unknown as AnyObject, switchType: "", }, onLoad(query: any) { 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>) { console.log(query,"111"); wx.showLoading({ title: '加载中' }); try { const { tongue, face, ...dataset } = await healthAnalysisMethod(query); this.setData({ tongue, face, dataset }); } catch (error) { getTickleContext.call(this).showErrorMessage(error.errMsg, 0); } wx.hideLoading(); }, toHomePage() { toHomePage(this.data.switchType as string); }, });