discussionArea.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  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" @click="goPages('/pages/crowdFunding/projectUpdateDetails?id='+item.id)">
  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. goPages(url) {
  169. uni.navigateTo({
  170. url: url
  171. })
  172. }
  173. }
  174. }
  175. </script>
  176. <style lang="scss" scoped>
  177. .discussion-page {
  178. min-height: 100vh;
  179. background: #f2f6f2;
  180. padding-bottom: 40rpx;
  181. .project-card {
  182. display: flex;
  183. align-items: center;
  184. background: #fff;
  185. width: 100vw;
  186. height: 184rpx;
  187. border-bottom: 1px solid #F2F6F2;
  188. padding: 28rpx;
  189. .project-img {
  190. width: 128rpx;
  191. height: 128rpx;
  192. border-radius: 6rpx;
  193. margin-right: 16rpx;
  194. }
  195. .project-title {
  196. font-size: 28rpx;
  197. font-weight: bold;
  198. color: #222;
  199. max-width: 500rpx;
  200. overflow: hidden;
  201. text-overflow: ellipsis;
  202. line-height: 2;
  203. }
  204. }
  205. .tabs {
  206. display: flex;
  207. height: 72rpx;
  208. justify-content: space-between;
  209. align-items: center;
  210. width: 100%;
  211. background: #fff;
  212. margin-bottom: 6rpx;
  213. .tab-item {
  214. width: 50%;
  215. display: flex;
  216. align-items: center;
  217. justify-content: center;
  218. .tab {
  219. position: relative;
  220. // width: 96rpx;
  221. width: 130rpx;
  222. height: 48rpx;
  223. font-size: 32rpx;
  224. font-family: "PingFang SC-Bold";
  225. color: #999;
  226. font-weight: 400;
  227. transition: all .5s;
  228. ::after {
  229. content: "";
  230. position: absolute;
  231. right: -15rpx;
  232. top: 0;
  233. width: 96rpx;
  234. height: 48rpx;
  235. background-image: url("../../static/me/wd_img_qiehuan.png");
  236. background-size: auto 100%;
  237. background-repeat: no-repeat;
  238. opacity: 0;
  239. }
  240. &.active {
  241. color: #1f1f1f;
  242. text {
  243. font-family: "PingFang SC-Bold";
  244. }
  245. ::after {
  246. opacity: 0.7;
  247. }
  248. }
  249. }
  250. }
  251. }
  252. .update-list {
  253. padding: 0 24rpx;
  254. .update-item {
  255. background: #fff;
  256. border-radius: 16rpx;
  257. margin-bottom: 24rpx;
  258. padding: 18rpx 20rpx 12rpx 20rpx;
  259. .update-title {
  260. font-size: 24rpx;
  261. color: #999;
  262. margin-bottom: 8rpx;
  263. }
  264. .update-content {
  265. font-size: 28rpx;
  266. color: #222;
  267. margin-bottom: 12rpx;
  268. }
  269. .update-user {
  270. display: flex;
  271. align-items: center;
  272. margin-bottom: 12rpx;
  273. .avatar {
  274. width: 36rpx;
  275. height: 36rpx;
  276. border-radius: 50%;
  277. margin-right: 8rpx;
  278. }
  279. .nickname {
  280. font-size: 22rpx;
  281. color: #999;
  282. }
  283. }
  284. .update-img {
  285. width: 100%;
  286. height: 160rpx;
  287. border-radius: 12rpx;
  288. object-fit: cover;
  289. margin-bottom: 10rpx;
  290. }
  291. .update-footer {
  292. display: flex;
  293. align-items: center;
  294. justify-content: space-between;
  295. .update-time {
  296. font-size: 22rpx;
  297. color: #999;
  298. }
  299. .update-like {
  300. display: flex;
  301. align-items: center;
  302. .like-icon {
  303. width: 28rpx;
  304. height: 28rpx;
  305. margin-right: 4rpx;
  306. }
  307. .like-num {
  308. font-size: 22rpx;
  309. color: #888;
  310. }
  311. }
  312. }
  313. }
  314. }
  315. .comment {
  316. background: #fff;
  317. border-top-left-radius: 32rpx;
  318. border-top-right-radius: 32rpx;
  319. }
  320. }
  321. </style>