outside-the-system
parent
c9aa04935c
commit
809e56243f
@ -1,5 +1,2 @@
|
||||
Promise.resolve("./pages/index/index.js").then((res) => {
|
||||
res.length;
|
||||
});
|
||||
Promise.resolve("./app.css.js").then(() => {
|
||||
});
|
||||
|
@ -1,102 +0,0 @@
|
||||
import { ref, openBlock, createElementBlock, createElementVNode, normalizeStyle, unref } from "vue";
|
||||
function formatAppLog(type, filename, ...args) {
|
||||
if (uni.__log__) {
|
||||
uni.__log__(type, filename, ...args);
|
||||
} else {
|
||||
console[type].apply(console, [...args, filename]);
|
||||
}
|
||||
}
|
||||
const env = "dev";
|
||||
const configs = {
|
||||
dev: {
|
||||
apiBaseUrl: "https://warehouse.szjixun.cn/oa_backend",
|
||||
h5Url: "http://192.168.88.35:8080/"
|
||||
},
|
||||
test: {
|
||||
apiBaseUrl: "https://warehouse.szjixun.cn/oa_backend",
|
||||
h5Url: "http://172.16.100.93:8041/#/"
|
||||
},
|
||||
prod: {
|
||||
apiBaseUrl: "https://oa.szjixun.cn/api",
|
||||
h5Url: "https://oa.szjixun.cn/#/"
|
||||
}
|
||||
};
|
||||
const config = configs[env];
|
||||
const sendWebWiew = (refValue, paramValue, callName = "onReceive") => {
|
||||
if (!refValue) {
|
||||
formatAppLog("error", "at utils/communicate/index.js:3", "evalJs: The reference to the webview is not provided or is null.");
|
||||
return;
|
||||
}
|
||||
if (typeof refValue.evalJs !== "function") {
|
||||
formatAppLog("error", "at utils/communicate/index.js:8", "evalJs: The evalJs method is not available on the provided reference.");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const jsonString = JSON.stringify(paramValue);
|
||||
const jsCode = `window.${callName}(${jsonString})`;
|
||||
refValue.evalJs(jsCode);
|
||||
} catch (error) {
|
||||
formatAppLog("error", "at utils/communicate/index.js:18", "evalJs: An error occurred while trying to stringify the parameter value or while invoking evalJs.", error);
|
||||
}
|
||||
};
|
||||
const receiveWebView = (e) => {
|
||||
return e.detail.data[0];
|
||||
};
|
||||
const _style_0 = { "content": { "": { "display": "flex", "flex": 1 } } };
|
||||
const _export_sfc = (sfc, props) => {
|
||||
const target = sfc.__vccOpts || sfc;
|
||||
for (const [key, val] of props) {
|
||||
target[key] = val;
|
||||
}
|
||||
return target;
|
||||
};
|
||||
const _sfc_main = {
|
||||
__name: "index",
|
||||
setup(__props) {
|
||||
const webViewRef = ref(null);
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
const webLoad = (e) => {
|
||||
const m = receiveWebView(e);
|
||||
switch (m.action) {
|
||||
case "load-complete": {
|
||||
const systemInfo2 = uni.getSystemInfoSync();
|
||||
uni.getLocation({
|
||||
type: "gcj02",
|
||||
geocode: false,
|
||||
isHighAccuracy: false,
|
||||
success: async (res) => {
|
||||
sendWebWiew(webViewRef.value, { ...res, systemInfo: systemInfo2 });
|
||||
},
|
||||
fail: (e2) => {
|
||||
formatAppLog("log", "at pages/index/index.nvue:38", e2);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return openBlock(), createElementBlock("scroll-view", {
|
||||
scrollY: true,
|
||||
showScrollbar: true,
|
||||
enableBackToTop: true,
|
||||
bubble: "true",
|
||||
style: { flexDirection: "column" }
|
||||
}, [
|
||||
createElementVNode("div", { class: "content" }, [
|
||||
createElementVNode("u-web-view", {
|
||||
class: "webview",
|
||||
"on:onPostMessage": webLoad,
|
||||
style: normalizeStyle({ height: `${unref(systemInfo).windowHeight}px`, width: `${unref(systemInfo).windowWidth}` }),
|
||||
ref_key: "webViewRef",
|
||||
ref: webViewRef,
|
||||
src: unref(config).h5Url
|
||||
}, null, 44, ["src"])
|
||||
])
|
||||
]);
|
||||
};
|
||||
}
|
||||
};
|
||||
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["styles", [_style_0]]]);
|
||||
export {
|
||||
index as default
|
||||
};
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,32 +0,0 @@
|
||||
"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 S=Object.create;var _=Object.defineProperty,j=Object.defineProperties,J=Object.getOwnPropertyDescriptor,k=Object.getOwnPropertyDescriptors,I=Object.getOwnPropertyNames,w=Object.getOwnPropertySymbols,U=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var h=(t,e,o)=>e in t?_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,g=(t,e)=>{for(var o in e||(e={}))y.call(e,o)&&h(t,o,e[o]);if(w)for(var o of w(e))A.call(e,o)&&h(t,o,e[o]);return t},v=(t,e)=>j(t,k(e));var B=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var $=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of I(e))!y.call(t,s)&&s!==o&&_(t,s,{get:()=>e[s],enumerable:!(n=J(e,s))||n.enumerable});return t};var z=(t,e,o)=>(o=t!=null?S(U(t)):{},$(e||!t||!t.__esModule?_(o,"default",{value:t,enumerable:!0}):o,t));var m=(t,e,o)=>new Promise((n,s)=>{var u=c=>{try{i(o.next(c))}catch(d){s(d)}},p=c=>{try{i(o.throw(c))}catch(d){s(d)}},i=c=>c.done?n(c.value):Promise.resolve(c.value).then(u,p);i((o=o.apply(t,e)).next())});var b=B((D,x)=>{x.exports=Vue});var r=z(b());function a(t,e,...o){uni.__log__?uni.__log__(t,e,...o):console[t].apply(console,[...o,e])}var T="dev",V={dev:{apiBaseUrl:"https://warehouse.szjixun.cn/oa_backend",h5Url:"http://192.168.88.35:8080/"},test:{apiBaseUrl:"https://warehouse.szjixun.cn/oa_backend",h5Url:"http://172.16.100.93:8041/#/"},prod:{apiBaseUrl:"https://oa.szjixun.cn/api",h5Url:"https://oa.szjixun.cn/#/"}},W=V[T],C=(t,e,o="onReceive")=>{if(!t){a("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"){a("error","at utils/communicate/index.js:8","evalJs: The evalJs method is not available on the provided reference.");return}try{let n=JSON.stringify(e),s=`window.${o}(${n})`;t.evalJs(s)}catch(n){a("error","at utils/communicate/index.js:18","evalJs: An error occurred while trying to stringify the parameter value or while invoking evalJs.",n)}},L=t=>t.detail.data[0],N={content:{"":{display:"flex",flex:1}}},O=(t,e)=>{let o=t.__vccOpts||t;for(let[n,s]of e)o[n]=s;return o},P={__name:"index",setup(t){let e=(0,r.ref)(null),o=uni.getSystemInfoSync(),n=s=>{switch(L(s).action){case"load-complete":{let p=uni.getSystemInfoSync();uni.getLocation({type:"gcj02",geocode:!1,isHighAccuracy:!1,success:i=>m(this,null,function*(){C(e.value,v(g({},i),{systemInfo:p}))}),fail:i=>{a("log","at pages/index/index.nvue:38",i)}})}}};return(s,u)=>((0,r.openBlock)(),(0,r.createElementBlock)("scroll-view",{scrollY:!0,showScrollbar:!0,enableBackToTop:!0,bubble:"true",style:{flexDirection:"column"}},[(0,r.createElementVNode)("div",{class:"content"},[(0,r.createElementVNode)("u-web-view",{class:"webview","on:onPostMessage":n,style:(0,r.normalizeStyle)({height:`${(0,r.unref)(o).windowHeight}px`,width:`${(0,r.unref)(o).windowWidth}`}),ref_key:"webViewRef",ref:e,src:(0,r.unref)(W).h5Url},null,44,["src"])])]))}},l=O(P,[["styles",[N]]]);var f=plus.webview.currentWebview();if(f){let t=parseInt(f.id),e="pages/index/index",o={};try{o=JSON.parse(f.__query__)}catch(s){}l.mpType="page";let n=Vue.createPageApp(l,{$store:getApp({allowDefault:!0}).$store,__pageId:t,__pagePath:e,__pageQuery:o});n.provide("__globalStyles",Vue.useCssStyles([...__uniConfig.styles,...l.styles||[]])),n.mount("#root")}})();
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue