<template>
  <div>
    <!--  left-text="" title="群聊" -->
    <van-nav-bar fixed @click-left="onClickLeft" @click-right="onClickRight">
      <template #left>
        <div>
          <van-icon name="arrow-left" color="black" size="18" />
        </div>
      </template>
      <template #right>
        <van-icon name="ellipsis" color="black" size="18" />
      </template>
    </van-nav-bar>
    <div class="w-full fixed top-48 left-0">
      <van-notice-bar
        left-icon="volume-o"
        mode="link"
        text="无论我们能活多久，我们能够享受的只有无法分割的此刻，此外别无其他。"
      ></van-notice-bar>
    </div>

    <van-pull-refresh v-model="loading" @refresh="onRefresh">
      <div
        style="height: calc(100vh - 50px)"
        :class="`w-full px-12 pt-60 border ${bg ? `bg-[url(${bg})] bg-cover` : 'bg-[#F3F3F3]'} `"
      >
        <ChatItem></ChatItem>
        <!-- <div style="width: calc(100vw - 74px)" class="flex justify-start items-start">
          <div class="shrink-0 w-40 h-40 border rounded-[4px]">
            <img class="w-full h-full" src="" alt="" />
          </div>

          <div class="w-0 h-0 mt-10 border-[8px] border-transparent border-r-white"></div>
          <div
            class="max-w-full break-words overflow-auto rounded-[4px] relative bg-white box-border text-base p-5 text-wrap"
            v-html="`ajshdgahsddasdasdasdgjasgdjhgdhajdadasdhjagdhjagsjhasgjdasgjhagsjagshd`"
          ></div>
        </div> -->
      </div>
    </van-pull-refresh>

    <!-- <ProfileNewsChatInput></ProfileNewsChatInput> -->
  </div>
</template>
<script setup>
const route = useRoute()
const router = useRouter()

definePageMeta({
  layout: false
})

useSeoMeta({
  title: '群聊'
})

// 刷新次数
const count = ref(0)
const loading = ref(false)
const idInfo = reactive({
  groupId: computed(() => route.query.groupId ?? ''),
  userId: computed(() => route.query.userId ?? '')
})

// 背景图
const bg = ref('')

const messageData = reactive({
  pageNum: 1,
  pageSize: 10,
  messageId: '',
  searchMessage: ''
})

// 刷新
const onRefresh = () => {
  setTimeout(() => {
    showToast('刷新成功')
    loading.value = false
    count.value++
  }, 1000)
}

const onClickLeft = () => router.back()

const onClickRight = () => {
  navigateTo({
    path: '/chat/set',
    query: idInfo
  })
}

// 获取群聊消息
async function getListMessage() {
  let { data } = await request('/website/tourMessage/getMessageByGroupId', {})
}

//
// 用户删除消息
async function userDelMessage(params) {
  let { data } = await request('/website/tourMessage/delMessage', {
    method: 'post',
    body: {}
  })
}

onMounted(() => {})
</script>
<style lang="scss" scoped></style>
