小说小程序前端代码仓库(小程序)
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.

193 lines
4.9 KiB

  1. <template>
  2. <view class="my-comment-page">
  3. <navbar title="我的评论" :leftClick="true" @leftClick="goBack" />
  4. <view class="comment-section">
  5. <view class="section-title">未读评论·{{ unreadComments.length }}</view>
  6. <view v-for="(item, idx) in unreadComments" :key="idx" class="comment-card">
  7. <uv-avatar :src="item.avatar" size="44" shape="circle" class="avatar" />
  8. <view class="comment-main">
  9. <view class="comment-header">
  10. <text class="username">{{ item.username }}</text>
  11. <text class="from">来自{{ item.bookTitle }}</text>
  12. </view>
  13. <view class="comment-content">{{ item.content }}</view>
  14. <view class="comment-footer">
  15. <text class="comment-time">{{ item.time }}</text>
  16. <view class="reply-btn-wrap" @click="goToReply(item)">
  17. <text class="reply-btn">回复</text>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="comment-section history-section">
  24. <view class="section-title">历史评论</view>
  25. <view v-for="(item, idx) in historyComments" :key="idx" class="comment-card">
  26. <uv-avatar :src="item.avatar" size="44" shape="circle" class="avatar" />
  27. <view class="comment-main">
  28. <view class="comment-header">
  29. <text class="username">{{ item.username }}</text>
  30. <text class="from">来自{{ item.bookTitle }}</text>
  31. </view>
  32. <view class="comment-content">{{ item.content }}</view>
  33. <view class="comment-footer">
  34. <text class="comment-time">{{ item.time }}</text>
  35. <view class="reply-btn-wrap" @click="goToReply(item)">
  36. <text class="reply-btn">回复</text>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. export default {
  46. components: {
  47. },
  48. data() {
  49. return {
  50. unreadComments: [{
  51. avatar: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.iUyxJ_fxLjjX3kEBjteXWwAAAA?rs=1&pid=ImgDetMain',
  52. username: '方香橙',
  53. bookTitle: '重生之财富滚滚',
  54. content: '我是本书的作者方香橙,这是一本甜文爽文哒!请放心入坑,五星好评!女主又美有个性可爱,绝对不圣母,不傻白!男主身心干净深情独宠媳妇儿一个人...',
  55. time: '2024.07.09'
  56. },
  57. {
  58. avatar: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.iUyxJ_fxLjjX3kEBjteXWwAAAA?rs=1&pid=ImgDetMain',
  59. username: '战斗世界',
  60. bookTitle: '重生之财富滚滚',
  61. content: '这本书打破了我看甜文套路之前的观念女主真的太可爱太有趣和以往看过的一个NPC介绍有很大不同',
  62. time: '2024.06.09'
  63. },
  64. {
  65. avatar: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.iUyxJ_fxLjjX3kEBjteXWwAAAA?rs=1&pid=ImgDetMain',
  66. username: '战斗世界',
  67. bookTitle: '重生之财富滚滚',
  68. content: '这本书打破了我看甜文套路之前的观念女主真的太可爱太有趣和以往看过的一个NPC介绍有很大不同',
  69. time: '2024.06.09'
  70. }
  71. ],
  72. historyComments: [{
  73. avatar: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.iUyxJ_fxLjjX3kEBjteXWwAAAA?rs=1&pid=ImgDetMain',
  74. username: '方香橙',
  75. bookTitle: '重生之财富滚滚',
  76. content: '我是本书的作者方香橙,这是一本甜文爽文哒!请放心入坑,五星好评!女主又美有个性可爱,绝对不圣母,不傻白!男主身心干净深情独宠媳妇儿一个人...',
  77. time: '2024.07.09'
  78. }]
  79. }
  80. },
  81. methods: {
  82. goBack() {
  83. uni.navigateBack()
  84. },
  85. goToReply(item) {
  86. uni.navigateTo({
  87. url: '/pages_order/novel/Respondcomments'
  88. })
  89. }
  90. }
  91. }
  92. </script>
  93. <style scoped lang="scss">
  94. .my-comment-page {
  95. min-height: 100vh;
  96. background: #f8f8f8;
  97. display: flex;
  98. flex-direction: column;
  99. }
  100. .comment-section {
  101. background: #fff;
  102. margin: 24rpx 24rpx 0 24rpx;
  103. border-radius: 16rpx;
  104. padding: 24rpx 24rpx 0 24rpx;
  105. margin-bottom: 24rpx;
  106. }
  107. .section-title {
  108. color: #222;
  109. font-size: 28rpx;
  110. font-weight: 500;
  111. margin-bottom: 16rpx;
  112. }
  113. .comment-card {
  114. display: flex;
  115. align-items: flex-start;
  116. margin-bottom: 32rpx;
  117. }
  118. .avatar {
  119. width: 56rpx;
  120. height: 56rpx;
  121. border-radius: 50%;
  122. margin-right: 16rpx;
  123. flex-shrink: 0;
  124. }
  125. .comment-main {
  126. flex: 1;
  127. display: flex;
  128. flex-direction: column;
  129. }
  130. .comment-header {
  131. display: flex;
  132. align-items: center;
  133. gap: 12rpx;
  134. margin-bottom: 4rpx;
  135. }
  136. .username {
  137. font-size: 26rpx;
  138. color: #222;
  139. font-weight: 500;
  140. }
  141. .from {
  142. font-size: 22rpx;
  143. color: #bdbdbd;
  144. }
  145. .comment-content {
  146. font-size: 26rpx;
  147. color: #333;
  148. margin-bottom: 12rpx;
  149. }
  150. .comment-footer {
  151. display: flex;
  152. align-items: center;
  153. font-size: 22rpx;
  154. color: #bdbdbd;
  155. justify-content: space-between;
  156. padding-right: 8rpx;
  157. }
  158. .comment-time {
  159. color: #bdbdbd;
  160. }
  161. .reply-btn-wrap {
  162. display: flex;
  163. align-items: center;
  164. cursor: pointer;
  165. }
  166. .reply-btn {
  167. color: #223a6b;
  168. font-weight: 500;
  169. margin-left: 0;
  170. font-size: 24rpx;
  171. }
  172. .history-section {
  173. margin-top: 24rpx;
  174. }
  175. </style>