From d902254bf698d7147ef7ac074217363afb0b6a00 Mon Sep 17 00:00:00 2001 From: pengxiaolong <15716207+pengxiaolong711@user.noreply.gitee.com> Date: Thu, 21 Aug 2025 14:57:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Appaside.vue | 7 +- src/components/mineSubComponent/PKRecord.vue | 120 +++++++++++++----- src/components/mineSubComponent/PKmessage.vue | 4 +- src/views/hosts/pk.vue | 71 ++++++++--- 4 files changed, 145 insertions(+), 57 deletions(-) diff --git a/src/components/Appaside.vue b/src/components/Appaside.vue index fc0f03b..60f5eeb 100644 --- a/src/components/Appaside.vue +++ b/src/components/Appaside.vue @@ -397,7 +397,6 @@ const chatList = ref({ //监听会话消息 function onConversationsUpdated(conversations) { chatList.value = conversations; - console.log(chatList.value); } //获取会话列表 function getChatList() { @@ -539,7 +538,6 @@ const handleAvatarSuccess = ( uploadFile ) => { avatar.value = URL.createObjectURL(uploadFile.raw) - console.log(info.value); editUserInfo({ id: info.value.id, headerIcon: response.data.filename, @@ -759,7 +757,6 @@ onMounted(() => { }); getPromiseStorage('user').then(res => { info.value = res; - console.log(res); avatar.value = info.value.headerIcon; getAnchorLibrary() UserInfo(); @@ -821,6 +818,10 @@ onUnmounted(() => { .Avatar-content{ width: 100%; height: 250px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } .Avatar-content-name{ width: 100%; diff --git a/src/components/mineSubComponent/PKRecord.vue b/src/components/mineSubComponent/PKRecord.vue index e587b41..d9c15ad 100644 --- a/src/components/mineSubComponent/PKRecord.vue +++ b/src/components/mineSubComponent/PKRecord.vue @@ -30,14 +30,24 @@
-
+
- +
{{ item.anchorIdA }}
-
PK时间:{{ TimestamptolocalTime(item.pkTime*1000) }}
+
+ PK时间:{{ TimestamptolocalTime(item.pkTime * 1000) }} +
实际金币数: -
{{ goldCoinCalculation(item.userACoins) }}
+
+ {{ goldCoinCalculation(item.userACoins) }} +
@@ -59,19 +71,23 @@
{{ item.anchorIdB }}
-
PK时间:{{ TimestamptolocalTime(item.pkTime*1000) }}
-
+
+ PK时间:{{ TimestamptolocalTime(item.pkTime * 1000) }} +
+
实际金币数: -
{{ goldCoinCalculation(item.userBCoins) }}
+
+ {{ goldCoinCalculation(item.userBCoins) }} +
- +
@@ -83,37 +99,64 @@
- - + +
-
总共:{{ goldCoinCalculation(selectedData.userACoins) }}
+
+ 总共:{{ goldCoinCalculation(selectedData.userACoins) }} +
-
总共:{{ goldCoinCalculation(selectedData.userBCoins) }}
+
+ 总共:{{ goldCoinCalculation(selectedData.userBCoins) }} +
-
- 第{{index+1}}局: +
+ 第{{ index + 1 }}局: {{ goldCoinCalculation(item.anchorCoinA) }}
-
- 第{{index+1}}局: +
+ 第{{ index + 1 }}局: {{ goldCoinCalculation(item.anchorCoinB) }}
- +
+
+
右方选择记录立即查看详情
@@ -128,9 +171,9 @@ import { onUpdated, // 组件更新后执行 onUnmounted, // 组件销毁前执行 } from "vue"; -import {getPkRecord,queryPkDetail} from "@/api/account"; +import { getPkRecord, queryPkDetail } from "@/api/account"; import { ElMessage } from "element-plus"; -import {getPromiseStorage } from "@/utils/storage.js"; +import { getPromiseStorage } from "@/utils/storage.js"; import { TimestamptolocalTime } from "@/utils/timeConversion.js"; import { goldCoinCalculation } from "@/utils/goldCoinCalculation.js"; @@ -151,14 +194,13 @@ const options = [ SelectedIcon: require("@/assets/InvitationSelected.png"), }, ]; -const list = ref([]);// PK记录列表 -const page = ref(0);// 页数 -const IPKPostedData = ref([]);//我发布的PK -const InvitationData = ref([]);//我邀请的PK +const list = ref([]); // PK记录列表 +const page = ref(0); // 页数 +const IPKPostedData = ref([]); //我发布的PK +const InvitationData = ref([]); //我邀请的PK const selectedData = ref(null); //被选中的PK数据 const fetchDetailPkDataWithId = ref([]); // PK详情数据 - //选中PK数据 function detail(item) { selectedData.value = item; @@ -171,12 +213,13 @@ function detail(item) { //切换选项卡 function optionsclick(value) { segmentedvalue.value = value; + selectedData.value = null; if (value === 1) { list.value = IPKPostedData.value; - console.log("我发布的PK",list.value); + console.log("我发布的PK", list.value); } else { list.value = InvitationData.value; - console.log("我邀请的PK",list.value); + console.log("我邀请的PK", list.value); } } @@ -191,16 +234,16 @@ function PkRecord(type) { console.log(res); if (type === 1) { IPKPostedData.value.push(...res); - if(segmentedvalue.value === type){ + if (segmentedvalue.value === type) { list.value = IPKPostedData.value; } - }else{ + } else { InvitationData.value.push(...res); - if(segmentedvalue.value === type){ + if (segmentedvalue.value === type) { list.value = InvitationData.value; } } - }) + }); } // 加载更多 @@ -242,6 +285,19 @@ onUnmounted(() => { flex-direction: column; align-items: center; } +.notdata { + width: 99%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + border-left: #03aba8 solid 1px; +} +.chatNotDeta-text { + font-size: 20px; + color: #03aba8; + font-weight: bold; +} .custom-style { width: 90%; height: 150px; @@ -396,7 +452,7 @@ onUnmounted(() => { border-radius: 50%; background-color: #fff; } -.avatar-img{ +.avatar-img { width: 100%; height: 100%; border-radius: 50%; @@ -615,7 +671,7 @@ onUnmounted(() => { background-color: #fbece9; border: 1px solid #f4d0c9; } -.goldlist-list{ +.goldlist-list { width: 85%; padding-left: 2.5%; padding-right: 2.5%; diff --git a/src/components/mineSubComponent/PKmessage.vue b/src/components/mineSubComponent/PKmessage.vue index 4c00aa6..5a22685 100644 --- a/src/components/mineSubComponent/PKmessage.vue +++ b/src/components/mineSubComponent/PKmessage.vue @@ -877,7 +877,7 @@ watch(refname, async (newQuestion, oldQuestion) => { resize: none; } .Confirm { - width: 400px; + width: 300px; height: 50px; margin-top: 40px; text-align: center; @@ -898,7 +898,7 @@ watch(refname, async (newQuestion, oldQuestion) => { opacity: 0.8; } .Reset { - width: 400px; + width: 300px; height: 50px; margin-top: 30px; text-align: center; diff --git a/src/views/hosts/pk.vue b/src/views/hosts/pk.vue index 2be37d3..f4c2a9d 100644 --- a/src/views/hosts/pk.vue +++ b/src/views/hosts/pk.vue @@ -191,8 +191,8 @@ -
-
+
+
{{ info.nickName }}
@@ -272,7 +272,7 @@
-
+
@@ -317,6 +317,11 @@
+
+
+ 右方选择主播立即聊天 +
+
@@ -788,7 +793,6 @@ function reminderDialogConfirm() { nickname: info.value.nickName, }; goEasySendPKMessage(data).then((res) => { - console.log(res); messageslist.value.push(res); reminder.value = false; resets(); @@ -885,17 +889,14 @@ function handleClick(time) { handleClickdata.value = time; isPage.value = true; messageRead(); - console.log(time); getUserInfo({ id: handleClickdata.value.senderId, }).then((res) => { - console.log(res); info.value = res; goEasyGetMessages({ id: String(handleClickdata.value.senderId), timestamp: null, }).then((res) => { - console.log(res); messageslist.value = res; nextTick(() => { if (chatlistContainer.value) { @@ -993,14 +994,19 @@ function scrollHandler() { // 获取pk列表 -function PkList(body) { +function PkList(body,type) { + console.log("body", body); getPkList(body).then((res) => { + console.log("res", res); + if (type == "load" && res.length == []) { + page.value--; + } if (body.condition.type == 2 || body.condition.type == undefined) { HallList.value.push(...res); if (PKistodayorhall.value) { list.value = HallList.value; } - } else { + } else if (body.condition.type == 1) { TodayList.value.push(...res); if (!PKistodayorhall.value) { list.value = TodayList.value; @@ -1008,13 +1014,13 @@ function PkList(body) { } }); } + // 加载更多 function load() { - page.value++; if (searchStatus.value) { const body = { status: 0, - page: page.value, + page: page.value++, size: 10, userId: user.value.id, condition: {}, @@ -1023,7 +1029,7 @@ function load() { if (PKistodayorhall.value) { body.condition.type = 2; } else { - body.condition.type = 2; + body.condition.type = 1; } } else { if (PKistodayorhall.value) { @@ -1065,7 +1071,7 @@ function load() { } else { const body = { status: 0, - page: page.value, + page: page.value++, size: 10, userId: user.value.id, condition: {}, @@ -1074,7 +1080,7 @@ function load() { if (PKistodayorhall.value) { body.condition.type = 2; } else { - body.condition.type = 2; + body.condition.type = 1; } } else { if (PKistodayorhall.value) { @@ -1082,7 +1088,7 @@ function load() { body.condition.type = 1; } } - PkList(body); + PkList(body,"load"); } } @@ -1090,6 +1096,7 @@ function load() { function Switch() { searchStatus.value = false; PKistodayorhall.value = !PKistodayorhall.value; + handleClickdata.value = null; if (PKistodayorhall.value) { list.value = HallList.value; } else { @@ -1099,17 +1106,19 @@ function Switch() { //搜索按钮 function search(data) { + handleClickdata.value = null; const body = { status: 0, size: 10, userId: user.value.id, condition: {}, }; + if (timevalue.value == null) { if (PKistodayorhall.value) { body.condition.type = 2; } else { - body.condition.type = 2; + body.condition.type = 1; } } else { if (PKistodayorhall.value) { @@ -1117,6 +1126,7 @@ function search(data) { body.condition.type = 1; } } + if (countryvalue.value != null) { body.condition.country = countryvalue.value; } @@ -1147,11 +1157,13 @@ function search(data) { end: timevalue.value[1] / 1000, }; } - if (PKistodayorhall) { + + if (PKistodayorhall.value) { HallList.value = []; } else { TodayList.value = []; } + body.page = 0; page.value = 0; list.value = []; @@ -1161,7 +1173,9 @@ function search(data) { searchStatus.value = true; } PkList(body); + page.value = 1; } + //重置按钮 function reset() { searchStatus.value = false; @@ -1204,7 +1218,7 @@ onMounted(() => { user.value = res; PkList({ status: 0, - page: 1, + page: 0, size: 10, userId: user.value.id, condition: { @@ -1213,13 +1227,14 @@ onMounted(() => { }); PkList({ status: 0, - page: 1, + page: 0, size: 10, userId: user.value.id, condition: { type: 2, }, }); + page.value = 1; }) .catch((err) => { console.log(err); @@ -1396,7 +1411,8 @@ onBeforeUnmount(() => { .infinite-list { width: 100%; height: 100%; - border-radius: 16px; + border-top-left-radius: 16px; + border-bottom-right-radius: 16px; background-color: #ffffff; } .infinite-list-item { @@ -1519,6 +1535,21 @@ onBeforeUnmount(() => { border-top-right-radius: 16px; border-left: 1px solid #03aba82f; } +.chatNotDeta{ + width: 100%; + height: 100%; + background-color: #ffffff; + display: flex; + justify-content: center; + align-items: center; + border-top-right-radius: 16px; + border-left: 1px solid #03aba82f; +} +.chatNotDeta-text{ + font-size: 20px; + color: #03aba8; + font-weight: bold; +} .chat-name { width: 100%; height: 50px;