<template>
  <view id="success-container" :data-theme="'theme-' + proxy.$settingStore.themeColor.name">
    <view class="content-section">
      <image class="content-section-image" src="http://192.168.123.165:9300/statics/images/common/success.png" />
      <view class="content-section-text">{{ codeName }}</view>
    </view>

    <view class="app-button-fixed" v-if="showNow" style="box-shadow: 0px 0px 15px 0 rgba(0, 0, 0, 0)">
      <u-button class="app-buttom" type="primary" @click="navigateTo()" shape="circle"> 返回 </u-button>
    </view>
  </view>
</template>

<script setup>
import config from "@/config";
import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
import { ref, onMounted, inject, shallowRef, reactive, toRefs, getCurrentInstance } from "vue";
import { useStores, commonStores } from "@/store/modules/index";
import { getToken, setToken, removeToken } from "@/utils/auth";

const commonStore = commonStores();

const { proxy } = getCurrentInstance();
const showNow = ref(true);
const codeName = ref("");

/**
 * @返回上一级
 */
function navigateTo() {
  proxy.$tab.navigateBack(1);
}

onLoad((options) => {
  if ("showNow" in options) {
    showNow.value = options.showNow;
  }

  if ("codeName" in options) {
    codeName.value = options.codeName;
  }
});
</script>

<style lang="scss" scoped>
#success-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  width: 100%;
  padding: 0 15px;
  margin: auto;
  padding-top: 20%;
  //#ifdef MP-WEIXIN
  padding-top: 30%;
  //#endif
  background-color: #ffffff;

  .content-section {
    &-image {
      display: flex;
      width: 120px;
      height: 120px;
      margin: 50px auto 20px auto;
    }

    &-text {
      font-size: 16px;
      text-align: center;
      font-weight: 600;
    }
  }
}
</style>
