|
@@ -2,12 +2,14 @@
|
|
|
<div class="w-full h-[100vh]">
|
|
|
<ChatHeaderBar title="扫码结果" />
|
|
|
<div class="h-250"></div>
|
|
|
- <!-- <ChatGroupAvatar class="mx-auto"></ChatGroupAvatar> -->
|
|
|
- <MultiHeader :size="60" :imgUrls="imgUrls" />
|
|
|
- <h1 class="w-220 text-center text-black-3 font-semibold text-xl mb-27 mt-16 mx-auto">
|
|
|
- {{ itemData?.groupName }}
|
|
|
- </h1>
|
|
|
- <!-- @click="
|
|
|
+ <template v-if="!qrQueryParmars.overTime && qrQueryParmars.success">
|
|
|
+ <div class="mx-auto">
|
|
|
+ <MultiHeader :size="60" :imgUrls="imgUrls" />
|
|
|
+ </div>
|
|
|
+ <h1 class="w-220 text-center text-black-3 font-semibold text-xl mb-27 mt-16 mx-auto">
|
|
|
+ {{ itemData?.groupName }}
|
|
|
+ </h1>
|
|
|
+ <!-- @click="
|
|
|
navigateTo({
|
|
|
path: '/',
|
|
|
query: {
|
|
@@ -15,7 +17,7 @@
|
|
|
}
|
|
|
})
|
|
|
" -->
|
|
|
- <!-- <van-cell center is-link size="large" :title="itemData?.showName" value="查看群主主页">
|
|
|
+ <!-- <van-cell center is-link size="large" :title="itemData?.showName" value="查看群主主页">
|
|
|
<template #icon>
|
|
|
<div class="w-48 h-48 rounded-full overflow-hidden border mr-12">
|
|
|
<img
|
|
@@ -26,7 +28,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</van-cell> -->
|
|
|
- <!-- <van-cell
|
|
|
+ <!-- <van-cell
|
|
|
center
|
|
|
size="large"
|
|
|
title="群介绍"
|
|
@@ -39,8 +41,8 @@
|
|
|
label="为维护逍遥游良好社区氛围,请遵守《逍遥游社区规范》如群聊疑似违规,可点击举报群聊"
|
|
|
></van-cell> -->
|
|
|
|
|
|
- <div class="fixed bottom-0 left-0 w-full box-border pb-40 pt-16 bg-white px-16">
|
|
|
- <!-- <van-button
|
|
|
+ <div class="fixed bottom-0 left-0 w-full box-border pb-40 pt-16 bg-white px-16">
|
|
|
+ <!-- <van-button
|
|
|
v-if="loading"
|
|
|
round
|
|
|
type="primary"
|
|
@@ -51,18 +53,18 @@
|
|
|
{{ showIsExist ? '立即聊天' : '加入' }}
|
|
|
{{ chageState(itemData?.codeShowStatus)?.text }}
|
|
|
</van-button> -->
|
|
|
- <van-button
|
|
|
- v-model:loading="loading"
|
|
|
- round
|
|
|
- type="primary"
|
|
|
- block
|
|
|
- :color="buttonColor"
|
|
|
- @click="handleQrcode"
|
|
|
- >
|
|
|
- {{ buttonText }}
|
|
|
- </van-button>
|
|
|
+ <van-button
|
|
|
+ v-model:loading="loading"
|
|
|
+ round
|
|
|
+ type="primary"
|
|
|
+ block
|
|
|
+ :color="buttonColor"
|
|
|
+ @click="handleQrcode"
|
|
|
+ >
|
|
|
+ {{ buttonText }}
|
|
|
+ </van-button>
|
|
|
|
|
|
- <!-- <van-button
|
|
|
+ <!-- <van-button
|
|
|
v-if="itemData?.codeShowStatus == 1"
|
|
|
round
|
|
|
type="primary"
|
|
@@ -117,10 +119,17 @@
|
|
|
>
|
|
|
此群已解散
|
|
|
</van-button> -->
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-else>
|
|
|
+ <ChatEmpty image="search" :title="'无法识别二维码'" />
|
|
|
+ </template>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
+import defaultAvatar from '~/assets/img/default_avatar.png'
|
|
|
+
|
|
|
const route = useRoute()
|
|
|
|
|
|
const userInfoStore = useUserInfoStore()
|
|
@@ -129,6 +138,11 @@ const { userInfo } = storeToRefs(userInfoStore)
|
|
|
const itemData = ref({})
|
|
|
const imgUrls = ref([])
|
|
|
const loading = ref(false)
|
|
|
+
|
|
|
+const qrQueryParmars = reactive({
|
|
|
+ success: computed(() => route.query.success), //扫码成功
|
|
|
+ overTime: computed(() => route.query.overTime) //二维码过期与否 true 过期 false 不过期
|
|
|
+})
|
|
|
// 是否存在
|
|
|
const showIsExist = ref(false)
|
|
|
|
|
@@ -158,21 +172,31 @@ async function getGroupInfo() {
|
|
|
|
|
|
if (typeof data == 'object') {
|
|
|
itemData.value = data
|
|
|
- // imgUrls.value = data.groupAvatar ? [] : ['~/assets/img/default_avatar.png']
|
|
|
|
|
|
- if (data.bannedStatus) {
|
|
|
- // showIsExist.value = data?.memberList.some((item) => item?.userId == userInfo.value.userId)
|
|
|
+ data.map((el) => {
|
|
|
+ if (Array.isArray(el?.memberList) && el?.memberList?.length > 0) {
|
|
|
+ imgUrls.value = [...changeHeadImage(el?.userList)]
|
|
|
+ } else {
|
|
|
+ imgUrls.value = [defaultAvatar]
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
- if (showIsExist.value) {
|
|
|
- buttonText.value = '立即聊天'
|
|
|
- buttonColor.value = '#FF9300'
|
|
|
+ if (data.bannedStatus) {
|
|
|
+ if (!qrQueryParmars.overTime) {
|
|
|
+ if (showIsExist.value) {
|
|
|
+ buttonText.value = '立即聊天'
|
|
|
+ buttonColor.value = '#FF9300'
|
|
|
+ } else {
|
|
|
+ buttonText.value = '加入'
|
|
|
+ buttonColor.value = '#FF9300'
|
|
|
+ }
|
|
|
} else {
|
|
|
- buttonText.value = '加入'
|
|
|
- buttonColor.value = '#FF9300'
|
|
|
+ buttonText.value = '二维码已过期'
|
|
|
+ buttonColor.value = '#D9D9D9'
|
|
|
}
|
|
|
} else {
|
|
|
buttonText.value = '此群已解散'
|
|
|
- buttonColor.value = '#FF9300'
|
|
|
+ buttonColor.value = '#D9D9D9'
|
|
|
}
|
|
|
|
|
|
loading.value = false
|
|
@@ -180,6 +204,14 @@ async function getGroupInfo() {
|
|
|
} catch (error) {}
|
|
|
}
|
|
|
|
|
|
+const changeHeadImage = (headerList) => {
|
|
|
+ let headImageList = headerList
|
|
|
+ .slice(0, 9)
|
|
|
+ .map((el) => (el?.headImageUrl ? el?.headImageUrl : defaultAvatar))
|
|
|
+
|
|
|
+ return headImageList
|
|
|
+}
|
|
|
+
|
|
|
// const colorList = ['#FF9300', '#FF9300', '#D9D9D9', '#D9D9D9', '#D9D9D9']
|
|
|
|
|
|
// // 切换状态
|