|
@@ -2,6 +2,8 @@ import { payDetail } from "./service";
|
|
|
import { tradePay } from "../../utils/tradePay";
|
|
|
import history from "../../utils/history";
|
|
|
import { reportApi, reportCmPV_YL } from "../../utils/cloudMonitorHelper";
|
|
|
+import { getAuthUser } from "../../../../core/utils/jsapi";
|
|
|
+import { submitAuthCode } from "../../../../core/utils/ywtService";
|
|
|
Component({
|
|
|
props: {},
|
|
|
data: {
|
|
@@ -140,6 +142,28 @@ Component({
|
|
|
const { medicareBinded = false } = e.target.dataset;
|
|
|
const { order: oreder } = this.data;
|
|
|
|
|
|
+ const [err, authResult] = await getAuthUser([
|
|
|
+ "auth_user",
|
|
|
+ "hospital_order",
|
|
|
+ ]);
|
|
|
+ if (err) {
|
|
|
+ my.showToast({
|
|
|
+ type: "fail",
|
|
|
+ content: "智能消息推送授权失败",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ const [error, result] = await submitAuthCode({
|
|
|
+ authCode: authResult.authCode,
|
|
|
+ });
|
|
|
+ if (!error) {
|
|
|
+ my.showToast({
|
|
|
+ type: "success",
|
|
|
+ content: "消息订阅成功",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return [error, result];
|
|
|
+ }
|
|
|
+
|
|
|
if (oreder.type === 1) {
|
|
|
await tradePay(
|
|
|
{
|