diff --git a/components.d.ts b/components.d.ts
index 5787ca5..d7b254d 100644
--- a/components.d.ts
+++ b/components.d.ts
@@ -23,6 +23,8 @@ declare module 'vue' {
AImagePreviewGroup: typeof import('ant-design-vue/es')['ImagePreviewGroup']
AInput: typeof import('ant-design-vue/es')['Input']
AInputPassword: typeof import('ant-design-vue/es')['InputPassword']
+ AList: typeof import('ant-design-vue/es')['List']
+ AListItem: typeof import('ant-design-vue/es')['ListItem']
AMenu: typeof import('ant-design-vue/es')['Menu']
AMenuItem: typeof import('ant-design-vue/es')['MenuItem']
AModal: typeof import('ant-design-vue/es')['Modal']
@@ -37,6 +39,7 @@ declare module 'vue' {
ATextarea: typeof import('ant-design-vue/es')['Textarea']
ATooltip: typeof import('ant-design-vue/es')['Tooltip']
AUpload: typeof import('ant-design-vue/es')['Upload']
+ BellOutlined: typeof import('@ant-design/icons-vue')['BellOutlined']
BoxDog: typeof import('./src/components/BoxDog/BoxDog.vue')['default']
Card3D: typeof import('./src/components/Card3D/Card3D.vue')['default']
CloseCircleOutlined: typeof import('@ant-design/icons-vue')['CloseCircleOutlined']
@@ -44,8 +47,6 @@ declare module 'vue' {
CommentInput: typeof import('./src/components/CommentReply/src/CommentInput/CommentInput.vue')['default']
CommentList: typeof import('./src/components/CommentReply/src/CommentList/CommentList.vue')['default']
CommentReply: typeof import('./src/components/CommentReply/index.vue')['default']
- CopyOutlined: typeof import('@ant-design/icons-vue')['CopyOutlined']
- DeleteOutlined: typeof import('@ant-design/icons-vue')['DeleteOutlined']
DynamicTitle: typeof import('./src/components/DynamicTitle/DynamicTitle.vue')['default']
EffectsCard: typeof import('./src/components/EffectsCard/EffectsCard.vue')['default']
EyeOutlined: typeof import('@ant-design/icons-vue')['EyeOutlined']
diff --git a/src/components/CommentReply/src/CommentInput/CommentInput.vue b/src/components/CommentReply/src/CommentInput/CommentInput.vue
index 0dee144..ecc1d43 100644
--- a/src/components/CommentReply/src/CommentInput/CommentInput.vue
+++ b/src/components/CommentReply/src/CommentInput/CommentInput.vue
@@ -24,15 +24,30 @@
-
-
-
+
+
+
+ {{
+ t('comment.loadingMore')
+ }}
+
+
+
+ {{ t('comment.noMore') }}
+
+
+
+
+
+
+
+
@@ -42,17 +57,30 @@
-
-
-
+
+
+
+ {{
+ t('comment.loadingMore')
+ }}
+
+
+
+ {{ t('comment.noMore') }}
+
-
+
+
+
+
+
+
@@ -153,6 +181,30 @@ const commentSlideCaptchaEvent = {
},
};
const emojiType = ref("qq");
+const currentEmojiList = ref(comment.emojiList.slice(0, 20));
+const currentEmojiListSize = ref(20);
+const currentLottieEmojiList = ref(comment.lottieEmojiList.slice(0, 15));
+const currentLottieEmojiListSize = ref(15);
+/**
+ * 加载更多表情
+ */
+const loadMoreEmoji = async () => {
+ if (currentEmojiListSize.value >= comment.emojiList.length) {
+ return;
+ }
+ currentEmojiListSize.value += 20;
+ currentEmojiList.value = comment.emojiList.slice(0, currentEmojiListSize.value);
+};
+/**
+ * 加载更多Lottie表情
+ */
+const loadMoreLottieEmoji = async () => {
+ if (currentLottieEmojiListSize.value >= comment.lottieEmojiList.length) {
+ return;
+ }
+ currentLottieEmojiListSize.value += 15;
+ currentLottieEmojiList.value = comment.lottieEmojiList.slice(0, currentLottieEmojiListSize.value);
+};
/**
* 聚焦事件
@@ -196,11 +248,11 @@ async function commentSubmit(point: any) {
const content = commentContent.value.replace(/\r\n/g, '
').replace(/\n/g, '
').replace(/\s/g, ' ');
const regex = /\[((1[0-6][0-6]|[1-9]?[0-9])\.gif)]/g; // 匹配 [1.gif] 的字符串
const contentWithEmoji = content.replace(regex, (_match, p1) => {
- return `
`;
+ return `
`;
});
const regexWithLottieEmoji = /\:((1[0-0-8]|[1-9]?[0-9])\.gif)\:/g; // 匹配 :1.gif: 的字符串
const contentWithLottieEmoji = contentWithEmoji.replace(regexWithLottieEmoji, (_match, p1) => {
- return `
`;
+ return `
`;
});
const commentParams: object = {
user_id: user.user.uid,
@@ -219,6 +271,7 @@ async function commentSubmit(point: any) {
showSubmitCaptcha.value = false;
await getCommentList();
} else {
+ showSubmitCaptcha.value = false;
message.error(result.message || t('comment.commentError'));
}
}
@@ -245,6 +298,14 @@ const getSlideCaptchaDataThrottled = useThrottleFn(comment.getSlideCaptchaData,
* 显示滑动验证码
*/
async function showSlideCaptcha() {
+ if (commentContent.value.trim() === "") {
+ message.error(t('comment.commentContentNotEmpty'));
+ return;
+ }
+ if (comment.imageList.length > 3) {
+ message.error(t('comment.maxImageCount'));
+ return;
+ }
const res = await comment.getSlideCaptchaData();
if (res) {
showSubmitCaptcha.value = true;
diff --git a/src/components/CommentReply/src/CommentList/CommentList.vue b/src/components/CommentReply/src/CommentList/CommentList.vue
index a3d2c7b..3ad74be 100644
--- a/src/components/CommentReply/src/CommentList/CommentList.vue
+++ b/src/components/CommentReply/src/CommentList/CommentList.vue
@@ -104,14 +104,6 @@
{{ t('comment.report') }}
-
-
- {{ t('comment.copy') }}
-
-
-
- {{ t('comment.delete') }}
-
diff --git a/src/components/CommentReply/src/ReplyInput/ReplyInput.vue b/src/components/CommentReply/src/ReplyInput/ReplyInput.vue
index 1eee379..05fa928 100644
--- a/src/components/CommentReply/src/ReplyInput/ReplyInput.vue
+++ b/src/components/CommentReply/src/ReplyInput/ReplyInput.vue
@@ -8,11 +8,8 @@
{{ t('comment.cancelReply') }}
-
+
-
-
-
-
-
-
+
+
+
+ {{
+ t('comment.loadingMore')
+ }}
+
+
+
+ {{ t('comment.noMore') }}
+
-
+
+
+
+
+
+
@@ -166,6 +192,31 @@ const commentSlideCaptchaEvent = {
};
const emojiType = ref("qq");
+const currentEmojiList = ref(comment.emojiList.slice(0, 20));
+const currentEmojiListSize = ref(20);
+const currentLottieEmojiList = ref(comment.lottieEmojiList.slice(0, 15));
+const currentLottieEmojiListSize = ref(15);
+/**
+ * 加载更多表情
+ */
+const loadMoreEmoji = async () => {
+ if (currentEmojiListSize.value >= comment.emojiList.length) {
+ return;
+ }
+ currentEmojiListSize.value += 20;
+ currentEmojiList.value = comment.emojiList.slice(0, currentEmojiListSize.value);
+};
+/**
+ * 加载更多Lottie表情
+ */
+const loadMoreLottieEmoji = async () => {
+ if (currentLottieEmojiListSize.value >= comment.lottieEmojiList.length) {
+ return;
+ }
+ currentLottieEmojiListSize.value += 15;
+ currentLottieEmojiList.value = comment.lottieEmojiList.slice(0, currentLottieEmojiListSize.value);
+};
+
/**
* 切换表情类型
* @param type
@@ -210,11 +261,11 @@ async function replySubmit(point: any) {
const content = replyContent.value.replace(/\r\n/g, '
').replace(/\n/g, '
').replace(/\s/g, ' ');
const regex = /\[((1[0-6][0-6]|[1-9]?[0-9])\.gif)\]/g; // 匹配 [1.gif] 的字符串
const contentWithEmoji = content.replace(regex, (_match, p1) => {
- return `
`;
+ return `
`;
});
const regexWithLottieEmoji = /\:((1[0-0-8]|[1-9]?[0-9])\.gif)\:/g; // 匹配 :1.gif: 的字符串
const contentWithLottieEmoji = contentWithEmoji.replace(regexWithLottieEmoji, (_match, p1) => {
- return `
`;
+ return `
`;
});
const replyParams: {
images: any;
@@ -247,6 +298,7 @@ async function replySubmit(point: any) {
comment.commentMap[props.item.id].reply_count++;
message.success(t('comment.replySuccess'));
} else {
+ showSubmitCaptcha.value = false;
message.error(t('comment.replyError'));
}
}
@@ -271,6 +323,14 @@ const getSlideCaptchaDataThrottled = useThrottleFn(comment.getSlideCaptchaData,
* 显示滑动验证码
*/
async function showSlideCaptcha() {
+ if (replyContent.value.trim() === "") {
+ message.error(t('comment.commentContentNotEmpty'));
+ return;
+ }
+ if (comment.imageList.length > 3) {
+ message.error(t('comment.maxImageCount'));
+ return;
+ }
const res = await comment.getSlideCaptchaData();
if (res) {
showSubmitCaptcha.value = true;
diff --git a/src/components/CommentReply/src/ReplyInput/index.scss b/src/components/CommentReply/src/ReplyInput/index.scss
index b8cbad7..e9a926d 100644
--- a/src/components/CommentReply/src/ReplyInput/index.scss
+++ b/src/components/CommentReply/src/ReplyInput/index.scss
@@ -22,10 +22,10 @@
margin-top: 10px;
.reply-input-content-text {
- margin-left: 10px;
+ //margin-left: 10px;
.comment-text-reply {
- width: 550px;
+ width: 600px;
}
.comment-actions-reply {
diff --git a/src/components/CommentReply/src/ReplyList/ReplyList.vue b/src/components/CommentReply/src/ReplyList/ReplyList.vue
index af93e1d..0eac89c 100644
--- a/src/components/CommentReply/src/ReplyList/ReplyList.vue
+++ b/src/components/CommentReply/src/ReplyList/ReplyList.vue
@@ -80,14 +80,9 @@
+
{{ t('comment.report') }}
-
- {{ t('comment.copy') }}
-
-
- {{ t('comment.delete') }}
-
diff --git a/src/components/CommentReply/src/ReplyReplyInput/ReplyReply.vue b/src/components/CommentReply/src/ReplyReplyInput/ReplyReply.vue
index b127369..3d06b37 100644
--- a/src/components/CommentReply/src/ReplyReplyInput/ReplyReply.vue
+++ b/src/components/CommentReply/src/ReplyReplyInput/ReplyReply.vue
@@ -10,11 +10,8 @@
{{ t('comment.cancelReply') }}
-
+
-
-
-
-
-
-
+
+
+
+ {{
+ t('comment.loadingMore')
+ }}
+
+
+
+ {{ t('comment.noMore') }}
+
-
+
+
+
+
+
+
@@ -179,6 +204,31 @@ const commentSlideCaptchaEvent = {
};
const emojiType = ref("qq");
+const currentEmojiList = ref(comment.emojiList.slice(0, 20));
+const currentEmojiListSize = ref(20);
+const currentLottieEmojiList = ref(comment.lottieEmojiList.slice(0, 15));
+const currentLottieEmojiListSize = ref(15);
+/**
+ * 加载更多表情
+ */
+const loadMoreEmoji = async () => {
+ if (currentEmojiListSize.value >= comment.emojiList.length) {
+ return;
+ }
+ currentEmojiListSize.value += 20;
+ currentEmojiList.value = comment.emojiList.slice(0, currentEmojiListSize.value);
+};
+/**
+ * 加载更多Lottie表情
+ */
+const loadMoreLottieEmoji = async () => {
+ if (currentLottieEmojiListSize.value >= comment.lottieEmojiList.length) {
+ return;
+ }
+ currentLottieEmojiListSize.value += 15;
+ currentLottieEmojiList.value = comment.lottieEmojiList.slice(0, currentLottieEmojiListSize.value);
+};
+
/**
* 切换表情类型
* @param type
@@ -223,11 +273,11 @@ async function replyReplySubmit(point: any) {
const content = replyReplyContent.value.replace(/\r\n/g, '
').replace(/\n/g, '
').replace(/\s/g, ' ');
const regex = /\[((1[0-6][0-6]|[1-9]?[0-9])\.gif)]/g; // 匹配 [1.gif] 的字符串
const contentWithEmoji = content.replace(regex, (_match, p1) => {
- return `
`;
+ return `
`;
});
const regexWithLottieEmoji = /:((1[0-0-8]|[1-9]?[0-9])\.gif):/g; // 匹配 :1.gif: 的字符串
const contentWithLottieEmoji = contentWithEmoji.replace(regexWithLottieEmoji, (_match, p1) => {
- return `
`;
+ return `
`;
});
const replyParams: ReplyCommentParams = {
user_id: user.user.uid,
@@ -252,6 +302,7 @@ async function replyReplySubmit(point: any) {
comment.commentMap[props.item.id].reply_count++;
message.success(t('comment.replySuccess'));
} else {
+ showSubmitCaptcha.value = false;
message.error(t('comment.replyError'));
}
}
@@ -262,6 +313,14 @@ const getSlideCaptchaDataThrottled = useThrottleFn(comment.getSlideCaptchaData,
* 显示滑动验证码
*/
async function showSlideCaptcha() {
+ if (replyReplyContent.value.trim() === "") {
+ message.error(t('comment.commentContentNotEmpty'));
+ return;
+ }
+ if (comment.imageList.length > 3) {
+ message.error(t('comment.maxImageCount'));
+ return;
+ }
const res = await comment.getSlideCaptchaData();
if (res) {
showSubmitCaptcha.value = true;
diff --git a/src/components/CommentReply/src/ReplyReplyInput/index.scss b/src/components/CommentReply/src/ReplyReplyInput/index.scss
index 7161c44..58a21c9 100644
--- a/src/components/CommentReply/src/ReplyReplyInput/index.scss
+++ b/src/components/CommentReply/src/ReplyReplyInput/index.scss
@@ -22,10 +22,10 @@
margin-top: 10px;
.reply-input-content-text-child {
- margin-left: 10px;
+ //margin-left: 10px;
.comment-text-reply-child {
- width: 480px;
+ width: 530px;
}
.comment-actions-reply-child {
diff --git a/src/layout/Landing/Header/Header.vue b/src/layout/Landing/Header/Header.vue
index 905b510..23dcd37 100644
--- a/src/layout/Landing/Header/Header.vue
+++ b/src/layout/Landing/Header/Header.vue
@@ -16,27 +16,6 @@
-
-
-
- {
- changeTheme(e.key)
- }">
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -47,9 +26,7 @@
{{ t("landing.english") }}
-
- {{ lang.lang === 'zh' ? '中文' : 'English' }}
-
+
@@ -67,24 +44,20 @@
import useStore from "@/store/index.ts";
-import {ref} from "vue";
-import {DownOutlined} from '@ant-design/icons-vue';
+import {h, ref} from "vue";
+import {TranslationOutlined} from '@ant-design/icons-vue';
import {useI18n} from "vue-i18n";
-import variables from "@/assets/styles/colors.module.scss";
import {useRouter} from "vue-router";
-
const {t, locale} = useI18n();
const router = useRouter();
const lang = useStore().lang;
+
async function changeLang(language: any) {
lang.lang = language;
locale.value = language;
}
-async function changeTheme(theme: any) {
- app.setThemeName(theme);
-}
const app = useStore().theme;
const isDarkMode = ref
(app.darkMode === "dark");
diff --git a/src/layout/Landing/Header/index.scss b/src/layout/Landing/Header/index.scss
index 9807ff2..667822a 100644
--- a/src/layout/Landing/Header/index.scss
+++ b/src/layout/Landing/Header/index.scss
@@ -8,6 +8,7 @@
justify-content: center;
transition: background-color 0.3s;
z-index: 3;
+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
.landing-header-logo {
display: inline-block;
diff --git a/src/layout/default/Header/Header.vue b/src/layout/default/Header/Header.vue
new file mode 100644
index 0000000..150ad2f
--- /dev/null
+++ b/src/layout/default/Header/Header.vue
@@ -0,0 +1,33 @@
+
+
+
+
+
diff --git a/src/layout/default/Header/index.scss b/src/layout/default/Header/index.scss
new file mode 100644
index 0000000..7f90287
--- /dev/null
+++ b/src/layout/default/Header/index.scss
@@ -0,0 +1,40 @@
+.header-main {
+ height: 60px;
+ width: 100%;
+ min-width: 1200px;
+ min-height: 60px;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ background-color: rgba(255, 255, 255, 0.38);
+ backdrop-filter: blur(20px);
+ transition: background-color 0.3s;
+ z-index: 3;
+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
+
+ .header-logo-container {
+ min-width: 280px;
+ cursor: pointer;
+ }
+
+ .header-menu-container {
+ width: 30%;
+
+ .header-menu-item {
+ min-width: 60px;
+
+ .header-menu-item-btn {
+ font-size: 16px;
+ }
+ }
+
+ .header-user-container {
+ min-width: 130px;
+
+ .header-user-avatar {
+ cursor: pointer;
+ }
+ }
+ }
+
+}
diff --git a/src/locales/language/en.ts b/src/locales/language/en.ts
index c0c1c71..de00f32 100644
--- a/src/locales/language/en.ts
+++ b/src/locales/language/en.ts
@@ -101,5 +101,7 @@ export default {
replySuccess: 'reply success!',
replyError: 'reply failed!',
illegalImage: 'illegal image!',
+ loadingMore: 'loading more',
+ noMore: 'no more',
}
};
diff --git a/src/locales/language/zh.ts b/src/locales/language/zh.ts
index 30c712a..cd84445 100644
--- a/src/locales/language/zh.ts
+++ b/src/locales/language/zh.ts
@@ -100,6 +100,8 @@ export default {
replySuccess: '回复成功!',
replyError: '回复失败!',
illegalImage: ' 非法图片!',
+ loadingMore: '加载更多',
+ noMore: '没有更多了',
}
};
diff --git a/src/router/router.ts b/src/router/router.ts
index af2cdbb..f7cfecc 100644
--- a/src/router/router.ts
+++ b/src/router/router.ts
@@ -3,7 +3,6 @@ import login from './modules/login';
import useStore from "@/store";
import {message} from "ant-design-vue";
-import {close, start} from '@/components/Nprogress/nprogress.ts';
import notFound from "./modules/notFound.ts";
import landing from "./modules/landing.ts";
import mainRouter from "./modules/main_router.ts";
@@ -26,7 +25,7 @@ const router: Router = createRouter({
});
router.beforeEach((to, _from, next) => {
- start();
+ // start();
const user = useStore().user;
const token: string | undefined = user.user.refreshToken;
const userId: string | undefined = user.user.uid;
@@ -59,6 +58,6 @@ router.beforeEach((to, _from, next) => {
router.afterEach(() => {
// 关闭进度条
- close();
+ // close();
});
export default router;
diff --git a/src/utils/alova/service.ts b/src/utils/alova/service.ts
index 9571028..67d3874 100644
--- a/src/utils/alova/service.ts
+++ b/src/utils/alova/service.ts
@@ -32,10 +32,6 @@ const {onAuthRequired, onResponseRefreshToken} = createServerTokenAuthentication
user.user.accessToken = access_token;
user.user.refreshToken = refresh_token;
user.user.uid = uid;
- } else {
- message.error(i18n.global.t('error.loginExpired'));
- localStorage.removeItem('user');
- window.location.href = '/login';
}
}
}
diff --git a/src/views/Main/MainPage.vue b/src/views/Main/MainPage.vue
index ba3b4d2..ecc034a 100644
--- a/src/views/Main/MainPage.vue
+++ b/src/views/Main/MainPage.vue
@@ -1,28 +1,19 @@
-
获取登录用户角色
- {{ data }}
+