index.vue 4.7 KB

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