-
- 1000w
+
+ 第{{index+1}}局:
+ {{ goldCoinCalculation(item.anchorCoinA) }}
-
-
- 10000000000000000w
+
+ 第{{index+1}}局:
+ {{ goldCoinCalculation(item.anchorCoinB) }}
+
@@ -125,9 +128,11 @@ import {
onUpdated, // 组件更新后执行
onUnmounted, // 组件销毁前执行
} from "vue";
-import {getPkRecord} from "@/api/account";
+import {getPkRecord,queryPkDetail} from "@/api/account";
import { ElMessage } from "element-plus";
import {getPromiseStorage } from "@/utils/storage.js";
+import { TimestamptolocalTime } from "@/utils/timeConversion.js";
+import { goldCoinCalculation } from "@/utils/goldCoinCalculation.js";
const user = ref(null); // 用户信息
const refname = ref("");
@@ -146,26 +151,54 @@ const options = [
SelectedIcon: require("@/assets/InvitationSelected.png"),
},
];
-const list = ref([]);
-const page = ref(0);
-const IPKPostedData = ref([]);
-const InvitationData = ref([]);
+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;
+ queryPkDetail({
+ id: item.id,
+ }).then((res) => {
+ fetchDetailPkDataWithId.value = res;
+ });
+}
+//切换选项卡
+function optionsclick(value) {
+ segmentedvalue.value = value;
+ if (value === 1) {
+ list.value = IPKPostedData.value;
+ console.log("我发布的PK",list.value);
+ } else {
+ list.value = InvitationData.value;
+ console.log("我邀请的PK",list.value);
+ }
+}
//获取PK记录列表
-function PkRecord() {
+function PkRecord(type) {
getPkRecord({
- type: segmentedvalue.value,
+ type: type,
userId: user.value.id,
page: page.value,
size: 10,
}).then((res) => {
console.log(res);
- if (segmentedvalue.value === 1) {
+ if (type === 1) {
IPKPostedData.value.push(...res);
- list.value = IPKPostedData.value;
+ if(segmentedvalue.value === type){
+ list.value = IPKPostedData.value;
+ }
}else{
InvitationData.value.push(...res);
- list.value = InvitationData.value;
+ if(segmentedvalue.value === type){
+ list.value = InvitationData.value;
+ }
}
})
}
@@ -178,7 +211,8 @@ onMounted(() => {
getPromiseStorage("user")
.then((res) => {
user.value = res;
- PkRecord();
+ PkRecord(1);
+ PkRecord(2);
})
.catch((err) => {
console.log(err);
@@ -196,6 +230,10 @@ onUnmounted(() => {
.pk-record {
width: 100%;
height: 100%;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
}
.demo-panel {
width: 100%;
@@ -336,6 +374,11 @@ onUnmounted(() => {
transform: scale(1.08);
opacity: 0.8;
}
+.list-content:active {
+ box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
+ transform: scale(1.05);
+ opacity: 0.9;
+}
.vs {
width: 50px;
height: 50px;
@@ -353,6 +396,11 @@ onUnmounted(() => {
border-radius: 50%;
background-color: #fff;
}
+.avatar-img{
+ width: 100%;
+ height: 100%;
+ border-radius: 50%;
+}
.content-left {
width: calc(100% - 150px);
height: 80%;
@@ -556,6 +604,8 @@ onUnmounted(() => {
display: flex;
flex-direction: column;
align-items: center;
+ overflow: auto;
+ scrollbar-width: none; /* Firefox */
}
.goldlist-card-left {
background-color: #dffefc;
@@ -575,10 +625,10 @@ onUnmounted(() => {
line-height: 57px;
font-size: 20px;
font-weight: bold;
- color: #333333;
+ color: #03aba8;
border-radius: 10px;
white-space: nowrap;
- overflow-x: hidden;
+ // overflow-y: hidden;
text-overflow: ellipsis;
}
diff --git a/src/components/mineSubComponent/PKmessage.vue b/src/components/mineSubComponent/PKmessage.vue
index 0d00484..4c00aa6 100644
--- a/src/components/mineSubComponent/PKmessage.vue
+++ b/src/components/mineSubComponent/PKmessage.vue
@@ -616,6 +616,10 @@ watch(refname, async (newQuestion, oldQuestion) => {
.pk-message {
width: 100%;
height: 100%;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
}
.demo-panel {
width: 100%;
diff --git a/src/components/mineSubComponent/PointsList.vue b/src/components/mineSubComponent/PointsList.vue
index 240cd92..4109e03 100644
--- a/src/components/mineSubComponent/PointsList.vue
+++ b/src/components/mineSubComponent/PointsList.vue
@@ -89,6 +89,10 @@ watch(refname, async (newQuestion, oldQuestion) => {
.points-list-container{
width: 100%;
height: 100%;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
}
.points-list{
width: 100%;
diff --git a/src/utils/goeasy.js b/src/utils/goeasy.js
index a550389..8afd20b 100644
--- a/src/utils/goeasy.js
+++ b/src/utils/goeasy.js
@@ -24,6 +24,19 @@ export function goEasyLink(data) {
});
})
}
+//断开IM
+export function goEasyDisConnect() {
+ return new Promise((resolve, reject) => {
+ goeasy.disconnect({
+ onSuccess: function(){
+ resolve(true)
+ },
+ onFailed: function(error){
+ console.log("断开失败, code:"+error.code+ ",error:"+error.content);
+ }
+ });
+ });
+}
//获取会话列表
export function goEasyGetConversations() {
@@ -57,4 +70,106 @@ export function goEasyGetMessages(data) {
}
});
})
+}
+
+//发送文本消息
+export function goEasySendMessage(data) {
+ var im = goeasy.im;
+ let textMessage = im.createTextMessage({
+ text: data.text, //消息内容
+ to: {
+ type: GoEasy.IM_SCENE.PRIVATE, //私聊还是群聊,群聊为GoEasy.IM_SCENE.GROUP
+ id: data.id, //接收方用户id
+ data: {"avatar": data.avatar, "nickname": data.nickname} //接收方用户扩展数据, 任意格式的字符串或者对象,用于更新会话列表conversation.data
+ }
+ });
+ return new Promise((resolve, reject) => {
+ im.sendMessage({
+ message: textMessage,
+ onSuccess: function () { //发送成功
+ resolve(textMessage);
+ },
+ onFailed: function (error) { //发送失败
+ console.log('Failed to send private message,code:' + error.code + ' ,error ' + error.content);
+ }
+ });
+ })
+}
+
+//发送图片消息
+export function goEasySendImageMessage(data) {
+ var im = goeasy.im;
+ var message = im.createImageMessage({
+ file: data.imagefile, //H5获得的图片file对象,Uniapp和小程序调用chooseImage,success时得到的res.tempFiles数组中的元素,比如res.tempFiles[0]即为选择的第一张图片
+ to: {
+ type: GoEasy.IM_SCENE.PRIVATE, //私聊还是群聊,群聊为GoEasy.IM_SCENE.GROUP
+ id: data.id, //接收方用户id
+ data: {"avatar": data.avatar, "nickname": data.nickname} //好友扩展数据, 任意格式的字符串或者对象,用于更新会话列表conversation.data
+ },
+ });
+ return new Promise((resolve, reject) => {
+ im.sendMessage({
+ message: message,
+ onSuccess: function () { //发送成功
+ resolve(message);
+ },
+ onFailed: function (error) { //发送失败
+ console.log('Failed to send message,code:' + error.code + ',error' + error.content);
+ }
+ })
+ })
+}
+//发送PK消息
+export function goEasySendPKMessage(data) {
+ var im = goeasy.im;
+ const customData = {
+ id: data.msgid,
+ pkIdA: data.pkIdA,
+ pkIdB: data.pkIdB,
+ };
+
+ let order = {
+ customData: customData,
+ link: "https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/pk.png",
+ text: "PK邀请消息",
+ };
+
+ var customMessage = im.createCustomMessage({
+ type: 'pk', //字符串,可以任意自定义类型,比如红包'hongbao', 订单'order,处方'chufang'
+ payload: order,
+ to: {
+ type: GoEasy.IM_SCENE.PRIVATE, //私聊还是群聊,群聊为GoEasy.IM_SCENE.GROUP
+ id: data.id, //接收方用户id
+ data: {"avatar": data.avatar, "nickname": data.nickname} //好友扩展数据, 任意格式的字符串或者对象,用于更新会话列表conversation.data
+ }
+ });
+
+ return new Promise((resolve, reject) => {
+ im.sendMessage({
+ message: customMessage,
+ onSuccess: function () { //发送成功
+ resolve(customMessage);
+ },
+ onFailed: function (error) { //发送失败
+ console.log('Failed to send message,code:' + error.code + ',error' + error.content);
+ }
+ });
+ })
+
+}
+//消息已读
+export function goEasyMessageRead(data) {
+ var im = goeasy.im;
+ return new Promise((resolve, reject) => {
+ im.markMessageAsRead({
+ id: data.id,
+ type: GoEasy.IM_SCENE.PRIVATE,
+ onSuccess: function () {
+ resolve(true);
+ },
+ onFailed: function (error) {
+ console.log('标记私聊已读失败', error);
+ },
+ });
+ })
}
\ No newline at end of file
diff --git a/src/utils/goldCoinCalculation.js b/src/utils/goldCoinCalculation.js
new file mode 100644
index 0000000..753e4e4
--- /dev/null
+++ b/src/utils/goldCoinCalculation.js
@@ -0,0 +1,19 @@
+export function goldCoinCalculation(goldCoins) {
+ if (goldCoins === null || goldCoins === undefined) {
+ return "";
+ }
+ if (goldCoins < 1000) {
+ return String(goldCoins);
+ }
+ if (goldCoins >= 1000000) {
+ return "1M+";
+ }
+ const kValue = goldCoins / 1000;
+ const formattedString = kValue.toFixed(2); // 确保至少保留两位小数
+ const matchResult = formattedString.match(/^\d+\.\d{0,2}/);
+ if (matchResult === null) {
+ return kValue.toFixed(2) + "k"; // 确保至少保留两位小数
+ }
+ const formatted = matchResult[0];
+ return `${formatted}k`;
+}
\ No newline at end of file
diff --git a/src/utils/timeDisplay.js b/src/utils/timeDisplay.js
new file mode 100644
index 0000000..3b81726
--- /dev/null
+++ b/src/utils/timeDisplay.js
@@ -0,0 +1,22 @@
+// 记录上次调用时间
+let lastTimestamp = null;
+
+/**
+ * 比较时间戳是否超过5分钟
+ * @param {number} timestamp - 要比较的时间戳(毫秒)
+ * @returns {boolean} - 是否超过5分钟或第一次调用
+ */
+export function timeDisplay(timestamp) {
+ // 第一次调用直接返回true
+ if (lastTimestamp === null) {
+ lastTimestamp = timestamp;
+ return true;
+ }
+
+ // 计算时间差(毫秒)
+ const timeDiff = Math.abs(timestamp - lastTimestamp);
+ lastTimestamp = timestamp;
+
+ // 5分钟 = 300,000毫秒
+ return timeDiff > 300000;
+}
diff --git a/src/views/ActivateEmail.vue b/src/views/ActivateEmail.vue
index d0bc861..4a9bdb0 100644
--- a/src/views/ActivateEmail.vue
+++ b/src/views/ActivateEmail.vue
@@ -68,6 +68,10 @@ onUnmounted(() => {
flex-direction: column;
justify-content: center;
align-items: center;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
}
.activate-email-content{
font-size: 30px;
diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue
index 58cce23..ea6813a 100644
--- a/src/views/HomeView.vue
+++ b/src/views/HomeView.vue
@@ -26,6 +26,7 @@
class="input-text"
v-model="refEmail"
placeholder="请输入邮箱或用户名"
+ @keydown.enter.native="EmailLogin"
/>
@@ -38,6 +39,7 @@
v-model="refpassword"
show-password
placeholder="请输入密码"
+ @keydown.enter.native="EmailLogin"
/>
@@ -200,6 +202,10 @@ onUnmounted(() => {
flex-direction: column;
justify-content: center;
align-items: center;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
}
.login {
width: 627px;
diff --git a/src/views/emailRegistration.vue b/src/views/emailRegistration.vue
index b87a4bc..462d8b6 100644
--- a/src/views/emailRegistration.vue
+++ b/src/views/emailRegistration.vue
@@ -178,6 +178,10 @@ onUnmounted(() => {
flex-direction: column;
justify-content: center;
align-items: center;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
}
.stepBar {
width: 900px;
diff --git a/src/views/hosts/Forum.vue b/src/views/hosts/Forum.vue
index 4a33ada..352ab86 100644
--- a/src/views/hosts/Forum.vue
+++ b/src/views/hosts/Forum.vue
@@ -61,6 +61,10 @@ onUnmounted(() => {
display: flex;
justify-content: center;
align-items: center;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
}
.infinite-list {
width: 90%;
diff --git a/src/views/hosts/Message.vue b/src/views/hosts/Message.vue
index 2091971..5e97aa1 100644
--- a/src/views/hosts/Message.vue
+++ b/src/views/hosts/Message.vue
@@ -41,12 +41,22 @@