index.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <view class="ranking-main">
  3. <view>
  4. <view class="ranking-title">
  5. <image src="@/static/img/容器@1x (1).png" mode="widthFix" class="ranking-title-img"></image>
  6. <view class="ranking-title-text">本月热门服务</view>
  7. </view>
  8. <view class="ranking-list">
  9. <view v-for="(item, index) in gitList" :key="index" class="ranking-list-item">
  10. <image :src="item.businessIcon" mode="widthFix" class="ranking-list-item-img"></image>
  11. <view class="ranking-list-item-content">
  12. <view class="ranking-list-item-header">
  13. <view class="ranking-list-item-title">{{ item.businessName }}</view>
  14. <view class="ranking-list-item-rating">
  15. <image src="@/static/img/容器@1x (3).png" mode="widthFix" class="star-icon"></image>
  16. <text class="score-text">{{ item.score }}星</text>
  17. </view>
  18. </view>
  19. <view class="ranking-list-item-bottom">
  20. <view class="ranking-list-item-tag">
  21. <view class="ranking-list-item-tag-text">
  22. {{ item.businessTierName }}
  23. </view>
  24. </view>
  25. <view class="ranking-list-item-count">本月已服务:{{ item.totalCount }}</view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script setup>
  34. import { userSortShotService } from '@/api/VolunteerList.js'
  35. import { onMounted, ref } from 'vue';
  36. const userType = uni.getStorageSync('userType'); //读取本地存储
  37. const gitList = ref([])
  38. const gitData = async () => {
  39. if (userType === 2) {
  40. const res = await userSortShotService()
  41. console.log(res, '>>>>>>>>>>>res')
  42. gitList.value = res.data
  43. }
  44. }
  45. onMounted(() => {
  46. gitData()
  47. })
  48. </script>
  49. <style scoped lang="scss">
  50. .ranking-main {
  51. padding: 30rpx;
  52. }
  53. .ranking-title {
  54. display: flex;
  55. align-items: center;
  56. justify-content: flex-start;
  57. margin-bottom: 30rpx;
  58. .ranking-title-img {
  59. width: 36rpx;
  60. height: 36rpx;
  61. margin-right: 10rpx;
  62. }
  63. .ranking-title-text {
  64. font-family: PingFang SC;
  65. font-size: 34rpx;
  66. font-weight: 500;
  67. color: rgba(0, 0, 0, 0.8);
  68. }
  69. }
  70. .ranking-list {
  71. .ranking-list-item {
  72. display: flex;
  73. padding: 30rpx 0;
  74. border-bottom: 1rpx solid rgba(0, 0, 0, 0.05);
  75. .ranking-list-item-img {
  76. width: 84rpx;
  77. height: 84rpx;
  78. border-radius: 50%;
  79. margin-right: 20rpx;
  80. flex-shrink: 0;
  81. top: 33rpx;
  82. }
  83. .ranking-list-item-content {
  84. flex: 1;
  85. display: flex;
  86. flex-direction: column;
  87. .ranking-list-item-header {
  88. display: flex;
  89. justify-content: space-between;
  90. align-items: center;
  91. margin-bottom: -3rpx;
  92. .ranking-list-item-title {
  93. width: 374rpx;
  94. height: 42rpx;
  95. font-family: PingFang SC;
  96. font-size: 32rpx;
  97. font-weight: normal;
  98. line-height: 42rpx;
  99. letter-spacing: normal;
  100. color: rgba(0, 0, 0, 0.8);
  101. }
  102. .ranking-list-item-rating {
  103. display: flex;
  104. align-items: center;
  105. .star-icon {
  106. width: 84rpx;
  107. height: 84rpx;
  108. margin-right: 8rpx;
  109. }
  110. .score-text {
  111. color: #FF7043;
  112. font-size: 28rpx;
  113. font-weight: 500;
  114. }
  115. }
  116. }
  117. .ranking-list-item-bottom {
  118. display: flex;
  119. justify-content: space-between;
  120. align-items: center;
  121. .ranking-list-item-tag {
  122. /* 自动布局子元素 */
  123. // width: 252rpx;
  124. height: 34rpx;
  125. /* 自动布局 */
  126. display: flex;
  127. flex-direction: column;
  128. justify-content: center;
  129. align-items: center;
  130. // padding: 8rpx 12rpx;
  131. z-index: 0;
  132. border-radius: 10rpx;
  133. box-sizing: border-box;
  134. border: 1rpx solid rgba(237, 93, 49, 0.8);
  135. .ranking-list-item-tag-text{
  136. /* 自动布局子元素 */
  137. // width: 228rpx;
  138. height: 22rpx;
  139. z-index: 0;
  140. font-family: PingFang SC;
  141. font-size: 26rpx;
  142. font-weight: normal;
  143. line-height: 22rpx;
  144. letter-spacing: 0.02em;
  145. color: #ED5D31;
  146. }
  147. }
  148. .ranking-list-item-count {
  149. font-size: 24rpx;
  150. color: rgba(0, 0, 0, 0.5);
  151. text-align: right;
  152. }
  153. }
  154. }
  155. }
  156. }
  157. </style>