|
|
@@ -23,7 +23,7 @@ export function getAnalysisResultsMethod() {
|
|
|
if (!tongue.result && !face.result) {
|
|
|
message = data.content;
|
|
|
} else {
|
|
|
- const { show, force } = await miniProgramMethod();
|
|
|
+ const { show, force } = await miniProgramMethod('report');
|
|
|
return {
|
|
|
id, date, miniProgramURL: show ? miniProgramURL : void 0,
|
|
|
tongue, face,
|
|
|
@@ -47,7 +47,7 @@ export function getReportMethod(id: string) {
|
|
|
if (params.patientId !== patientId ) Visitor.$reset()
|
|
|
const report = fromReportData(<any> data);
|
|
|
Visitor.updatePulseReport(report.pulse, patientId);
|
|
|
- const { show, force } = await miniProgramMethod();
|
|
|
+ const { show, force } = await miniProgramMethod('report');
|
|
|
if ( !show ) { report.miniProgramURL = void 0; }
|
|
|
report.payLock = show && force;
|
|
|
return report;
|
|
|
@@ -80,27 +80,39 @@ export function updateReportMethod(id: string, data: Record<string, any>) {
|
|
|
return HTTP.Post(`/fdhb-tablet/analysisManage/upConFacImgById`, params, {});
|
|
|
}
|
|
|
|
|
|
-export function getReportSchemeMethod(id: string) {
|
|
|
+export function getReportSchemeMethod(id: string, standalone?: boolean) {
|
|
|
const Visitor = useVisitor();
|
|
|
- const params = { healthAnalysisReportId: id, patientId: Visitor.patientId };
|
|
|
+ const params = { healthAnalysisReportId: id, patientId: Visitor.patientId, standalone };
|
|
|
return HTTP.Get(`/fdhb-tablet/analysisManage/getCondProgDetailById`, {
|
|
|
params,
|
|
|
- transform(data: any, headers) {
|
|
|
- return fromSchemeRequest(data);
|
|
|
+ async transform(data: any, headers) {
|
|
|
+ const scheme = fromSchemeRequest(data);
|
|
|
+ const { show, force } = await miniProgramMethod('scheme');
|
|
|
+ if ( !show ) { scheme.miniProgramURL = void 0; }
|
|
|
+ scheme.payLock = show && force;
|
|
|
+ return scheme;
|
|
|
},
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
-export function miniProgramMethod() {
|
|
|
+export function miniProgramMethod(type: 'report' | 'scheme' = 'report') {
|
|
|
return HTTP.Post<{ show: boolean; force: boolean; }, { tabletRequiredPageOperationElements: string[] }>(
|
|
|
`/fdhb-tablet/warrantManage/getPageSets`, void 0, {
|
|
|
cacheFor, name: `variate:mini_program`,
|
|
|
- params: { k: 'mini_program' },
|
|
|
+ params: { k: `mini_program_${type}` },
|
|
|
transform(data, headers) {
|
|
|
+ const cfg = Array.isArray(data.tabletRequiredPageOperationElements) ? data.tabletRequiredPageOperationElements : [];
|
|
|
+ /**
|
|
|
+ * - health_analysis_report_page_appletbutton
|
|
|
+ * - health_analysis_report_page_appletscan
|
|
|
+ *
|
|
|
+ * - health_analysis_scheme_page_appletbutton
|
|
|
+ * - health_analysis_scheme_page_appletscan
|
|
|
+ */
|
|
|
return {
|
|
|
- show: data?.tabletRequiredPageOperationElements?.includes('health_analysis_report_page_appletbutton'),
|
|
|
- force: data?.tabletRequiredPageOperationElements?.includes('health_analysis_report_page_appletscan'),
|
|
|
+ show: cfg.includes(`health_analysis_${type}_page_appletbutton`),
|
|
|
+ force: cfg.includes(`health_analysis_${type}_page_appletscan`),
|
|
|
};
|
|
|
},
|
|
|
});
|