circle-feed.vue 24 KB

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