优化代码
This commit is contained in:
36
src/App.vue
36
src/App.vue
@@ -6,24 +6,24 @@
|
||||
|
||||
<script>
|
||||
|
||||
const debounce = (fn, delay) => {
|
||||
let timer
|
||||
return (...args) => {
|
||||
if (timer) {
|
||||
clearTimeout(timer)
|
||||
}
|
||||
timer = setTimeout(() => {
|
||||
fn(...args)
|
||||
}, delay)
|
||||
}
|
||||
}
|
||||
const _ResizeObserver = window.ResizeObserver
|
||||
window.ResizeObserver = class ResizeObserver extends _ResizeObserver {
|
||||
constructor(callback) {
|
||||
callback = debounce(callback, 200)
|
||||
super(callback)
|
||||
}
|
||||
}
|
||||
// const debounce = (fn, delay) => {
|
||||
// let timer
|
||||
// return (...args) => {
|
||||
// if (timer) {
|
||||
// clearTimeout(timer)
|
||||
// }
|
||||
// timer = setTimeout(() => {
|
||||
// fn(...args)
|
||||
// }, delay)
|
||||
// }
|
||||
// }
|
||||
// const _ResizeObserver = window.ResizeObserver
|
||||
// window.ResizeObserver = class ResizeObserver extends _ResizeObserver {
|
||||
// constructor(callback) {
|
||||
// callback = debounce(callback, 200)
|
||||
// super(callback)
|
||||
// }
|
||||
// }
|
||||
</script>
|
||||
<style lang="less">
|
||||
@import "@/static/css/app.less";
|
||||
|
||||
@@ -157,4 +157,12 @@ export function forgetPassword(data) {
|
||||
//重设密码
|
||||
export function resetPassword(data) {
|
||||
return postAxios({ url: 'user/resetPassword', data })
|
||||
}
|
||||
//激活邮箱
|
||||
export function activeEmail(data) {
|
||||
return getAxios({ url: 'user/activate?token=' + data})
|
||||
}
|
||||
//验证账号
|
||||
export function checkAccount(data) {
|
||||
return getAxios({ url: 'user/verificationMail?token=' + data})
|
||||
}
|
||||
@@ -397,12 +397,32 @@ const chatList = ref({
|
||||
//监听会话消息
|
||||
function onConversationsUpdated(conversations) {
|
||||
chatList.value = conversations;
|
||||
if (chatList.value.unreadTotal != 0) {
|
||||
initNotification();
|
||||
}
|
||||
}
|
||||
//谷歌通知提醒
|
||||
function initNotification() {
|
||||
if (Notification.permission !== "granted") {
|
||||
Notification.requestPermission().then(showNotification);
|
||||
} else {
|
||||
showNotification();
|
||||
}
|
||||
}
|
||||
|
||||
function showNotification() {
|
||||
new Notification("新消息到达", {
|
||||
body: "您有 "+ chatList.value.unreadTotal +" 封未读消息",
|
||||
lang: "zh-CN", // 语言
|
||||
// onClick: () => window.location.href = "/nav/Message",
|
||||
});
|
||||
}
|
||||
|
||||
//获取会话列表
|
||||
function getChatList() {
|
||||
goEasyGetConversations().then((res) => {
|
||||
chatList.value = res.content;
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
|
||||
//重发邮箱验证
|
||||
@@ -416,7 +436,7 @@ function ResendEmail() {
|
||||
}).then(res => {
|
||||
isResendEmail.value = 1;
|
||||
setInterval(startCountdown, 1000);
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
|
||||
//修改新邮箱
|
||||
@@ -442,7 +462,7 @@ function changeEmail() {
|
||||
ElMessage.success("修改成功,请至新邮箱中验证邮箱");
|
||||
emailVisible.value = false;
|
||||
UserInfo();
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
|
||||
//获取验证码
|
||||
@@ -456,7 +476,7 @@ function sendEmail() {
|
||||
}).then(res => {
|
||||
isSendEmail.value = 1;
|
||||
setInterval(startCountdown, 1000);
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
|
||||
function startCountdown() {
|
||||
@@ -516,7 +536,7 @@ function changePassword() {
|
||||
}).then(res => {
|
||||
passwordVisible.value = false;
|
||||
ElMessage.success("修改成功");
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
//修改昵称
|
||||
function handleNickNameChange() {
|
||||
@@ -527,7 +547,7 @@ function handleNickNameChange() {
|
||||
setStorage("user", res);
|
||||
ElMessage.success("修改成功");
|
||||
UserInfo();
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
// 上传头像
|
||||
const headers = {
|
||||
@@ -545,7 +565,7 @@ const handleAvatarSuccess = (
|
||||
setStorage("user", res);
|
||||
ElMessage.success("修改成功");
|
||||
UserInfo();
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
|
||||
const beforeAvatarUpload = (rawFile) => {
|
||||
@@ -671,7 +691,7 @@ function getAnchorLibrary() {
|
||||
}
|
||||
).then(res => {
|
||||
anchorLibrary.value = res;
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
|
||||
//侧边导航
|
||||
@@ -716,8 +736,8 @@ function popoverClick(id) {
|
||||
clearStorage("user")
|
||||
clearStorage("token")
|
||||
clearStorage("activeId")
|
||||
})
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -727,7 +747,7 @@ function setsignIn() {
|
||||
userId: info.value.id,
|
||||
}).then(res => {
|
||||
ElMessage.success("签到成功");
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
|
||||
//获取用户数据
|
||||
@@ -743,7 +763,7 @@ function UserInfo() {
|
||||
if (info.value.mailVerification == 1) {
|
||||
ElMessage.error("邮箱未验证,请至设置验证邮箱,如果已经验证请刷新页面");
|
||||
}
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
|
||||
const refname = ref('');
|
||||
@@ -754,13 +774,13 @@ watch(refname, async (newQuestion, oldQuestion) => {
|
||||
onMounted(() => {
|
||||
getPromiseStorage('activeId').then(res => {
|
||||
activeId.value = res || 1;
|
||||
});
|
||||
}).catch((err) => {});
|
||||
getPromiseStorage('user').then(res => {
|
||||
info.value = res;
|
||||
avatar.value = info.value.headerIcon;
|
||||
getAnchorLibrary()
|
||||
UserInfo();
|
||||
});
|
||||
}).catch((err) => {});
|
||||
|
||||
setTimeout(() => {
|
||||
getChatList();
|
||||
|
||||
@@ -209,7 +209,7 @@ function agreedialogConfirm(){
|
||||
ElMessage.success("同意成功");
|
||||
PkIDInfodata.value.pkStatus = 1;
|
||||
agreedialog.value = false
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
|
||||
//确认拒绝
|
||||
@@ -221,7 +221,7 @@ function refusedialogConfirm(){
|
||||
ElMessage.success("拒绝成功");
|
||||
PkIDInfodata.value.pkStatus = 2;
|
||||
refusedialog.value = false
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
|
||||
//同意邀请
|
||||
@@ -244,7 +244,7 @@ watch(
|
||||
}).then((res) => {
|
||||
PkIDInfodata.value = res;
|
||||
console.log("PkIDInfodata", res);
|
||||
});
|
||||
}).catch((err) => {});
|
||||
pkArticleDetail({
|
||||
id: newVal.payload.customData.pkIdA,
|
||||
userId: info.value.id,
|
||||
@@ -252,7 +252,7 @@ watch(
|
||||
}).then((res) => {
|
||||
ArticleDetailsA.value = res;
|
||||
console.log("ArticleDetailsA", res);
|
||||
});
|
||||
}).catch((err) => {});
|
||||
pkArticleDetail({
|
||||
id: newVal.payload.customData.pkIdB,
|
||||
userId: info.value.id,
|
||||
@@ -260,7 +260,7 @@ watch(
|
||||
}).then((res) => {
|
||||
ArticleDetailsB.value = res;
|
||||
console.log("ArticleDetailsB", res);
|
||||
});
|
||||
}).catch((err) => {});
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
@@ -268,7 +268,7 @@ watch(
|
||||
onMounted(() => {
|
||||
getPromiseStorage("user").then((res) => {
|
||||
info.value = res;
|
||||
});
|
||||
}).catch((err) => {});
|
||||
});
|
||||
onUpdated(() => {
|
||||
// 组件更新后执行
|
||||
|
||||
@@ -192,7 +192,7 @@ function agreedialogConfirm() {
|
||||
ElMessage.success("同意成功");
|
||||
PkIDInfodata.value.pkStatus = 1;
|
||||
agreedialog.value = false;
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
|
||||
//确认拒绝
|
||||
@@ -204,7 +204,7 @@ function refusedialogConfirm() {
|
||||
ElMessage.success("拒绝成功");
|
||||
PkIDInfodata.value.pkStatus = 2;
|
||||
refusedialog.value = false;
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
|
||||
//同意邀请
|
||||
@@ -227,7 +227,7 @@ watch(
|
||||
}).then((res) => {
|
||||
PkIDInfodata.value = res;
|
||||
console.log("PkIDInfodata", res);
|
||||
});
|
||||
}).catch((err) => {});
|
||||
pkArticleDetail({
|
||||
id: newVal.payload.customData.pkIdA,
|
||||
userId: info.value.id,
|
||||
@@ -235,7 +235,7 @@ watch(
|
||||
}).then((res) => {
|
||||
ArticleDetailsA.value = res;
|
||||
console.log("ArticleDetailsA", res);
|
||||
});
|
||||
}).catch((err) => {});
|
||||
pkArticleDetail({
|
||||
id: newVal.payload.customData.pkIdB,
|
||||
userId: info.value.id,
|
||||
@@ -243,7 +243,7 @@ watch(
|
||||
}).then((res) => {
|
||||
ArticleDetailsB.value = res;
|
||||
console.log("ArticleDetailsB", res);
|
||||
});
|
||||
}).catch((err) => {});
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
@@ -251,7 +251,7 @@ watch(
|
||||
onMounted(() => {
|
||||
getPromiseStorage("user").then((res) => {
|
||||
info.value = res;
|
||||
});
|
||||
}).catch((err) => {});
|
||||
});
|
||||
onUpdated(() => {
|
||||
// 组件更新后执行
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
class="anchor-library-list"
|
||||
style="overflow: auto"
|
||||
v-infinite-scroll="load"
|
||||
v-if="list.length !== 0"
|
||||
>
|
||||
<div class="anchor-library-card" v-for="(item, index) in list" :key="index">
|
||||
<div class="card-content">
|
||||
@@ -46,6 +47,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="chatNotDeta" v-if="list.length === 0">
|
||||
<div class="chatNotDeta-text">您还没有主播,快去添加吧!</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-splitter-panel>
|
||||
<el-splitter-panel size="25%" :collapsible="true" :resizable="false">
|
||||
@@ -102,7 +106,8 @@
|
||||
</el-splitter>
|
||||
</div>
|
||||
<!-- 确认删除弹窗 -->
|
||||
<el-dialog center
|
||||
<el-dialog
|
||||
center
|
||||
class="center-dialog"
|
||||
v-model="centerDialogVisible"
|
||||
title="提示"
|
||||
@@ -147,7 +152,7 @@ const genderOptions = [
|
||||
const gendervalue = ref(null); // 性别值
|
||||
const countryvalue = ref(null); //国家
|
||||
const anchorName = ref(null); // 主播名称
|
||||
const list = ref([{}, {}, {}, {}, {}, {}]);
|
||||
const list = ref([]);
|
||||
const user = ref(null); // 用户信息
|
||||
const AnchorProfilePicture = ref(null); // 主播头像
|
||||
const centerDialogVisible = ref(false); // 确认删除弹窗
|
||||
@@ -189,11 +194,13 @@ function cancel() {
|
||||
// 删除主播
|
||||
const deleteAnchorID = ref(null);
|
||||
const deleteAnchor = () => {
|
||||
delAnchor({ id: deleteAnchorID.value }).then((res) => {
|
||||
centerDialogVisible.value = false;
|
||||
ElMessage.success("删除成功");
|
||||
AnchorList();
|
||||
});
|
||||
delAnchor({ id: deleteAnchorID.value })
|
||||
.then((res) => {
|
||||
centerDialogVisible.value = false;
|
||||
ElMessage.success("删除成功");
|
||||
AnchorList();
|
||||
})
|
||||
.catch((err) => {});
|
||||
};
|
||||
function anchordelete(id) {
|
||||
deleteAnchorID.value = id;
|
||||
@@ -320,6 +327,19 @@ onUnmounted(() => {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.chatNotDeta{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #ffffff;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.chatNotDeta-text{
|
||||
font-size: 20px;
|
||||
color: #03aba8;
|
||||
font-weight: bold;
|
||||
}
|
||||
.anchor-library-card {
|
||||
width: 100%;
|
||||
height: 150px;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- list -->
|
||||
<div class="list" style="overflow: auto" v-infinite-scroll="load">
|
||||
<div class="list" style="overflow: auto" v-infinite-scroll="load" v-if="list.length !== 0">
|
||||
<div v-for="(item, index) in list" :key="index" class="list-item">
|
||||
<div
|
||||
class="list-content"
|
||||
@@ -93,6 +93,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="chatNotDeta"v-if="list.length === 0">
|
||||
<div class="chatNotDeta-text">您还没有PK记录</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-splitter-panel>
|
||||
|
||||
@@ -208,7 +211,7 @@ function detail(item) {
|
||||
id: item.id,
|
||||
}).then((res) => {
|
||||
fetchDetailPkDataWithId.value = res;
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
//切换选项卡
|
||||
function optionsclick(value) {
|
||||
@@ -243,7 +246,7 @@ function PkRecord(type) {
|
||||
list.value = InvitationData.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
|
||||
// 加载更多
|
||||
@@ -404,6 +407,19 @@ onUnmounted(() => {
|
||||
width: 100%;
|
||||
height: calc(100% -150px);
|
||||
}
|
||||
.chatNotDeta{
|
||||
width: 100%;
|
||||
height: calc(100% -150px);
|
||||
background-color: #ffffff;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.chatNotDeta-text{
|
||||
font-size: 20px;
|
||||
color: #03aba8;
|
||||
font-weight: bold;
|
||||
}
|
||||
.list-item {
|
||||
width: 100%;
|
||||
height: 150px;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
class="anchor-library-list"
|
||||
style="overflow: auto"
|
||||
v-infinite-scroll="load"
|
||||
v-if="list.length !== 0"
|
||||
>
|
||||
<div class="anchor-library-card" v-for="(item, index) in list" :key="index">
|
||||
<div class="card-content">
|
||||
@@ -85,6 +86,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="chatNotDeta" v-if="list.length === 0">
|
||||
<div class="chatNotDeta-text">您还没有PK信息,快去添加吧!</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-splitter-panel>
|
||||
<el-splitter-panel size="25%" :resizable="false" collapsible>
|
||||
@@ -342,7 +346,7 @@ function getMyAnchorLibrary() {
|
||||
getAnchorList({ id: user.value.id }).then((res) => {
|
||||
console.log("anchorLibrary", res);
|
||||
anchorLibrary.value = res;
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
// 置顶or取消置顶
|
||||
function topPosition(item) {
|
||||
@@ -371,7 +375,7 @@ function topPositionstateConfirm() {
|
||||
list.value = [];
|
||||
page.value = 0;
|
||||
PKInfo();
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
|
||||
// 确认取消置顶
|
||||
@@ -382,7 +386,7 @@ function cancelTopPositionstateConfirm() {
|
||||
list.value = [];
|
||||
page.value = 0;
|
||||
PKInfo();
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
|
||||
//计算置顶时长
|
||||
@@ -449,7 +453,7 @@ function deleteAnchor() {
|
||||
list.value = [];
|
||||
page.value = 0;
|
||||
PKInfo();
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
|
||||
// 确认发布
|
||||
@@ -508,7 +512,7 @@ function Confirm() {
|
||||
page.value = 0;
|
||||
PKInfo();
|
||||
cancel();
|
||||
});
|
||||
}).catch((err) => {});
|
||||
} else {
|
||||
releasePkInfo({
|
||||
anchorId: anchorName.value,
|
||||
@@ -585,7 +589,7 @@ function PKInfo() {
|
||||
}).then((res) => {
|
||||
console.log("list", res);
|
||||
list.value.push(...res);
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
|
||||
// 组件挂载完成后执行
|
||||
@@ -629,6 +633,19 @@ watch(refname, async (newQuestion, oldQuestion) => {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.chatNotDeta{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #ffffff;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.chatNotDeta-text{
|
||||
font-size: 20px;
|
||||
color: #03aba8;
|
||||
font-weight: bold;
|
||||
}
|
||||
.anchor-library-card {
|
||||
width: 100%;
|
||||
height: 150px;
|
||||
|
||||
@@ -1,36 +1,35 @@
|
||||
<template>
|
||||
<!-- 积分列表 -->
|
||||
<!-- 积分列表 -->
|
||||
<div class="points-list-container">
|
||||
<div class="points-list-title">
|
||||
<img
|
||||
class="points-icon"
|
||||
src="@/assets/Points.png"
|
||||
mode="scaleToFill"
|
||||
/>
|
||||
<div class="points-text">
|
||||
我的积分:{{ user.points }}
|
||||
<div class="points-alwaysnum">
|
||||
|
||||
<img class="points-icon" src="@/assets/Points.png" mode="scaleToFill" />
|
||||
<div class="points-text">
|
||||
我的积分:{{ user.points }}
|
||||
<div class="points-alwaysnum"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="points-list" style="overflow: auto;">
|
||||
<div class="points-list-item" v-for="(item, index) in pointsList" :key="index">
|
||||
<div class="points-list-content" :style="{background: item.status == 1 ? '#DFFEFC':'#FBECE9'}">
|
||||
<div class="Event">
|
||||
{{ item.info }}
|
||||
</div>
|
||||
<div class="points-num">
|
||||
{{ item.number }}
|
||||
</div>
|
||||
<div class="time">
|
||||
{{TimestamptolocalTime(item.time*1000) }}
|
||||
<div class="points-list" style="overflow: auto" v-if="pointsList.length !== 0">
|
||||
<div class="points-list-item" v-for="(item, index) in pointsList" :key="index">
|
||||
<div
|
||||
class="points-list-content"
|
||||
:style="{ background: item.status == 1 ? '#DFFEFC' : '#FBECE9' }"
|
||||
>
|
||||
<div class="Event">
|
||||
{{ item.info }}
|
||||
</div>
|
||||
<div class="points-num">
|
||||
{{ item.number }}
|
||||
</div>
|
||||
<div class="time">
|
||||
{{ TimestamptolocalTime(item.time * 1000) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="chatNotDeta" v-if="pointsList.length === 0">
|
||||
<div class="chatNotDeta-text">您还没有积分记录!</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -41,24 +40,26 @@ import {
|
||||
onUpdated, // 组件更新后执行
|
||||
onUnmounted, // 组件销毁前执行
|
||||
} from "vue";
|
||||
import {getIntegralDetail} from "@/api/account";
|
||||
import { getIntegralDetail } 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";
|
||||
const pointsList = ref([]);
|
||||
const user = ref({});//用户信息
|
||||
const user = ref({}); //用户信息
|
||||
const page = ref(0);
|
||||
|
||||
//获取积分数据
|
||||
function getPointsList () {
|
||||
function getPointsList() {
|
||||
getIntegralDetail({
|
||||
page: page.value,
|
||||
size: 30,
|
||||
userId: user.value.id,
|
||||
}).then((res) => {
|
||||
console.log(res);
|
||||
pointsList.value.push(...res);
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
pointsList.value.push(...res);
|
||||
})
|
||||
.catch((err) => {});
|
||||
}
|
||||
|
||||
// 组件挂载完成后执行
|
||||
@@ -66,7 +67,7 @@ onMounted(() => {
|
||||
getPromiseStorage("user")
|
||||
.then((res) => {
|
||||
user.value = res;
|
||||
getPointsList()
|
||||
getPointsList();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
@@ -79,14 +80,14 @@ onUpdated(() => {
|
||||
onUnmounted(() => {
|
||||
// 组件销毁前执行
|
||||
});
|
||||
const refname = ref('');
|
||||
const refname = ref("");
|
||||
watch(refname, async (newQuestion, oldQuestion) => {
|
||||
// 变化后执行
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.points-list-container{
|
||||
.points-list-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
-webkit-user-select: none;
|
||||
@@ -94,44 +95,57 @@ watch(refname, async (newQuestion, oldQuestion) => {
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
.points-list{
|
||||
.points-list {
|
||||
width: 100%;
|
||||
height: calc(100% - 70px);
|
||||
}
|
||||
.points-list-title{
|
||||
.chatNotDeta {
|
||||
width: 100%;
|
||||
height: calc(100% - 70px);
|
||||
background-color: #ffffff;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.chatNotDeta-text {
|
||||
font-size: 20px;
|
||||
color: #03aba8;
|
||||
font-weight: bold;
|
||||
}
|
||||
.points-list-title {
|
||||
width: 100%;
|
||||
height: 70px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.points-text{
|
||||
.points-text {
|
||||
margin-top: 10px;
|
||||
color: #666666;
|
||||
font-size: 24px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.points-alwaysnum{
|
||||
.points-alwaysnum {
|
||||
color: #333333;
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.points-icon{
|
||||
.points-icon {
|
||||
width: 52px;
|
||||
height: 52px;
|
||||
margin-right: 18px;
|
||||
}
|
||||
.points-list-item{
|
||||
.points-list-item {
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
justify-content:center;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.points-list-content{
|
||||
.points-list-content {
|
||||
width: 90%;
|
||||
height: 100%;
|
||||
border-radius: 10px;
|
||||
@@ -139,17 +153,17 @@ watch(refname, async (newQuestion, oldQuestion) => {
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
}
|
||||
.Event{
|
||||
.Event {
|
||||
color: @Supplementary-text-color;
|
||||
font-size: 16px;
|
||||
}
|
||||
.points-num{
|
||||
.points-num {
|
||||
color: @font-color;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.time{
|
||||
color:@Prompt-text-color;
|
||||
.time {
|
||||
color: @Prompt-text-color;
|
||||
font-size: 16px;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -5,6 +5,7 @@ import ActivateEmail from '../views/ActivateEmail.vue'
|
||||
import activationSuccessful from '../views/activationSuccessful.vue'
|
||||
import forgetPassword from '../views/forgetPassword.vue'
|
||||
import resetPassword from '../views/resetPassword.vue'
|
||||
import verifyAccount from '../views/verifyAccount.vue'
|
||||
import { setStorage , getStorage } from '@/utils/storage.js';
|
||||
const routes = [
|
||||
{
|
||||
@@ -23,9 +24,16 @@ const routes = [
|
||||
component: ActivateEmail
|
||||
},
|
||||
{
|
||||
path: '/activationSuccessful',
|
||||
path: '/activationSuccessful/:token',
|
||||
name: 'activationSuccessful',
|
||||
component: activationSuccessful
|
||||
component: activationSuccessful,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: '/verifyAccount/:token',
|
||||
name: 'verifyAccount',
|
||||
component: verifyAccount,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: '/forgetPassword',
|
||||
@@ -33,9 +41,10 @@ const routes = [
|
||||
component: forgetPassword
|
||||
},
|
||||
{
|
||||
path: '/resetPassword',
|
||||
name: 'resetPassword',
|
||||
component: resetPassword
|
||||
path: '/resetPassword/:token',
|
||||
name: 'resetPassword',
|
||||
component: resetPassword,
|
||||
props: true
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
@@ -88,8 +88,10 @@ export function getAxios({ url, params }) {
|
||||
} else if (res.code == 40400) {
|
||||
router.push('/')
|
||||
ElMessage.error(res.code + '' + res.msg);
|
||||
reject();
|
||||
} else {
|
||||
ElMessage.error(res.code + '' + res.msg);
|
||||
reject();
|
||||
}
|
||||
}).catch(err => {
|
||||
reject(err)
|
||||
@@ -116,9 +118,11 @@ export function postAxios({ url, data }) {
|
||||
router.push('/')
|
||||
console.log(res.msg);
|
||||
ElMessage.error(res.code + '' + res.msg);
|
||||
reject();
|
||||
} else {
|
||||
console.log(res.msg);
|
||||
ElMessage.error(res.code + '' + res.msg);
|
||||
reject();
|
||||
}
|
||||
}).catch(err => {
|
||||
reject(err)
|
||||
|
||||
@@ -46,7 +46,7 @@ onMounted(() => {
|
||||
getPromiseStorage('user').then(res => {
|
||||
console.log(res);
|
||||
user.value = res;
|
||||
});
|
||||
}).catch((err) => {});
|
||||
});
|
||||
onUpdated(() => {
|
||||
// 组件更新后执行
|
||||
|
||||
@@ -157,7 +157,7 @@ function forgetPassword() {
|
||||
function fetchQrcode() {
|
||||
getVxQrcode().then((res) => {
|
||||
Qrcode.value = res;
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
//查询微信扫码是否成功
|
||||
function checkLogin() {
|
||||
@@ -170,7 +170,7 @@ function checkLogin() {
|
||||
pollstop();
|
||||
router.push("/nav");
|
||||
}
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
function pollstop() {
|
||||
clearInterval(vxloginstatus);
|
||||
|
||||
@@ -3,13 +3,46 @@
|
||||
<!-- 完成注册 -->
|
||||
<div class="form">
|
||||
<div class="title">
|
||||
验证成功
|
||||
{{Hinttext}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { useRoute,useRouter } from "vue-router";
|
||||
import { ref, watch, onMounted, onUpdated, onUnmounted } from "vue";
|
||||
import { activeEmail } from "@/api/account";
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const token = ref("");
|
||||
import { ElMessage } from "element-plus";
|
||||
const Hinttext = ref("激活中,请稍候");
|
||||
//确认
|
||||
function nextStep() {
|
||||
activeEmail(
|
||||
token.value,
|
||||
).then(() => {
|
||||
Hinttext.value = "激活成功,请登录";
|
||||
setTimeout(() => {
|
||||
router.push("/");
|
||||
}, 3000);
|
||||
}).catch(() => {
|
||||
Hinttext.value = "激活失败";
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
token.value = route.params.token;
|
||||
nextStep();
|
||||
});
|
||||
|
||||
onUpdated(() => {
|
||||
// 组件更新后执行
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
// 组件销毁前执行
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@@ -45,5 +78,6 @@
|
||||
font-size: 100px;
|
||||
color: #03aba8;
|
||||
font-weight: bold;
|
||||
transition: all 0.5s ease-in-out;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -103,7 +103,7 @@ function userNameBlur() {
|
||||
ElMessage.success('用户名可用');
|
||||
userNamebtn.value = true
|
||||
}
|
||||
})
|
||||
}).catch((err) => {});
|
||||
}
|
||||
//下一步
|
||||
function nextStep() {
|
||||
@@ -157,7 +157,7 @@ function check(id) {
|
||||
pollstop()
|
||||
router.push('/nav')
|
||||
}
|
||||
})
|
||||
}).catch((err) => {});
|
||||
}, 2000);
|
||||
}
|
||||
function pollstop() {
|
||||
|
||||
@@ -44,7 +44,7 @@ watch(refname, async (newQuestion, oldQuestion) => {
|
||||
onMounted(() => {
|
||||
getNoticeList({page: 0, size: 10}).then((res) => {
|
||||
NoticeList.value = res;
|
||||
});
|
||||
}).catch((err) => {});
|
||||
});
|
||||
onUpdated(() => {
|
||||
// 组件更新后执行
|
||||
|
||||
@@ -581,7 +581,7 @@ function getAnchorList() {
|
||||
userId: handleClickdata.value.userId,
|
||||
}).then((res) => {
|
||||
getAnchorListdata.value = res;
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
//查询我方已发布的未被邀请的主播列表
|
||||
function getMyAnchorList() {
|
||||
@@ -589,7 +589,7 @@ function getMyAnchorList() {
|
||||
userId: user.value.id,
|
||||
}).then((res) => {
|
||||
getMyAnchorListdata.value = res;
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
|
||||
//确认邀请
|
||||
@@ -626,8 +626,8 @@ function reminderDialogConfirm() {
|
||||
chatlistContainer.value.scrollTop = chatlistContainer.value.scrollHeight;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
// PK邀请弹窗
|
||||
function PKInvitationdialogclick() {
|
||||
@@ -683,7 +683,7 @@ const handleFileSelect = (event) => {
|
||||
chatlistContainer.value.scrollTop = chatlistContainer.value.scrollHeight;
|
||||
}
|
||||
});
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -705,7 +705,7 @@ function sendMsg() {
|
||||
chatlistContainer.value.scrollTop = chatlistContainer.value.scrollHeight;
|
||||
}
|
||||
});
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
|
||||
// 加载更多消息
|
||||
@@ -740,14 +740,14 @@ function handleClick(item) {
|
||||
}
|
||||
});
|
||||
chatlistContainer.value.addEventListener("scroll", scrollHandler);
|
||||
});
|
||||
}).catch((err) => {});
|
||||
messageRead();
|
||||
}
|
||||
//已读消息
|
||||
function messageRead() {
|
||||
goEasyMessageRead({
|
||||
id: handleClickdata.value.userId,
|
||||
}).then((res) => {});
|
||||
}).then((res) => {}).catch((err) => {});
|
||||
}
|
||||
|
||||
//获取更多消息
|
||||
@@ -818,7 +818,7 @@ function onPrivateMessageReceived(message) {
|
||||
function getChatList() {
|
||||
goEasyGetConversations().then((res) => {
|
||||
chatList.value = res.content.conversations;
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
watch(counter, (newQuestion, oldQuestion) => {
|
||||
setTimeout(() => {
|
||||
|
||||
@@ -61,14 +61,8 @@ const options = [
|
||||
icon: require("@/assets/PointsList.png"),
|
||||
},
|
||||
]
|
||||
import { throttle } from 'lodash-es';
|
||||
|
||||
const throttledUpdate = throttle((value) => {
|
||||
segmentedvalue.value = value;
|
||||
}, 500);
|
||||
|
||||
function SelectorClick(value) {
|
||||
throttledUpdate(value);
|
||||
segmentedvalue.value = value;
|
||||
}
|
||||
|
||||
const segmentedvalue = ref(1);
|
||||
|
||||
@@ -757,7 +757,7 @@ function getAnchorList() {
|
||||
userId: info.value.id,
|
||||
}).then((res) => {
|
||||
getAnchorListdata.value = res;
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
//查询我方已发布的未被邀请的主播列表
|
||||
function getMyAnchorList() {
|
||||
@@ -765,7 +765,7 @@ function getMyAnchorList() {
|
||||
userId: user.value.id,
|
||||
}).then((res) => {
|
||||
getMyAnchorListdata.value = res;
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
|
||||
//确认邀请
|
||||
@@ -801,8 +801,8 @@ function reminderDialogConfirm() {
|
||||
chatlistContainer.value.scrollTop = chatlistContainer.value.scrollHeight;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
// PK邀请弹窗
|
||||
function PKInvitationdialogclick() {
|
||||
@@ -859,7 +859,7 @@ const handleFileSelect = (event) => {
|
||||
chatlistContainer.value.scrollTop = chatlistContainer.value.scrollHeight;
|
||||
}
|
||||
});
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -881,7 +881,7 @@ function sendMsg() {
|
||||
chatlistContainer.value.scrollTop = chatlistContainer.value.scrollHeight;
|
||||
}
|
||||
});
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
// 选中主播后获取聊天列表数据
|
||||
function handleClick(time) {
|
||||
@@ -904,8 +904,8 @@ function handleClick(time) {
|
||||
}
|
||||
});
|
||||
chatlistContainer.value.addEventListener("scroll", scrollHandler);
|
||||
});
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
|
||||
// 加载更多消息
|
||||
@@ -920,7 +920,7 @@ function loadMore() {
|
||||
function messageRead() {
|
||||
goEasyMessageRead({
|
||||
id: String(handleClickdata.value.senderId),
|
||||
}).then((res) => {});
|
||||
}).then((res) => {}).catch((err) => {});
|
||||
}
|
||||
|
||||
//私聊消息接收
|
||||
@@ -1012,7 +1012,7 @@ function PkList(body,type) {
|
||||
list.value = TodayList.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
}).catch((err) => {});
|
||||
}
|
||||
|
||||
// 加载更多
|
||||
|
||||
@@ -45,7 +45,6 @@ const token = ref("");
|
||||
const Password = ref("");// 密码
|
||||
const ConfirmPassword = ref("");// 确认密码
|
||||
import { ElMessage } from "element-plus";
|
||||
|
||||
//确认
|
||||
function nextStep() {
|
||||
// 密码验证
|
||||
@@ -64,8 +63,8 @@ function nextStep() {
|
||||
password: Password.value,
|
||||
confirmPassword: ConfirmPassword.value
|
||||
}).then(() => {
|
||||
active.value = active.value + 1;
|
||||
})
|
||||
active.value = 1;
|
||||
}).catch((err) => {});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
@@ -115,8 +114,8 @@ onUnmounted(() => {
|
||||
}
|
||||
.forms{
|
||||
margin-top: 30px;
|
||||
width: 900px;
|
||||
height: 600px;
|
||||
width: 80%;
|
||||
height: 80%;
|
||||
background-image: linear-gradient(180deg, #dbf0f1, #ffffff);
|
||||
border-radius: 10px;
|
||||
border: 1px solid #4fcacd;
|
||||
|
||||
84
src/views/verifyAccount.vue
Normal file
84
src/views/verifyAccount.vue
Normal file
@@ -0,0 +1,84 @@
|
||||
<template>
|
||||
<div class="email-registration">
|
||||
<!-- 完成注册 -->
|
||||
<div class="form">
|
||||
<div class="title">
|
||||
{{ Hinttext }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { ref, watch, onMounted, onUpdated, onUnmounted } from "vue";
|
||||
import { checkAccount } from "@/api/account";
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const token = ref("");
|
||||
import { ElMessage } from "element-plus";
|
||||
const Hinttext = ref("验证中,请稍候");
|
||||
//确认
|
||||
function nextStep() {
|
||||
checkAccount(token.value,
|
||||
)
|
||||
.then(() => {
|
||||
Hinttext.value = "验证成功,请登录";
|
||||
setTimeout(() => {
|
||||
router.push("/");
|
||||
}, 3000);
|
||||
})
|
||||
.catch(() => {
|
||||
Hinttext.value = "验证失败";
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
token.value = route.params.token;
|
||||
nextStep();
|
||||
});
|
||||
|
||||
onUpdated(() => {
|
||||
// 组件更新后执行
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
// 组件销毁前执行
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.email-registration {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background-image: url(../assets/bg.png);
|
||||
background-size: 100% 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
.form {
|
||||
margin-top: 30px;
|
||||
width: 80%;
|
||||
height: 80%;
|
||||
background-image: linear-gradient(180deg, #dbf0f1, #ffffff);
|
||||
border-radius: 10px;
|
||||
border: 1px solid #4fcacd;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.title {
|
||||
font-size: 100px;
|
||||
color: #03aba8;
|
||||
font-weight: bold;
|
||||
transition: all 0.5s ease-in-out;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user