From e2b171c7a521cd68726afc5febde5568079e20b3 Mon Sep 17 00:00:00 2001 From: lzx_win <2602107437@qq.com> Date: Tue, 23 Sep 2025 14:40:34 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=BE=A4=E7=BB=84=E5=8A=9F=E8=83=BD):=20?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E5=90=8C=E5=9F=8E=E7=BE=A4=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增群组相关页面:创建群组、群组详情、群组聊天、群组管理 - 添加群组列表组件和API接口 - 修改活动页为群组列表页并实现搜索和分类功能 - 更新配置文件和路由配置支持群组功能 - 完善文件上传组件支持视频类型 - 添加群组功能文档和项目规则说明 --- .trae/rules/project_rules.md | 6 + api/api.js | 86 ++++- components/base/tabbar.vue | 4 +- components/list/dynamic/daynamicInfo.vue | 74 +++- components/list/group/groupItem.vue | 150 ++++++++ components/list/square/waterfallItem.vue | 79 +++- config.js | 3 +- doc/group_feature.md | 117 ++++++ pages.json | 28 ++ pages/index/activity.vue | 505 +++++++++++++++++++++++--- pages/index/index.vue | 3 + pages/index/product.vue | 60 ++- pages_order/group/createGroup.vue | 300 +++++++++++++++ pages_order/group/groupChat.vue | 304 ++++++++++++++++ pages_order/group/groupDetail.vue | 601 +++++++++++++++++++++++++++++++ pages_order/group/groupManage.vue | 456 +++++++++++++++++++++++ pages_order/post/addPost.vue | 30 +- pages_order/post/postDetail.vue | 2 +- 18 files changed, 2714 insertions(+), 94 deletions(-) create mode 100644 .trae/rules/project_rules.md create mode 100644 components/list/group/groupItem.vue create mode 100644 doc/group_feature.md create mode 100644 pages_order/group/createGroup.vue create mode 100644 pages_order/group/groupChat.vue create mode 100644 pages_order/group/groupDetail.vue create mode 100644 pages_order/group/groupManage.vue diff --git a/.trae/rules/project_rules.md b/.trae/rules/project_rules.md new file mode 100644 index 0000000..f273bfb --- /dev/null +++ b/.trae/rules/project_rules.md @@ -0,0 +1,6 @@ + + + +功能模块 +同城群:显示各个地区同城群聊的基本信息,不需要实时聊天、不需要加入群聊、点击进行播放广告看完广告显示群聊二维码 + diff --git a/api/api.js b/api/api.js index 635da6f..8a55bff 100644 --- a/api/api.js +++ b/api/api.js @@ -12,7 +12,7 @@ const config = { // limit : 1000 // }, - getConfig : {url : '/login/getConfigInfo', method : 'GET', limit : 500}, + getConfig : {url : '/login/getConfigInfo', method : 'GET', auth: false, limit : 500}, // 微信登录接口 @@ -63,21 +63,25 @@ const config = { getClassInfo: { url: '/city/getClassInfo', method: 'GET', + auth: false, }, //获取首页头部信息 getIndexHeaderInfo: { url: '/city/getIndexHeaderInfo', method: 'GET', + auth: false, }, //获取banner列表 getBannerList: { url: '/city/getBannerList', method: 'GET', + auth: false, }, //获取分类类型列表 getClassifyList: { url: '/city/getClassifyList', method: 'GET', + auth: false, }, //获取工作信息列表 getJobPage: { @@ -441,6 +445,86 @@ const config = { auth : true, showLoading : true, }, + + // 获取群组列表 + getGroupList : { + url: '/group/getGroupList', + method: 'GET', + auth : false, + limit : 1000, + }, + + // 获取群组详情 + getGroupDetail : { + url: '/group/getGroupDetail', + method: 'GET', + auth : true, + limit : 1000, + }, + + // 加入群组 + joinGroup : { + url: '/group/joinGroup', + method: 'POST', + auth : true, + showLoading : true, + }, + + // 退出群组 + quitGroup : { + url: '/group/quitGroup', + method: 'POST', + auth : true, + showLoading : true, + }, + + // 创建群组 + createGroup : { + url: '/group/createGroup', + method: 'POST', + auth : true, + showLoading : true, + }, + + // 发送群组消息 + sendGroupMessage : { + url: '/group/sendMessage', + method: 'POST', + auth : true, + showLoading : false, + }, + + // 获取群组消息列表 + getGroupMessages : { + url: '/group/getMessages', + method: 'GET', + auth : true, + limit : 1000, + }, + + // 更新群组公告 + updateGroupAnnouncement : { + url: '/group/updateAnnouncement', + method: 'POST', + auth : true, + showLoading : true, + }, + + // 解散群组 + dissolveGroup : { + url: '/group/dissolveGroup', + method: 'POST', + auth : true, + showLoading : true, + }, + + // 转让群主 + transferGroup : { + url: '/group/transferGroup', + method: 'POST', + auth : true, + showLoading : true, + }, } const models = ['order'] diff --git a/components/base/tabbar.vue b/components/base/tabbar.vue index 3ea4fe1..bf0c3c1 100644 --- a/components/base/tabbar.vue +++ b/components/base/tabbar.vue @@ -54,8 +54,8 @@ "selectedIconPath": "/static/image/tabbar/order-a.png", "iconPath": "/static/image/tabbar/order.png", "pagePath": "/pages/index/activity", - "title": "活动", - icon : 'gift', + "title": "同城群", + icon : 'chat', }, // { // "selectedIconPath": "/static/image/tabbar/cart-a.png", diff --git a/components/list/dynamic/daynamicInfo.vue b/components/list/dynamic/daynamicInfo.vue index 6690ea7..d509b6e 100644 --- a/components/list/dynamic/daynamicInfo.vue +++ b/components/list/dynamic/daynamicInfo.vue @@ -4,8 +4,15 @@ - - + + + + @@ -36,6 +43,33 @@ } return arr + }, + mediaList(){ + let mediaArray = [] + + // 添加微信二维码图片 + if(this.item.wxImage){ + mediaArray.push({ + url: this.item.wxImage, + type: 'image' + }) + } + + // 从 image 字段解析所有文件(图片和视频) + if(this.item.image){ + this.item.image.split(',').forEach(url => { + if(url.trim()){ + // 根据文件扩展名判断类型 + const isVideo = this.isVideoFile(url.trim()) + mediaArray.push({ + url: url.trim(), + type: isVideo ? 'video' : 'image' + }) + } + }) + } + + return mediaArray } }, data() { @@ -44,7 +78,25 @@ } }, methods: { - + previewMedia(media, index){ + if(media.type === 'image'){ + // 只预览图片 + const imageUrls = this.mediaList.filter(item => item.type === 'image').map(item => item.url) + const imageIndex = this.mediaList.slice(0, index).filter(item => item.type === 'image').length + uni.previewImage({ + urls: imageUrls, + current: imageIndex + }) + } else if(media.type === 'video'){ + // 视频点击播放(已经有controls属性,无需额外处理) + console.log('播放视频:', media.url) + } + }, + isVideoFile(url) { + const videoExtensions = ['.mp4', '.avi', '.mov', '.wmv', '.flv', '.webm', '.m4v'] + const lowerUrl = url.toLowerCase() + return videoExtensions.some(ext => lowerUrl.includes(ext)) + } } } @@ -63,12 +115,28 @@ .wrokimg { margin: 10rpx; + position: relative; image { height: 190rpx; width: 190rpx; border-radius: 20rpx; } + + video { + height: 190rpx; + width: 190rpx; + border-radius: 20rpx; + } + + .video-overlay { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + pointer-events: none; + z-index: 1; + } } } \ No newline at end of file diff --git a/components/list/group/groupItem.vue b/components/list/group/groupItem.vue new file mode 100644 index 0000000..0754511 --- /dev/null +++ b/components/list/group/groupItem.vue @@ -0,0 +1,150 @@ + + + + + \ No newline at end of file diff --git a/components/list/square/waterfallItem.vue b/components/list/square/waterfallItem.vue index b3ac633..5ad51fb 100644 --- a/components/list/square/waterfallItem.vue +++ b/components/list/square/waterfallItem.vue @@ -1,8 +1,16 @@