discussionArea.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  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. <view v-else class="comment-list">
  41. <block v-for="(item, idx) in commentList" :key="idx">
  42. <view class="comment-item">
  43. <image class="avatar" :src="item.avatar" />
  44. <view class="comment-main">
  45. <view class="comment-content">{{ item.content }}</view>
  46. <view class="comment-footer">
  47. <text class="nickname">{{ item.nickname }}</text>
  48. <text class="comment-time">{{ item.time }}</text>
  49. </view>
  50. </view>
  51. <view class="comment-like">
  52. <image :src="item.liked ? '/static/icon/icon-18.png' : '/static/icon/icon-19.png'"
  53. class="like-icon" />
  54. <text class="like-num">{{ item.likeNum }}</text>
  55. </view>
  56. </view>
  57. </block>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. export default {
  63. data() {
  64. return {
  65. tab: 1,
  66. updateList: [
  67. {
  68. index: 2,
  69. content: '附赠精品灯塔牌包装,附赠精品灯塔牌包装',
  70. avatar: '/static/crowdFunding/top-img.png',
  71. nickname: '也许时间是一种解药',
  72. img: 'https://img.zcool.cn/community/01b6b95d5b2e2fa801216518a7e7e7.jpg',
  73. time: '2025.5.23 16:23',
  74. likeNum: 12,
  75. liked: false
  76. },
  77. {
  78. index: 1,
  79. content: '附赠精品灯塔牌包装,附赠精品灯塔牌包装',
  80. avatar: '/static/crowdFunding/top-img.png',
  81. nickname: '也许时间是一种解药',
  82. img: 'https://img.zcool.cn/community/01b6b95d5b2e2fa801216518a7e7e7.jpg',
  83. time: '2025.5.23 16:23',
  84. likeNum: 12,
  85. liked: false
  86. }
  87. ],
  88. commentList: [
  89. {
  90. avatar: '../../static/crowdFunding/top-img.png',
  91. content: '还是希望签名能签在书上,还是希望签名能签在书上还是希望签名能签在书上还是希望签名能签在书上,还是希望签名能签在书上还是希望签名能签在书上',
  92. nickname: '也许时间是一种解药',
  93. time: '2025.5.23 16:23',
  94. likeNum: 12,
  95. liked: false
  96. },
  97. {
  98. avatar: '../../static/crowdFunding/top-img.png',
  99. content: '还是希望签名能签在书上',
  100. nickname: '也许时间是一种解药',
  101. time: '2025.5.23 16:23',
  102. likeNum: 12,
  103. liked: true
  104. }
  105. ],
  106. cate: [
  107. {
  108. name: "项目更新",
  109. id: 1,
  110. },
  111. {
  112. name: "项目讨论",
  113. id: 2,
  114. },
  115. ],
  116. }
  117. },
  118. methods: {
  119. checkTab(tab) {
  120. this.tab = tab;
  121. },
  122. }
  123. }
  124. </script>
  125. <style lang="scss" scoped>
  126. .discussion-page {
  127. min-height: 100vh;
  128. background: #f2f6f2;
  129. padding-bottom: 40rpx;
  130. .project-card {
  131. display: flex;
  132. align-items: center;
  133. background: #fff;
  134. width: 100vw;
  135. height: 184rpx;
  136. border-bottom: 1px solid #F2F6F2;
  137. padding: 28rpx;
  138. .project-img {
  139. width: 128rpx;
  140. height: 128rpx;
  141. border-radius: 6rpx;
  142. margin-right: 16rpx;
  143. }
  144. .project-title {
  145. font-size: 28rpx;
  146. font-weight: bold;
  147. color: #222;
  148. max-width: 500rpx;
  149. overflow: hidden;
  150. text-overflow: ellipsis;
  151. line-height: 2;
  152. }
  153. }
  154. .tabs {
  155. display: flex;
  156. height: 72rpx;
  157. justify-content: space-between;
  158. align-items: center;
  159. width: 100%;
  160. background: #fff;
  161. margin-bottom: 6rpx;
  162. .tab-item {
  163. width: 50%;
  164. display: flex;
  165. align-items: center;
  166. justify-content: center;
  167. .tab {
  168. position: relative;
  169. // width: 96rpx;
  170. width: 130rpx;
  171. height: 48rpx;
  172. font-size: 32rpx;
  173. font-family: "PingFang SC-Bold";
  174. color: #999;
  175. font-weight: 400;
  176. transition: all .5s;
  177. ::after {
  178. content: "";
  179. position: absolute;
  180. right: -15rpx;
  181. top: 0;
  182. width: 96rpx;
  183. height: 48rpx;
  184. background-image: url("../../static/me/wd_img_qiehuan.png");
  185. background-size: auto 100%;
  186. background-repeat: no-repeat;
  187. opacity: 0;
  188. }
  189. &.active {
  190. color: #1f1f1f;
  191. text {
  192. font-family: "PingFang SC-Bold";
  193. }
  194. ::after {
  195. opacity: 0.7;
  196. }
  197. }
  198. }
  199. }
  200. }
  201. .update-list {
  202. padding: 0 24rpx;
  203. .update-item {
  204. background: #fff;
  205. border-radius: 16rpx;
  206. margin-bottom: 24rpx;
  207. padding: 18rpx 20rpx 12rpx 20rpx;
  208. .update-title {
  209. font-size: 24rpx;
  210. color: #999;
  211. margin-bottom: 8rpx;
  212. }
  213. .update-content {
  214. font-size: 28rpx;
  215. color: #222;
  216. margin-bottom: 12rpx;
  217. }
  218. .update-user {
  219. display: flex;
  220. align-items: center;
  221. margin-bottom: 12rpx;
  222. .avatar {
  223. width: 36rpx;
  224. height: 36rpx;
  225. border-radius: 50%;
  226. margin-right: 8rpx;
  227. }
  228. .nickname {
  229. font-size: 22rpx;
  230. color: #999;
  231. }
  232. }
  233. .update-img {
  234. width: 100%;
  235. height: 160rpx;
  236. border-radius: 12rpx;
  237. object-fit: cover;
  238. margin-bottom: 10rpx;
  239. }
  240. .update-footer {
  241. display: flex;
  242. align-items: center;
  243. justify-content: space-between;
  244. .update-time {
  245. font-size: 22rpx;
  246. color: #999;
  247. }
  248. .update-like {
  249. display: flex;
  250. align-items: center;
  251. .like-icon {
  252. width: 28rpx;
  253. height: 28rpx;
  254. margin-right: 4rpx;
  255. }
  256. .like-num {
  257. font-size: 22rpx;
  258. color: #888;
  259. }
  260. }
  261. }
  262. }
  263. }
  264. .comment-list {
  265. padding: 0 24rpx;
  266. .comment-item {
  267. display: flex;
  268. align-items: flex-start;
  269. background: #fff;
  270. border-radius: 16rpx;
  271. margin-bottom: 24rpx;
  272. padding: 18rpx 20rpx 12rpx 20rpx;
  273. .avatar {
  274. width: 36rpx;
  275. height: 36rpx;
  276. border-radius: 50%;
  277. margin-right: 12rpx;
  278. }
  279. .comment-main {
  280. flex: 1;
  281. display: flex;
  282. flex-direction: column;
  283. .comment-content {
  284. font-size: 28rpx;
  285. color: #222;
  286. margin-bottom: 10rpx;
  287. display: -webkit-box;
  288. -webkit-line-clamp: 2;
  289. -webkit-box-orient: vertical;
  290. overflow: hidden;
  291. text-overflow: ellipsis;
  292. }
  293. .comment-footer {
  294. display: flex;
  295. align-items: center;
  296. .nickname {
  297. font-size: 22rpx;
  298. color: #999;
  299. margin-right: 16rpx;
  300. }
  301. .comment-time {
  302. font-size: 22rpx;
  303. color: #999;
  304. }
  305. }
  306. }
  307. .comment-like {
  308. display: flex;
  309. align-items: center;
  310. margin-left: 16rpx;
  311. .like-icon {
  312. width: 28rpx;
  313. height: 28rpx;
  314. margin-right: 4rpx;
  315. }
  316. .like-num {
  317. font-size: 22rpx;
  318. color: #888;
  319. }
  320. }
  321. }
  322. }
  323. }
  324. </style>