<template>
  <div class="box">
    <image :src="datainfo.auth_code" alt="" />
    <div class="flex">
      <div>
        <span class="green" v-if="datainfo.auth_status.b2b == 1">已认证</span>
        <span class="red" v-else>未认证</span>
      </div>
      <div>
        <span class="green" v-if="datainfo.auth_status.scha == 1">已认证</span>
        <span class="red" v-else>未认证</span>
      </div>
    </div>
    <div class="button">
      <div class="tip">认证成功后点击下方“我已认证”按钮进行确认</div>
      <button class="btn" @click="getAuth(da)">我已认证</button>
    </div>
  </div>
</template>

<script>
import { post } from "@/request/api.js";
export default {
  props: {},
  components: {},
  data() {
    return {
      datainfo: {},
      da:""
    };
  },

  methods: {
    getAuth(da) {
      post("v1/lakala/getAuth", da).then((res) => {
        if (res.code == 0) {
          this.datainfo = res.data;
        }
      });
    },
  },

  onLoad(da) {
    this.da = da
    this.getAuth(da);
  },
  mounted() {},
};
</script>

<style scoped lang='scss'>
.box {
  width: 100vw;
  height: 100vh;
  box-sizing: border-box;
  padding: 26rpx 0;
  position: relative;
  background-color: #fff;
  image {
    width: 100%;
    padding: 0 26rpx;
    box-sizing: border-box;
  }
  .flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 30rpx;
    padding: 0 26rpx;
    div {
      width: 50%;
      font-size: 26rpx;
      text-align: center;
      .green {
        color: #17bb87;
      }
      .red {
        color: red;
      }
    }
  }

  .button {
    position: absolute;
    bottom: 26rpx;
    width: 100%;
    box-sizing: border-box;
    font-size: 26rpx;
    margin-bottom: 50rpx;

    .tip {
      margin-left: 40rpx;
    }

    .btn {
      color: #fff;
      font-size: 36rpx;
      text-align: center;
      height: 80rpx;
      line-height: 80rpx;
      border-radius: 45rpx;
      margin: 26rpx 26rpx 0;
      background: #17bb87;
    }
  }
}
</style>