<template>
  <view class="page">
    <view class="content" v-if="information.status == 0">
      <image class="logo" src="../../static/mine/350.png" mode=""></image>
      <view class="wait">审核中</view>
      <view class="review">审核中，请耐心等待~</view>
    </view>
    <view class="content" v-else-if="information.status == 2">
      <image class="logo" src="../../static/mine/351.png" mode=""></image>
      <view class="wait">审核失败</view>
      <view class="review">未通过，请重新提交信息</view>
      <view class="refuse">拒绝原因：{{ information.refusal }}</view>
    </view>
    <view class="content" v-else>
      <image class="logo" src="../../static/mine/352.png" mode=""></image>
      <view class="wait">您已入驻成功</view>
      <view class="prompt"
        >请访问以下pc端地址进行店铺信息维护以及 商品信息的发布</view
      >
      <view class="inp">
        <view class="url">https://cbec-admin.hdlkeji.com/#/login</view>
        <view
          style="color: #f83224; font-size: 26rpx"
          @click="cope('https://cbec-admin.hdlkeji.com/#/login')"
        >
          复制链接
        </view>
      </view>
      <view class="account">
        <view class="_label">账号：</view>
        <view class="_value">{{ information.username }}</view>
      </view>
      <view class="account">
        <view class="_label">密码：</view>
        <view class="_value">{{ information.password }}</view>
      </view>
    </view>
    <button class="go-back" @click="back" v-if="information.status == 0">
      返回首页
    </button>
    <button class="go-back" @click="back" v-if="information.status == 1">
      返回
    </button>
    <button class="go-back" @click="resetSubmit" v-if="information.status == 2">
      重新提交
    </button>
  </view>
</template>

<script>
export default {
  data() {
    return {
      code: "111",
      information: {},
    };
  },
  methods: {
    cope(e) {
      uni.setClipboardData({
        data: e,
        success() {
          uni.showToast({
            title: "复制成功",
            icon: "none",
          });
        },
      });
    },
    //返回首页
    back() {
      uni.switchTab({
        url: "/pages/index/index",
      });
    },

    //重新提交
    resetSubmit() {
      uni.navigateTo({
        url: "/pageD/settleIn/settleIn",
      });
    },
    getInfo() {
      uni.$u.http.post(`/api/merchant/status`).then((res) => {
        this.information = res;
      });
    },
  },
  created() {
    this.getInfo();
    uni.setNavigationBarTitle({
      title: "结果反馈",
    });
  },
};
</script>

<style lang="scss" scoped>
.page {
  background-color: #fff;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  .content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    .logo {
      width: 338rpx;
      height: 298rpx;
      margin: 68rpx auto;
    }
    .wait {
      font-size: 36rpx;
      color: #222;
      font-weight: 600;
    }
    .review {
      font-size: 26rpx;
      color: rgba(34, 34, 34, 0.9);
      margin-top: 14rpx;
    }
    .refuse {
      font-size: 24rpx;
      color: rgba(34, 34, 34, 0.6);
      margin-top: 14rpx;
    }
    .prompt {
      font-size: 28rpx;
      color: #666;
      margin-top: 14rpx;
      width: 75%;
      text-align: center;
    }
    .inp {
      display: flex;
      align-items: center;
      justify-content: space-between;
      background-color: #f7f7f7;
      border-radius: 8rpx;
      width: 530rpx;
      height: 68rpx;
      margin-top: 60rpx;
      border: 1rpx solid #c3c3c3;
      padding: 0 10rpx;
      .url {
        width: 80%;
        font-size: 28rpx;
        color: #777;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
    }
    .account {
      display: flex;
      margin-top: 36rpx;
      width: 530rpx;
      ._label {
        font-size: 28rpx;
        color: #666;
      }
      ._value {
        font-size: 28rpx;
        color: #f83224;
      }
    }
  }
  .go-back {
    background-color: #f83224;
    color: #fff;
    border: none;
    border-radius: 44rpx;
    margin-top: 90rpx;
    width: 262rpx;
    height: 88rpx;
    line-height: 88rpx;
  }
}
</style>
