0
点赞
收藏
分享

微信扫一扫

UI自动化测试示例:python+pytest+selenium+allure

爱上流星雨 2024-10-16 阅读 14

我们在做每一个项目中 都会版本迭代的去更新 不可能每一次修改都要让用户去从新下载或者安装  我们需要在项目启动页做 一个版本更新提示

在项目的App.vue中 就可以直接复制

<script>
  export default {
    onLaunch() {
      uni.hideTabBar({})
    },
    onShow() {
      console.log('小程序进入前台')
      uni.hideTabBar({})
      const updateManager = wx.getUpdateManager()
      updateManager.onUpdateReady(function() {
        wx.showModal({
          title: '更新提示',
          content: '检测到新版本升级',
          showCancel: false,
          confirmText: '立即升级',
          success: function(res) {
            if (res.confirm) {
              console.log('小程序开始更新版本...')
              updateManager.applyUpdate()
            } else {
              console.log('取消更新版本...')
            }
          }
        })
      })
    },
    onHide() {
      console.log('App Hide')
    },

  }
</script>


<style lang="scss">
  /* uview */
  @import "@/uni_modules/uview-ui/index.scss";
</style>
举报

相关推荐

0 条评论