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

206 lines
4.7 KiB

  1. <template>
  2. <view class="respond-comments-page">
  3. <!-- 顶部导航栏 -->
  4. <navbar title="回复评论" :leftClick="true" @leftClick="goBack">
  5. <template #left>
  6. <uv-icon name="arrow-left" customPrefix="uvicon" size="22" color="#222" />
  7. </template>
  8. </navbar>
  9. <!-- 原评论展示 -->
  10. <view class="origin-comment-card">
  11. <view class="comment-header">
  12. <image class="avatar" :src="comment.avatar" mode="aspectFill" />
  13. <view class="user-info">
  14. <text class="username">{{ comment.username }}</text>
  15. </view>
  16. </view>
  17. <view class="comment-content">{{ comment.content }}</view>
  18. <view class="comment-footer">
  19. <text class="comment-time">{{ comment.time }}</text>
  20. <text class="comment-reply-count">
  21. <uv-icon name="chat" customPrefix="uvicon" size="18" color="#bdbdbd" style="margin-right: 4rpx;" />
  22. {{ comment.replyCount }}
  23. </text>
  24. </view>
  25. </view>
  26. <!-- 回复输入区 -->
  27. <view class="reply-area">
  28. <view class="form-label-row">
  29. <text class="required-star">*</text>
  30. <text class="form-label">回复内容</text>
  31. </view>
  32. <uv-input
  33. v-model="replyContent"
  34. type="text"
  35. :maxlength="200"
  36. placeholder="请输入回复内容"
  37. border="surround"
  38. clearable
  39. class="reply-input"
  40. />
  41. </view>
  42. <!-- 底部提交按钮 -->
  43. <view class="reply-footer">
  44. <button class="submit-btn" :disabled="!replyContent.trim()" @click="submitReply">发送</button>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. import navbar from '@/components/base/navbar.vue'
  50. export default {
  51. components: { navbar },
  52. data() {
  53. return {
  54. comment: {
  55. avatar: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.iUyxJ_fxLjjX3kEBjteXWwAAAA?rs=1&pid=ImgDetMain',
  56. username: '方香橙',
  57. content: '我是本书的作者方香橙,这是一本甜文爽文哒!请放心入坑,五星好评!女主又美有个性可爱,绝对不圣母,不傻白!男主身心干净深情独宠媳妇儿一个人...',
  58. time: '2024.07.09',
  59. replyCount: 17
  60. },
  61. replyContent: ''
  62. }
  63. },
  64. methods: {
  65. goBack() {
  66. uni.navigateBack()
  67. },
  68. submitReply() {
  69. if (!this.replyContent.trim()) {
  70. uni.showToast({ title: '请输入回复内容', icon: 'none' })
  71. return
  72. }
  73. // 实际开发中可调用API提交
  74. uni.showToast({ title: '回复成功', icon: 'success' })
  75. this.replyContent = ''
  76. setTimeout(() => {
  77. uni.navigateBack()
  78. }, 1000)
  79. }
  80. }
  81. }
  82. </script>
  83. <style scoped lang="scss">
  84. .respond-comments-page {
  85. min-height: 100vh;
  86. background: #f8f8f8;
  87. display: flex;
  88. flex-direction: column;
  89. }
  90. .origin-comment-card {
  91. background: #fff;
  92. margin: 24rpx 24rpx 0 24rpx;
  93. padding: 24rpx 24rpx 0 24rpx;
  94. margin-bottom: 0;
  95. border-radius: 0;
  96. box-shadow: none;
  97. padding-bottom: 0;
  98. }
  99. .comment-header {
  100. display: flex;
  101. align-items: center;
  102. margin-bottom: 8rpx;
  103. }
  104. .avatar {
  105. width: 56rpx;
  106. height: 56rpx;
  107. border-radius: 50%;
  108. margin-right: 16rpx;
  109. }
  110. .user-info {
  111. display: flex;
  112. flex-direction: column;
  113. }
  114. .username {
  115. font-size: 26rpx;
  116. color: #222;
  117. font-weight: 500;
  118. }
  119. .comment-content {
  120. font-size: 26rpx;
  121. color: #333;
  122. margin-bottom: 12rpx;
  123. }
  124. .comment-footer {
  125. display: flex;
  126. align-items: center;
  127. font-size: 22rpx;
  128. color: #bdbdbd;
  129. justify-content: space-between;
  130. }
  131. .comment-time {
  132. color: #bdbdbd;
  133. margin-top: 18rpx;
  134. }
  135. .comment-reply-count {
  136. display: flex;
  137. align-items: center;
  138. font-size: 22rpx;
  139. color: #bdbdbd;
  140. }
  141. .reply-area {
  142. background: #fff;
  143. margin: 0 24rpx 0 24rpx;
  144. padding: 0 24rpx 24rpx 24rpx;
  145. display: flex;
  146. flex-direction: column;
  147. border-radius: 0;
  148. box-shadow: none;
  149. margin-top: 0;
  150. }
  151. .form-label-row {
  152. display: flex;
  153. align-items: center;
  154. margin-bottom: 8rpx;
  155. margin-top: 50rpx;
  156. }
  157. .required-star {
  158. color: #e23d3d;
  159. font-size: 22rpx;
  160. margin-right: 4rpx;
  161. line-height: 1;
  162. }
  163. .form-label {
  164. color: #222;
  165. font-size: 26rpx;
  166. font-weight: 400;
  167. }
  168. .reply-input {
  169. margin-top: 12rpx;
  170. border: none !important;
  171. box-shadow: none !important;
  172. }
  173. .reply-footer {
  174. position: fixed;
  175. left: 0;
  176. right: 0;
  177. bottom: 90rpx;
  178. background: #fff;
  179. padding: 24rpx 32rpx 32rpx 32rpx;
  180. box-shadow: 0 -2rpx 12rpx rgba(0,0,0,0.03);
  181. z-index: 10;
  182. }
  183. .submit-btn {
  184. width: 100%;
  185. height: 80rpx;
  186. background: #0a225f !important;
  187. color: #fff !important;
  188. font-size: 30rpx;
  189. border-radius: 40rpx;
  190. font-weight: 500;
  191. letter-spacing: 2rpx;
  192. border: none;
  193. box-shadow: none;
  194. margin: 0 auto;
  195. display: block;
  196. text-align: center;
  197. line-height: 80rpx;
  198. }
  199. .submit-btn:disabled {
  200. background: #bdbdbd;
  201. color: #fff;
  202. }
  203. </style>