2 lines
1.6 KiB
JavaScript
2 lines
1.6 KiB
JavaScript
import{N as c,al as s,am as d,an as u,ao as l,ap as m,aq as g}from"./index.39dbb28b.js";document.addEventListener("deviceready",()=>{navigator.splashscreen.hide(),s(),cordova.plugins.notification.badge.configure({autoClear:!0}),cordova.plugins.notification.local.on("click",function(e,t){cordova.plugins.backgroundMode.moveToForeground()}),cordova.plugins.backgroundMode.enable(),cordova.plugins.backgroundMode.on("activate",function(){cordova.plugins.backgroundMode.disableWebViewOptimizations()}),o()});function o(){return o.lastestCheckTime=new Date().getTime(),d.checkUpdate().then(({version:e,version_code:t,url:a,description:i})=>(setTimeout(()=>{u.create({title:"\u53D1\u73B0\u65B0\u7248\u672Cv"+e,message:i,ok:"\u524D\u5F80\u66F4\u65B0",persistent:!0}).onOk(()=>{l(a)}).onDismiss(()=>{m.show({backgroundColor:"white",html:!0,message:'\u7B49\u5F85\u66F4\u65B0\u5B8C\u6210\uFF5E\uFF5E<br/><a href="'+a+'" target="_blank" class="text-primary">\u70B9\u51FB\u4E0B\u8F7D\u6700\u65B0\u7248\u672C</a>'})})},200),e))}document.addEventListener("resume",function(){o.lastestCheckTime&&new Date().getTime()-o.lastestCheckTime>60*6e4&&o()},!1);window.addEventListener("cordovacallbackerror",function(e){console.error(e)});var p=c(({app:e,router:t,store:a,urlPath:i,redirect:v})=>{e.provide("checkUpdate",function(){o().catch(n=>{g.create(n.message)})}),document.addEventListener("deviceready",function(){document.addEventListener("backbutton",function(n){n.preventDefault();let r=t.currentRoute.value.name;["login","home","my","customerManage","statistics"].indexOf(r)>=0&&cordova.plugins.backgroundMode.moveToBackground()},!1)})});export{p as default};
|