2 lines
2.7 KiB
JavaScript
2 lines
2.7 KiB
JavaScript
if("undefined"==typeof Promise||Promise.prototype.finally||(Promise.prototype.finally=function(e){const r=this.constructor;return this.then((o=>r.resolve(e()).then((()=>o))),(o=>r.resolve(e()).then((()=>{throw o}))))}),"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";function r(e,r,...o){uni.__log__?uni.__log__(e,r,...o):console[e].apply(console,[...o,r])}__definePage("uni_modules/yykj-tv/pages/home/home1",((e,r)=>{const o=e.__vccOpts||e;for(const[n,t]of r)o[n]=t;return o})({data:()=>({url:"",originalUrl:"http://192.168.100.201",loading:!0,loadError:!1}),onLoad(e){this.initWebView()},methods:{initWebView(){this.loading=!0,this.loadError=!1;const e=(new Date).getTime();this.url=`${this.originalUrl}?timestamp=${e}`,setTimeout((()=>{this.loading&&(this.loading=!1,this.loadError=!0)}),1e4),uni.onNetworkStatusChange((e=>{e.isConnected&&this.loadError&&this.retryLoad()}))},onWebViewError(e){r("error","at uni_modules/yykj-tv/pages/home/home1.vue:49","WebView加载错误:",e),this.loading=!1,this.loadError=!0},onMessage(e){this.loading=!1,this.loadError=!1},retryLoad(){this.initWebView()}},onUnload(){uni.offNetworkStatusChange()}},[["render",function(r,o,n,t,i,a){return e.openBlock(),e.createElementBlock("view",null,[e.createElementVNode("web-view",{src:i.url,"on:onPostMessage":o[0]||(o[0]=(...e)=>a.onMessage&&a.onMessage(...e)),onError:o[1]||(o[1]=(...e)=>a.onWebViewError&&a.onWebViewError(...e))},null,40,["src"]),i.loading?(e.openBlock(),e.createElementBlock("view",{key:0,class:"loading"},"页面加载中...")):e.createCommentVNode("",!0),i.loadError?(e.openBlock(),e.createElementBlock("view",{key:1,class:"error"},[e.createTextVNode(" 页面加载失败 "),e.createElementVNode("button",{onClick:o[2]||(o[2]=(...e)=>a.retryLoad&&a.retryLoad(...e))},"重新加载")])):e.createCommentVNode("",!0)])}]]));const o={onLaunch:function(){plus.screen.lockOrientation("landscape-primary"),plus.navigator.setFullscreen(!0)},onHide:function(){r("log","at App.vue:10","App Hide")},onUnload(){plus.screen.lockOrientation("landscape-primary")}};const{app:n,Vuex:t,Pinia:i}={app:e.createVueApp(o)};uni.Vuex=t,uni.Pinia=i,n.provide("__globalStyles",__uniConfig.styles),n._component.mpType="app",n._component.render=()=>{},n.mount("#app")}(Vue);
|