diff --git a/src/api/all/generationWorkshop.ts b/src/api/all/generationWorkshop.ts index ae03fdc..c7efa76 100644 --- a/src/api/all/generationWorkshop.ts +++ b/src/api/all/generationWorkshop.ts @@ -108,8 +108,8 @@ export const patchShareWorksConfirm = (id: string, shareCode: string) => { }; // 内容稿件-评论(客户) -export const postShareWorksComments = (id: string, shareCode: string) => { - return Http.post(`/v1/share/works/${id}/comments`, {}, { +export const postShareWorksComments = (id: string, shareCode: string, params = {}) => { + return Http.post(`/v1/share/works/${id}/comments`, params, { headers: { 'share-code': shareCode }, }); }; diff --git a/src/assets/img/creative-generation-workshop/icon-avatar-default.png b/src/assets/img/creative-generation-workshop/icon-avatar-default.png new file mode 100644 index 0000000..277a80f Binary files /dev/null and b/src/assets/img/creative-generation-workshop/icon-avatar-default.png differ diff --git a/src/assets/svg/svg-comment.svg b/src/assets/svg/svg-comment.svg new file mode 100644 index 0000000..848f0cd --- /dev/null +++ b/src/assets/svg/svg-comment.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/views/creative-generation-workshop/explore/detail/aiSuggest.vue b/src/views/creative-generation-workshop/explore/detail/aiSuggest.vue deleted file mode 100644 index bb899cd..0000000 --- a/src/views/creative-generation-workshop/explore/detail/aiSuggest.vue +++ /dev/null @@ -1,175 +0,0 @@ - - - diff --git a/src/views/creative-generation-workshop/explore/detail/components/ai-suggest/index.vue b/src/views/creative-generation-workshop/explore/detail/components/ai-suggest/index.vue new file mode 100644 index 0000000..178fdc5 --- /dev/null +++ b/src/views/creative-generation-workshop/explore/detail/components/ai-suggest/index.vue @@ -0,0 +1,266 @@ + + + diff --git a/src/views/creative-generation-workshop/explore/detail/components/ai-suggest/style.scss b/src/views/creative-generation-workshop/explore/detail/components/ai-suggest/style.scss new file mode 100644 index 0000000..3882234 --- /dev/null +++ b/src/views/creative-generation-workshop/explore/detail/components/ai-suggest/style.scss @@ -0,0 +1,86 @@ +.ai-suggest-box { + width: 440px; + height: fit-content; + max-height: 100%; + border-radius: 16px; + background: linear-gradient(126deg, #eef2fd 8.36%, #f5ebfe 49.44%, #fdebf3 90.52%); + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.1); + .cts { + color: #939499; + font-family: $font-family-regular; + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: 22px; + &.bold { + font-family: $font-family-medium; + } + } + .ai-text { + font-family: $font-family-medium; + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: 24px; + background: linear-gradient(85deg, #7d419d 4.56%, #31353d 94.75%); + background-clip: text; + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + .result-box { + background: rgba(255, 255, 255, 0.8); + backdrop-filter: blur(4px); + .result-item { + .s1 { + color: var(--Brand-6, #6d4cfe); + font-family: $font-family-manrope-regular; + font-size: 24px; + font-style: normal; + font-weight: 700; + line-height: 32px; + } + &:first-child { + position: relative; + &::after { + content: ''; + position: absolute; + top: 50%; + transform: translateY(-50%); + right: 0; + width: 1px; + height: 32px; + background: var(--Border-1, #d7d7d9); + } + } + } + } + .collapse-box { + transition: all 0.3s; + } + .comment-box { + .cm { + background: linear-gradient(85deg, #7d419d 4.56%, #31353d 94.75%); + background-clip: text; + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + :deep(.arco-input-wrapper) { + padding: 8px 16px; + height: 38px; + border-radius: 8px !important; + background-color: rgba(255, 255, 255, 0.8) !important; + color: #211f24 !important; + &:hover { + border-color: #6d4cfe !important; + } + } + .comment-list { + backdrop-filter: blur(4px); + .comment-item { + &:not(:last-child) { + margin-bottom: 8px; + } + } + } + } +} diff --git a/src/views/creative-generation-workshop/explore/detail/constants.ts b/src/views/creative-generation-workshop/explore/detail/constants.ts index 8273ad4..4111fe9 100644 --- a/src/views/creative-generation-workshop/explore/detail/constants.ts +++ b/src/views/creative-generation-workshop/explore/detail/constants.ts @@ -24,4 +24,44 @@ export const RESULT_LIST = [ export const ENUM_OPINION = { wait: 0, // 待确认 confirm: 1, // 已确认 -}; \ No newline at end of file +}; + +export const formatRelativeTime = (date: number): string => { + const target = dayjs(date * 1000); + + if (!target.isValid()) return ''; + + const now = dayjs(); + // 处理未来时间 + if (target.isAfter(now)) return '刚刚'; + + const diffInMinutes = now.diff(target, 'minute'); + const diffInHours = now.diff(target, 'hour'); + const diffInDays = now.diff(target, 'day'); + const diffInYears = now.diff(target, 'year'); + + // 1分钟内 + if (diffInMinutes < 1) { + return '刚刚'; + } + // 1分钟 ~ 1小时 + else if (diffInMinutes < 60) { + return `${diffInMinutes}分钟前`; + } + // 1小时 ~ 24小时 + else if (diffInHours < 24) { + return `${diffInHours}小时前`; + } + // 1天 ~ 30天 + else if (diffInDays < 30) { + return `${diffInDays}天前`; + } + // 超过30天但不到1年 + else if (diffInYears < 1) { + return target.format('MM-DD HH:mm'); + } + // 超过1年 + else { + return target.format('YYYY-MM-DD HH:mm'); + } +}; diff --git a/src/views/creative-generation-workshop/explore/detail/index.vue b/src/views/creative-generation-workshop/explore/detail/index.vue index 6e62934..262d78b 100644 --- a/src/views/creative-generation-workshop/explore/detail/index.vue +++ b/src/views/creative-generation-workshop/explore/detail/index.vue @@ -1,11 +1,12 @@