"use strict";const e=require("../common/vendor.js");require("../common/libraries/request.js"),require("../common/store/useWatermarkStore.js");const o=require("../common/store/useWeAppAuthStore.js");if(require("../common/store/useWorkStore.js"),require("../gen/Apis.js"),require("../common/libraries/apiLoading.js"),!Array){(e.resolveComponent("uni-icons")+e.resolveComponent("hs-button")+e.resolveComponent("hs-private-policy"))()}Math||((()=>"../uni_modules/uni-icons/components/uni-icons/uni-icons.js")+(()=>"../components/hs-button/hs-button.js")+(()=>"../components/hs-private-policy/hs-private-policy.js"))();const n=e.defineComponent({__name:"login",setup(n){const t=e.ref({}),i=e.ref(""),s=o.useWeAppAuthStore();let r=e.ref(!1);const l=()=>{u()&&(e.index.showLoading({title:"正在登录...",mask:!0}),e.index.qy.getMobile({success:function(o){console.log(o,"res"),"qy__getMobile:ok"===(null==o?void 0:o.errMsg)?null==s||s.handleUserLoginWxwork(o):e.index.showToast({title:"获取手机号失败",icon:"none"})}}))},a=async o=>{if(!r.value)return!1;e.index.showLoading({title:"正在登录...",mask:!0}),null==s||s.handleUserLogin({code:o.detail.code})},u=()=>!!r.value||(e.index.showToast({title:"请阅读并勾选隐私政策！",icon:"none"}),!1),c=()=>{e.index.showLoading({title:"加载中...",mask:!0}),e.index.downloadFile({url:"https://pay-test-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01K44N5AP6T246WQWHNB2ERQ9M.pdf",success:function(o){const n=o.tempFilePath;e.index.hideLoading(),e.index.openDocument({filePath:n,showMenu:!0})}})},p=()=>{e.index.navigateBack({delta:1})};return e.onLoad(()=>{try{const o=e.index.getSystemInfoSync();i.value=o.environment}catch(o){}}),e.onShow(()=>{t.value=e.index.getMenuButtonBoundingClientRect()}),(o,n)=>e.e({a:e.p({type:"left",size:"20"}),b:e.s(`height:${t.value.height}px;width:${t.value.height}px;`),c:e.o(p),d:e.s(`padding-top:${t.value.top}px;height:${t.value.height}px;line-height:${t.value.height}px;`),e:"wxwork"===i.value},"wxwork"===i.value?{f:e.o(l),g:e.p({label:"快捷登录",type:"primary",size:"lg"})}:{h:e.o(a),i:e.o(u),j:e.p({type:"primary",size:"lg",label:"快捷登录",openType:e.unref(r)?"getPhoneNumber":""})},{k:e.o(c),l:e.o(o=>e.isRef(r)?r.value=o:r=o),m:e.p({policyName:"《用户协议》",isAgree:e.unref(r)})})}});wx.createPage(n);
