| 12345678910111213141516171819202122232425262728293031323334353637 |
- 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,
- },
- onLoad(query: any) {
- this._load(query);
- },
- async _load(query: Record<'id' | 'scene', string>) {
- 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(); },
- });
|