Compare commits
3 Commits
972bd2c8b8
...
8c50ffd479
| Author | SHA1 | Date | |
|---|---|---|---|
| 8c50ffd479 | |||
| ca7982c974 | |||
| 6c85256b96 |
@ -7,22 +7,22 @@ import type { ProjectRespVO, PageResultProjectCommentResVO, ProjectDrawPageRespV
|
|||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
export const getDetail = (params: { id?: number | string }) => {
|
export const getDetail = (params: { id?: number | string }) => {
|
||||||
return useFetchRequest.get<IResponse<ProjectRespVO>>('/prod-api/app-api/business/app/project-draw/preview', { query:params })
|
return useFetchRequest.get<IResponse<ProjectRespVO>>('/prod-api/app-api/business/app/project-draw/preview', { query: params })
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取评论列表
|
* 获取评论列表
|
||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
export const getCommentList = (params: { relationId?: number | string; pageNum?: number; pageSize?: number }) => {
|
export const getCommentList = (params: { relationId?: number | string; pageNum?: number; pageSize?: number; type: number }) => {
|
||||||
return useDollarFetchRequest.get<IResponse<PageResultProjectCommentResVO>>('/prod-api/app-api/business/app/project-comment/page', { query:params })
|
return useDollarFetchRequest.get<IResponse<PageResultProjectCommentResVO>>('/prod-api/app-api/business/app/project-comment/page', { query: params })
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发表评论
|
* 发表评论
|
||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
export const createComment = (params: { relationId?: number | string; content?: string; projectId?: number | string }) => {
|
export const createComment = (params: { relationId?: number | string; content?: string; projectId?: number | string; type: number }) => {
|
||||||
return useDollarFetchRequest.post<IResponse<boolean>>('/prod-api/app-api/business/app/project-comment/create', params)
|
return useDollarFetchRequest.post<IResponse<boolean>>('/prod-api/app-api/business/app/project-comment/create', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -31,14 +31,14 @@ export const createComment = (params: { relationId?: number | string; content?:
|
|||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
export const getRelationRecommend = (params: { type?: number | string; projectType?: number | string }) => {
|
export const getRelationRecommend = (params: { type?: number | string; projectType?: number | string }) => {
|
||||||
return useFetchRequest.get<IResponse<ProjectDrawPageRespVO[]>>('/prod-api/app-api/business/app/project-draw/top-list', { query:params })
|
return useFetchRequest.get<IResponse<ProjectDrawPageRespVO[]>>('/prod-api/app-api/business/app/project-draw/top-list', { query: params })
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 举报
|
* 举报
|
||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
export const report = (params: { id?: number | string; title?: string; comments?: string; files?: any; projectId: any; drawId: any }) => {
|
export const report = (params: { id?: number | string; title?: string; comments?: string; files?: any; projectId?: any; drawId: any; type: any }) => {
|
||||||
return useDollarFetchRequest.post<IResponse<boolean>>('/prod-api/app-api/business/project-report/create', params)
|
return useDollarFetchRequest.post<IResponse<boolean>>('/prod-api/app-api/business/project-report/create', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,6 +50,14 @@ export const getUserInfo = (params: { id?: number | string }) => {
|
|||||||
return useFetchRequest.get<IResponse<UserExtendSimpleRespDTO>>('/prod-api/app-api/business/app/project-draw/preview-user-info', { params })
|
return useFetchRequest.get<IResponse<UserExtendSimpleRespDTO>>('/prod-api/app-api/business/app/project-draw/preview-user-info', { params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取工具发布人信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
export const getToolUserInfo = (params: { id?: number | string }) => {
|
||||||
|
return useFetchRequest.get<IResponse<UserExtendSimpleRespDTO>>('/prod-api/app-api/business/resource/publish-user-info', { params })
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当前用户的主要作品内容
|
* 当前用户的主要作品内容
|
||||||
*/
|
*/
|
||||||
@ -59,7 +67,7 @@ export const getMainWork = (params: { id?: number | string; limit: number; membe
|
|||||||
/**
|
/**
|
||||||
* 创建内容信息
|
* 创建内容信息
|
||||||
*/
|
*/
|
||||||
export const createContent = (params: { projectId: any; drawId: any }) => {
|
export const createContent = (params: { projectId?: any; drawId: any; type: any }) => {
|
||||||
return useDollarFetchRequest.post<IResponse<boolean>>('/prod-api/app-api/business/project-member-favorites/create', params)
|
return useDollarFetchRequest.post<IResponse<boolean>>('/prod-api/app-api/business/project-member-favorites/create', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -137,6 +137,7 @@ export interface UserExtendSimpleRespDTO {
|
|||||||
files: any[]
|
files: any[]
|
||||||
fansCount: number
|
fansCount: number
|
||||||
projectCount: number
|
projectCount: number
|
||||||
|
postsNum?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ProjectDrawMemberRespVO {
|
export interface ProjectDrawMemberRespVO {
|
||||||
|
|||||||
@ -75,6 +75,8 @@ export interface ProjectResourceRespVO {
|
|||||||
favoriteId?: number
|
favoriteId?: number
|
||||||
downloadId?: string
|
downloadId?: string
|
||||||
sourceType: number
|
sourceType: number
|
||||||
|
ownedUserName?: string
|
||||||
|
ownedUserAvatar?: string
|
||||||
ownedUserIdInfo: {
|
ownedUserIdInfo: {
|
||||||
id: number
|
id: number
|
||||||
nickName: string
|
nickName: string
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mt-[30px] w-[100%]">
|
<div class="mt-[30px] w-[100%]">
|
||||||
<div class="h-[48px] w-[100%] rounded-[1px] bg-[#F8F8F8] pl-[10px] text-[16px] text-[#333333] font-normal line-height-[50px]"> 共有{{ result.total || 0 }}条评论 </div>
|
<div class="h-[48px] w-[100%] rounded-[1px] bg-[#F8F8F8] pl-[10px] text-[16px] text-[#333333] font-normal line-height-[50px]">
|
||||||
|
共有{{ result.total || 0 }}条评论
|
||||||
|
</div>
|
||||||
<div v-for="item in result.list" :key="item.id" class="mt-[20px] border-b-[1px] border-b-[#eee] border-b-solid pb-[14px]">
|
<div v-for="item in result.list" :key="item.id" class="mt-[20px] border-b-[1px] border-b-[#eee] border-b-solid pb-[14px]">
|
||||||
<div class="flex items-start">
|
<div class="flex items-start">
|
||||||
<el-avatar :src="item.creatorInfo.avatar" alt="" srcset="" class="h-[50px] w-[49px] rounded-full" />
|
<el-avatar :src="item.creatorInfo.avatar" alt="" srcset="" class="h-[50px] w-[49px] rounded-full" />
|
||||||
@ -44,7 +46,7 @@
|
|||||||
},
|
},
|
||||||
projectId: {
|
projectId: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: true,
|
required: false,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -66,7 +68,12 @@
|
|||||||
|
|
||||||
// 获取评论列表
|
// 获取评论列表
|
||||||
const handleGetCommentList = async () => {
|
const handleGetCommentList = async () => {
|
||||||
const res = await getCommentList({ relationId: props.relationId, pageNum: query.value.pageNo, pageSize: query.value.pageSize })
|
const res = await getCommentList({
|
||||||
|
relationId: props.relationId,
|
||||||
|
pageNum: query.value.pageNo,
|
||||||
|
pageSize: query.value.pageSize,
|
||||||
|
type: props.projectId ? 1 : 2,
|
||||||
|
})
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
result.value.list = res.data.list
|
result.value.list = res.data.list
|
||||||
result.value.total = res.data.total
|
result.value.total = res.data.total
|
||||||
@ -75,7 +82,7 @@
|
|||||||
|
|
||||||
// 发表评论
|
// 发表评论
|
||||||
const handleCreateComment = async () => {
|
const handleCreateComment = async () => {
|
||||||
const res = await createComment({ relationId: props.relationId, content: commentContent.value, projectId: props.projectId })
|
const res = await createComment({ relationId: props.relationId, content: commentContent.value, projectId: props.projectId || props.relationId, type: props.projectId ? 1 : 2 })
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
commentContent.value = ''
|
commentContent.value = ''
|
||||||
query.value.pageNo = 1
|
query.value.pageNo = 1
|
||||||
@ -87,8 +94,9 @@
|
|||||||
() => props.relationId,
|
() => props.relationId,
|
||||||
() => {
|
() => {
|
||||||
handleGetCommentList()
|
handleGetCommentList()
|
||||||
},{
|
},
|
||||||
immediate: true
|
{
|
||||||
|
immediate: true,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -146,7 +146,7 @@
|
|||||||
<div class="h-[20px]">
|
<div class="h-[20px]">
|
||||||
<img src="~/assets/images/user4.png" alt="fans" class="w-[80%] rounded-full vertical-top" />
|
<img src="~/assets/images/user4.png" alt="fans" class="w-[80%] rounded-full vertical-top" />
|
||||||
</div>
|
</div>
|
||||||
<div class="relative top-[-3px] ml-[8px] text-[14px] text-[#666] font-normal">粉丝: {{ userInfo.fansCount || 0 }}</div>
|
<div class="relative top-[-3px] ml-[8px] text-[14px] text-[#666] font-normal">发帖数: {{ userInfo.postsNum || 0 }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -361,6 +361,7 @@
|
|||||||
comments: value,
|
comments: value,
|
||||||
projectId: detail.value?.projectId,
|
projectId: detail.value?.projectId,
|
||||||
drawId: detail.value?.id,
|
drawId: detail.value?.id,
|
||||||
|
type: detail.value?.type,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
ElMessage.success('举报成功')
|
ElMessage.success('举报成功')
|
||||||
@ -380,6 +381,7 @@
|
|||||||
: await createContent({
|
: await createContent({
|
||||||
projectId: detail.value?.projectId,
|
projectId: detail.value?.projectId,
|
||||||
drawId: detail.value?.id,
|
drawId: detail.value?.id,
|
||||||
|
type: detail.value?.type,
|
||||||
})
|
})
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
ElMessage.success(`${detail.value?.favoriteId ? '取消' : '收藏'}成功`)
|
ElMessage.success(`${detail.value?.favoriteId ? '取消' : '收藏'}成功`)
|
||||||
|
|||||||
@ -13,8 +13,8 @@
|
|||||||
>
|
>
|
||||||
<div class="text-[20px] text-[#333333] font-normal"> {{ detail?.title }}</div>
|
<div class="text-[20px] text-[#333333] font-normal"> {{ detail?.title }}</div>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<img :src="detail?.ownedUserIdInfo?.avatar" alt="" srcset="" class="h-[30px] w-[30px] rd-[50%]" />
|
<img :src="detail?.ownedUserAvatar" alt="" srcset="" class="h-[30px] w-[30px] rd-[50%]" />
|
||||||
<span class="ml-[12px] color-[#999999]">by {{ detail?.ownedUserIdInfo?.nickName }}</span>
|
<span class="ml-[8px] color-[#999999]">by {{ detail?.ownedUserName }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -81,10 +81,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 评论 -->
|
<!-- 评论 -->
|
||||||
<!-- <CommentSection :relation-id="detail!.id" :project-id="detail!.projectId" /> -->
|
<CommentSection :relation-id="detail!.id" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ml-[22px]">
|
<div class="ml-[22px]">
|
||||||
<div class="box-border min-h-[269px] w-[397px] border border-[#EEEEEE] rounded-[12px] border-solid bg-[#FFFFFF] pa-[22px]">
|
<div class="box-border min-h-[180px] w-[397px] border border-[#EEEEEE] rounded-[12px] border-solid bg-[#FFFFFF] pa-[22px]">
|
||||||
<div class="mb-[10px]">工具ID: {{ detail?.no }}</div>
|
<div class="mb-[10px]">工具ID: {{ detail?.no }}</div>
|
||||||
<!-- <div class="mb-[10px]">文件大小:{{ detail?.filesInfo?.fileSize || 0 }} </div> -->
|
<!-- <div class="mb-[10px]">文件大小:{{ detail?.filesInfo?.fileSize || 0 }} </div> -->
|
||||||
<!-- <div class="mb-10px">图纸版本:{{ detail.editionsName }} </div> -->
|
<!-- <div class="mb-10px">图纸版本:{{ detail.editionsName }} </div> -->
|
||||||
@ -99,33 +99,33 @@
|
|||||||
<img src="~/assets/images/banner.png" alt="" srcset="" class="w-[100%]" />
|
<img src="~/assets/images/banner.png" alt="" srcset="" class="w-[100%]" />
|
||||||
<div class="box-border border border-[#EEEEEE] border-rd-[10px_10px_0px_0px] border-solid border-t-none bg-[#FFFFFF] pa-[18px]">
|
<div class="box-border border border-[#EEEEEE] border-rd-[10px_10px_0px_0px] border-solid border-t-none bg-[#FFFFFF] pa-[18px]">
|
||||||
<div class="flex flex-wrap items-start">
|
<div class="flex flex-wrap items-start">
|
||||||
<div v-if="userInfo.nickname" class="text-[18px] text-[#333333] font-bold">{{ userInfo.nickname }}</div>
|
<div v-if="userInfo?.nickname" class="text-[18px] text-[#333333] font-bold">{{ userInfo.nickname }}</div>
|
||||||
<div
|
<div
|
||||||
v-for="item in userInfo.labels"
|
v-for="item in userInfo?.labels"
|
||||||
:key="item"
|
:key="item"
|
||||||
class="mb-[10px] ml-[10px] box-border border border-[#1A65FF] rounded-[13px] border-solid px-[8px] py-[3px] color-[#1a65ff]"
|
class="mb-[10px] ml-[10px] box-border border border-[#1A65FF] rounded-[13px] border-solid px-[8px] py-[3px] color-[#1a65ff]"
|
||||||
>{{ item }}</div
|
>{{ item }}</div
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="userInfo.description" class="mb-[20px] text-[14px] text-[#333333] font-normal">{{ userInfo.description }}</div>
|
<div v-if="userInfo?.description" class="mb-[20px] text-[14px] text-[#333333] font-normal">{{ userInfo.description }}</div>
|
||||||
<!-- 显示作品 粉丝 荣誉证书 -->
|
<!-- 显示作品 粉丝 荣誉证书 -->
|
||||||
<div class="flex items-center gap-[40px]">
|
<div class="flex items-center gap-[40px]">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<div class="h-[20px]">
|
<div class="h-[20px]">
|
||||||
<img src="~/assets/images/folder.png" alt="works" class="w-[80%]" />
|
<img src="~/assets/images/folder.png" alt="works" class="w-[80%]" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ml-[8px] mt-[-4px] text-[14px] text-[#666] font-normal">作品: {{ userInfo.projectCount || 0 }}</div>
|
<div class="ml-[8px] mt-[-4px] text-[14px] text-[#666] font-normal">作品: {{ userInfo?.projectCount || 0 }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<div class="h-[20px]">
|
<div class="h-[20px]">
|
||||||
<img src="~/assets/images/user4.png" alt="fans" class="w-[80%] rounded-full vertical-top" />
|
<img src="~/assets/images/user4.png" alt="fans" class="w-[80%] rounded-full vertical-top" />
|
||||||
</div>
|
</div>
|
||||||
<div class="relative top-[-3px] ml-[8px] text-[14px] text-[#666] font-normal">粉丝: {{ userInfo.fansCount || 0 }}</div>
|
<div class="relative top-[-3px] ml-[8px] text-[14px] text-[#666] font-normal">发帖数: {{ userInfo?.fansCount || 0 }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 3个图片一排 超过换下一行 -->
|
<!-- 3个图片一排 超过换下一行 -->
|
||||||
<div v-if="userInfo.files?.length" class="mt-[20px] flex flex-wrap gap-[16px]">
|
<div v-if="userInfo?.files?.length" class="mt-[20px] flex flex-wrap gap-[16px]">
|
||||||
<div v-for="i in userInfo.files" :key="i" class="flex-1">
|
<div v-for="i in userInfo.files" :key="i" class="flex-1">
|
||||||
<div
|
<div
|
||||||
class="box-border h-[200px] w-full overflow-hidden border border-[#E5E7EB] rounded-[8px] border-solid from-[#FFFFFF] to-[#F5F7FA] bg-gradient-to-b p-[16px]"
|
class="box-border h-[200px] w-full overflow-hidden border border-[#E5E7EB] rounded-[8px] border-solid from-[#FFFFFF] to-[#F5F7FA] bg-gradient-to-b p-[16px]"
|
||||||
@ -167,10 +167,10 @@
|
|||||||
import CardPicture from '~/components/kl-card-picture/index.vue'
|
import CardPicture from '~/components/kl-card-picture/index.vue'
|
||||||
import { getDictTree } from '~/api/home/index'
|
import { getDictTree } from '~/api/home/index'
|
||||||
import { get } from '@/api/toolbox/index'
|
import { get } from '@/api/toolbox/index'
|
||||||
import { getDetail, getRelationRecommend, report, getUserInfo, getMainWork, createContent, createUserProject, deleteProject } from '~/api/drawe-detail/index'
|
import { getDetail, getRelationRecommend, report, getToolUserInfo, getMainWork, createContent, createUserProject, deleteProject } from '~/api/drawe-detail/index'
|
||||||
import KlNavTab from '~/components/kl-nav-tab/index.vue'
|
import KlNavTab from '~/components/kl-nav-tab/index.vue'
|
||||||
import ThumBnail from './components/swiper.vue'
|
import ThumBnail from './components/swiper.vue'
|
||||||
// import CommentSection from '~/components/comment-section/index.vue'
|
import CommentSection from '~/components/comment-section/index.vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import useUserStore from '~/stores/user'
|
import useUserStore from '~/stores/user'
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
@ -198,7 +198,7 @@
|
|||||||
|
|
||||||
const [{ data: mainWork }, { data: userInfo }] = await Promise.all([
|
const [{ data: mainWork }, { data: userInfo }] = await Promise.all([
|
||||||
getMainWork({ id: detail.value?.id, limit: 10, memberId: detail.value?.ownedUserId }),
|
getMainWork({ id: detail.value?.id, limit: 10, memberId: detail.value?.ownedUserId }),
|
||||||
getUserInfo({ id: detail.value?.id }),
|
getToolUserInfo({ id: detail.value?.id }),
|
||||||
])
|
])
|
||||||
|
|
||||||
// 获取最新发布
|
// 获取最新发布
|
||||||
@ -300,8 +300,8 @@
|
|||||||
title: detail.value?.title,
|
title: detail.value?.title,
|
||||||
files: detail.value?.files,
|
files: detail.value?.files,
|
||||||
comments: value,
|
comments: value,
|
||||||
projectId: detail.value?.projectId,
|
|
||||||
drawId: detail.value?.id,
|
drawId: detail.value?.id,
|
||||||
|
type: 4,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
ElMessage.success('举报成功')
|
ElMessage.success('举报成功')
|
||||||
@ -319,8 +319,8 @@
|
|||||||
const res = detail.value?.favoriteId
|
const res = detail.value?.favoriteId
|
||||||
? await deleteProject({ id: detail.value.favoriteId })
|
? await deleteProject({ id: detail.value.favoriteId })
|
||||||
: await createContent({
|
: await createContent({
|
||||||
projectId: detail.value?.projectId,
|
|
||||||
drawId: detail.value?.id,
|
drawId: detail.value?.id,
|
||||||
|
type: 4,
|
||||||
})
|
})
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
ElMessage.success(`${detail.value?.favoriteId ? '取消' : '收藏'}成功`)
|
ElMessage.success(`${detail.value?.favoriteId ? '取消' : '收藏'}成功`)
|
||||||
|
|||||||
Reference in New Issue
Block a user