瑶都万能墙
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

600 lines
15 KiB

  1. <template>
  2. <view class="page">
  3. <navbar title="群组详情" bgColor="#5baaff" color="#fff" leftClick @leftClick="$utils.navigateBack" />
  4. <!-- 群组信息 -->
  5. <view class="group-info">
  6. <view class="group-header">
  7. <image :src="groupInfo.avatar || '/static/image/logo.jpg'" class="group-avatar" mode="aspectFill"></image>
  8. <view class="group-details">
  9. <view class="group-name">{{ groupInfo.name || '群组名称' }}</view>
  10. <view class="group-desc">{{ groupInfo.description || '群组描述' }}</view>
  11. <view class="group-stats">
  12. <text class="member-count">{{ groupInfo.memberCount || 0 }}</text>
  13. <text class="separator">·</text>
  14. <text class="group-type">{{ groupInfo.type || '同城群' }}</text>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="group-actions">
  19. <view v-if="showQrCode" class="qr-code-section">
  20. <view class="qr-code-title">扫码加入群聊</view>
  21. <image :src="groupInfo.qrCode || '/static/image/qr/default.jpg'" class="qr-code-image" mode="aspectFit"></image>
  22. <view class="qr-code-tip">长按保存二维码微信扫码加入</view>
  23. </view>
  24. <view v-else class="watch-ad-btn" @click="watchAd">
  25. <uv-icon name="play-circle" size="30rpx" color="#fff"></uv-icon>
  26. <text>观看广告获取二维码</text>
  27. </view>
  28. <view v-if="groupInfo.isOwner" class="manage-btn" @click="manageGroup">
  29. <uv-icon name="setting" size="30rpx" color="#fff"></uv-icon>
  30. <text>编辑群组信息</text>
  31. </view>
  32. </view>
  33. </view>
  34. <!-- 群组公告 -->
  35. <view v-if="groupInfo.announcement" class="announcement">
  36. <view class="announcement-title">
  37. <uv-icon name="volume" size="30rpx" color="#5baaff"></uv-icon>
  38. <text>群组公告</text>
  39. </view>
  40. <view class="announcement-content">{{ groupInfo.announcement }}</view>
  41. </view>
  42. <!-- 成员列表 -->
  43. <view class="member-section">
  44. <view class="section-header">
  45. <text class="section-title">群组成员</text>
  46. <text class="member-count-text">({{ groupInfo.memberCount || 0 }})</text>
  47. </view>
  48. <view class="member-list">
  49. <view
  50. v-for="(member, index) in memberList"
  51. :key="index"
  52. class="member-item"
  53. @click="viewMemberProfile(member)"
  54. >
  55. <image :src="member.avatar || '/static/image/logo.jpg'" class="member-avatar" mode="aspectFill"></image>
  56. <view class="member-info">
  57. <view class="member-name">{{ member.name || '用户' }}</view>
  58. <view class="member-role">{{ member.role || '成员' }}</view>
  59. </view>
  60. <view class="member-status">
  61. <view v-if="member.isOnline" class="online-status">在线</view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. </template>
  68. <script>
  69. export default {
  70. data() {
  71. return {
  72. groupId: '',
  73. showQrCode: false, // 是否显示二维码
  74. groupInfo: {
  75. id: 1,
  76. name: '江华同城交流群',
  77. description: '江华本地生活交流,分享美食、租房、工作信息',
  78. avatar: '/static/image/logo.jpg',
  79. memberCount: 1280,
  80. type: '同城群',
  81. qrCode: '/static/image/qr/group1.jpg',
  82. isOwner: true,
  83. announcement: '欢迎加入江华同城交流群!请遵守群规,文明交流。'
  84. },
  85. memberList: [
  86. {
  87. id: 1,
  88. name: '张三',
  89. avatar: '/static/image/logo.jpg',
  90. role: '群主',
  91. isOnline: true
  92. },
  93. {
  94. id: 2,
  95. name: '李四',
  96. avatar: '/static/image/logo.jpg',
  97. role: '管理员',
  98. isOnline: true
  99. },
  100. {
  101. id: 3,
  102. name: '王五',
  103. avatar: '/static/image/logo.jpg',
  104. role: '成员',
  105. isOnline: false
  106. }
  107. ],
  108. }
  109. },
  110. onLoad(options) {
  111. if (options.id) {
  112. this.groupId = options.id
  113. this.getGroupDetail()
  114. }
  115. },
  116. methods: {
  117. // 获取群组详情
  118. getGroupDetail() {
  119. // 模拟数据
  120. const mockGroupData = {
  121. 1: {
  122. id: 1,
  123. name: '江华同城交流群',
  124. description: '江华本地生活交流,分享美食、租房、工作信息',
  125. avatar: '/static/image/logo.jpg',
  126. memberCount: 1280,
  127. type: '同城群',
  128. isJoined: true,
  129. isOwner: true,
  130. announcement: '欢迎加入江华同城交流群!请遵守群规,文明交流。'
  131. },
  132. 2: {
  133. id: 2,
  134. name: '江华美食分享群',
  135. description: '发现江华本地美食,分享美食攻略',
  136. avatar: '/static/image/logo.jpg',
  137. memberCount: 856,
  138. type: '兴趣群',
  139. isJoined: false,
  140. isOwner: false,
  141. announcement: '欢迎美食爱好者加入!请分享美食照片和推荐。'
  142. },
  143. 3: {
  144. id: 3,
  145. name: '江华租房信息群',
  146. description: '江华租房信息发布与交流',
  147. avatar: '/static/image/logo.jpg',
  148. memberCount: 2341,
  149. type: '同城群',
  150. isJoined: true,
  151. isOwner: false,
  152. announcement: '租房信息请详细说明位置、价格、联系方式。'
  153. },
  154. 4: {
  155. id: 4,
  156. name: '江华求职招聘群',
  157. description: '江华本地求职招聘信息发布',
  158. avatar: '/static/image/logo.jpg',
  159. memberCount: 1567,
  160. type: '工作群',
  161. isJoined: false,
  162. isOwner: false,
  163. announcement: '招聘信息请详细说明职位要求、薪资待遇、联系方式。'
  164. },
  165. 5: {
  166. id: 5,
  167. name: '江华旅游攻略群',
  168. description: '江华旅游景点推荐,攻略分享',
  169. avatar: '/static/image/logo.jpg',
  170. memberCount: 623,
  171. type: '兴趣群',
  172. isJoined: true,
  173. isOwner: false,
  174. announcement: '欢迎分享江华旅游攻略和景点推荐!'
  175. },
  176. 6: {
  177. id: 6,
  178. name: '江华学习交流群',
  179. description: '江华本地学习交流,分享学习资源',
  180. avatar: '/static/image/logo.jpg',
  181. memberCount: 445,
  182. type: '学习群',
  183. isJoined: false,
  184. isOwner: false,
  185. announcement: '欢迎学习爱好者加入!请分享学习心得和资源。'
  186. },
  187. 7: {
  188. id: 7,
  189. name: '江华二手交易群',
  190. description: '江华本地二手物品交易',
  191. avatar: '/static/image/logo.jpg',
  192. memberCount: 1890,
  193. type: '同城群',
  194. isJoined: true,
  195. isOwner: false,
  196. announcement: '二手交易请详细说明物品状况、价格、联系方式。'
  197. },
  198. 8: {
  199. id: 8,
  200. name: '江华宠物交流群',
  201. description: '江华宠物爱好者交流群',
  202. avatar: '/static/image/logo.jpg',
  203. memberCount: 567,
  204. type: '兴趣群',
  205. isJoined: false,
  206. isOwner: false,
  207. announcement: '欢迎宠物爱好者加入!请分享宠物照片和养护经验。'
  208. },
  209. 9: {
  210. id: 9,
  211. name: '江华汽车交流群',
  212. description: '江华汽车爱好者交流,分享用车心得',
  213. avatar: '/static/image/logo.jpg',
  214. memberCount: 892,
  215. type: '兴趣群',
  216. isJoined: true,
  217. isOwner: false,
  218. announcement: '欢迎汽车爱好者加入!请分享用车心得和维修经验。'
  219. },
  220. 10: {
  221. id: 10,
  222. name: '江华宝妈交流群',
  223. description: '江华宝妈育儿经验分享',
  224. avatar: '/static/image/logo.jpg',
  225. memberCount: 1234,
  226. type: '同城群',
  227. isJoined: false,
  228. isOwner: false,
  229. announcement: '欢迎宝妈加入!请分享育儿经验和心得。'
  230. },
  231. 11: {
  232. id: 11,
  233. name: '江华IT技术交流群',
  234. description: '江华IT从业者技术交流',
  235. avatar: '/static/image/logo.jpg',
  236. memberCount: 345,
  237. type: '工作群',
  238. isJoined: true,
  239. isOwner: true,
  240. announcement: '欢迎IT从业者加入!请分享技术心得和项目经验。'
  241. },
  242. 12: {
  243. id: 12,
  244. name: '江华健身运动群',
  245. description: '江华健身爱好者交流群',
  246. avatar: '/static/image/logo.jpg',
  247. memberCount: 678,
  248. type: '兴趣群',
  249. isJoined: false,
  250. isOwner: false,
  251. announcement: '欢迎健身爱好者加入!请分享健身心得和运动计划。'
  252. },
  253. 13: {
  254. id: 13,
  255. name: '江华摄影爱好者群',
  256. description: '江华摄影爱好者交流群',
  257. avatar: '/static/image/logo.jpg',
  258. memberCount: 456,
  259. type: '兴趣群',
  260. isJoined: true,
  261. isOwner: false,
  262. announcement: '欢迎摄影爱好者加入!请分享摄影作品和技巧。'
  263. },
  264. 14: {
  265. id: 14,
  266. name: '江华创业交流群',
  267. description: '江华创业者交流平台',
  268. avatar: '/static/image/logo.jpg',
  269. memberCount: 789,
  270. type: '工作群',
  271. isJoined: false,
  272. isOwner: false,
  273. announcement: '欢迎创业者加入!请分享创业心得和项目经验。'
  274. },
  275. 15: {
  276. id: 15,
  277. name: '江华医疗健康群',
  278. description: '江华医疗健康咨询交流',
  279. avatar: '/static/image/logo.jpg',
  280. memberCount: 1123,
  281. type: '同城群',
  282. isJoined: true,
  283. isOwner: false,
  284. announcement: '欢迎医疗健康从业者加入!请分享健康知识和医疗经验。'
  285. },
  286. 16: {
  287. id: 16,
  288. name: '江华读书会',
  289. description: '江华读书爱好者交流群',
  290. avatar: '/static/image/logo.jpg',
  291. memberCount: 234,
  292. type: '学习群',
  293. isJoined: false,
  294. isOwner: false,
  295. announcement: '欢迎读书爱好者加入!请分享读书心得和好书推荐。'
  296. },
  297. 17: {
  298. id: 17,
  299. name: '江华音乐爱好者群',
  300. description: '江华音乐爱好者交流群',
  301. avatar: '/static/image/logo.jpg',
  302. memberCount: 567,
  303. type: '兴趣群',
  304. isJoined: true,
  305. isOwner: false,
  306. announcement: '欢迎音乐爱好者加入!请分享音乐作品和演奏技巧。'
  307. },
  308. 18: {
  309. id: 18,
  310. name: '江华电商交流群',
  311. description: '江华电商从业者交流群',
  312. avatar: '/static/image/logo.jpg',
  313. memberCount: 890,
  314. type: '工作群',
  315. isJoined: false,
  316. isOwner: false,
  317. announcement: '欢迎电商从业者加入!请分享电商运营经验和技巧。'
  318. },
  319. 19: {
  320. id: 19,
  321. name: '江华园艺爱好者群',
  322. description: '江华园艺爱好者交流群',
  323. avatar: '/static/image/logo.jpg',
  324. memberCount: 345,
  325. type: '兴趣群',
  326. isJoined: true,
  327. isOwner: false,
  328. announcement: '欢迎园艺爱好者加入!请分享园艺心得和植物养护经验。'
  329. },
  330. 20: {
  331. id: 20,
  332. name: '江华法律咨询群',
  333. description: '江华法律咨询服务交流',
  334. avatar: '/static/image/logo.jpg',
  335. memberCount: 678,
  336. type: '同城群',
  337. isJoined: false,
  338. isOwner: false,
  339. announcement: '欢迎法律从业者加入!请提供专业的法律咨询服务。'
  340. }
  341. }
  342. // 模拟API延迟
  343. setTimeout(() => {
  344. this.groupInfo = mockGroupData[this.groupId] || this.groupInfo
  345. }, 500)
  346. },
  347. // 观看广告
  348. watchAd() {
  349. uni.showLoading({
  350. title: '加载广告中...'
  351. })
  352. // 模拟广告播放
  353. setTimeout(() => {
  354. uni.hideLoading()
  355. uni.showModal({
  356. title: '广告播放完成',
  357. content: '恭喜您获得群聊二维码!',
  358. showCancel: false,
  359. success: () => {
  360. this.showQrCode = true
  361. }
  362. })
  363. }, 2000)
  364. },
  365. // 查看成员资料
  366. viewMemberProfile(member) {
  367. this.$utils.navigateTo('/pages_order/profile/userProfile?id=' + member.id)
  368. },
  369. // 管理群组
  370. manageGroup() {
  371. this.$utils.navigateTo('/pages_order/group/createGroup?id=' + this.groupId)
  372. }
  373. }
  374. }
  375. </script>
  376. <style scoped lang="scss">
  377. .page {
  378. background-color: #f5f5f5;
  379. min-height: 100vh;
  380. .group-info {
  381. background-color: #fff;
  382. padding: 30rpx;
  383. margin-bottom: 20rpx;
  384. .group-header {
  385. display: flex;
  386. align-items: center;
  387. margin-bottom: 30rpx;
  388. .group-avatar {
  389. width: 120rpx;
  390. height: 120rpx;
  391. margin-right: 20rpx;
  392. image {
  393. width: 100%;
  394. height: 100%;
  395. border-radius: 20rpx;
  396. }
  397. }
  398. .group-details {
  399. flex: 1;
  400. .group-name {
  401. font-size: 36rpx;
  402. font-weight: bold;
  403. color: #333;
  404. margin-bottom: 10rpx;
  405. }
  406. .group-desc {
  407. font-size: 28rpx;
  408. color: #666;
  409. margin-bottom: 10rpx;
  410. line-height: 1.4;
  411. }
  412. .group-stats {
  413. display: flex;
  414. align-items: center;
  415. font-size: 24rpx;
  416. color: #999;
  417. .separator {
  418. margin: 0 8rpx;
  419. }
  420. }
  421. }
  422. }
  423. .group-actions {
  424. display: flex;
  425. flex-direction: column;
  426. gap: 20rpx;
  427. .qr-code-section {
  428. display: flex;
  429. flex-direction: column;
  430. align-items: center;
  431. padding: 30rpx;
  432. background-color: #f8f9fa;
  433. border-radius: 20rpx;
  434. .qr-code-title {
  435. font-size: 30rpx;
  436. font-weight: bold;
  437. color: #333;
  438. margin-bottom: 20rpx;
  439. }
  440. .qr-code-image {
  441. width: 300rpx;
  442. height: 300rpx;
  443. border-radius: 10rpx;
  444. margin-bottom: 20rpx;
  445. }
  446. .qr-code-tip {
  447. font-size: 24rpx;
  448. color: #666;
  449. text-align: center;
  450. }
  451. }
  452. .watch-ad-btn, .manage-btn {
  453. display: flex;
  454. align-items: center;
  455. justify-content: center;
  456. padding: 20rpx 30rpx;
  457. border-radius: 30rpx;
  458. font-size: 28rpx;
  459. text {
  460. margin-left: 10rpx;
  461. }
  462. }
  463. .watch-ad-btn {
  464. background-color: #ff6b35;
  465. color: #fff;
  466. }
  467. .manage-btn {
  468. background-color: #5baaff;
  469. color: #fff;
  470. }
  471. }
  472. }
  473. .announcement {
  474. background-color: #fff;
  475. padding: 30rpx;
  476. margin-bottom: 20rpx;
  477. .announcement-title {
  478. display: flex;
  479. align-items: center;
  480. margin-bottom: 20rpx;
  481. font-size: 30rpx;
  482. font-weight: bold;
  483. color: #333;
  484. text {
  485. margin-left: 10rpx;
  486. }
  487. }
  488. .announcement-content {
  489. font-size: 28rpx;
  490. color: #666;
  491. line-height: 1.5;
  492. }
  493. }
  494. .member-section {
  495. background-color: #fff;
  496. padding: 30rpx;
  497. margin-bottom: 20rpx;
  498. .section-header {
  499. display: flex;
  500. align-items: center;
  501. margin-bottom: 30rpx;
  502. .section-title {
  503. font-size: 32rpx;
  504. font-weight: bold;
  505. color: #333;
  506. }
  507. .member-count-text {
  508. font-size: 24rpx;
  509. color: #999;
  510. margin-left: 10rpx;
  511. }
  512. }
  513. }
  514. .member-list {
  515. .member-item {
  516. display: flex;
  517. align-items: center;
  518. padding: 20rpx 0;
  519. border-bottom: 1rpx solid #f0f0f0;
  520. &:last-child {
  521. border-bottom: none;
  522. }
  523. .member-avatar {
  524. width: 80rpx;
  525. height: 80rpx;
  526. border-radius: 50%;
  527. margin-right: 20rpx;
  528. }
  529. .member-info {
  530. flex: 1;
  531. .member-name {
  532. font-size: 28rpx;
  533. color: #333;
  534. margin-bottom: 5rpx;
  535. }
  536. .member-role {
  537. font-size: 24rpx;
  538. color: #999;
  539. }
  540. }
  541. .member-status {
  542. .online-status {
  543. background-color: #52c41a;
  544. color: #fff;
  545. padding: 4rpx 12rpx;
  546. border-radius: 10rpx;
  547. font-size: 20rpx;
  548. }
  549. }
  550. }
  551. }
  552. }
  553. </style>