jingcai-html-dist/public/seller/assets/mobile.eb32b679.js

2 lines
1.8 KiB
JavaScript

import{N as l,al as g,am as c,an as r,ao as m,ap as v,aq as f}from"./index.299f5d50.js";document.addEventListener("deviceready",()=>{navigator.splashscreen.hide(),g(),cordova.plugins.notification.badge.configure({autoClear:!0}),cordova.plugins.notification.local.on("click",function(e,o){cordova.plugins.backgroundMode.moveToForeground()}),cordova.plugins.backgroundMode.enable(),cordova.plugins.backgroundMode.on("activate",function(){cordova.plugins.backgroundMode.disableWebViewOptimizations()}),t()});function t(){return t.lastestCheckTime=new Date().getTime(),c.checkUpdate().then(({version:e,version_code:o,url:a,description:i})=>(setTimeout(()=>{r.create({title:"\u53D1\u73B0\u65B0\u7248\u672Cv"+e,message:i,ok:"\u524D\u5F80\u66F4\u65B0",persistent:!0}).onOk(()=>{m(a)}).onDismiss(()=>{v.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))}function s(){c.getAppUpgrade().then(e=>{r.create({title:e.title||"\u7CFB\u7EDF\u63D0\u793A",message:e.content})})}function d(){s(),t.lastestCheckTime&&new Date().getTime()-t.lastestCheckTime>60*6e4&&t()}document.addEventListener("resume",d,!1);document.addEventListener("visibilitychange",function(){document.visibilityState==="visible"&&d()});window.addEventListener("cordovacallbackerror",function(e){console.error(e)});var k=l(({app:e,router:o,store:a,urlPath:i,redirect:p})=>{s(),e.provide("checkUpdate",function(){t().catch(n=>{f.create(n.message)})}),document.addEventListener("deviceready",function(){document.addEventListener("backbutton",function(n){n.preventDefault();let u=o.currentRoute.value.name;["login","home","my","customerManage","statistics"].indexOf(u)>=0&&cordova.plugins.backgroundMode.moveToBackground()},!1)})});export{k as default};