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 @@