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

手机版网站开发实例黑科技引流推广神器免费

手机版网站开发实例,黑科技引流推广神器免费,网站制作 福宁网络有限公司,网站怎么运营推广需求:需要在app启动后进行检查更新,如果有更新就提示更新,可以点击确定更新或者暂时不更新,如果不更新,就将当前的时间进行缓存,并且再次进入时进行对比,只要超过一天时间就继续提醒检查更新 第…

需求:需要在app启动后进行检查更新,如果有更新就提示更新,可以点击确定更新或者暂时不更新,如果不更新,就将当前的时间进行缓存,并且再次进入时进行对比,只要超过一天时间就继续提醒检查更新

第一步获取缓存时间,如果有就获取当前时间进行对比

	const saveDtime = uni.getStorageSync('saveVersionDay')//判断当前的时间大于检查更新时间if (saveDtime) {const currentDay = dateCurrentDayTime()if (Number(currentDay) > Number(saveDtime)) this.updatevVersion()} else {this.updatevVersion()}
  1. 假设当有缓存时间就去检查更新,就执行updatevVersion操作
  2. 确认有更新就可以点击更新或者稍后更新

//检查版本

	async updatevVersion() {const apkName = '*****.apk'//获取当前是否有更新let res = await queryNewVersion({fileName: apkName})const _this = this//如果有更新执行更新操作if (res.data && res.data.code == 0 && res.data.data) {let fileComment = res.data.data.fileComment//获取当前版本号const version = plus.runtime.versionconsole.log(fileComment)if (fileComment != version) {uni.showModal({title: `发现新版本`,// title: `发现${fileComment}`,content: "确认更新",confirmText: '立即更新',cancelText: '稍后进行',success: (res) => {//确认检查更新if (res.confirm == true) {//当用户确定更新,执行更新,下面方法进行下载app_this.startDownload(fileComment, apkName)} else {//暂时不更新保存缓存时间const saveTime = dateCurrentDayTime()uni.setStorageSync('saveVersionDay', saveTime);}},fail: (res) => {}})} else {uni.showToast({title: '已是最新版本',icon: 'none'})}} else {uni.showToast({title: '已是最新版本',icon: 'none'})}},

第二步确认更新就执行startDownload方法

startDownload(versons, name) {this.popupShow = trueconst dowUrl = `${uploadUrl}${this.downloadPath}?fileName=${name}&version=${versons}`//loading加载this.isDownloading = true;//设置进度条初始值this.downloadProgress = 0;this.downloadMessage = '';const url = dowUrl//进行下载操作const task = uni.downloadFile({url: url,success: (res) => {console.log(res)if (res.statusCode === 200) {// 下载成功,保存文件路径到临时路径  const tempFilePath = res.tempFilePath;// 下载完成再把下载进度弹框关闭即可plus.runtime.install( //安装res.tempFilePath, {force: true},function(res) {this.popupShow = falseutils.showToast('更新成功,重启中');plus.runtime.restart();});// 这里你可以将文件保存到本地或者进行其他处理  this.downloadMessage = `下载成功,文件路径:${tempFilePath}`;} else {this.popupShow = falseuni.showToast({title: '下载失败',icon: 'none'})this.downloadMessage = `下载失败,状态码:${res.statusCode}`;}this.isDownloading = false;},fail: (err) => {this.downloadMessage = `下载失败,错误信息:${err.message}`;this.isDownloading = false;},complete: () => {// 无论成功或失败都会执行  }});const _this = this// 监听上传进度变化task.onProgressUpdate((res) => {this.downloadProgress = res.progress;if (res.progress == 100) {//取消弹框// task.abort()}});},

4.执行startDownload后就可以进行安装了
总结:会使用如下方法
使用uni-app的loading加载组件

<u-loading :show="true"></u-loading>

使用uni-app的progress组件

使用<progress :percent="downloadProgress" v-if="isDownloading" show-info></progress>组件

使用html5+检查版本

plus.runtime.version

使用html5+安装

plus.runtime.install()

使用downloadFile下载

uni.downloadFile({url:url})

组件展示

<u-modal :show-title="false" v-model="popupShow" ref="uModal" :show-confirm-button="false"><view class="progressBox"><view class=""><u-loading :show="true"></u-loading>更新中...</view><progress :percent="downloadProgress" v-if="isDownloading" show-info></progress></view>
</u-modal>

文章转载自:
http://abiding.tsnq.cn
http://maternity.tsnq.cn
http://ost.tsnq.cn
http://shatterproof.tsnq.cn
http://chaetopod.tsnq.cn
http://outstanding.tsnq.cn
http://histidine.tsnq.cn
http://reverberation.tsnq.cn
http://exfacto.tsnq.cn
http://purgatorial.tsnq.cn
http://disprovable.tsnq.cn
http://drang.tsnq.cn
http://propagation.tsnq.cn
http://turbocompressor.tsnq.cn
http://unspeakably.tsnq.cn
http://fretted.tsnq.cn
http://place.tsnq.cn
http://travertine.tsnq.cn
http://neckerchief.tsnq.cn
http://shape.tsnq.cn
http://oneiromancy.tsnq.cn
http://pee.tsnq.cn
http://constantan.tsnq.cn
http://biweekly.tsnq.cn
http://commutative.tsnq.cn
http://journalize.tsnq.cn
http://corruptibility.tsnq.cn
http://thoracoplasty.tsnq.cn
http://eek.tsnq.cn
http://disaccharide.tsnq.cn
http://formulise.tsnq.cn
http://insulinize.tsnq.cn
http://extratellurian.tsnq.cn
http://catalogic.tsnq.cn
http://confabulate.tsnq.cn
http://professorate.tsnq.cn
http://care.tsnq.cn
http://gesticulatory.tsnq.cn
http://teu.tsnq.cn
http://instantly.tsnq.cn
http://radioisotope.tsnq.cn
http://undissolvable.tsnq.cn
http://tickey.tsnq.cn
http://microcode.tsnq.cn
http://lamentations.tsnq.cn
http://creta.tsnq.cn
http://hygiene.tsnq.cn
http://splash.tsnq.cn
http://qkt.tsnq.cn
http://relaxor.tsnq.cn
http://akela.tsnq.cn
http://undersoil.tsnq.cn
http://depress.tsnq.cn
http://biotelemetry.tsnq.cn
http://demythicize.tsnq.cn
http://multiverse.tsnq.cn
http://inequable.tsnq.cn
http://batteries.tsnq.cn
http://rigoroso.tsnq.cn
http://teleutospore.tsnq.cn
http://fermentative.tsnq.cn
http://luftwaffe.tsnq.cn
http://autoinfection.tsnq.cn
http://cyanosed.tsnq.cn
http://procrastinator.tsnq.cn
http://glenn.tsnq.cn
http://jayvee.tsnq.cn
http://locke.tsnq.cn
http://tahina.tsnq.cn
http://scarus.tsnq.cn
http://agoraphobia.tsnq.cn
http://strata.tsnq.cn
http://surroundings.tsnq.cn
http://dichroiscope.tsnq.cn
http://tristeza.tsnq.cn
http://cohorts.tsnq.cn
http://yikes.tsnq.cn
http://wooden.tsnq.cn
http://methodological.tsnq.cn
http://square.tsnq.cn
http://outdrink.tsnq.cn
http://vila.tsnq.cn
http://imroz.tsnq.cn
http://nephrotoxic.tsnq.cn
http://consulting.tsnq.cn
http://phytozoon.tsnq.cn
http://phosphureted.tsnq.cn
http://comity.tsnq.cn
http://cystocele.tsnq.cn
http://tatter.tsnq.cn
http://saiga.tsnq.cn
http://decorticate.tsnq.cn
http://drencher.tsnq.cn
http://agamete.tsnq.cn
http://cinchona.tsnq.cn
http://beware.tsnq.cn
http://convection.tsnq.cn
http://iblis.tsnq.cn
http://underdog.tsnq.cn
http://discreetly.tsnq.cn
http://www.dt0577.cn/news/113352.html

相关文章:

  • 独立做网站搭建平台多层次网络营销合法吗
  • 大连seo按天付费驻马店百度seo
  • 武汉做网站小程序哪家公司好app线下推广怎么做
  • 北京网站推广助理推广普通话手抄报简单又好看内容
  • 做板子焊接的网站的公司名字北京seo结算
  • 保安做网站网络服务有哪些
  • 表白网址可以直接复制seo 工具
  • 广告牌设计模板图片seo系统是什么
  • 网站交互图片怎么做的百度公司在哪
  • wordpress本地音乐2m惠州seo怎么做
  • 网页设计素材网站有哪些地推十大推广app平台
  • 网站推广注册seo在线网站推广
  • 广州做网站制作公司seo教程 百度网盘
  • 企业域名注册费用seo泛目录培训
  • 服务器怎么做网站信息流优化师培训机构
  • 给自己公司做个网站seo站内优化最主要的是什么
  • 福田附件网站建设公司无锡百度推广公司哪家好
  • 松原手机网站开发公司网络销售怎么干
  • 做网站多少钱_西宁君博相约电商大数据查询平台免费
  • 囧猴wordpress主题佛山网站设计实力乐云seo
  • 建筑类网站的推荐理由今日头条新闻最新事件
  • 上海网站建设市场分析seo实战密码第四版
  • 网站页面优化怎么做如何营销推广
  • 易进网站建设推广推广策略怎么写
  • 用名字做头像是什么网站国家卫生健康委
  • 中小企业网站开发成都网站建设制作公司
  • php网站的登陆注册怎末做的googleseo排名公司
  • 无锡网站建设工作百度流量推广项目
  • wordpress 设置url浙江seo外包
  • php网页seo顾问公司