ranking.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  1. <template>
  2. <view class="matchmaker-ranking">
  3. <!-- 顶部导航栏 -->
  4. <view class="header">
  5. <view class="back-btn" @click="goBack"></view>
  6. <text class="header-title">红娘排行榜</text>
  7. <view class="placeholder"></view>
  8. </view>
  9. <!-- 更新提示 -->
  10. <view class="update-info">
  11. <text class="update-text">每天17点自动更新数据</text>
  12. </view>
  13. <!-- 本周最佳榜标题 -->
  14. <view class="section-title-wrapper">
  15. <text class="section-title">
  16. <text class="title-icon">👩‍❤️‍💋‍👨</text>
  17. 本周最佳榜
  18. <text class="title-icon">👩‍❤️‍💋‍👨</text>
  19. </text>
  20. </view>
  21. <!-- 榜说明 -->
  22. <view class="ranking-description">
  23. <text class="description-text">榜单综合万粉以下红娘的日牵线数,用户好评数 等综合因素,上榜为前20的红娘</text>
  24. </view>
  25. <!-- 前三名展示 -->
  26. <view class="top-three-container">
  27. <view class="top-three-item second">
  28. <text class="rank-number">2</text>
  29. <view class="avatar-large"></view>
  30. <text class="matchmaker-name">小颖颖</text>
  31. <text class="success-count">成功人数: 11</text>
  32. <view class="like-btn" @click="handleLike(2)">点赞</view>
  33. </view>
  34. <view class="top-three-item first">
  35. <text class="rank-number">1</text>
  36. <view class="avatar-large"></view>
  37. <text class="matchmaker-name">小超超</text>
  38. <text class="success-count">成功人数: 12</text>
  39. <view class="like-btn active" @click="handleLike(1)">点赞</view>
  40. </view>
  41. <view class="top-three-item third">
  42. <text class="rank-number">3</text>
  43. <view class="avatar-large"></view>
  44. <text class="matchmaker-name">小魏魏</text>
  45. <text class="success-count">成功人数: 10</text>
  46. <view class="like-btn" @click="handleLike(3)">点赞</view>
  47. </view>
  48. </view>
  49. <!-- 排行榜列表 -->
  50. <scroll-view scroll-y class="ranking-list">
  51. <view class="ranking-item" v-for="(item, index) in rankingList" :key="index">
  52. <text class="rank-number-normal">{{ index + 4 }}</text>
  53. <view class="avatar-small"></view>
  54. <view class="matchmaker-info">
  55. <text class="matchmaker-name-normal">{{ item.name }}</text>
  56. <text class="success-count-normal">成功人数: {{ item.successCount }} 人</text>
  57. <text class="user-rating">用户好评数:{{ item.userRating }}</text>
  58. </view>
  59. <view class="like-btn-small" @click="handleLike(index + 4)">点赞</view>
  60. </view>
  61. </scroll-view>
  62. <!-- 底部导航 -->
  63. <view class="tabbar">
  64. <view class="tabbar-item" @click="navigateToWorkbench">
  65. <view class="tabbar-icon home"></view>
  66. <text class="tabbar-text">工作台</text>
  67. </view>
  68. <view class="tabbar-item" @click="navigateToMyResources">
  69. <view class="tabbar-icon resources"></view>
  70. <text class="tabbar-text">我的资源</text>
  71. </view>
  72. <view class="tabbar-item active" @click="navigateToRanking">
  73. <view class="tabbar-icon trophy"></view>
  74. <text class="tabbar-text">排行榜</text>
  75. </view>
  76. <view class="tabbar-item" @click="navigateToMessage">
  77. <view class="tabbar-icon message">
  78. <view class="badge">3</view>
  79. </view>
  80. <text class="tabbar-text">消息</text>
  81. </view>
  82. <view class="tabbar-item" @click="navigateToMine">
  83. <view class="tabbar-icon mine"></view>
  84. <text class="tabbar-text">我的</text>
  85. </view>
  86. </view>
  87. </view>
  88. </template>
  89. <script>
  90. import api from '@/utils/api.js'
  91. export default {
  92. data() {
  93. return {
  94. rankingList: [
  95. { name: '小华华', successCount: 9, userRating: 25 },
  96. { name: '小蒋蒋', successCount: 8, userRating: 24 },
  97. { name: '小明明', successCount: 7, userRating: 23 },
  98. { name: '小信信', successCount: 6, userRating: 23 },
  99. { name: '小莉莉', successCount: 6, userRating: 22 },
  100. { name: '小圆圆', successCount: 5, userRating: 21 },
  101. { name: '小方方', successCount: 5, userRating: 20 },
  102. { name: '小香香', successCount: 4, userRating: 19 },
  103. { name: '小甜甜', successCount: 4, userRating: 18 },
  104. { name: '小美美', successCount: 4, userRating: 18 },
  105. { name: '小柔柔', successCount: 3, userRating: 17 },
  106. { name: '小静静', successCount: 3, userRating: 16 },
  107. { name: '小聪聪', successCount: 3, userRating: 15 },
  108. { name: '小慧慧', successCount: 3, userRating: 15 },
  109. { name: '小欢欢', successCount: 2, userRating: 14 },
  110. { name: '小乐乐', successCount: 2, userRating: 13 },
  111. { name: '小笑笑', successCount: 2, userRating: 12 },
  112. { name: '小闹闹', successCount: 1, userRating: 11 },
  113. { name: '小跳跳', successCount: 1, userRating: 10 },
  114. { name: '小跑跑', successCount: 1, userRating: 9 }
  115. ]
  116. }
  117. },
  118. onLoad() {
  119. // 加载排行榜数据
  120. this.loadRankingData()
  121. },
  122. methods: {
  123. // 返回上一页
  124. goBack() {
  125. uni.navigateBack()
  126. },
  127. // 加载排行榜数据
  128. async loadRankingData() {
  129. try {
  130. const res = await api.matchmaker.getRankingData()
  131. if (res.data) {
  132. this.rankingList = res.data
  133. }
  134. } catch (e) {
  135. console.error('加载排行榜数据失败:', e)
  136. }
  137. },
  138. // 点赞
  139. handleLike(rank) {
  140. // 实现点赞功能
  141. console.log('点赞第', rank, '名红娘')
  142. uni.showToast({
  143. title: '点赞成功',
  144. icon: 'success'
  145. })
  146. },
  147. // 导航到工作台
  148. navigateToWorkbench() {
  149. uni.navigateTo({
  150. url: '/pages/matchmaker-workbench/index'
  151. })
  152. },
  153. // 导航到我的资源
  154. navigateToMyResources() {
  155. uni.navigateTo({
  156. url: '/pages/matchmaker-workbench/my-resources'
  157. })
  158. },
  159. // 导航到排行榜
  160. navigateToRanking() {
  161. // 已在排行榜页面,无需跳转
  162. },
  163. // 导航到消息
  164. navigateToMessage() {
  165. uni.navigateTo({
  166. url: '/pages/matchmaker-workbench/message'
  167. })
  168. },
  169. // 导航到我的
  170. navigateToMine() {
  171. uni.navigateTo({
  172. url: '/pages/matchmaker-workbench/mine'
  173. })
  174. }
  175. }
  176. }
  177. </script>
  178. <style lang="scss" scoped>
  179. .matchmaker-ranking {
  180. min-height: 100vh;
  181. background: linear-gradient(135deg, #FFF3F6 0%, #FFE4E8 100%);
  182. display: flex;
  183. flex-direction: column;
  184. }
  185. /* 顶部导航栏 */
  186. .header {
  187. display: flex;
  188. align-items: center;
  189. justify-content: space-between;
  190. padding: 25rpx 30rpx;
  191. padding-top: calc(25rpx + env(safe-area-inset-top));
  192. background: #FFF9F9;
  193. border-bottom: 1rpx solid #F0F0F0;
  194. .back-btn {
  195. width: 70rpx;
  196. height: 70rpx;
  197. display: flex;
  198. align-items: center;
  199. justify-content: center;
  200. background: rgba(240, 240, 240, 0.5);
  201. border-radius: 50%;
  202. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23333"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>');
  203. background-size: 40rpx 40rpx;
  204. background-repeat: no-repeat;
  205. background-position: center;
  206. }
  207. .header-title {
  208. font-size: 38rpx;
  209. font-weight: bold;
  210. color: #333;
  211. }
  212. .placeholder {
  213. width: 70rpx;
  214. }
  215. }
  216. /* 更新提示 */
  217. .update-info {
  218. background: #FFF3E0;
  219. padding: 15rpx;
  220. text-align: center;
  221. .update-text {
  222. font-size: 24rpx;
  223. color: #FF9800;
  224. }
  225. }
  226. /* 本周最佳榜标题 */
  227. .section-title-wrapper {
  228. text-align: center;
  229. margin: 30rpx 0 15rpx;
  230. .section-title {
  231. display: inline-block;
  232. font-size: 36rpx;
  233. font-weight: bold;
  234. color: #E91E63;
  235. line-height: 1.4;
  236. .title-icon {
  237. font-size: 40rpx;
  238. margin: 0 10rpx;
  239. }
  240. }
  241. }
  242. /* 榜说明 */
  243. .ranking-description {
  244. padding: 0 30rpx 25rpx;
  245. .description-text {
  246. display: block;
  247. font-size: 26rpx;
  248. color: #666;
  249. line-height: 1.5;
  250. text-align: center;
  251. }
  252. }
  253. /* 前三名展示 */
  254. .top-three-container {
  255. display: flex;
  256. justify-content: space-around;
  257. align-items: flex-end;
  258. padding: 0 20rpx 40rpx;
  259. background: #FFF9F9;
  260. border-radius: 20rpx;
  261. margin: 0 20rpx 20rpx;
  262. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  263. .top-three-item {
  264. display: flex;
  265. flex-direction: column;
  266. align-items: center;
  267. padding: 20rpx;
  268. border-radius: 20rpx;
  269. position: relative;
  270. &.first {
  271. background: linear-gradient(135deg, #FFD700 0%, #FFA000 100%);
  272. width: 280rpx;
  273. height: 400rpx;
  274. order: 2;
  275. margin-bottom: 30rpx;
  276. }
  277. &.second {
  278. background: linear-gradient(135deg, #C0C0C0 0%, #A8A8A8 100%);
  279. width: 240rpx;
  280. height: 350rpx;
  281. order: 1;
  282. }
  283. &.third {
  284. background: linear-gradient(135deg, #CD7F32 0%, #B87333 100%);
  285. width: 240rpx;
  286. height: 350rpx;
  287. order: 3;
  288. }
  289. .rank-number {
  290. position: absolute;
  291. top: 20rpx;
  292. left: 20rpx;
  293. font-size: 48rpx;
  294. font-weight: bold;
  295. color: #FFFFFF;
  296. }
  297. .avatar-large {
  298. width: 120rpx;
  299. height: 120rpx;
  300. border-radius: 50%;
  301. background: rgba(255, 255, 255, 0.3);
  302. margin: 40rpx 0 20rpx;
  303. }
  304. .matchmaker-name {
  305. font-size: 32rpx;
  306. font-weight: bold;
  307. color: #FFFFFF;
  308. margin-bottom: 15rpx;
  309. }
  310. .success-count {
  311. font-size: 28rpx;
  312. color: #FFFFFF;
  313. margin-bottom: 30rpx;
  314. }
  315. .like-btn {
  316. padding: 12rpx 35rpx;
  317. background: rgba(255, 255, 255, 0.2);
  318. color: #FFFFFF;
  319. border-radius: 25rpx;
  320. font-size: 26rpx;
  321. font-weight: bold;
  322. border: 2rpx solid #FFFFFF;
  323. &.active {
  324. background: #E91E63;
  325. color: #FFFFFF;
  326. border-color: #E91E63;
  327. }
  328. }
  329. }
  330. }
  331. .ranking-list {
  332. flex: 1;
  333. padding: 0 20rpx 120rpx;
  334. .ranking-item {
  335. display: flex;
  336. align-items: center;
  337. background: #FFFFFF;
  338. border-radius: 20rpx;
  339. padding: 25rpx;
  340. margin-bottom: 20rpx;
  341. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  342. .rank-number-normal {
  343. width: 50rpx;
  344. height: 50rpx;
  345. display: flex;
  346. align-items: center;
  347. justify-content: center;
  348. font-size: 28rpx;
  349. font-weight: bold;
  350. color: #999;
  351. border-radius: 50%;
  352. background: #F0F0F0;
  353. margin-right: 20rpx;
  354. }
  355. .avatar-small {
  356. width: 80rpx;
  357. height: 80rpx;
  358. border-radius: 50%;
  359. background: #F0F0F0;
  360. margin-right: 20rpx;
  361. }
  362. .matchmaker-info {
  363. flex: 1;
  364. .matchmaker-name-normal {
  365. display: block;
  366. font-size: 32rpx;
  367. font-weight: bold;
  368. color: #333;
  369. margin-bottom: 8rpx;
  370. }
  371. .success-count-normal,
  372. .user-rating {
  373. display: block;
  374. font-size: 24rpx;
  375. color: #666;
  376. margin-bottom: 4rpx;
  377. }
  378. }
  379. .like-btn-small {
  380. padding: 10rpx 30rpx;
  381. background: linear-gradient(135deg, #E91E63 0%, #C2185B 100%);
  382. color: #FFFFFF;
  383. border-radius: 25rpx;
  384. font-size: 26rpx;
  385. font-weight: bold;
  386. }
  387. }
  388. }
  389. /* 底部导航 */
  390. .tabbar {
  391. position: fixed;
  392. bottom: 0;
  393. left: 0;
  394. right: 0;
  395. height: 100rpx;
  396. background: #FFFFFF;
  397. border-top: 1rpx solid #F0F0F0;
  398. display: flex;
  399. justify-content: space-around;
  400. align-items: center;
  401. padding-bottom: env(safe-area-inset-bottom);
  402. .tabbar-item {
  403. display: flex;
  404. flex-direction: column;
  405. align-items: center;
  406. gap: 8rpx;
  407. padding: 10rpx 0;
  408. .tabbar-icon {
  409. width: 44rpx;
  410. height: 44rpx;
  411. background-size: contain;
  412. background-repeat: no-repeat;
  413. background-position: center;
  414. position: relative;
  415. .badge {
  416. position: absolute;
  417. top: -8rpx;
  418. right: -8rpx;
  419. background: #FF4444;
  420. color: #FFFFFF;
  421. font-size: 20rpx;
  422. font-weight: bold;
  423. width: 32rpx;
  424. height: 32rpx;
  425. display: flex;
  426. align-items: center;
  427. justify-content: center;
  428. border-radius: 16rpx;
  429. }
  430. }
  431. .tabbar-text {
  432. font-size: 20rpx;
  433. color: #999;
  434. }
  435. &.active {
  436. .tabbar-text {
  437. color: #9C27B0;
  438. font-weight: bold;
  439. }
  440. }
  441. &.home .tabbar-icon {
  442. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>');
  443. }
  444. &.active.home .tabbar-icon {
  445. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>');
  446. }
  447. &.resources .tabbar-icon {
  448. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></svg>');
  449. }
  450. &.active.resources .tabbar-icon {
  451. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></svg>');
  452. }
  453. &.trophy .tabbar-icon {
  454. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M18 6l-1.42 1.42-1.59-1.59L13 8.17l-1.42-1.42L9 8.17l-1.59-1.59L6 6l3 3V18c0 1.1.9 2 2 2h4c1.1 0 2-.9 2-2V9l3-3zm-4 12H8v-7.5l4-4 4 4V18z"/></svg>');
  455. }
  456. &.message .tabbar-icon {
  457. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"/></svg>');
  458. }
  459. &.active.message .tabbar-icon {
  460. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"/></svg>');
  461. }
  462. &.mine .tabbar-icon {
  463. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>');
  464. }
  465. &.active.mine .tabbar-icon {
  466. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>');
  467. }
  468. }
  469. }
  470. </style>