Skip to content

Commit 4d2c74e

Browse files
authored
Merge pull request #273 from dinphy/develop
feature:优化用户评论信息输入框,用户设置保存
2 parents 0f4e41e + a685005 commit 4d2c74e

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

front/components/CommentBox.vue

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
<template>
22
<div class="px-4 py-2 flex flex-col gap-2 mt-2" v-if="currentCommentBox === pid">
33
<div class="relative">
4-
<UTextarea :rows="3" autofocus :placeholder="replyTo ? `回复给${replyTo}` : ''" v-model="state.content"/>
5-
<div class="animate-bounce absolute right-2 bottom-1 cursor-pointer text-xl select-none" @click="toggleEmoji">😊
4+
<UTextarea :rows="4" autofocus :placeholder="replyTo ? `回复给${replyTo}` : ''" v-model="state.content"/>
5+
<div class="flex gap-2 absolute right-3 bottom-2">
6+
<UIcon v-if="!global.userinfo.token" class="text-[#9fc84a] w-6 h-6 cursor-pointer" name="i-carbon-user-avatar" @click="toggleUser"/>
7+
<UIcon class="text-[#9fc84a] w-6 h-6 cursor-pointer select-none" name="i-carbon-face-satisfied" @click="toggleEmoji"/>
8+
<UButton class="cursor-pointer text-xs" color="white" @click="comment">发送</UButton>
69
</div>
710
</div>
811
<Emoji v-if="emojiShow" @selected="emojiSelected"/>
9-
<div class="flex gap-1">
12+
<div v-if="userShow" class="flex gap-1">
1013
<template v-if="!global.userinfo.token">
1114
<UInput placeholder="姓名" v-model="state.username"/>
1215
<UInput placeholder="网站" v-model="state.website"/>
1316
<UInput placeholder="邮箱" v-model="state.email"/>
1417
</template>
15-
<UButton color="white" @click="comment">发布评论</UButton>
1618
</div>
1719
</div>
1820
</template>
@@ -40,6 +42,7 @@ const localCommentUserinfo = useStorage('localCommentUserinfo', {
4042
website: "",
4143
email: "",
4244
})
45+
const userShow = ref(false)
4346
const emojiShow = ref(false)
4447
const currentCommentBox = useState('currentCommentBox')
4548
const sysConfig = useState<SysConfigVO>('sysConfig')
@@ -88,7 +91,9 @@ const doComment = async (token?: string) => {
8891
memoChangedEvent.emit(props.memoId)
8992
}
9093
91-
94+
const toggleUser = () => {
95+
userShow.value = !userShow.value
96+
}
9297
const toggleEmoji = () => {
9398
emojiShow.value = !emojiShow.value
9499
}

front/components/MemoEdit.vue

+1-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
<div class="w-full" @contextmenu.prevent="onContextMenu">
2323
<div class="relative">
2424
<UTextarea ref="contentRef" v-model="state.content" :rows="8" autoresize padded autofocus/>
25-
<div class="animate-bounce absolute right-2 bottom-1 cursor-pointer text-xl select-none" @click="toggleEmoji">
26-
😊
27-
</div>
25+
<UIcon class="text-[#9fc84a] w-6 h-6 animate-bounce absolute right-2 bottom-1 cursor-pointer select-none" name="i-carbon-face-satisfied" @click="toggleEmoji"/>
2826
</div>
2927

3028
<Emoji v-if="emojiShow" @selected="emojiSelected" @close="emojiShow=false"/>

front/pages/user/settings.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const reload = async () => {
6666
const save = async () => {
6767
await useMyFetch('/user/saveProfile', state)
6868
toast.success("保存成功")
69-
await reload()
69+
location.reload()
7070
}
7171
7272
const uploadAvatarUrl = async (files: FileList) => {

0 commit comments

Comments
 (0)