<template>
  <uni-popup class="popupcss" ref="popup" type="center" border-radius="10px 10px 0 0">
    <view class="popup-content">
      <view class="popup-title">
        <view class="popup-text">点击选择您要参与的主播</view>
        <view v-if="list.length !== 0">
          <scroll-view show-scrollbar="false" scroll-y="true" class="scroll">
            <view class="card" v-for="(item, index) in list" :key="index">
              <view
                class="card-content"
                @click="Select(item.id, index)"
                :style="{
                  background: selectedId === item.id ? '#b8ff8c74' : '#ffffff',
                }"
              >
                <view class="Avatarimg">
                  <image class="avatar" :src="item.anchorIcon" mode="scaleToFill" />
                </view>
                <view class="NameMoney">
                  <view class="TimeMoney">
                    <view class="NameMoney_Name">{{ item.anchorId }}</view>
                  </view>
                  <view class="TimeMoney_Time">
                    <view class="pkTimeimg">
                      <image
                        style="width: 31.49rpx; height: 31.49rpx; margin-top: 3rpx"
                        src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/time.png"
                        mode="scaleToFill"
                      />
                    </view>
                    <!-- <view>{{ TimeFormatting(item.pkTime) }}</view> -->
                    <view class="goldimg">
                      <image
                        style="width: 31.49rpx; height: 31.49rpx; margin-top: 4rpx"
                        src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/species.png"
                        mode="scaleToFill"
                      />
                    </view>
                    <view class="goldnb">{{ item.coin }}K</view>
                  </view>
                </view>
              </view>
            </view>
          </scroll-view>
        </view>
        <view class="noData" v-if="list.length === 0"
          >您还没有可参与的主播PK，快去新建一个吧！</view
        >
      </view>
      <view class="popup-btn">
        <button class="invite" type="primary" @click="invite()">邀请</button>
        <button class="cancel" type="default" @click="close()">取消</button>
      </view>
    </view>
  </uni-popup>
</template>

<script>
export default {
  data() {
    return {
      title: "Hello",
    };
  },
  onLoad() {
    // 页面加载时执行
  },
  methods: {
    //确定邀请
    invite() {},
    //关闭弹窗
    close() {
      popup.value.close();
    },
  },
};
</script>

<style scoped>
/* 样式定义 */
</style>
