circle-feed.vue 24 KB

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