<template>
  <Container
    title="添加老师咨询"
    :scrollStyle="{
      padding: 0,
    }"
  >
    <view class="bg">
      <div class="bg-0"></div>
      <view class="bg-1">
        <image :src="qrcode" show-menu-by-longpress class="qrcode"></image>
      </view>
      <div class="bg-2">
        <div>报名信息</div>
        <div class="text-14">
          {{ info.contact_name }}{{ info.contact_information
          }}{{ info.pharmacist_type === 1 ? "中药" : "西药" }}
        </div>
        <div class="text-t9 text-12">如需修改报名信息，请联系客服修改</div>
      </div>
    </view>
  </Container>
</template>

<script setup>
import Container from "@/components/Container/Container.vue";
import { request } from "../../utils/request";
import { ref } from "vue";
import { onShow } from "@dcloudio/uni-app";
import { getRoute } from "../../utils/router";

const qrcode = ref("");
const info = ref({});

onShow(() => {
  request("api/question_bank/question_reception/common_config/detail", {
    content_code: "challenge_activities",
  }).then((res) => {
    const { type } = getRoute().params;
    const key =
      type === 1 ? "chinese_medicine_qrcode" : "western_medicine_qrcode";
    qrcode.value = res.data.content_detail[key];
  });
  request(
    "api/question_bank/question_reception/challenge_registration_log/detail"
  ).then((res) => {
    if (res.data) {
      info.value = res.data;
    }
  });
});
</script>

<style scoped lang="scss">
.bg {
  width: 100%;
  height: 100%;
  background: url("https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/05/yz2eTeqIRv60IEe6kOQBOYlHr75wiFIpeFqrJmgZ.png");
  background-size: 100% 100%;
  padding: 216rpx 10rpx;
  box-sizing: border-box;
  position: relative;

  .bg-0 {
    width: 128rpx;
    height: 128rpx;
    top: 70rpx;
    left: 50%;
    transform: translateX(-50%);
    background: url("https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/06/IGf12z7pkPWDXrRxt9Yk9xVz9Mt1Cs8OZXGkyT1R.png");
    background-size: 100% 100%;
    position: absolute;
  }

  .bg-1 {
    width: 730.71rpx;
    height: 841rpx;
    background: url("https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/06/U29HhzEGO1qyFSKkngSFM3uosicKhY8Gc4EsifY8.png");
    background-size: 100% 100%;
    position: relative;

    .qrcode {
      position: absolute;
      top: 205rpx;
      left: 141rpx;
      width: 448rpx;
      height: 448rpx;
      background-size: 100% 100%;
    }
  }

  .bg-2 {
    width: 680rpx;
    height: 310rpx;
    margin: 0 20rpx;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    justify-content: center;
    gap: 51rpx;
    background: url("https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/06/CyJTtM0Jtx2JY4aMthrAwjl0caJxApRcypbKsU20.png");
    background-size: 100% 100%;
  }
}
</style>
