From 4276e9466a32d5c554a829b03f9bbfdf00889cb2 Mon Sep 17 00:00:00 2001 From: Cxx0822 <1556464090@qq.com> Date: Fri, 27 Jun 2025 15:58:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=9B=B4=E6=96=B0=E6=9C=8B=E5=8F=8B?= =?UTF-8?q?=E5=9C=88=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/moment.ts | 6 ++++++ src/assets/ios.png | Bin 0 -> 2521 bytes src/components/Food/FoodCard.vue | 2 -- src/components/Moment/MomentCard.vue | 19 +++++++++++++++---- src/store/app.ts | 2 +- src/store/food.ts | 10 ++++++---- src/types/food.ts | 2 ++ src/views/moment/momentForm.vue | 15 ++++++++++++--- src/views/profile/index.vue | 9 +++++++++ 9 files changed, 51 insertions(+), 14 deletions(-) create mode 100644 src/assets/ios.png diff --git a/src/apis/moment.ts b/src/apis/moment.ts index 7cbeb30..cf3dc4b 100644 --- a/src/apis/moment.ts +++ b/src/apis/moment.ts @@ -15,6 +15,12 @@ export const updateMomentApi = (id: number, moment: IMoment): Promise = data: moment }) +export const deleteMomentApi = (id: number): Promise => + cloudService({ + url: `/food-service/moment/${id}`, + method: 'delete' + }) + export const queryMomentApi = (): Promise => cloudService({ url: '/food-service/moment', diff --git a/src/assets/ios.png b/src/assets/ios.png new file mode 100644 index 0000000000000000000000000000000000000000..d12ca8864a2ee23669b9c76fc63f9592bf9b6259 GIT binary patch literal 2521 zcmV;~2`2W5P)r004>z1^@s6b%)Yq00001b5ch_0Itp) z=>Px;lSxEDRCr$PoojX@D-48hb~#yLmg#$($(hE)sPrMVok!&_&_JnFdbnf1{Q2|e z^4|mg-rnBAU0z>bm*dgedEGoW8b5PwblK>x$`tB;YW?o`i-~eTr;IR;E0UQgo0PPo z9Kcyo0uq@hKa42Kpjkmt(yYd_`^@u*w~|nE-DiAu=UNh`=)PSze#%iylw8h24Hl8i zL>UmEz;<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#@`O}bRnB+T#h zFy;Bk*ORwvQ zN|4WBy5=e_s`FP2xEppKN#?MHKR4V=lr^19lm#|Qy3{z4w#ehGC~G7;D>I}h6{DP$ zaaZ1v>0H~@M_JO%+6y6PQuieUC8e|~pQAe{$G^!@ zOcX+geDy&TlNggE!s=!wN`O$s11ko#qAbu;Qru-QwNIx9nkY$Qs|2;H%u^(yFfnj1CiDi`d^6)0)ceWQex5SZ*!!O=va3`ou=1|)Np zu`47C6(#ymP{sF0y>OGX&E0909t@Fug%!C&S7;@Bs`Hn=?9W75n}T?@Qi+Pech}D6 zH&Hf`R9_y;R#Fn%kL2MYx7lj{>eTZlWCM znJ591OcWC(B{U|=HzNw^qof$HnA9n+q>Fo2=}GQ$J;QDbUp3=ML80u2-f&Y7+Z`vs zs?yR#Ijmr!B=Z|ZDl1CfwXG;Y?DiRn0X~;=F1ceOh@u8$!{XuRL-IH315XI zzpkM!Px>e(%7K6~Aj#*56OpE%6(z8O73BcOL@`nRA+Q~KRHz}6Sm}k3q?7EUo=c=z zVRcpxc2*TMKlf>`87N?*WG`B4qTK!%70Fqmxh6`$Ix9+$qYzIgb2~kql(-~3R_;T? zSXMC=Zlq#TXN>NT{z;txscQNz11cc9_EGmyM%eAts{5HJNmeQ#O_X)NCJFKTG%E^0 jYnV%_jq9@St|{{ props.item.username }}

{{ props.item.content }}

- +
+ +

{{ formatTimeAgo(props.item.date) }}

- + @@ -66,12 +69,14 @@ import { Edit } from '@element-plus/icons-vue' import { defineProps, reactive } from 'vue' import type { PropType } from 'vue' import type { IMoment } from '@/types/food' -import { serviceFileRootPath } from '@/utils' +import { fileServiceUrl, serviceFileRootPath } from '@/utils' import { formatTimeAgo } from '@/utils/dateUtils' import { useFoodStore } from '@/store/food' +import { useUserStore } from '@/store/user' import { useRouter } from 'vue-router' const router = useRouter() +const userStore = useUserStore() const props = defineProps({ item: { @@ -127,6 +132,12 @@ const sendCommentClick = async () => { font-size: larger; } + .moment-image-list { + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 10px; + } + .moment-comment { display: grid; grid-template-columns: 1fr 40px 60px; diff --git a/src/store/app.ts b/src/store/app.ts index c656b8e..e03ad84 100644 --- a/src/store/app.ts +++ b/src/store/app.ts @@ -14,7 +14,7 @@ export const useAppStore = defineStore('ipp', { isDark: false, isWebSocket: false, serverIp: '14.103.235.151', - version: 'v1.0.0.2025062401' + version: 'v1.0.0.2025062701' }), actions: { initApp() { diff --git a/src/store/food.ts b/src/store/food.ts index f8ef8f8..b16716e 100644 --- a/src/store/food.ts +++ b/src/store/food.ts @@ -21,7 +21,7 @@ import { import type { IDialog, IHandleApi, IStatsChart } from 'vue3-common/types' import { ElMessage } from 'element-plus' import { getCurrentMonth, getCurrentYear, getStartEndDate } from 'vue3-common/utils/dateUtil' -import { addCommentApi, addMomentApi, queryMomentApi, updateMomentApi } from '@/apis/moment' +import { addCommentApi, addMomentApi, deleteMomentApi, queryMomentApi, updateMomentApi } from '@/apis/moment' export const useFoodStore = defineStore('food', { state: () => ({ @@ -75,7 +75,8 @@ export const useFoodStore = defineStore('food', { recordApiType: 'ADD' as IHandleApi, editRecordIndex: 0, currentMoment: { - content: '' + content: '', + imageList: [] } as IMoment, momentApiType: 'ADD' as IHandleApi, imagePath: 'food-hub', @@ -179,7 +180,7 @@ export const useFoodStore = defineStore('food', { ElMessage.success('更新朋友圈成功') break case 'DELETE': - // await deleteRecordApi(record.id as number) + await deleteMomentApi(moment.id as number) ElMessage.success('删除朋友圈成功') break default: @@ -233,7 +234,8 @@ export const useFoodStore = defineStore('food', { }, getEmptyMoment(): IMoment { return { - content: '' + content: '', + imageList: [] } } } diff --git a/src/types/food.ts b/src/types/food.ts index 0755063..275c756 100644 --- a/src/types/food.ts +++ b/src/types/food.ts @@ -88,9 +88,11 @@ export interface IComment { export interface IMoment { id?: number; + userId?: number; username?: string; avatar?: string; content: string; + imageList: string[]; date?: string; commentList?: IComment[]; } diff --git a/src/views/moment/momentForm.vue b/src/views/moment/momentForm.vue index 0d7f9fb..727143f 100644 --- a/src/views/moment/momentForm.vue +++ b/src/views/moment/momentForm.vue @@ -8,11 +8,20 @@ :maxlength="100" show-word-limit placeholder="请输入内容"/> + + + +
确认 - 删除 + 删除 取消
@@ -47,9 +56,9 @@ const cancelClick = () => { } const deleteClick = () => { - commonElMessageBox('是否确认删除该朋友圈?').then(() => { + commonElMessageBox('是否确认删除该朋友圈?').then(async () => { foodStore.momentApiType = 'DELETE' - foodStore.handleMomentApi(foodStore.currentMoment) + await foodStore.handleMomentApi(foodStore.currentMoment) history.back() }) } diff --git a/src/views/profile/index.vue b/src/views/profile/index.vue index 5240f2d..996ebd1 100644 --- a/src/views/profile/index.vue +++ b/src/views/profile/index.vue @@ -5,6 +5,14 @@ 版本号: {{ appStore.version }} + +
+ IOS下载地址: +
+
+ Android下载地址: +
+
检查新版本 退出登录 @@ -17,6 +25,7 @@ import { useAppStore } from '@/store/app.ts' import { useUserStore } from '@/store/user.ts' import { useAuthStore } from '@/store/auth.ts' import { useRouter } from 'vue-router' +import { getAssetsImageFile } from '@/utils' const appStore = useAppStore() const userStore = useUserStore()