<template>
  <view class="versions-container">
    <view class="logo-content"></view>
    <view class="versions-content">版本号：{{ versionNumber }}</view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      versionNumber: "",
    };
  },
  onShow() {
    // 获取当前app的版本
    const systemInfo = uni.getSystemInfoSync();
    // 应用程序版本号
    // 条件编译，只在H5渲染
    // #ifdef H5
    this.versionNumber = systemInfo.appVersion;
    console.log(systemInfo.appVersion, "版本号");
    // #endif
    // #ifdef APP-PLUS
    uni.getSystemInfo({
      success: function (res) {
        this.versionNumber = res.appVersion;
      },
    });
    // #endif
  },
};
</script>

<style lang="scss">
.versions-container {
  .logo-content {
    background-image: url("../../static/logo-2.png");
    background-size: 100% 100%;
    width: 228rpx;
    height: 228rpx;
    margin: 50% auto;
    margin-bottom: 32rpx;
  }
  .versions-content {
    text-align: center;
  }
}
</style>