zhengyiming
3 天以前 e3d4c3426c86392e27df63300b601507b32f5c7e
apps/bMiniApp/src/subpackages/authentication/hooks/index.ts
@@ -10,7 +10,7 @@
  UserCertificationPayType,
} from '@12333/constants';
import { FormValidator, Message } from '@12333/utils';
// import { useUserCertificationSetting } from '@12333/hooks';
import { useUserCertificationSetting } from '@12333/hooks';
import Taro from '@tarojs/taro';
type UseAuthenticationFlowOptions = {
@@ -158,32 +158,32 @@
  };
}
// export function useDownloadPowerAttorneyTemplate() {
//   // const { userCertificationSetting } = useUserCertificationSetting();
export function useDownloadPowerAttorneyTemplate() {
  const { userCertificationSetting } = useUserCertificationSetting();
//   function downloadPowerAttorneyTemplate() {
//     Taro.showLoading({
//       title: '下载中',
//     });
//     Taro.downloadFile({
//       url: userCertificationSetting.value.enterprisePowerAttorneyTempPath,
//       success: function (res) {
//         Taro.hideLoading();
//         // Message.success('下载成功');
//         var filePath = res.tempFilePath;
//         Taro.openDocument({
//           filePath: filePath,
//           showMenu: true,
//         });
//       },
//       fail: function (error: any) {
//         Taro.hideLoading();
//         Message.error('下载失败');
//       },
//     });
//   }
  function downloadPowerAttorneyTemplate() {
    Taro.showLoading({
      title: '下载中',
    });
    Taro.downloadFile({
      url: userCertificationSetting.value.enterprisePowerAttorneyTempPath,
      success: function (res) {
        Taro.hideLoading();
        // Message.success('下载成功');
        var filePath = res.tempFilePath;
        Taro.openDocument({
          filePath: filePath,
          showMenu: true,
        });
      },
      fail: function (error: any) {
        Taro.hideLoading();
        Message.error('下载失败');
      },
    });
  }
//   return {
//     downloadPowerAttorneyTemplate,
//   };
// }
  return {
    downloadPowerAttorneyTemplate,
  };
}