circle-feed.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748
  1. <template>
  2. <view class="feed-page">
  3. <!-- 导航栏 -->
  4. <view class="nav-bar">
  5. <view class="nav-back" @tap="goBack">
  6. <text class="nav-back-icon">‹</text>
  7. </view>
  8. <text class="nav-title">{{ circleName }}</text>
  9. <view class="nav-placeholder"></view>
  10. </view>
  11. <!-- 圈子信息卡 -->
  12. <view class="circle-header-card" @tap="showMemberList">
  13. <view class="ch-avatar">{{ (circleName || '?').substring(0,1) }}</view>
  14. <view class="ch-info">
  15. <text class="ch-name">{{ circleName }}</text>
  16. <text class="ch-meta">{{ memberCount }} 位成员 · 点击查看详情</text>
  17. </view>
  18. <text class="ch-arrow">›</text>
  19. </view>
  20. <!-- 发布框 -->
  21. <view class="post-input-card" @tap="openPostEditor">
  22. <text class="pi-icon">✍️</text>
  23. <text class="pi-placeholder">分享今天的打卡或想法...</text>
  24. </view>
  25. <!-- 动态列表 -->
  26. <scroll-view class="feed-scroll" scroll-y :refresher-enabled="true" :refresher-triggered="refreshing" @refresherrefresh="onRefresh" @scrolltolower="onScrollToLower">
  27. <view v-if="posts.length === 0 && !loading" class="empty-state">
  28. <text class="empty-icon">📭</text>
  29. <text class="empty-text">暂无动态,快来发第一条吧</text>
  30. </view>
  31. <view v-for="post in posts" :key="post.id" class="feed-item">
  32. <!-- 作者信息 -->
  33. <view class="feed-author">
  34. <view class="fa-avatar">{{ getAvatarText(post) }}</view>
  35. <view class="fa-info">
  36. <text class="fa-name">{{ getMemberName(post) }}</text>
  37. <text class="fa-time">{{ formatTime(post.createdAt) }}</text>
  38. </view>
  39. <text class="fa-type-badge" :class="'type-' + post.type">{{ typeLabel(post.type) }}</text>
  40. </view>
  41. <!-- 文字内容 -->
  42. <view class="feed-content" v-if="post.content">
  43. <text class="fc-text">{{ post.content }}</text>
  44. </view>
  45. <!-- 图片 -->
  46. <view class="feed-images" v-if="post.imageUrls && post.imageUrls.length > 0">
  47. <image
  48. v-for="(img, idx) in post.imageUrls"
  49. :key="idx"
  50. :src="img"
  51. mode="aspectFill"
  52. class="feed-img"
  53. @tap="previewImage(post.imageUrls, idx)"
  54. />
  55. </view>
  56. <!-- 操作栏 -->
  57. <view class="feed-actions">
  58. <view class="fa-item" :class="{ 'fa-active': post.liked }" @tap="toggleLike(post)">
  59. <text class="fa-icon">{{ post.liked ? '❤️' : '🤍' }}</text>
  60. <text class="fa-count">{{ post.likeCount || 0 }}</text>
  61. </view>
  62. <view class="fa-item" @tap="openCommentInput(post)">
  63. <text class="fa-icon">💬</text>
  64. <text class="fa-count">{{ post.commentCount || 0 }}</text>
  65. </view>
  66. <view class="fa-item" @tap="sharePost(post)">
  67. <text class="fa-icon">↗️</text>
  68. <text class="fa-count">分享</text>
  69. </view>
  70. <view class="fa-item fa-delete" v-if="post.memberId === myMemberId && !post.deleting" @tap="deletePost(post)">
  71. <text class="fa-icon">🗑️</text>
  72. <text class="fa-count">删除</text>
  73. </view>
  74. </view>
  75. <!-- 评论列表 -->
  76. <view class="feed-comments" v-if="post.comments && post.comments.length > 0">
  77. <view class="comment-item" v-for="(c, idx) in getVisibleComments(post)" :key="getCommentKey(c, idx)">
  78. <image class="c-avatar" v-if="getCommentAvatar(c)" :src="getCommentAvatar(c)" mode="aspectFill" />
  79. <text class="c-name">{{ getCommentName(c) }}</text>
  80. <text class="c-text">{{ c.content }}</text>
  81. </view>
  82. <text class="more-comments" v-if="post.commentCount > 3 && !post.showAllComments" @tap="loadMoreComments(post)">查看全部 {{ post.commentCount }} 条评论</text>
  83. <text class="more-comments" v-if="post.showAllComments && post.commentCount > 3" @tap="collapseComments(post)">收起评论</text>
  84. </view>
  85. <!-- 评论输入框(展开时) -->
  86. <view class="comment-input-area" v-if="post.showCommentInput">
  87. <input class="ci-input" placeholder="写评论..." v-model="post.commentText" @confirm="submitComment(post)" />
  88. <text class="ci-send" @tap="submitComment(post)">发送</text>
  89. </view>
  90. </view>
  91. <view class="loading-more" v-if="loadingMore">
  92. <text class="lm-text">加载中...</text>
  93. </view>
  94. <view class="end-hint" v-if="!hasMore && posts.length > 0">
  95. <text class="eh-text">— 没有更多了 —</text>
  96. </view>
  97. <view class="bottom-space"></view>
  98. </scroll-view>
  99. <!-- 发帖弹窗 -->
  100. <view class="modal-mask" v-if="showPostModal" @tap="closePostModal">
  101. <view class="modal-content" @tap.stop>
  102. <view class="modal-header">
  103. <text class="modal-title">发布动态</text>
  104. <text class="modal-close" @tap="closePostModal">✕</text>
  105. </view>
  106. <view class="type-selector">
  107. <view class="type-opt" :class="{ 'type-active': postType === t.value }" v-for="t in postTypes" :key="t.value" @tap="postType = t.value">
  108. <text class="to-icon">{{ t.icon }}</text>
  109. <text class="to-label">{{ t.label }}</text>
  110. </view>
  111. </view>
  112. <textarea class="post-textarea" placeholder="分享你的想法..." v-model="postContent" maxlength="500" />
  113. <view class="modal-footer">
  114. <button class="btn-publish" :disabled="!postContent.trim()" @tap="publishPost">发布</button>
  115. </view>
  116. </view>
  117. </view>
  118. <!-- 成员列表弹窗 -->
  119. <view class="modal-mask" v-if="showMemberModal" @tap="showMemberModal = false">
  120. <view class="modal-content modal-members" @tap.stop>
  121. <view class="modal-header">
  122. <text class="modal-title">圈子成员</text>
  123. <text class="modal-close" @tap="showMemberModal = false">✕</text>
  124. </view>
  125. <view class="member-list">
  126. <view class="member-item" v-for="m in members" :key="m.id">
  127. <view class="mi-avatar">{{ (m.nickname || '?').substring(0,1) }}</view>
  128. <text class="mi-name">{{ m.nickname || '未知成员' }}</text>
  129. <text class="mi-role" v-if="m.role === 'admin'">管理员</text>
  130. </view>
  131. </view>
  132. </view>
  133. </view>
  134. </view>
  135. </template>
  136. <script>
  137. import { getCircleFeed, getCircleMembers, createCirclePost, toggleCircleLike, addCircleComment, getCircleComments, deleteCirclePost } from '@/utils/api.js'
  138. import { parseDate } from '@/utils/format.js'
  139. export default {
  140. data: function() {
  141. return {
  142. circleId: null,
  143. circleName: '',
  144. memberCount: 0,
  145. myMemberId: '',
  146. posts: [],
  147. loading: true,
  148. refreshing: false,
  149. loadingMore: false,
  150. hasMore: true,
  151. page: 1,
  152. pageSize: 10,
  153. showPostModal: false,
  154. showMemberModal: false,
  155. members: [],
  156. postType: 'text',
  157. postContent: '',
  158. postTypes: [
  159. { value: 'text', label: '文字', icon: '📝' },
  160. { value: 'checkin', label: '打卡', icon: '✅' },
  161. { value: 'diet', label: '饮食', icon: '🥗' },
  162. { value: 'exercise', label: '运动', icon: '🏃' },
  163. { value: 'sleep', label: '睡眠', icon: '😴' },
  164. { value: 'water', label: '饮水', icon: '💧' },
  165. { value: 'mood', label: '心情', icon: '😊' }
  166. ]
  167. }
  168. },
  169. onLoad: function(options) {
  170. this.circleId = options.circleId ? parseInt(options.circleId) : null
  171. this.circleName = options.name || '圈子'
  172. this.myMemberId = parseInt(uni.getStorageSync('currentChildId')) || ''
  173. if (options.memberCount) this.memberCount = parseInt(options.memberCount)
  174. if (this.circleId) {
  175. this.loadFeed()
  176. this.loadMembers()
  177. }
  178. },
  179. methods: {
  180. goBack: function() {
  181. uni.navigateBack()
  182. },
  183. loadFeed: function() {
  184. var self = this
  185. self.loading = true
  186. getCircleFeed({ circleId: self.circleId, page: self.page, size: self.pageSize }).then(function(res) {
  187. if (res.code === 200 && Array.isArray(res.data)) {
  188. if (self.page === 1) {
  189. self.posts = res.data
  190. } else {
  191. self.posts = self.posts.concat(res.data)
  192. }
  193. self.hasMore = res.data.length >= self.pageSize
  194. }
  195. }).catch(function() {}).finally(function() {
  196. self.loading = false
  197. self.refreshing = false
  198. self.loadingMore = false
  199. })
  200. },
  201. loadMembers: function() {
  202. var self = this
  203. var memberId = uni.getStorageSync('currentChildId') || ''
  204. getCircleMembers(self.circleId, memberId).then(function(res) {
  205. if (res.code === 200 && Array.isArray(res.data)) {
  206. self.members = res.data
  207. }
  208. }).catch(function() {})
  209. },
  210. onRefresh: function() {
  211. this.page = 1
  212. this.hasMore = true
  213. this.loadFeed()
  214. },
  215. loadMore: function() {
  216. if (this.loadingMore || !this.hasMore) return
  217. this.page++
  218. this.loadingMore = true
  219. this.loadFeed()
  220. },
  221. openPostEditor: function() {
  222. var memberId = uni.getStorageSync('currentChildId') || ''
  223. if (!memberId) {
  224. uni.showToast({ title: '请先登录', icon: 'none' })
  225. return
  226. }
  227. this.postContent = ''
  228. this.postType = 'text'
  229. this.showPostModal = true
  230. },
  231. closePostModal: function() {
  232. this.showPostModal = false
  233. },
  234. publishPost: function() {
  235. var self = this
  236. var memberId = uni.getStorageSync('currentChildId') || ''
  237. if (!memberId) return
  238. if (!self.postContent.trim()) return
  239. createCirclePost({
  240. circleId: self.circleId,
  241. memberId: memberId,
  242. memberType: 'child',
  243. type: self.postType,
  244. content: self.postContent.trim()
  245. }).then(function(res) {
  246. if (res.code === 200) {
  247. self.showPostModal = false
  248. self.page = 1
  249. self.hasMore = true
  250. self.loadFeed()
  251. uni.showToast({ title: '发布成功', icon: 'success' })
  252. } else {
  253. uni.showToast({ title: res.message || '发布失败', icon: 'none' })
  254. }
  255. }).catch(function() {
  256. uni.showToast({ title: '发布失败,请重试', icon: 'none' })
  257. })
  258. },
  259. toggleLike: function(post) {
  260. var self = this
  261. var memberId = uni.getStorageSync('currentChildId') || ''
  262. if (!memberId) return
  263. toggleCircleLike({
  264. circleId: self.circleId,
  265. postId: post.id,
  266. memberId: memberId,
  267. memberType: 'child'
  268. }).then(function(res) {
  269. if (res.code === 200) {
  270. post.liked = res.data && res.data.liked
  271. post.likeCount = res.data && res.data.likeCount
  272. }
  273. }).catch(function() {})
  274. },
  275. openCommentInput: function(post) {
  276. post.showCommentInput = !post.showCommentInput
  277. if (post.showCommentInput && !post.comments) {
  278. var self = this
  279. var memberId = uni.getStorageSync('currentChildId') || ''
  280. if (!memberId) return
  281. getCircleComments({ postId: post.id }).then(function(res) {
  282. if (res.code === 200) {
  283. post.comments = res.data || []
  284. }
  285. }).catch(function() {})
  286. }
  287. },
  288. submitComment: function(post) {
  289. var self = this
  290. var memberId = uni.getStorageSync('currentChildId') || ''
  291. if (!memberId || !post.commentText.trim()) return
  292. addCircleComment({
  293. circleId: self.circleId,
  294. postId: post.id,
  295. memberId: memberId,
  296. memberType: 'child',
  297. content: post.commentText.trim()
  298. }).then(function(res) {
  299. if (res.code === 200) {
  300. post.commentText = ''
  301. post.commentCount = (post.commentCount || 0) + 1
  302. if (!post.comments) post.comments = []
  303. post.comments.push(res.data)
  304. }
  305. }).catch(function() {})
  306. },
  307. loadMoreComments: function(post) {
  308. var self = this
  309. if (post.comments && post.comments.length >= (post.commentCount || 0)) {
  310. this.$set(post, 'showAllComments', true)
  311. return
  312. }
  313. getCircleComments({ postId: post.id, page: 1, size: 100 }).then(function(res) {
  314. if (res.code === 200) {
  315. post.comments = res.data || []
  316. self.$set(post, 'showAllComments', true)
  317. }
  318. }).catch(function() {})
  319. },
  320. collapseComments: function(post) {
  321. this.$set(post, 'showAllComments', false)
  322. },
  323. getVisibleComments: function(post) {
  324. var comments = post.comments || []
  325. if (post.showAllComments) return comments
  326. return comments.slice(0, 3)
  327. },
  328. getCommentKey: function(c, idx) {
  329. return (c && c.id) || idx
  330. },
  331. getCommentName: function(c) {
  332. if (c && c.authorName) return c.authorName
  333. if (c && c.memberId) return this.getMemberNameById(c.memberId)
  334. return '未知成员'
  335. },
  336. getCommentAvatar: function(c) {
  337. return (c && c.authorAvatar) || ''
  338. },
  339. deletePost: function(post) {
  340. var self = this
  341. var memberId = uni.getStorageSync('currentChildId') || ''
  342. if (!memberId) return
  343. uni.showModal({
  344. title: '删除动态',
  345. content: '确定删除这条动态吗?删除后不可恢复。',
  346. confirmColor: '#FF8C42',
  347. success: function(res) {
  348. if (!res.confirm) return
  349. post.deleting = true
  350. deleteCirclePost({
  351. circleId: self.circleId,
  352. postId: post.id,
  353. memberId: memberId
  354. }).then(function(r) {
  355. if (r.code === 200) {
  356. var arr = []
  357. for (var i = 0; i < self.posts.length; i++) {
  358. if (self.posts[i].id !== post.id) arr.push(self.posts[i])
  359. }
  360. self.posts = arr
  361. uni.showToast({ title: '已删除', icon: 'success' })
  362. } else {
  363. post.deleting = false
  364. uni.showToast({ title: r.message || '删除失败', icon: 'none' })
  365. }
  366. }).catch(function() {
  367. post.deleting = false
  368. uni.showToast({ title: '删除失败,请重试', icon: 'none' })
  369. })
  370. }
  371. })
  372. },
  373. sharePost: function(post) {
  374. var self = this
  375. var memberId = uni.getStorageSync('currentChildId') || ''
  376. if (!memberId) {
  377. uni.showToast({ title: '请先登录', icon: 'none' })
  378. return
  379. }
  380. var shareText = post.content || '我在圈子「' + self.circleName + '」里发了一条动态'
  381. uni.showActionSheet({
  382. itemList: ['复制内容分享', '保存图片并分享'],
  383. success: function(res) {
  384. if (res.tapIndex === 0) {
  385. uni.setClipboardData({
  386. data: shareText,
  387. success: function() {
  388. uni.showToast({ title: '已复制,去粘贴分享吧', icon: 'none' })
  389. }
  390. })
  391. } else if (res.tapIndex === 1 && post.imageUrls && post.imageUrls.length > 0) {
  392. uni.saveImageToPhotosAlbum({
  393. filePath: post.imageUrls[0],
  394. success: function() {
  395. uni.showToast({ title: '已保存到相册', icon: 'success' })
  396. },
  397. fail: function() {
  398. uni.showToast({ title: '保存失败', icon: 'none' })
  399. }
  400. })
  401. } else if (res.tapIndex === 1) {
  402. uni.showToast({ title: '该动态没有图片可保存', icon: 'none' })
  403. }
  404. }
  405. })
  406. },
  407. showMemberList: function() {
  408. this.showMemberModal = true
  409. },
  410. previewImage: function(images, index) {
  411. uni.previewImage({ current: images[index], urls: images })
  412. },
  413. getAvatarText: function(post) {
  414. var name = (post && post.authorName) || ''
  415. return name ? name.substring(0, 1) : 'A'
  416. },
  417. getMemberName: function(post) {
  418. if (post && post.authorName) return post.authorName
  419. if (post && post.memberId) return this.getMemberNameById(post.memberId)
  420. return '我'
  421. },
  422. getMemberNameById: function(memberId) {
  423. for (var i = 0; i < this.members.length; i++) {
  424. if (this.members[i].memberId === memberId) {
  425. return this.members[i].nickname || '未知'
  426. }
  427. }
  428. return '未知成员'
  429. },
  430. formatTime: function(timeStr) {
  431. if (!timeStr) return ''
  432. var d = parseDate(timeStr)
  433. if (!d) return ''
  434. var h = d.getHours().toString()
  435. if (h.length < 2) h = '0' + h
  436. var m = d.getMinutes().toString()
  437. if (m.length < 2) m = '0' + m
  438. return h + ':' + m
  439. },
  440. typeLabel: function(type) {
  441. var map = {
  442. text: '文字', checkin: '打卡', diet: '饮食',
  443. exercise: '运动', sleep: '睡眠', water: '饮水', mood: '心情'
  444. }
  445. return map[type] || type
  446. },
  447. onScrollToLower: function() {
  448. this.loadMore()
  449. }
  450. }
  451. }
  452. </script>
  453. <style scoped>
  454. .feed-page {
  455. min-height: 100vh;
  456. background: #F5F7FA;
  457. }
  458. .nav-bar {
  459. display: flex;
  460. align-items: center;
  461. justify-content: space-between;
  462. height: 88rpx;
  463. padding-top: env(safe-area-inset-top);
  464. background: #FFFFFF;
  465. position: sticky;
  466. top: 0;
  467. z-index: 100;
  468. border-bottom: 1rpx solid #f0f0f0;
  469. }
  470. .nav-back {
  471. width: 80rpx;
  472. display: flex;
  473. align-items: center;
  474. padding-left: 24rpx;
  475. }
  476. .nav-back-icon {
  477. font-size: 48rpx;
  478. color: #333;
  479. }
  480. .nav-title {
  481. font-size: 32rpx;
  482. font-weight: 600;
  483. color: #333;
  484. }
  485. .nav-placeholder { width: 80rpx; }
  486. /* 圈子信息卡 */
  487. .circle-header-card {
  488. display: flex;
  489. align-items: center;
  490. background: #FFFFFF;
  491. padding: 24rpx 32rpx;
  492. margin-bottom: 16rpx;
  493. }
  494. .ch-avatar {
  495. width: 72rpx;
  496. height: 72rpx;
  497. border-radius: 50%;
  498. background: linear-gradient(135deg, #FF8C42, #FFB366);
  499. color: #fff;
  500. font-size: 32rpx;
  501. font-weight: 700;
  502. display: flex;
  503. align-items: center;
  504. justify-content: center;
  505. margin-right: 20rpx;
  506. flex-shrink: 0;
  507. }
  508. .ch-info { flex: 1; }
  509. .ch-name {
  510. font-size: 30rpx;
  511. font-weight: 600;
  512. color: #333;
  513. display: block;
  514. }
  515. .ch-meta {
  516. font-size: 22rpx;
  517. color: #999;
  518. margin-top: 4rpx;
  519. display: block;
  520. }
  521. .ch-arrow { font-size: 36rpx; color: #ccc; }
  522. /* 发布框 */
  523. .post-input-card {
  524. display: flex;
  525. align-items: center;
  526. background: #FFFFFF;
  527. padding: 24rpx 32rpx;
  528. margin-bottom: 16rpx;
  529. }
  530. .pi-icon { font-size: 40rpx; margin-right: 20rpx; }
  531. .pi-placeholder { font-size: 28rpx; color: #bbb; }
  532. /* 滚动区域 */
  533. .feed-scroll {
  534. height: calc(100vh - 400rpx);
  535. }
  536. /* 动态项 */
  537. .feed-item {
  538. background: #FFFFFF;
  539. margin-bottom: 16rpx;
  540. padding: 24rpx 32rpx;
  541. }
  542. .feed-author {
  543. display: flex;
  544. align-items: center;
  545. margin-bottom: 16rpx;
  546. }
  547. .fa-avatar {
  548. width: 56rpx;
  549. height: 56rpx;
  550. border-radius: 50%;
  551. background: #E3F2FD;
  552. color: #1976D2;
  553. font-size: 24rpx;
  554. font-weight: 700;
  555. display: flex;
  556. align-items: center;
  557. justify-content: center;
  558. margin-right: 16rpx;
  559. flex-shrink: 0;
  560. }
  561. .fa-info { flex: 1; display: flex; flex-direction: column; }
  562. .fa-name { font-size: 26rpx; font-weight: 600; color: #333; }
  563. .fa-time { font-size: 20rpx; color: #999; margin-top: 2rpx; }
  564. .fa-type-badge {
  565. font-size: 20rpx;
  566. padding: 4rpx 12rpx;
  567. border-radius: 12rpx;
  568. background: #FFF0E0;
  569. color: #FF8C42;
  570. }
  571. /* 内容 */
  572. .feed-content { margin-bottom: 16rpx; }
  573. .fc-text { font-size: 28rpx; color: #333; line-height: 1.7; }
  574. .feed-images { display: flex; flex-wrap: wrap; margin-bottom: 16rpx; }
  575. .feed-img {
  576. width: 220rpx;
  577. height: 220rpx;
  578. border-radius: 12rpx;
  579. margin-right: 12rpx;
  580. margin-bottom: 12rpx;
  581. }
  582. /* 操作栏 */
  583. .feed-actions {
  584. display: flex;
  585. border-top: 1rpx solid #f5f5f5;
  586. padding-top: 16rpx;
  587. }
  588. .fa-item {
  589. display: flex;
  590. align-items: center;
  591. margin-right: 40rpx;
  592. }
  593. .fa-icon { font-size: 32rpx; margin-right: 6rpx; }
  594. .fa-count { font-size: 22rpx; color: #999; }
  595. .fa-active .fa-icon { transform: scale(1.1); }
  596. .fa-delete { margin-left: auto; margin-right: 0; }
  597. .fa-delete .fa-icon { font-size: 28rpx; }
  598. /* 评论 */
  599. .feed-comments { margin-top: 16rpx; padding-top: 16rpx; border-top: 1rpx solid #f5f5f5; }
  600. .comment-item { display: flex; align-items: flex-start; margin-bottom: 12rpx; }
  601. .c-avatar {
  602. width: 40rpx;
  603. height: 40rpx;
  604. border-radius: 50%;
  605. background: #E3F2FD;
  606. margin-right: 10rpx;
  607. flex-shrink: 0;
  608. }
  609. .c-name { font-size: 24rpx; color: #FF8C42; font-weight: 600; margin-right: 8rpx; flex-shrink: 0; }
  610. .c-text { font-size: 24rpx; color: #666; flex: 1; line-height: 1.5; }
  611. .more-comments { font-size: 22rpx; color: #999; margin-top: 8rpx; display: block; padding: 8rpx 0; }
  612. .comment-input-area {
  613. display: flex;
  614. align-items: center;
  615. margin-top: 12rpx;
  616. padding-top: 12rpx;
  617. border-top: 1rpx solid #f5f5f5;
  618. }
  619. .ci-input {
  620. flex: 1;
  621. background: #F5F5F5;
  622. border-radius: 30rpx;
  623. padding: 12rpx 20rpx;
  624. font-size: 26rpx;
  625. margin-right: 16rpx;
  626. }
  627. .ci-send { font-size: 26rpx; color: #FF8C42; font-weight: 600; }
  628. /* 加载状态 */
  629. .loading-more, .end-hint { text-align: center; padding: 24rpx 0; }
  630. .lm-text, .eh-text { font-size: 24rpx; color: #ccc; }
  631. .empty-state { text-align: center; padding: 120rpx 0; }
  632. .empty-icon { font-size: 80rpx; display: block; margin-bottom: 16rpx; }
  633. .empty-text { font-size: 26rpx; color: #ccc; }
  634. .bottom-space { height: 40rpx; }
  635. /* 弹窗 */
  636. .modal-mask {
  637. position: fixed;
  638. top: 0; left: 0; right: 0; bottom: 0;
  639. background: rgba(0,0,0,0.5);
  640. z-index: 1000;
  641. display: flex;
  642. align-items: flex-end;
  643. justify-content: center;
  644. }
  645. .modal-content {
  646. width: 100%;
  647. max-height: 80vh;
  648. background: #FFFFFF;
  649. border-radius: 32rpx 32rpx 0 0;
  650. padding: 32rpx;
  651. overflow-y: auto;
  652. }
  653. .modal-header {
  654. display: flex;
  655. justify-content: space-between;
  656. align-items: center;
  657. margin-bottom: 24rpx;
  658. }
  659. .modal-title { font-size: 32rpx; font-weight: 600; color: #333; }
  660. .modal-close { font-size: 32rpx; color: #999; }
  661. .type-selector {
  662. display: flex;
  663. flex-wrap: wrap;
  664. margin-bottom: 20rpx;
  665. }
  666. .type-opt {
  667. display: flex;
  668. flex-direction: column;
  669. align-items: center;
  670. padding: 16rpx 24rpx;
  671. margin-right: 16rpx;
  672. margin-bottom: 16rpx;
  673. background: #F5F5F5;
  674. border-radius: 16rpx;
  675. border: 2rpx solid transparent;
  676. }
  677. .type-active { border-color: #FF8C42; background: #FFF0E0; }
  678. .to-icon { font-size: 36rpx; margin-bottom: 6rpx; }
  679. .to-label { font-size: 22rpx; color: #666; }
  680. .post-textarea {
  681. width: 100%;
  682. height: 200rpx;
  683. background: #F8F8F8;
  684. border-radius: 16rpx;
  685. padding: 20rpx;
  686. font-size: 28rpx;
  687. line-height: 1.6;
  688. box-sizing: border-box;
  689. }
  690. .modal-footer { margin-top: 20rpx; }
  691. .btn-publish {
  692. background: linear-gradient(135deg, #FF8C42, #FFB366);
  693. color: #fff;
  694. border: none;
  695. border-radius: 40rpx;
  696. font-size: 30rpx;
  697. font-weight: 600;
  698. padding: 24rpx 0;
  699. }
  700. .btn-publish[disabled] { opacity: 0.4; }
  701. /* 成员列表 */
  702. .modal-members { max-height: 60vh; }
  703. .member-list { }
  704. .member-item {
  705. display: flex;
  706. align-items: center;
  707. padding: 20rpx 0;
  708. border-bottom: 1rpx solid #f5f5f5;
  709. }
  710. .mi-avatar {
  711. width: 56rpx;
  712. height: 56rpx;
  713. border-radius: 50%;
  714. background: #E3F2FD;
  715. color: #1976D2;
  716. font-size: 24rpx;
  717. font-weight: 700;
  718. display: flex;
  719. align-items: center;
  720. justify-content: center;
  721. margin-right: 16rpx;
  722. }
  723. .mi-name { font-size: 26rpx; color: #333; flex: 1; }
  724. .mi-role { font-size: 20rpx; color: #FF8C42; background: #FFF0E0; padding: 4rpx 12rpx; border-radius: 12rpx; }
  725. </style>