更新:图书搜索功能;听书实时显示对应文字;书籍评论功能完善;
This commit is contained in:
@@ -52,7 +52,7 @@
|
||||
<wd-popup v-model="commentVisible" position="bottom">
|
||||
<view class="comment-dialog">
|
||||
<text class="dialog-title">
|
||||
{{ replyTarget ? $t('bookDetails.reply') + replyTarget.name + $t('bookDetails.dpl') : $t('bookDetails.makeComment') }}
|
||||
{{ replyTarget ? $t('bookDetails.reply') + '"' + replyTarget.name + '"' + $t('bookDetails.dpl') : $t('bookDetails.makeComment') }}
|
||||
</text>
|
||||
|
||||
<!-- 富文本编辑器 -->
|
||||
@@ -73,7 +73,7 @@
|
||||
|
||||
<!-- 这里需要一个Emoji选择器组件,暂时简化处理 -->
|
||||
<view v-if="showEmoji" class="emoji-picker">
|
||||
<text class="emoji-tip">Emoji功能待集成</text>
|
||||
<EmotionPicker @emotion="handleEmj" :height="220"></EmotionPicker>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -95,8 +95,8 @@ import { onLoad } from '@dcloudio/uni-app'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { bookApi } from '@/api/modules/book'
|
||||
import type { IBookDetail, IComment } from '@/types/book'
|
||||
import CustomNavbar from '@/components/book/CustomNavbar.vue'
|
||||
import CommentList from '@/components/book/CommentList.vue'
|
||||
import EmotionPicker from '@/components/bkhumor-emojiplus/index.vue'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
@@ -220,7 +220,7 @@ function showCommentDialog(comment?: IComment) {
|
||||
if (comment) {
|
||||
const userName = comment.userEntity.nickname || comment.userEntity.name || 'TA'
|
||||
replyTarget.value = { id: comment.id, name: userName }
|
||||
placeholder.value = t('bookDetails.replyText') + userName + t('bookDetails.dpl')
|
||||
placeholder.value = t('bookDetails.replyText') + '"' + userName + '"' + t('bookDetails.dpl')
|
||||
} else {
|
||||
replyTarget.value = null
|
||||
placeholder.value = t('bookDetails.enterText')
|
||||
@@ -266,6 +266,16 @@ function getEditorContent(): Promise<string> {
|
||||
})
|
||||
}
|
||||
|
||||
//获得输入的表情数组
|
||||
function handleEmj(i: any) {
|
||||
editorCtx.value.insertImage({
|
||||
src: i.emotion,
|
||||
alt: "emoji",
|
||||
className: 'emoji_image',
|
||||
success: function() {},
|
||||
});
|
||||
}
|
||||
|
||||
// 提交评论
|
||||
async function submitComment() {
|
||||
try {
|
||||
@@ -465,9 +475,17 @@ function toggleEmoji() {
|
||||
border: 1rpx solid #ddd;
|
||||
width: 100%;
|
||||
min-height: 200rpx;
|
||||
height: 200rpx;
|
||||
padding: 10rpx;
|
||||
border-radius: 10rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
:deep() .ql-editor {
|
||||
img {
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.emoji-section {
|
||||
@@ -482,8 +500,8 @@ function toggleEmoji() {
|
||||
padding-top: 20rpx;
|
||||
|
||||
image {
|
||||
width: 45rpx;
|
||||
height: 45rpx;
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
display: block;
|
||||
margin: 0 auto 5rpx;
|
||||
}
|
||||
@@ -498,10 +516,7 @@ function toggleEmoji() {
|
||||
|
||||
.emoji-picker {
|
||||
margin-top: 20rpx;
|
||||
padding: 20rpx;
|
||||
background: #f4f5f7;
|
||||
border-radius: 10rpx;
|
||||
|
||||
|
||||
.emoji-tip {
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
|
||||
Reference in New Issue
Block a user