discussionArea.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. <template>
  2. <view class="discussion-page">
  3. <!-- 项目卡片 -->
  4. <view class="project-card">
  5. <image class="project-img" src="@/static/crowdFunding/top-img.png" />
  6. <view class="project-info">
  7. <view class="project-title two-omit">【Woh】灯塔 塔罗牌 治愈风泛伟特系伟特系伟特系</view>
  8. </view>
  9. </view>
  10. <view class="tabs">
  11. <view class="tab-item" @click="checkTab(item.id)" v-for="(item, index) in cate" :key="index">
  12. <view class="tab" :class="{ active: tab === item.id }">
  13. <text class="left">{{ item.name }}</text>
  14. <view class="line"></view>
  15. </view>
  16. </view>
  17. </view>
  18. <!-- tab内容 -->
  19. <view v-if="tab === 1" class="update-list">
  20. <block v-for="(item, idx) in updateList" :key="idx">
  21. <view class="update-item">
  22. <view class="update-title">第{{ item.index }}次更新</view>
  23. <view class="update-content">{{ item.content }}</view>
  24. <view class="update-user">
  25. <image class="avatar" :src="item.avatar" />
  26. <text class="nickname">{{ item.nickname }}</text>
  27. </view>
  28. <image class="update-img" :src="'../../static/crowdFunding/top-img.png'" mode="widthFix" />
  29. <view class="update-footer">
  30. <text class="update-time">{{ item.time }}</text>
  31. <view class="update-like">
  32. <image :src="item.liked ? '/static/icon/icon-18.png' : '/static/icon/icon-19.png'"
  33. class="like-icon" />
  34. <text class="like-num">{{ item.likeNum }}</text>
  35. </view>
  36. </view>
  37. </view>
  38. </block>
  39. </view>
  40. <!-- 评论区域 -->
  41. <CommentSection v-else-if=" articleInfo.title" class="comment" ref="commentSection"
  42. :myInfo="myInfo" :articleId="arcID" @totalNumberOfComments="totalNumberOfComments"
  43. :articleInfo="articleInfo" :author="author" find="work">
  44. </CommentSection>
  45. </view>
  46. </template>
  47. <script>
  48. export default {
  49. data() {
  50. return {
  51. tab: 1,
  52. updateList: [
  53. {
  54. index: 2,
  55. content: '附赠精品灯塔牌包装,附赠精品灯塔牌包装',
  56. avatar: '/static/crowdFunding/top-img.png',
  57. nickname: '也许时间是一种解药',
  58. img: 'https://img.zcool.cn/community/01b6b95d5b2e2fa801216518a7e7e7.jpg',
  59. time: '2025.5.23 16:23',
  60. likeNum: 12,
  61. liked: false
  62. },
  63. {
  64. index: 1,
  65. content: '附赠精品灯塔牌包装,附赠精品灯塔牌包装',
  66. avatar: '/static/crowdFunding/top-img.png',
  67. nickname: '也许时间是一种解药',
  68. img: 'https://img.zcool.cn/community/01b6b95d5b2e2fa801216518a7e7e7.jpg',
  69. time: '2025.5.23 16:23',
  70. likeNum: 12,
  71. liked: false
  72. }
  73. ],
  74. commentList: [
  75. {
  76. avatar: '../../static/crowdFunding/top-img.png',
  77. content: '还是希望签名能签在书上,还是希望签名能签在书上还是希望签名能签在书上还是希望签名能签在书上,还是希望签名能签在书上还是希望签名能签在书上',
  78. nickname: '也许时间是一种解药',
  79. time: '2025.5.23 16:23',
  80. likeNum: 12,
  81. liked: false
  82. },
  83. {
  84. avatar: '../../static/crowdFunding/top-img.png',
  85. content: '还是希望签名能签在书上',
  86. nickname: '也许时间是一种解药',
  87. time: '2025.5.23 16:23',
  88. likeNum: 12,
  89. liked: true
  90. }
  91. ],
  92. cate: [
  93. {
  94. name: "项目更新",
  95. id: 1,
  96. },
  97. {
  98. name: "项目讨论",
  99. id: 2,
  100. },
  101. ],
  102. myInfo: {
  103. "user_id": 1349,
  104. "user_name": "??????????????????????????????",
  105. "user_avatar": "http://e.zhichao.art/upload/2025-04/0a7d9b922ac8307a6f988d17b3dd7805_new.jpg"
  106. },
  107. articleInfo: {
  108. "id": 574,
  109. "task_type": 1,
  110. "queue_id": 0,
  111. "article_id": 0,
  112. "sso_id": 1458,
  113. "images": "http://c.zhichao.art/upload/2025-05/9cc4c00bab5ae9be6486d95c31d2d720_new.jpg",
  114. "content": "非常喜欢这个手办图片",
  115. "lyrics": "",
  116. "result_audio": "",
  117. "title": "这个手办感觉不错呀",
  118. "style": "",
  119. "num_like": 12,
  120. "num_comment": 0,
  121. "num_view": 84,
  122. "city": "",
  123. "tdate": "2025-05-26",
  124. "reason": "",
  125. "can_comment": 1,
  126. "can_view_comment": 1,
  127. "create_time": "2025-05-26 12:02:22",
  128. "status": 1,
  129. "video_url": "",
  130. "video_width": 1080,
  131. "video_height": 1920,
  132. "nickname": "",
  133. "age": 0,
  134. "avator": "",
  135. "author": "",
  136. "xinzuo": "",
  137. "sex": 0,
  138. "dtime": "",
  139. "is_like": 0,
  140. "is_vip": 0,
  141. "userID": 0,
  142. "like_count": 0,
  143. "sms_id": 0
  144. },
  145. articleId: 574,
  146. arcID: 574,
  147. type: 'work',
  148. find: 'work',
  149. author: {
  150. "id": 1458,
  151. "nickname": "时光慢递员∞",
  152. "avator": "https://c.zhichao.art/upload/plat/10000000062.jpg",
  153. "is_attention": 0
  154. }
  155. }
  156. },
  157. onLoad(options) {
  158. if (options.tags) {
  159. this.tab = options.tags === 'update' ? 1 : options.tags === 'comment' ? 2 : 1;
  160. }
  161. },
  162. methods: {
  163. checkTab(tab) {
  164. this.tab = tab;
  165. }, totalNumberOfComments(tableTotal) {
  166. this.tableTotal = tableTotal;
  167. },
  168. }
  169. }
  170. </script>
  171. <style lang="scss" scoped>
  172. .discussion-page {
  173. min-height: 100vh;
  174. background: #f2f6f2;
  175. padding-bottom: 40rpx;
  176. .project-card {
  177. display: flex;
  178. align-items: center;
  179. background: #fff;
  180. width: 100vw;
  181. height: 184rpx;
  182. border-bottom: 1px solid #F2F6F2;
  183. padding: 28rpx;
  184. .project-img {
  185. width: 128rpx;
  186. height: 128rpx;
  187. border-radius: 6rpx;
  188. margin-right: 16rpx;
  189. }
  190. .project-title {
  191. font-size: 28rpx;
  192. font-weight: bold;
  193. color: #222;
  194. max-width: 500rpx;
  195. overflow: hidden;
  196. text-overflow: ellipsis;
  197. line-height: 2;
  198. }
  199. }
  200. .tabs {
  201. display: flex;
  202. height: 72rpx;
  203. justify-content: space-between;
  204. align-items: center;
  205. width: 100%;
  206. background: #fff;
  207. margin-bottom: 6rpx;
  208. .tab-item {
  209. width: 50%;
  210. display: flex;
  211. align-items: center;
  212. justify-content: center;
  213. .tab {
  214. position: relative;
  215. // width: 96rpx;
  216. width: 130rpx;
  217. height: 48rpx;
  218. font-size: 32rpx;
  219. font-family: "PingFang SC-Bold";
  220. color: #999;
  221. font-weight: 400;
  222. transition: all .5s;
  223. ::after {
  224. content: "";
  225. position: absolute;
  226. right: -15rpx;
  227. top: 0;
  228. width: 96rpx;
  229. height: 48rpx;
  230. background-image: url("../../static/me/wd_img_qiehuan.png");
  231. background-size: auto 100%;
  232. background-repeat: no-repeat;
  233. opacity: 0;
  234. }
  235. &.active {
  236. color: #1f1f1f;
  237. text {
  238. font-family: "PingFang SC-Bold";
  239. }
  240. ::after {
  241. opacity: 0.7;
  242. }
  243. }
  244. }
  245. }
  246. }
  247. .update-list {
  248. padding: 0 24rpx;
  249. .update-item {
  250. background: #fff;
  251. border-radius: 16rpx;
  252. margin-bottom: 24rpx;
  253. padding: 18rpx 20rpx 12rpx 20rpx;
  254. .update-title {
  255. font-size: 24rpx;
  256. color: #999;
  257. margin-bottom: 8rpx;
  258. }
  259. .update-content {
  260. font-size: 28rpx;
  261. color: #222;
  262. margin-bottom: 12rpx;
  263. }
  264. .update-user {
  265. display: flex;
  266. align-items: center;
  267. margin-bottom: 12rpx;
  268. .avatar {
  269. width: 36rpx;
  270. height: 36rpx;
  271. border-radius: 50%;
  272. margin-right: 8rpx;
  273. }
  274. .nickname {
  275. font-size: 22rpx;
  276. color: #999;
  277. }
  278. }
  279. .update-img {
  280. width: 100%;
  281. height: 160rpx;
  282. border-radius: 12rpx;
  283. object-fit: cover;
  284. margin-bottom: 10rpx;
  285. }
  286. .update-footer {
  287. display: flex;
  288. align-items: center;
  289. justify-content: space-between;
  290. .update-time {
  291. font-size: 22rpx;
  292. color: #999;
  293. }
  294. .update-like {
  295. display: flex;
  296. align-items: center;
  297. .like-icon {
  298. width: 28rpx;
  299. height: 28rpx;
  300. margin-right: 4rpx;
  301. }
  302. .like-num {
  303. font-size: 22rpx;
  304. color: #888;
  305. }
  306. }
  307. }
  308. }
  309. }
  310. .comment {
  311. background: #fff;
  312. border-top-left-radius: 32rpx;
  313. border-top-right-radius: 32rpx;
  314. }
  315. }
  316. </style>