12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- import request from "../../../../core/utils/request";
- import { activeStatusUrl } from "../../../../core/utils/constants";
- import { report } from '@mas.io/falcon-utils';
- const app = getApp();
- Component({
- props: {
- componentData: {}
- },
- data: {
- success: false,
- // summary组件是否渲染完成
- bindStatus: false
- },
- async didMount() {
- const params = {
- isShowLoadig: true,
- isShowError: true,
- method: 'GET',
- url: activeStatusUrl
- };
- report('@mas.io/medicare-home');
- const [err, res = {}] = await request(params);
- if (err) return;
- const {
- bindStatus,
- appid,
- page
- } = res;
- this.setData({
- bindStatus
- });
- const currentAppId = app.globalData.appId;
- const pages = getCurrentPages() || [];
- const len = pages.length; // eslint-disable-next-line no-proto
- const currentPage = pages[len - 1].__proto__.route;
- const {
- pageUuid
- } = this.$page.options;
- const pageOptions = `?source=medicare&pageUuid=${pageUuid}`;
- const currentAppSchema = `alipays://platformapi/startapp?appId=${currentAppId}&page=${currentPage}${encodeURIComponent(pageOptions)}`;
- const path = `${page}?returnUrl=${encodeURIComponent(currentAppSchema)}`;
- if (bindStatus === 'NOT_BIND' && appid && page) {
- return my.navigateToMiniProgram({
- appId: appid,
- path
- });
- }
- },
- methods: {
- onSuccess() {
- this.setData({
- success: true
- });
- }
- }
- });
|