From 819fb8db8fa8e6e3d7925db9611d20da3932f64d Mon Sep 17 00:00:00 2001 From: rd <1344903914@qq.com> Date: Fri, 8 Aug 2025 15:55:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=A8=BF=E4=BB=B6=E8=AF=84=E8=AE=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/all/generationWorkshop.ts | 4 +- .../icon-avatar-default.png | Bin 0 -> 1749 bytes src/assets/svg/svg-comment.svg | 6 + .../explore/detail/aiSuggest.vue | 175 ------------ .../detail/components/ai-suggest/index.vue | 266 ++++++++++++++++++ .../detail/components/ai-suggest/style.scss | 86 ++++++ .../explore/detail/constants.ts | 42 ++- .../explore/detail/index.vue | 32 ++- 8 files changed, 431 insertions(+), 180 deletions(-) create mode 100644 src/assets/img/creative-generation-workshop/icon-avatar-default.png create mode 100644 src/assets/svg/svg-comment.svg delete mode 100644 src/views/creative-generation-workshop/explore/detail/aiSuggest.vue create mode 100644 src/views/creative-generation-workshop/explore/detail/components/ai-suggest/index.vue create mode 100644 src/views/creative-generation-workshop/explore/detail/components/ai-suggest/style.scss 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 0000000000000000000000000000000000000000..277a80ff427b81f90172dfb54458f148bde63c1a GIT binary patch literal 1749 zcmV;`1}gc9P)X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<6#K9zkP#jk=A!pGK<#r zfy@gG%4~h~gS+y|*gauqH1gjYZk|Jy1TA?NS_D+Cs`)-wvzj9j3;gMhl!kKFAUWn9 zy4Hb5OGG;CRC7@m#=y+qx8HEn5z-ecB$M5upareTtyO2f{m&f&iWTa5F!TH>qfgLP zli1o_Pj^1VXl3Halck%h>P)u{v9ofHOJ5YD6PT=Vl4B-rbF6?;Sq9+3l@V;2pl8c@ z;oB=tO$S`ZwpEsE@0BL1=ft|}s(H#e>_3diHS1QlXHub_0-B(qOJ~NaYoo7KuDQQm z`=m&F61RH-io`qJzLJn4^;0W}S7*rqls?c-YFOl2(umjmZh9_F`!x!0{~TGQt0Fy( zw3&am9jG%2Dlmc>KJ*A92>9CVEpo#2_cIv~=9qyNkw+!dhbKeTEK-0LNocqIlR2R4 z#(70_VQ7TZ?y7^KQrFe8&T^h-B5rZ(vQ>-BQMh-97yy@Mq;3o<#B>39BOy43r-Q-^ zQC@?54>v&M_Rxm8(>tgr(8;VUQ=ammUzP(>p1TttMi7S)w1Hy^L755r&EqhDN%NG4 rwr-IT3Fa{wB9@eYXQ=w11#9PjgAKl8*FIHi00000NkvXXu0mjfQRX{& literal 0 HcmV?d00001 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 @@