<template>
  <!-- PK信息 -->
  <div class="pk-message">
    <el-splitter>
      <el-splitter-panel>
        <div class="demo-panel">
          <div
            class="anchor-library-list"
            style="overflow: auto"
            v-infinite-scroll="load"
          >
            <div class="anchor-library-card" v-for="(item, index) in list" :key="index">
              <div class="card-content">
                <div class="card-avatar"></div>
                <div class="personalInformation">
                  <div class="name">来自世界上最长名的国家的某个人</div>
                  <div class="GenderAndCountry">
                    <div class="Gender">女</div>
                    <div class="Country">来自世界上最长名的国家的名称很长很长哦</div>
                    <div class="goldbox">
                      <img
                        class="gold-icon"
                        src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/species.png"
                        alt=""
                      />
                      <div class="gold">
                        金币：
                        <div class="gold-num">999999k</div>
                      </div>
                    </div>
                  </div>
                  <div class="time">PK时间:2025-08-31 14:06</div>
                </div>
                <div class="card-Operation">
                  <div class="modify">
                    <img
                      class="modify-icon"
                      src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/pin.png"
                      alt=""
                    />
                    <!-- <img
                      class="modify-icon"
                      src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/cancelPin.png"
                      alt=""
                    /> -->
                  </div>
                  <div class="modify">
                    <img
                      class="modify-icon"
                      src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/recompose.png"
                      alt=""
                    />
                  </div>
                  <div class="delete">
                    <img
                      class="delete-icon"
                      src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/expurgate.png"
                      alt=""
                    />
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </el-splitter-panel>
      <el-splitter-panel size="25%" :resizable="false" collapsible>
        <!-- 添加或修改主播 -->
        <div class="demo-panel">
          <div class="add-anchor-library">
            <div class="title">发布新PK</div>
            <!-- <div class="title">
                    修改PK信息
                </div> -->
            <div class="add-anchor-library-content">
              <div class="input-name">
                <!-- 主播名称 -->
                <el-input
                  class="input-name-input"
                  v-model="anchorName"
                  size="large"
                  placeholder="请输入主播名称"
                />
                <div class="myanchor">
                  <div class="myanchor-btn">选择我的主播</div>
                </div>
              </div>
              <div class="country">
                <!-- 国家 -->
                <el-select-v2
                  v-model="countryvalue"
                  filterable
                  :options="country"
                  placeholder="请选择国家"
                  size="large"
                  style="vertical-align: middle"
                  class="select"
                />
              </div>
              <div class="gender">
                <!-- 性别 -->
                <el-select-v2
                  v-model="gendervalue"
                  filterable
                  :options="genderOptions"
                  size="large"
                  placeholder="请选择性别"
                  style="vertical-align: middle"
                  class="select"
                />
              </div>
              <div class="timeselect">
                <el-date-picker
                  v-model="value1"
                  type="datetime"
                  placeholder="选择PK时间"
                  size="large"
                  style="width: 100%; height: 100%"
                />
              </div>
              <div class="Gold-sessions">
                <div class="Goldcoinbox-right">
                  <div class="Goldcoinbox-text">金币数（单位为K）</div>
                  <el-input-number
                    v-model="maxnum"
                    controls-position="right"
                    @change="handleChange"
                  />
                </div>
                <div class="Goldcoinbox-right">
                  <div class="Goldcoinbox-text">场次</div>
                  <el-input-number
                    v-model="maxnum"
                    controls-position="right"
                    @change="handleChange"
                  />
                </div>
              </div>
              <div class="Confirm">确认</div>
              <div class="Reset">重置</div>
            </div>
          </div>
        </div>
      </el-splitter-panel>
    </el-splitter>
  </div>
</template>

<script setup>
import {
  ref, // 响应式基础
  watch, // 侦听器
  onMounted, // 组件挂载完成后执行
  onUpdated, // 组件更新后执行
  onUnmounted, // 组件销毁前执行
} from "vue";
import { getCountryNamesArray } from "../../utils/countryUtil";

const country = ref([]);
country.value = getCountryNamesArray(); //国家条目
const genderOptions = [
  { value: 1, label: "男" },
  { value: 2, label: "女" },
]; // 性别选项
const gendervalue = ref(null); // 性别值
const countryvalue = ref(null); //国家
const anchorName = ref(null); // 主播名称
const refname = ref("");
const list = ref([{}, {}, {}, {}, {}]);

function load() {
  // 加载更多数据
}
watch(refname, async (newQuestion, oldQuestion) => {
  // 变化后执行
});
onMounted(() => {
  // 组件挂载完成后执行
});
onUpdated(() => {
  // 组件更新后执行
});
onUnmounted(() => {
  // 组件销毁前执行
});
</script>

<style scoped lang="less">
.pk-message {
  width: 100%;
  height: 100%;
}
.demo-panel {
  width: 100%;
  height: 100%;
}
.anchor-library-list {
  width: 100%;
  height: 100%;
}
.anchor-library-card {
  width: 100%;
  height: 150px;
  margin-bottom: 15px;
  margin-top: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.card-content {
  width: 90%;
  height: 100%;
  border-radius: 20px;
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
  background-image: linear-gradient(45deg, @bg-Sidebar-color-bottom, @bg-color);
  transition: all 0.4s ease;
  display: flex;
  align-items: center;
}
.card-content:hover {
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.8);
  transform: scale(1.08);
  opacity: 0.8;
}
.card-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background-color: #ffffff;
  margin-left: 20px;
}
.personalInformation {
  width: calc(100% - 340px);
  height: 100px;
  margin-left: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.name {
  font-size: 20px;
  font-weight: bold;
  color: #333333;
}
.GenderAndCountry {
  display: flex;
  align-items: center;
}
.Gender {
  font-size: 16px;
  color: #666666;
  border-radius: 50px;
  background-color: #ffffff;
  padding: 2px 20px 2px 20px;
  margin-right: 20px;
}
.Country {
  font-size: 16px;
  color: #666666;
  border-radius: 50px;
  background-color: #ffffff;
  padding: 2px 20px 2px 20px;
}
.goldbox {
  margin-left: 20px;
  display: flex;
  align-items: center;
}
.gold-icon {
  width: 20px;
  height: 20px;
  margin-right: 5px;
}
.gold {
  color: @Prompt-text-color;
  font-size: 16px;
  display: flex;
  align-items: center;
}
.gold-num {
  font-size: 16px;
  color: @font-color;
  font-weight: bold;
}
.time {
  font-size: 14px;
  color: @Prompt-text-color;
}
.card-Operation {
  width: 200px;
  height: 100px;
  margin-left: 20px;
  margin-right: 20px;
  display: flex;
  align-items: center;
  justify-content: space-around;
}
.modify-icon {
  width: 30px;
  height: 30px;
}
.delete-icon {
  width: 30px;
  height: 30px;
}
.add-anchor-library {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.title {
  width: 100%;
  height: 70px;
  font-size: 24px;
  font-weight: bold;
  color: #333333;
  text-align: center;
  line-height: 70px;
}
.add-anchor-library-content {
  width: 100%;
  height: calc(100% - 70px);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.input-name {
  width: 90%;
  height: 50px;
  margin-top: 20px;
  display: flex;
}
.input-name-input {
  width: 50%;
  height: 40px;
}
.myanchor {
  width: 50%;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.myanchor-btn {
  width: 90%;
  height: 35px;
  border-radius: 5px;
  font-size: 16px;
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
  text-align: center;
  line-height: 35px;
  transition: all 0.4s ease;
  color: @Prompt-text-color;
}
.myanchor-btn:hover {
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
  opacity: 0.8;
}
.country {
  width: 90%;
  height: 50px;
  margin-top: 20px;
}
.gender {
  width: 90%;
  height: 50px;
  margin-top: 20px;
}
.select {
  width: 100%;
}
.timeselect {
  width: 90%;
  height: 40px;
  margin-top: 20px;
}
.Gold-sessions {
  width: 90%;
  height: 50px;
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.Goldcoinbox-right{
  display: flex;
  flex-direction: column;
}
.Goldcoinbox-text {
  font-size: 12px;
  color: @Prompt-text-color;
}
.Confirm {
  width: 90%;
  height: 50px;
  margin-top: 100px;
  text-align: center;
  line-height: 50px;
  background-color: #ffffff;
  color: @Prompt-text-color;
  font-size: 20px;
  transition: all 0.4s ease;
  border-radius: 20px;
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
}
.Confirm:hover {
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
  opacity: 0.8;
}
.Reset {
  width: 90%;
  height: 50px;
  margin-top: 30px;
  text-align: center;
  line-height: 50px;
  background-color: #ffffff;
  color: @Prompt-text-color;
  font-size: 20px;
  transition: all 0.4s ease;
  border-radius: 20px;
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
}
.Reset:hover {
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
  opacity: 0.8;
}
</style>
