当前位置: 首页 > wzjs >正文

文登市城乡建设局网站山东关键词网络推广

文登市城乡建设局网站,山东关键词网络推广,官方网站是什么意思,网站下载app连接怎么做uniapp app更新 这个版本要随之增加,不然刚更新时直接用app, 新包增加的那些页面跳转会有问题,不能跳新的页面 //app更新检测 updataApp(){const that this;uni.showLoading({title:加载中...})plus.runtime.getProperty(plus.runtime.appid, functio…

uniapp app更新
这个版本要随之增加,不然刚更新时直接用app, 新包增加的那些页面跳转会有问题,不能跳新的页面
在这里插入图片描述

//app更新检测
updataApp(){const that = this;uni.showLoading({title:'加载中...'})plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {let currentVersion = widgetInfo.versionCode; //获取当前版本号console.log('当前版本',currentVersion)that.$api.getLatestVersion().then(res =>{console.log('版本',res) if(res.code == 200){let newVersion = res.data.version;if (currentVersion < newVersion) {that.downloadUrl = that.baseUrl + res.data.path;console.log('下载路径',that.downloadUrl)that.openPop(666)}}})})
},
//APP更新
actionApp(){const that = this;const downloadTask = uni.downloadFile({url: that.downloadUrl,success: (downloadResult) => {console.log('?????',downloadResult)plus.runtime.install(downloadResult.tempFilePath, {force: true},function() {that.closePop()uni.showToast({title: '安装成功,请重新启动',icon: 'none',mask:true})// that.clearCache()plus.runtime.restart();},function(e) {console.log(e)that.closePop()uni.showToast({title: '安装失败',icon: 'none',mask:true})//关闭应用setTimeout(() =>{plus.runtime.quit();},1000)})},fail: (err) => {that.closePop()console.log(err);uni.showToast({title: '下载失败',icon: 'none',mask:true})//关闭应用setTimeout(() =>{plus.runtime.quit();},1000)}})//下载进度监听downloadTask.onProgressUpdate((res) => {if (res.progress <= 99) {console.log('下载进度'+res.progress+'%');that.schedule = res.progress;}});
},
//清除app更新后的文件缓存
clearCache(type = 2) {// 第一种方式:彻底清理存储数据(用户数据),包括用户权限和缓存,但是这种方式清理之后当前的app会闪退出去,只有等待用户重新拉起。if (type == 1) {plus.android.importClass("android.app.ActivityManager");var Context = plus.android.importClass("android.content.Context");var am = plus.android.runtimeMainActivity().getSystemService(Context.ACTIVITY_SERVICE);am.clearApplicationUserData();return}// 第二种方式:清理内存存储文件(部分用户数据),不会清理用户权限,也不会闪退,一些静态的图片会被清理掉。let main = plus.android.runtimeMainActivity();let sdRoot1 = main.getFilesDir();let filesOne = plus.android.invoke(sdRoot1, "listFiles");let lenOne = filesOne.length;for (let i = 0; i < lenOne; i++) {let filePath = '' + filesOne[i]; // 没有找到合适的方法获取路径,这样写可以转成文件路径plus.io.resolveLocalFileSystemURL(filePath, function(entry) {if (entry.isDirectory) {entry.removeRecursively(function(entry) { //递归删除其下的所有文件及子目录console.log('清理文件数据完成')}, function(e) {console.log(e.message)});} else {entry.remove(function(entry) { //递归删除其下的所有文件及子目录console.log('清理文件数据完成')}, function(e) {console.log(e.message)});}}, function(e) {console.log('清理文件数据失败')});};
},
http://www.dtcms.com/wzjs/298358.html

相关文章:

  • 淘宝有做钓鱼网站的吗制作网站的最大公司
  • 在网站上做支付功能 需要什么企业网站优化报告
  • 做单平台网站制作所有代刷平台推广
  • 建设政府网站的原因西安seo报价
  • 做网站时用插件需要注明吗深圳网络推广专员
  • 宝安建网站福州百度首页优化
  • 上海市做网站seo精准培训课程
  • ps临摹网站怎样在网上做推广
  • 网站根目录验证文件在哪里网页制作软件推荐
  • 怎么做淘宝联盟的推广网站东莞网站制作的公司
  • 网站过期后百度销售岗位怎么样
  • 东莞市凤岗建设局网站培训网站官网
  • 网站编辑兼职国外免费ip地址
  • 中山市做网站1000个关键词
  • 建设集团网站企业广告宣传
  • 做一整套网站需要什么网站seo平台
  • 网站基础建设英文长沙市最新疫情
  • 电脑网站打不开了但是有网班级优化大师下载安装app
  • 怎么做阿里巴巴国际网站首页下载班级优化大师app
  • 新竹网站5118网站如何使用免费版
  • 怎么做属于自己的网站竞价销售是什么意思
  • 网页ip代理seo站长综合查询工具
  • 建设银行手机绑定网站seo常见优化技术
  • 品牌网站建设价格实惠杭州百度快照
  • 代理公司注册机构网站推广优化排名公司
  • wordpress负载均衡3步打造seo推广方案
  • 班级网站中个人简介怎么做网站建设与优化
  • 莱芜金点子租房信息港西安seo管理
  • 做2手车网站需要多少钱网站排名怎么做
  • 做海报挣钱的网站百度指数免费查询入口