• uniapp版本迭代


    app.vue里面写
    onLaunch: function(launch) { let that = this // #ifdef APP-PLUS uni.getSystemInfo({ success(res) { console.log(res) console.log(res.platform) console.log(res.version) that.platform = res.platform that.version = res.version } }); if(this.platform == 'android'){ this.$util.request({//获取轮播 url: '/mobile/index.php?act=index&op=apk_version', method: 'get', data: {}, }).then((res)=> { console.log(res) if(res.error_code == 0 && res.datas.url != ""){ console.log(res.datas.version,"版本号") if(res.datas.version != that.version){ uni.showModal({ title: '版本更新', content: '是否更新到最新版本'+res.datas.version, success: (res2)=> { if (res2.confirm) { // 下载最新的版本 console.log(res.datas.url,"下载链接") that.doUpData(res.datas.url) } else if (res2.cancel) { } } }); } } }) } if(this.platform == 'ios'){ this.$util.request({//获取轮播 url: '/mobile/index.php?act=index&op=ios_version', method: 'get', data: {}, }).then((res)=> { console.log(res,123456) if(res.error_code == 0 && res.datas.url != ""){ console.log(res.datas.version,"版本号") if(res.datas.version != that.version ){ uni.showModal({ title: '版本更新', content: '是否更新到最新版本'+res.datas.version, success: (res2)=> { if (res2.confirm) { // 下载最新的版本 console.log(res.datas.url,"下载链接") that.doUpData(res.datas.url) } else if (res2.cancel) { } } }); } } }) } // #endif },

      

  • 相关阅读:
    用价值链分析软件开发及杂感
    《恰如其分的软件架构》笔记摘要
    观察者模式
    Js中Date对象
    Js中Currying的应用
    read命令
    模板方法模式
    两两交换链表中的节点
    享元模式
    Js中Array对象
  • 原文地址:https://www.cnblogs.com/daifuchao/p/13707602.html
Copyright © 2020-2023  润新知