UpdateBox.vue 2.23 KB
<template>
  <view
    class="update-modal"
    v-if="show"
  >
    <view class="update-box">
      <image
        class="bg"
        src="@/assets/images/common/update-bg.png"
      />
      <view class="content">
        <view class="title">新版本升级 V.1.1.0</view>
        <view class="content-item">
          1、提升使用体验
        </view>
        <view class="content-item">
          2、修复部分问题
        </view>
      </view>
      <view class="btn" @click="toMarket">立即更新</view>
    </view>
  </view>
</template>

<script type='text/ecmascript-6'>
export default {
  name: 'updateBox',
  data () {
    return {
      show: false
    }
  },
  computed: {
    watchUpdateStatus () {
      return this.$store.state.update.status
    },
  },
  watch: {
    watchUpdateStatus: {
      immediate: true,
      handler (newval) {
        if (newval) this.show = true
      }
    },
  },
  mounted () {
  },
  methods: {
    toMarket(){
      plus.runtime.openURL('market://details?id=io.dcloud.hellouniapp')
    }
  }
}
</script>

<style scoped lang='scss'>
.update-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999999999;
  background: #00000066;
  .update-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800rpx;
    height: 752rpx;
    background: #ffffff;
    border-radius: 32rpx;
    box-sizing: border-box;
    padding-top: 288rpx;
    .bg {
      width: 800rpx;
      height: 400rpx;
      position: absolute;
      left: 0;
      top: -84rpx;
    }
    .content {
      position: relative;
      z-index: 2;
      width: 640rpx;
      height: 288rpx;
      overflow-y: scroll;
      margin: 0 auto 32rpx;
      .title {
        text-align: center;
        font-weight: 500;
        font-size: 32rpx;
        margin-bottom: 24rpx;
      }
      &-item{
        color: #5A5E66;
        font-size: 28rpx;
      }
    }
    .btn {
      width: 608rpx;
      height: 80rpx;
      background-image: linear-gradient(270deg, #2c66f7 0%, #48a6ff 100%);
      border-radius: 98rpx;
      text-align: center;
      line-height: 80rpx;
      font-weight: 500;
      font-size: 32rpx;
      color: #ffffff;
      margin: 0 auto;
    }
  }
}
</style>