746 lines
26 KiB
Vue
746 lines
26 KiB
Vue
<script setup lang="ts">
|
||
import {
|
||
CalendarCheck,
|
||
ThumbsUp,
|
||
} from 'lucide-vue-next'
|
||
import { watch } from 'vue'
|
||
|
||
interface LikeParams {
|
||
id: string | number
|
||
communityId?: string | number
|
||
tenantId?: string | number
|
||
publishId?: string | number
|
||
}
|
||
|
||
const props = defineProps({
|
||
height: {
|
||
type: Number,
|
||
default: 800,
|
||
},
|
||
type: {
|
||
type: String,
|
||
default: '',
|
||
},
|
||
publishListParams: {
|
||
type: Object,
|
||
default: () => ({}),
|
||
},
|
||
})
|
||
|
||
// const $props = defineProps(['headUrl', 'dataList', 'height'])
|
||
|
||
const userStore = useUserStore()
|
||
const message = useMessage()
|
||
const showQuestionModal = ref(false)
|
||
const questionItem = ref({})
|
||
function handleShowQuestion(item: any) {
|
||
questionItem.value = item
|
||
showQuestionModal.value = true
|
||
}
|
||
const questionContent = ref('')
|
||
// 发布评论
|
||
const commentParams = ref({
|
||
content: '',
|
||
parentId: '',
|
||
replyUserId: '',
|
||
userId: userStore?.userInfo?.userId,
|
||
workFlowId: props.publishListParams.id,
|
||
})
|
||
function commentParamsInit() {
|
||
commentParams.value.content = ''
|
||
commentParams.value.replyUserId = ''
|
||
commentParams.value.parentId = ''
|
||
}
|
||
|
||
const isShowSend = ref(false)
|
||
const publicWord = ref('')
|
||
// 评论列表
|
||
const commentList = ref([])
|
||
async function getCommentList() {
|
||
try {
|
||
const res = await request.post(`/question/list`, props.publishListParams)
|
||
if (res.code === 200) {
|
||
// for (let i = 0; i < res.rows.length; i++) {
|
||
// res.rows[i].isShowInput = false
|
||
// res.rows[i].isShowSend = false
|
||
// if (res.rows[i].contentList && res.rows[i].contentList.length > 0) {
|
||
// for (let j = 0; j < res.rows[i].contentList.length; j++) {
|
||
// res.rows[i].contentList[j].isShowInput = false
|
||
// res.rows[i].contentList[j].isShowSend = false
|
||
// }
|
||
// }
|
||
// }
|
||
commentList.value = res.rows
|
||
}
|
||
}
|
||
catch (error) {
|
||
console.error(error)
|
||
}
|
||
// try {
|
||
// let url = ''
|
||
// if (props.type === 'workflow') {
|
||
// url = `${urlList.value[props.type]}commentId=${props.detailsInfo.id}&sortType=${sortType.value}`
|
||
// }
|
||
// else if (props.type === 'pictrue') {
|
||
// url = `${urlList.value[props.type]}imageId=${props.detailsInfo.id}&sortType=${sortType.value}`
|
||
// }
|
||
// else {
|
||
// url = `${urlList.value[props.type]}modelId=${props.detailsInfo.id}&sortType=${sortType.value}`
|
||
// }
|
||
// const res = await request.get(url)
|
||
// for (let i = 0; i < res.data.length; i++) {
|
||
// res.data[i].isShowInput = false
|
||
// res.data[i].isShowSend = false
|
||
// if (res.data[i].contentList.length > 0) {
|
||
// for (let j = 0; j < res.data[i].contentList.length; j++) {
|
||
// res.data[i].contentList[j].isShowInput = false
|
||
// res.data[i].contentList[j].isShowSend = false
|
||
// }
|
||
// }
|
||
// }
|
||
// commentList.value = res.data
|
||
// }
|
||
// catch (error) {
|
||
// console.log(error)
|
||
// }
|
||
}
|
||
getCommentList()
|
||
|
||
// 监听 publishListParams 变化
|
||
watch(
|
||
() => props.publishListParams,
|
||
() => {
|
||
if (props.publishListParams.type !== 999) {
|
||
getCommentList()
|
||
}
|
||
},
|
||
{ deep: true, immediate: true },
|
||
)
|
||
|
||
function handleBlur(ele) {
|
||
// 默认评价
|
||
if (!ele) {
|
||
isShowSend.value = !!publicWord.value
|
||
}
|
||
else {
|
||
ele.isShowSend = !!ele.word
|
||
}
|
||
}
|
||
// 发送评论
|
||
async function sendMessage(type: string, ele: any, index: number, subIndex?: number) {
|
||
if (ele && ele.userId) {
|
||
try {
|
||
if (ele.word) {
|
||
commentParams.value.content = ele.word
|
||
commentParams.value.publishId = commentList.value[index].id
|
||
if (type === 'sub') {
|
||
commentParams.value.parentId = commentList.value[index].commentList[subIndex].id
|
||
}
|
||
else {
|
||
commentParams.value.parentId = commentList.value[index].id
|
||
}
|
||
commentParams.value.communityId = props.publishListParams.communityId
|
||
commentParams.value.tenantId = props.publishListParams.tenantId
|
||
const res = await request.post(`/publishComment/save`, commentParams.value)
|
||
if (res.code === 200) {
|
||
ele.word = ''
|
||
message.success('评论成功!')
|
||
getCommentList()
|
||
// getCommentNum()
|
||
commentParamsInit()
|
||
}
|
||
}
|
||
else {
|
||
message.warning('评论不能为空!')
|
||
}
|
||
}
|
||
catch (error) {
|
||
console.log(error)
|
||
}
|
||
}
|
||
}
|
||
|
||
// 查询条数
|
||
// async function getCommentNum() {
|
||
// if (props.type !== 'pictrue') {
|
||
// try {
|
||
// const res = await request.get(`${commentNumUrl.value[props.type]}=${props.detailsInfo.id}`)
|
||
// if (res.code === 200) {
|
||
// commentCount.value = res.data
|
||
// }
|
||
// }
|
||
// catch (error) {
|
||
// console.log(error)
|
||
// }
|
||
// }
|
||
// }
|
||
// getCommentNum()
|
||
|
||
// 点赞/取消点赞
|
||
async function handleFocus(type: string, item: any) {
|
||
const params: LikeParams = { id: '' }
|
||
if (type === 'parent') {
|
||
params.id = item.item.id
|
||
}
|
||
else {
|
||
const { id, communityId, tenantId } = item.sub
|
||
params.id = id
|
||
params.communityId = communityId
|
||
params.tenantId = tenantId
|
||
params.publishId = item.item.id
|
||
}
|
||
|
||
try {
|
||
const url = type === 'sub' ? '/publishComment/like' : '/PublishLike/like'
|
||
const res = await request.post(url, params)
|
||
if (res.code === 200) {
|
||
// message.success('删除成功!')
|
||
getCommentList()
|
||
}
|
||
}
|
||
catch (error) {
|
||
console.log(error)
|
||
}
|
||
// const { id, communityId, tenantId, operatorId } = item
|
||
// const res = await request.post(`PublishLike/like`, { commentId: id, communityId, tenantId, operatorId })
|
||
// if (res.code === 200) {
|
||
// if (item.isLike === 0) {
|
||
// item.isLike = 1
|
||
// item.likeNum++
|
||
// message.success('点赞成功!')
|
||
// }
|
||
// else {
|
||
// item.isLike = 0
|
||
// item.likeNum--
|
||
// message.success('取消点赞成功!')
|
||
// }
|
||
// }
|
||
}
|
||
|
||
// 显示回复框
|
||
// function handleMessage(item: any) {
|
||
// if (!item.isShowInput) {
|
||
// item.word = ''
|
||
// }
|
||
// item.isShowInput = !item.isShowInput
|
||
// }
|
||
// 删除评论
|
||
// async function handleDel(type: string, item: any) {
|
||
// const params = {}
|
||
// if (type === 'parent') {
|
||
// params.publishId = item.item.id
|
||
// params.communityId = item.item.communityId
|
||
// }
|
||
// else {
|
||
// const { id, communityId, tenantId } = item.sub
|
||
// params.id = id
|
||
// params.communityId = communityId
|
||
// params.tenantId = tenantId
|
||
// params.publishId = item.item.id
|
||
// }
|
||
// try {
|
||
// const url = type === 'sub' ? '/publishComment/delete' : '/publish/remove'
|
||
// const res = await request.post(url, params)
|
||
// if (res.code === 200) {
|
||
// message.success('删除成功!')
|
||
// getCommentList()
|
||
// }
|
||
// }
|
||
// catch (error) {
|
||
// console.log(error)
|
||
// }
|
||
// }
|
||
|
||
// 发布回答
|
||
async function handlePublish() {
|
||
const params = {
|
||
content: questionContent.value,
|
||
questionId: questionItem.value.id,
|
||
communityId: questionItem.value.communityId,
|
||
tenantId: questionItem.value.tenantId,
|
||
}
|
||
try {
|
||
const res = await request.post('questionComment/comment', params)
|
||
if (res.code === 200) {
|
||
message.success('回答成功!')
|
||
setTimeout(() => {
|
||
window.location.reload()
|
||
// getCommentList()
|
||
// showQuestionModal.value = false
|
||
// questionContent.value = ''
|
||
}, 2000)
|
||
// getCommentList()
|
||
// showQuestionModal.value = false
|
||
// questionContent.value = ''
|
||
}
|
||
}
|
||
catch (error) {
|
||
console.log(error)
|
||
}
|
||
}
|
||
|
||
// 采纳
|
||
async function handleAccept(item: any, ele: any) {
|
||
const params = {
|
||
commentId: ele.id,
|
||
tenantId: props.publishListParams.tenantId,
|
||
communityId: props.publishListParams.communityId,
|
||
questionId: item.id,
|
||
}
|
||
try {
|
||
const res = await request.post('questionComment/adopt', params)
|
||
if (res.code === 200) {
|
||
message.success('采纳成功!')
|
||
getCommentList()
|
||
}
|
||
}
|
||
catch (error) {
|
||
console.log(error)
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<template>
|
||
<div class="pb-4 rounded min-h-[320px]">
|
||
<!-- <div class="flex justify-between items-center mb-4">
|
||
<div class="flex items-center">
|
||
<div class="left text-[20px] mr-2">
|
||
讨论
|
||
</div>
|
||
<div v-if="props.type !== 'pictrue'" class="text-[#999]">
|
||
{{ commentCount }}
|
||
</div>
|
||
</div>
|
||
<div v-if="props.type !== 'pictrue'" class="flex items-center">
|
||
<div class="cursor-pointer" :class="sortType === 0 ? '' : 'text-[#999]'" @click="changeType(0)">
|
||
最热
|
||
</div>|
|
||
<div class="cursor-pointer" :class="sortType === 1 ? '' : 'text-[#999]'" @click="changeType(1)">
|
||
最新
|
||
</div>
|
||
</div>
|
||
</div> -->
|
||
<!-- <div class="header-wrap">
|
||
<div v-if="userStore?.userInfo?.avatar" class="left">
|
||
<img
|
||
alt="avatar"
|
||
:src="userStore?.userInfo?.avatar"
|
||
>
|
||
</div>
|
||
<div class="input-wrap">
|
||
<NConfigProvider inline-theme-disabled style="width:100%">
|
||
<NInput
|
||
v-model:value="publicWord"
|
||
type="textarea"
|
||
:autosize="{ minRows: 1 }"
|
||
placeholder="善语结善缘,恶言伤人心~"
|
||
class="text"
|
||
@focus="isShowSend = true"
|
||
@blur="handleBlur"
|
||
/>
|
||
</NConfigProvider>
|
||
|
||
<div class="send-btn" :class="{ active: publicWord }" @click="sendMessage">
|
||
<span v-if="isShowSend">发送</span>
|
||
</div>
|
||
</div>
|
||
</div> -->
|
||
<div
|
||
v-for="(item, index) in commentList"
|
||
:key="index"
|
||
class="px-4 pt-2 pb-0 mb-4 bg-white"
|
||
>
|
||
<div class="nav-wrap">
|
||
<div class="left-img">
|
||
<img :src="item.questionUserAvatar">
|
||
</div>
|
||
<div class="right">
|
||
<div class="name">
|
||
{{ item.questionUserName }}
|
||
</div>
|
||
<div class="des">
|
||
{{ item.content }}
|
||
</div>
|
||
<div class="star-wrap">
|
||
<span class="time">{{ item.createTime }}</span>
|
||
<!-- <div class="star-operator">
|
||
<div class="icon-wrap">
|
||
<ThumbsUp size="16" class="mr-1" :color="item.isLike !== 0 ? '#ff0000' : '#000000'" @click="handleFocus('parent', { item })" />
|
||
<span style="vertical-align: middle">{{ item.likeNum }}</span>
|
||
</div>
|
||
<span class="cursor-pointer m-r16" @click="handleMessage(item)">回复</span>
|
||
<span v-if="item.userId === userStore?.userInfo?.userId" class="cursor-pointer" @click="handleDel('parent', { item })">删除</span>
|
||
</div> -->
|
||
</div>
|
||
<div v-if="item.questionUrl" class="flex flex-wrap gap-2">
|
||
<img v-for="(ele, subIndex) in item.questionUrl.split(',')" :key="subIndex" class="w-16 h-16 rounded-md" :src="ele">
|
||
</div>
|
||
<!-- 父项评论回复操作 -->
|
||
<!-- <div v-if="item.isShowInput" class="input-wrap" style="margin-top: 10px;">
|
||
<NConfigProvider inline-theme-disabled style="width:100%">
|
||
<NInput
|
||
v-model:value="item.word"
|
||
type="textarea"
|
||
:autosize="{ minRows: 1 }"
|
||
:placeholder="`回复: @${item.userName}`"
|
||
class="text"
|
||
@focus="item.isShowSend = true"
|
||
@blur="handleBlur(item)"
|
||
/>
|
||
</NConfigProvider>
|
||
<div class="send-btn" :class="{ active: publicWord }" @click="sendMessage('parent', item, index)">
|
||
<span v-if="item.isShowSend">发送</span>
|
||
</div>
|
||
</div> -->
|
||
</div>
|
||
</div>
|
||
<div class="child-wrap">
|
||
<div v-for="(ele, subIndex) in item.commentList" :key="subIndex" class="child-wrap-item">
|
||
<div class="left-img">
|
||
<img :src="ele.avatar">
|
||
</div>
|
||
<div class="right relative">
|
||
<!-- <svg t="1745994218359" class="icon absolute top-0 right-0 w-10 h-10" viewBox="0 0 1216 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2626" width="32" height="32"><path d="M106.650156 506.787762l37.914565 1.307233A454.97837 454.97837 0 0 0 371.925008 918.476759a455.054222 455.054222 0 0 0 478.676872-14.443774l20.886821 31.634522A492.980148 492.980148 0 0 1 352.962045 951.321574c-159.625802-92.16-252.59068-263.636701-246.311889-444.533812zM1091.789926 553.260221l-37.861213-2.196086A455.054222 455.054222 0 0 0 827.036119 130.201192 455.035259 455.035259 0 0 0 351.682931 142.491138l-20.620159-31.830909A492.942222 492.942222 0 0 1 845.999082 97.356376a492.961185 492.961185 0 0 1 245.774422 455.894363z" fill="#46D8D3" p-id="2627" /><path d="M201.831734 546.500878l37.866392-2.136441A359.670519 359.670519 0 0 0 419.332415 836.364721c105.671252 60.987429 232.882877 63.882432 340.245238 10.779887l16.802442 34.006057A397.786074 397.786074 0 0 1 400.369453 869.209536a397.596444 397.596444 0 0 1-198.537719-322.708658zM996.949659 499.226753l-37.84185 2.435264A359.879111 359.879111 0 0 0 779.628712 212.31323a359.822222 359.822222 0 0 0-335.780604-12.975676l-16.340572-34.199224A397.748148 397.748148 0 0 1 798.591675 179.468414a397.805037 397.805037 0 0 1 198.357984 319.758339z" fill="#46D8D3" p-id="2628" /><path d="M234.467964 94.633417l-189.62963 328.448153 919.654829 530.962963L1154.122793 625.59638 234.467964 94.633417z m2.540555-42.326297l952.499644 549.925926a18.962963 18.962963 0 0 1 6.940927 25.903889l-208.592593 361.292969a18.962963 18.962963 0 0 1-25.903889 6.940926L9.452964 446.444904a18.962963 18.962963 0 0 1-6.940926-25.903889L211.10463 59.248047a18.962963 18.962963 0 0 1 25.903889-6.940927z" fill="#46D8D3" p-id="2629" /><path d="M221.765188 306.264901m-32.844816-18.962963a37.925926 37.925926 0 1 0 65.689631 37.925926 37.925926 37.925926 0 1 0-65.689631-37.925926Z" fill="#46D8D3" p-id="2630" /><path d="M977.19594 742.413049m-32.844816-18.962963a37.925926 37.925926 0 1 0 65.689631 37.925926 37.925926 37.925926 0 1 0-65.689631-37.925926Z" fill="#46D8D3" p-id="2631" /><path d="M596.690736 421.916581l14.197467 21.072079c-21.301993 14.064727-42.850407 24.308564-64.415328 30.864251l-10.305441-22.503637a238.705778 238.705778 0 0 0 60.523302-29.432693z m-69.983964-34.887331c-0.005107 15.937735-1.4964 32.85673-4.73936 51.216812l-24.205098-6.924133a255.67763 255.67763 0 0 0 4.862571-49.306367l24.081887 5.013688z m-65.722306-30.587553c1.108893 17.194007 0.634428 35.006619-1.387827 52.845269l-25.179382-2.581809a289.754074 289.754074 0 0 0 1.66284-55.445456l24.904369 5.181996z m164.033992 41.365089l-0.043229 24.499171c-49.320321-16.519588-110.833045-45.902943-183.945604-88.114499l5.013688-24.081887c68.054457 39.291259 127.789477 68.567911 178.975145 87.697215z m-232.505231 5.550577l81.84928 47.255703 11.415703-19.772578 21.611889 12.477629-11.415704 19.772579 82.079193 47.388444-12.212148 21.152062-63.456183-36.636445c3.421984 30.178431 17.597837 63.500096 42.987388 100.230476l-26.917095 10.516294c-23.64486-43.999976-35.023627-84.290187-34.003562-121.100548l-0.689741-0.398222-48.848593 84.608244-21.611888-12.477629L462.150358 471.765127c-34.836441 21.57819-76.833222 31.665118-125.760427 30.393525l-0.601414-27.63032c42.558204 4.338584 78.503539-0.045599 107.738831-13.515205l-63.226269-36.503703 12.212148-21.152061z m338.396541 336.693626l-20.46232-11.813926 6.525911-23.515357 18.18922 12.034309c5.058102 2.920296 9.675436 1.294393 13.126696-4.683363l72.874667-126.222625L791.505074 568.726472a571.828148 571.828148 0 0 1-16.926656 22.415309c-0.470042 31.609989-2.10616 58.868124-5.23544 81.27901l-24.278787 2.229871a668.672 668.672 0 0 0 8.465631-59.794755c-17.260719 16.091406-35.917428 27.698218-56.20004 34.687695l-4.334662-24.880886c22.795155-9.217478 43.478543-24.865564 61.917422-46.714343 5.034618-6.596362 10.334717-13.652551 15.670384-21.301309l-29.428954-16.990815-90.130963 156.111408-20.46232-11.813926L732.771059 506.920176l51.270757 29.601185c6.964124-11.00029 14.096556-22.823062 21.397297-35.468316l21.152061 12.212148c-7.300741 12.645254-14.663087 24.335285-21.627211 35.335576l48.741706 28.141037-87.608889 151.743046c-9.159111 15.864046-20.932362 19.796063-35.187012 11.566137z m-79.131491-110.368977l-11.813926 20.46232c-25.930728-3.935255-53.594062-10.71014-83.317089-20.820051l9.09053-22.647777c31.429596 11.40175 60.109758 19.070253 86.040485 23.005508z m53.842719-185.64588l15.949135 19.630992c-26.045092 21.749052-49.267061 38.077349-69.435993 49.117629 8.118115 3.46079 16.006317 6.788838 24.027259 9.886974 8.6872-6.020301 18.002535-12.597602 27.91044-19.139336l15.524875 18.772943c-40.12701 26.494021-71.291809 44.367554-93.397224 53.983254a424.96 424.96 0 0 0 47.632813 10.94703l-10.752 18.623011c-28.530914-4.210267-54.053889-10.975621-76.471753-19.93341l5.039725-22.534097c4.837718 0.647197 9.251177 0.436344 13.603031-0.729732 11.543337-4.064758 28.377243-13.045346 50.368977-26.71185-11.408043-4.134024-23.143172-8.763443-35.108215-13.525602l5.994947-22.595702c4.015236 0.478888 8.826917-0.421706 13.842475-2.737351a521.216 521.216 0 0 0 65.271508-53.054753z" fill="#46D8D3" p-id="2632" /></svg> -->
|
||
<div class="name">
|
||
{{ ele.userName }}
|
||
<!-- <div v-if="ele.userId === props.detailsInfo.userId" class="author">
|
||
作者
|
||
</div> -->
|
||
</div>
|
||
<div class="des">
|
||
<!-- <span v-if="ele.replyUserName">
|
||
<span>回复</span>
|
||
<span class="u-name">@{{ ele.replyUserName }}</span>
|
||
</span> -->
|
||
{{ ele.content }}
|
||
</div>
|
||
<div class="star-wrap">
|
||
<span class="time">{{ ele.createTime }}</span>
|
||
<div
|
||
v-if="ele.isAccept === 0
|
||
&& item.status === 0
|
||
&& userStore?.userInfo?.userId === item.userId
|
||
&& ele.userId !== userStore?.userInfo?.userId"
|
||
class="cursor-pointer m-r16 text-xs flex items-center text-[#3f7ef7] bg-[#ecf1fc] rounded-lg px-2 py-1" @click="handleAccept(item, ele)"
|
||
>
|
||
<CalendarCheck size="16" fill="currentColor" color="#fff" class="mr-1" />
|
||
<span>采纳</span>
|
||
</div>
|
||
<div v-if="ele.isAccept === 1" class="text-xs flex items-center text-[#3f7ef7] bg-[#ecf1fc] rounded-lg px-2 py-1">
|
||
<span>已采纳</span>
|
||
</div>
|
||
<!-- <div class="star-operator">
|
||
<div class="icon-wrap">
|
||
<ThumbsUp size="16" class="mr-1" :color="ele.isLike !== 0 ? '#ff0000' : '#000000'" @click="handleFocus('sub', { sub: ele, item })" />
|
||
<span style="vertical-align: middle">{{ ele.likeNum }}</span>
|
||
</div>
|
||
<span class="cursor-pointer m-r16" @click="handleMessage(ele)">回复</span>
|
||
<span v-if="item.userId === userStore?.userInfo?.userId" class="cursor-pointer" @click="handleDel('sub', { item, sub: ele })">删除</span>
|
||
</div> -->
|
||
</div>
|
||
<!-- 子项评论回复操作 -->
|
||
<!-- <div v-if="ele.isShowInput" class="input-wrap" style="margin-top: 10px;">
|
||
<NConfigProvider inline-theme-disabled style="width:100%">
|
||
<NInput
|
||
v-model:value="ele.word"
|
||
type="textarea"
|
||
:autosize="{ minRows: 1 }"
|
||
:placeholder="`回复: @${ele.userName}`"
|
||
class="text"
|
||
@focus="ele.isShowSend = true"
|
||
@blur="handleBlur(ele)"
|
||
/>
|
||
</NConfigProvider>
|
||
<div class="send-btn" :class="{ active: publicWord }" @click="sendMessage('sub', ele, index, subIndex)">
|
||
<span v-if="ele.isShowSend">发送</span>
|
||
</div>
|
||
</div> -->
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="flex justify-center items-center text-sm py-4">
|
||
<div v-if="item.amount" class="cursor-pointer" @click="handleShowQuestion(item)">
|
||
<span class="text-blue-500">回答该问题可获得</span>
|
||
<span class="text-[#ffa820]">{{ item.amount }}积分</span>
|
||
</div>
|
||
<div v-else class="cursor-pointer" @click="handleShowQuestion(item)">
|
||
<span class="text-blue-500">回答该问题</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="no-more">
|
||
暂时没有更多评论
|
||
</div>
|
||
<n-modal
|
||
v-model:show="showQuestionModal"
|
||
:style="{ width: '640px' }"
|
||
preset="dialog"
|
||
transform-origin="center"
|
||
class="custom-modal"
|
||
:show-icon="false"
|
||
>
|
||
<div class="bg-white rounded-lg px-6">
|
||
<div class="flex items-center justify-between pb-4">
|
||
<div class="flex items-center">
|
||
<div class="flex items-center">
|
||
回答<img class="w-4 h-4 rounded-full mx-2" :src="questionItem.questionUserAvatar">
|
||
</div>
|
||
<span>{{ questionItem.questionUserName }}</span>
|
||
<span>发起的咨询</span>
|
||
</div>
|
||
</div>
|
||
<n-form
|
||
label-placement="left"
|
||
label-width="auto"
|
||
require-mark-placement="right-hanging"
|
||
>
|
||
<n-form-item path="content" :show-label="false">
|
||
<n-input
|
||
v-model:value="questionContent"
|
||
type="textarea"
|
||
placeholder="请输入提问内容"
|
||
:required="true"
|
||
:autosize="{ minRows: 5, maxRows: 10 }"
|
||
class="rounded-lg"
|
||
/>
|
||
</n-form-item>
|
||
<div class="flex items-center justify-between my-4">
|
||
<div class="flex items-center justify-end gap-8 w-full">
|
||
<n-button
|
||
type="primary"
|
||
class="!px-8 rounded"
|
||
:theme-overrides="{
|
||
common: {
|
||
primaryColor: '#3f7ef7',
|
||
primaryColorHover: '#3f7ef7',
|
||
},
|
||
}"
|
||
@click="handlePublish"
|
||
>
|
||
回答
|
||
</n-button>
|
||
</div>
|
||
</div>
|
||
</n-form>
|
||
</div>
|
||
</n-modal>
|
||
</div>
|
||
</template>
|
||
|
||
<style scoped lang="scss">
|
||
.header-wrap {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
margin-bottom: 20px;
|
||
.left {
|
||
width: 40px;
|
||
height: 40px;
|
||
border-radius: 50%;
|
||
margin-right: 12px;
|
||
border: 1px solid #2d28ff;
|
||
img {
|
||
width: 100%;
|
||
height: 100%;
|
||
border-radius: 50%;
|
||
}
|
||
}
|
||
.right {
|
||
}
|
||
}
|
||
|
||
.input-wrap {
|
||
display: flex;
|
||
align-items: center;
|
||
line-height: 1.55;
|
||
border-radius: 8px;
|
||
caret-color: #999;
|
||
font-size: 14px;
|
||
background: #f2f5f9;
|
||
padding: 10px 12px;
|
||
flex: 1;
|
||
|
||
:deep(.n-input) {
|
||
--n-padding-left: 0 !important;
|
||
--n-border: 0 !important;
|
||
--n-border-hover: 0 !important;
|
||
--n-border-focus: 0 !important;
|
||
--n-box-shadow-focus: unset;
|
||
--n-padding-vertical: 0px !important;
|
||
|
||
&::hover {
|
||
border: 0;
|
||
}
|
||
&:active,
|
||
&:focus {
|
||
border: 0 !important;
|
||
}
|
||
background-color: transparent;
|
||
}
|
||
.send-btn {
|
||
margin-left: 16px;
|
||
margin-right: 16px;
|
||
flex-shrink: 0;
|
||
color: #999;
|
||
font-size: 14px;
|
||
cursor: pointer;
|
||
&.active {
|
||
color: #222;
|
||
}
|
||
}
|
||
}
|
||
|
||
.nav-wrap {
|
||
margin: 10px 0;
|
||
display: flex;
|
||
font-size: 14px;
|
||
// align-items: center;
|
||
.left-img {
|
||
width: 40px;
|
||
height: 40px;
|
||
border-radius: 50%;
|
||
margin-right: 12px;
|
||
img {
|
||
width: 100%;
|
||
height: 100%;
|
||
border-radius: 50%;
|
||
}
|
||
}
|
||
.right {
|
||
width: 100%;
|
||
.name {
|
||
// margin-top: 10px;
|
||
margin-bottom: 7px;
|
||
font-weight: 500;
|
||
color: #333;
|
||
}
|
||
|
||
.des {
|
||
line-height: 1.25;
|
||
}
|
||
|
||
.star-wrap {
|
||
margin-top: 4px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
.time {
|
||
color: #999;
|
||
font-size: 12px;
|
||
}
|
||
.star-operator {
|
||
font-size: 12px;
|
||
color: #999;
|
||
display: flex;
|
||
align-items: center;
|
||
cursor: pointer;
|
||
.icon-wrap {
|
||
display: flex;
|
||
align-items: center;
|
||
margin-right: 16px;
|
||
cursor: pointer;
|
||
img {
|
||
width: 16px;
|
||
height: 16px;
|
||
margin-right: 3px;
|
||
}
|
||
}
|
||
|
||
.m-r16 {
|
||
margin-right: 16px;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
.child-wrap {
|
||
padding-left: 52px;
|
||
.child-wrap-item {
|
||
display: flex;
|
||
font-size: 14px;
|
||
margin-top: 16px;
|
||
// align-items: center;
|
||
.left-img {
|
||
width: 24px;
|
||
height: 24px;
|
||
border-radius: 50%;
|
||
margin-right: 12px;
|
||
img {
|
||
width: 100%;
|
||
height: 100%;
|
||
border-radius: 50%;
|
||
}
|
||
}
|
||
.right {
|
||
width: 100%;
|
||
.name {
|
||
margin-bottom: 7px;
|
||
font-weight: 500;
|
||
color: #333;
|
||
display: flex;
|
||
align-items: center;
|
||
.author {
|
||
margin-left: 8px;
|
||
color: #fff;
|
||
background: linear-gradient(90deg, #2d28ff, #1a7dff);
|
||
padding: 3px 4px;
|
||
font-size: 12px;
|
||
line-height: 12px;
|
||
border-radius: 4px;
|
||
}
|
||
}
|
||
|
||
.des {
|
||
line-height: 1.5;
|
||
// display: flex;
|
||
align-items: center;
|
||
.u-name {
|
||
color: #1880ff;
|
||
margin-right: 6px;
|
||
}
|
||
}
|
||
|
||
.star-wrap {
|
||
margin-top: 4px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
.time {
|
||
color: #999;
|
||
font-size: 12px;
|
||
}
|
||
.star-operator {
|
||
font-size: 12px;
|
||
color: #999;
|
||
display: flex;
|
||
align-items: center;
|
||
cursor: pointer;
|
||
.icon-wrap {
|
||
display: flex;
|
||
align-items: center;
|
||
margin-right: 16px;
|
||
cursor: pointer;
|
||
img {
|
||
width: 16px;
|
||
height: 16px;
|
||
margin-right: 3px;
|
||
}
|
||
}
|
||
|
||
.m-r16 {
|
||
margin-right: 16px;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
.no-more {
|
||
color: #999;
|
||
font-size: 14px;
|
||
text-align: center;
|
||
padding: 20px 0;
|
||
}
|
||
</style>
|