33 lines
4.4 KiB
JavaScript
33 lines
4.4 KiB
JavaScript
"use weex:vue";
|
|
|
|
if (typeof Promise !== 'undefined' && !Promise.prototype.finally) {
|
|
Promise.prototype.finally = function(callback) {
|
|
const promise = this.constructor
|
|
return this.then(
|
|
value => promise.resolve(callback()).then(() => value),
|
|
reason => promise.resolve(callback()).then(() => {
|
|
throw reason
|
|
})
|
|
)
|
|
}
|
|
};
|
|
|
|
if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
|
|
const global = uni.requireGlobal()
|
|
ArrayBuffer = global.ArrayBuffer
|
|
Int8Array = global.Int8Array
|
|
Uint8Array = global.Uint8Array
|
|
Uint8ClampedArray = global.Uint8ClampedArray
|
|
Int16Array = global.Int16Array
|
|
Uint16Array = global.Uint16Array
|
|
Int32Array = global.Int32Array
|
|
Uint32Array = global.Uint32Array
|
|
Float32Array = global.Float32Array
|
|
Float64Array = global.Float64Array
|
|
BigInt64Array = global.BigInt64Array
|
|
BigUint64Array = global.BigUint64Array
|
|
};
|
|
|
|
|
|
(()=>{var j=Object.create;var f=Object.defineProperty,B=Object.defineProperties,C=Object.getOwnPropertyDescriptor,J=Object.getOwnPropertyDescriptors,I=Object.getOwnPropertyNames,_=Object.getOwnPropertySymbols,H=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var h=(t,e,n)=>e in t?f(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,v=(t,e)=>{for(var n in e||(e={}))g.call(e,n)&&h(t,n,e[n]);if(_)for(var n of _(e))N.call(e,n)&&h(t,n,e[n]);return t},m=(t,e)=>B(t,J(e));var T=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var U=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of I(e))!g.call(t,r)&&r!==n&&f(t,r,{get:()=>e[r],enumerable:!(s=C(e,r))||s.enumerable});return t};var A=(t,e,n)=>(n=t!=null?j(H(t)):{},U(e||!t||!t.__esModule?f(n,"default",{value:t,enumerable:!0}):n,t));var y=(t,e,n)=>new Promise((s,r)=>{var a=i=>{try{c(n.next(i))}catch(d){r(d)}},p=i=>{try{c(n.throw(i))}catch(d){r(d)}},c=i=>i.done?s(i.value):Promise.resolve(i.value).then(a,p);c((n=n.apply(t,e)).next())});var x=T((P,b)=>{b.exports=Vue});var o=A(x());var V="onShow",E="onHide";function l(t,e,...n){uni.__log__?uni.__log__(t,e,...n):console[t].apply(console,[...n,e])}var k=t=>(e,n=(0,o.getCurrentInstance)())=>{!o.isInSSRComponentSetup&&(0,o.injectHook)(t,e,n)},L=k(V),O=k(E),R="dev",W={dev:{apiBaseUrl:"https://warehouse.szjixun.cn/oa_backend",h5Url:"http://192.168.0.191:8080/#/"},test:{apiBaseUrl:"https://warehouse.szjixun.cn/oa_backend",h5Url:"http://114.218.158.24:9051/#/"},prod:{apiBaseUrl:"https://oa- a.szjixun.cn/#/",h5Url:"https://oa-a.szjixun.cn/#/"}},z=W[R],S=(t,e,n="onReceive")=>{if(!t){l("error","at utils/communicate/index.js:3","evalJs: The reference to the webview is not provided or is null.");return}if(typeof t.evalJs!="function"){l("error","at utils/communicate/index.js:8","evalJs: The evalJs method is not available on the provided reference.");return}try{let s=JSON.stringify(e),r=`window.${n}(${s})`;t.evalJs(r)}catch(s){l("error","at utils/communicate/index.js:18","evalJs: An error occurred while trying to stringify the parameter value or while invoking evalJs.",s)}},$=t=>t.detail.data[0];uni;var u={__name:"index",setup(t){let e=(0,o.ref)(null);uni.getSystemInfoSync();let n=a=>{a.isConnected?uni.redirectTo({url:"/pages/index/index"}):uni.showToast({title:"\u7F51\u7EDC\u65E0\u8FDE\u63A5",icon:"none"})},s=()=>{S(e.value,{turnBack:1})};L(()=>{plus.key.addEventListener("backbutton",s,!1),uni.onNetworkStatusChange(n)}),O(()=>{plus.key.removeEventListener("backbutton",s,!1),uni.offNetworkStatusChange(n)});let r=a=>{switch($(a).action){case"load-complete":{let c=uni.getSystemInfoSync();uni.getLocation({type:"gcj02",geocode:!1,isHighAccuracy:!1,success:i=>y(this,null,function*(){S(e.value,m(v({},i),{systemInfo:c,webViewRef:e.value,latitude:31.386561,longitude:120.660274}))}),fail:i=>{l("log","at pages/index/index.nvue:89",i)}})}}};return(a,p)=>((0,o.openBlock)(),(0,o.createElementBlock)("scroll-view",{scrollY:!0,showScrollbar:!0,enableBackToTop:!0,bubble:"true",style:{flexDirection:"column"}},[(0,o.createElementVNode)("u-web-view",{class:"webview","on:onPostMessage":r,style:{flex:"1"},ref_key:"webViewRef",ref:e,src:(0,o.unref)(z).h5Url},null,40,["src"])]))}};var w=plus.webview.currentWebview();if(w){let t=parseInt(w.id),e="pages/index/index",n={};try{n=JSON.parse(w.__query__)}catch(r){}u.mpType="page";let s=Vue.createPageApp(u,{$store:getApp({allowDefault:!0}).$store,__pageId:t,__pagePath:e,__pageQuery:n});s.provide("__globalStyles",Vue.useCssStyles([...__uniConfig.styles,...u.styles||[]])),s.mount("#root")}})();
|