<style>
.NotCertified .popup_box {
  width: 100%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 10px;

  background-size: cover;
  position: relative;
  height: 622rpx;
}
.NotCertified .popup_box1 {
  background-image: url("https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/signSuccsetc.png");
}
.NotCertified .popup_box2 {
  background-image: url("https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/daishenpibg.png");
}
.btn {
  width: 420rpx;
  height: 88rpx;
  border-radius: 10px;
  background-color: #f70027;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 134rpx;
  font-size: 32rpx;
  font-family: PingFang SC;
  font-weight: bold;
  color: #ffffff;
}
</style>
<template>
  <view class="NotCertified">
    <u-popup v-model="isShow" mode="center" length="80%" :closeable="true">
      <view class="popup_box popup_box1">
        <view
          class="btn"
          style="
            position: absolute;
            left: 50%;
            bottom: 78rpx;
            margin-left: -210rpx;
          "
          @click="jumpPage"
          >立即入驻</view
        >
        <u-icon
          name="cross"
          color="#909399"
          size="42"
          style="position: absolute; right: 15px; top: 15px"
          @click="goBack"
        ></u-icon>
      </view>
    </u-popup>
    <u-popup v-model="isShow2" mode="center" length="80%" :closeable="true">
      <view class="popup_box popup_box2">
        <view
          class="btn"
          style="
            position: absolute;
            left: 50%;
            bottom: 78rpx;
            margin-left: -210rpx;
          "
          @click="goBack"
          >我知道了</view
        >
        <u-icon
          name="cross"
          color="#909399"
          size="42"
          style="position: absolute; right: 15px; top: 15px"
          @click="goBack"
        ></u-icon>
      </view>
    </u-popup>
  </view>
</template>

<script>
export default {
  data() {
    return {
      mc: "",
      isShow: false,
      isShow2: false,
      CommpanyStatus: 0, //公司认证状态
      FirstShopType: 0, //1：品牌，2：载体
    };
  },
  created() {},
  mounted() {
    this.mc = this.$uiConfig.mainColor;
    this.getCommpanyStatus();
  },
  onLoad(option) {
    if (option) {
    }
  },
  methods: {
    //获取认证状态
    getCommpanyStatus() {
      this.request2(
        {
          url: "/api/AppletTrade/GetCommpanyStatus",
          data: {},
        },
        (res) => {
          if (res.resultCode == 1) {
            this.CommpanyStatus = res.data.CompanyStatus;
            this.FirstShopType = res.data.FirstShopType;
            this.auth();
          }
        }
      );
    },
    auth() {
      console.log(87, this.CommpanyStatus);
      if (this.CommpanyStatus === 1 || this.CommpanyStatus === 4) {
        this.isShow = true;
      } else if (this.CommpanyStatus === 3) {
        this.isShow2 = true;
      } else if (this.CommpanyStatus === 2) {
        uni.showModal({
          title: "提示",
          content: "认证待完善",
          confirmText: "立即完善",
          success: function (res) {
            if (res.confirm) {
              uni.navigateTo({
                url: "/pages/kotra/identification",
              });
            } else if (res.cancel) {
              uni.navigateBack({
                delta: 1,
              });
            }
          },
        });
      }
    },
    jumpPage() {
      uni.navigateTo({
        url: "/pages/kotra/identification",
      });
    },
    goBack() {
      uni.navigateBack({
        delta: 1,
      });
    },
    closePopup() {
      this.isShow = false;
    },
  },
};
</script>

<style>
</style>
