oa-base/unpackage/cache/wgt/__UNI__4796942/app-service.js

2 lines
156 KiB
JavaScript
Raw Normal View History

2024-08-28 06:07:51 +00:00
if("undefined"==typeof Promise||Promise.prototype.finally||(Promise.prototype.finally=function(e){const t=this.constructor;return this.then((n=>t.resolve(e()).then((()=>n))),(n=>t.resolve(e()).then((()=>{throw n}))))}),"undefined"!=typeof uni&&uni&&uni.requireGlobal){const e=uni.requireGlobal();ArrayBuffer=e.ArrayBuffer,Int8Array=e.Int8Array,Uint8Array=e.Uint8Array,Uint8ClampedArray=e.Uint8ClampedArray,Int16Array=e.Int16Array,Uint16Array=e.Uint16Array,Int32Array=e.Int32Array,Uint32Array=e.Uint32Array,Float32Array=e.Float32Array,Float64Array=e.Float64Array,BigInt64Array=e.BigInt64Array,BigUint64Array=e.BigUint64Array}uni.restoreGlobal&&uni.restoreGlobal(Vue,weex,plus,setTimeout,clearTimeout,setInterval,clearInterval),function(e){"use strict";var t,n,i,o,r,s,a,c,u,l;function d(e,t,...n){uni.__log__?uni.__log__(e,t,...n):console[e].apply(console,[...n,t])}function h(e,t){return"string"==typeof e?t:e}const p=(t=>(n,i=e.getCurrentInstance())=>{!e.isInSSRComponentSetup&&e.injectHook(t,n,i)})("onExit"),f={apiBaseUrl:"https://warehouse.szjixun.cn/oa_backend",h5Url:"http://192.168.88.56:8080/#/"};class g{constructor(){this.webViewObj=null,this.messageHandlers={}}setWebView(e){this.webViewObj=e}sendToH5(e,t={}){if(!this.webViewObj)return void d("error","at utils/communication.js:13","webViewObj is not initialized");const n=JSON.stringify({action:e,data:t});this.webViewObj.evalJS(`window.handleMessage(${JSON.stringify(n)})`)}registerHandler(e,t){this.messageHandlers[e]=t}handleMessage(e){const{action:t,data:n={}}=e;this.messageHandlers[t]?this.messageHandlers[t](n):d("warn","at utils/communication.js:30","Unknown action:",t)}}const{registerUTSInterface:m,initUTSProxyClass:y,initUTSProxyFunction:A,initUTSPackageName:v,initUTSIndexClassName:w,initUTSClassName:S}=uni,b="uniRegisterRequestPermissionTips",k="uni-registerRequestPermissionTips",E=v(b,true),I=w(b,true),P=A(!1,{moduleName:k,moduleType:"",errMsg:"",main:!0,package:E,class:I,name:"registerRequestPermissionTipsListenerByJs",params:[{name:"listener",type:"UTSSDKModulesUniRegisterRequestPermissionTipsRequestPermissionTipsListenerJSONObject",default:"UTSNull"}],return:""}),T=A(!1,{moduleName:k,moduleType:"",errMsg:"",main:!0,package:E,class:I,name:"setRequestPermissionTipsByJs",params:[{name:"tips",type:"UTSJSONObject"}],return:""}),x={__name:"index",setup(t){const n=new g,i={"android.permission.CAMERA":'<h4 style="font-size:40px;">正在读取通讯录权限</h4><font color=#cccccc>通讯录权限不会获取任何信息,请注意</font>',"android.permission.READ_PHONE_STATE":'<h4 style="font-size:40px;">正在读取网络状态权限</h4><font color=#cccccc>通讯录权限不会获取任何信息,请注意通讯录权限不会获取任何信息,请注意通讯录权限不会获取任何信息,请注意</font>'};p((()=>{})),n.registerHandler("load-complete",(()=>{!function(){const e=getCurrentPages().pop().$getAppWebview();n.setWebView(e.children()[0])}();const{statusBarHeight:e}=uni.getSystemInfoSync();n.webViewObj.setStyle({top:e,bottom:0});const t=uni.getSystemInfoSync().deviceBrand;P({onRequest:e=>{d("log","at pages/index/index.vue:39","onRequest",e)},onConfirm:e=>{d("log","at pages/index/index.vue:42","onConfirm",e)},onComplete:e=>{if(d("log","at pages/index/index.vue:45","onComplete",e),"huawei"===t.toLowerCase()){const t={};let n=!1;for(let o in i)"denied"!==e[o]?t[o]=i[o]:n=!0;T(t),n&&uni.showModal({content:"权限已经被拒绝,请前往设置中开启"})}}})}));const o=e=>{var t;const i=(null==(t=e.detail.data)?void 0:t[0])||"";n.handleMessage(i)};return(t,n)=>(e.openBlock(),e.createElementBlock("web-view",{class:"webview",onMessage:o,style:{flex:"1"},src:e.unref(f).h5Url},null,40,["src"]))}},B={};function C(e){return/^[\+-]?(\d+\.?\d*|\.\d+|\d\.\d+e\+\d+)$/.test(e)}function U(e){switch(typeof e){case"undefined":return!0;case"string":if(0==e.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g,"").length)return!0;break;case"boolean":if(!e)return!0;break;case"number":if(0===e||isNaN(e))return!0;break;case"object":if(null===e||0===e.length)return!0;for(const t in e)return!