xiaoshoue.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <view>
  3. <uni-table stripe emptyText="暂无更多数据" >
  4. <!-- 表头行 -->
  5. <uni-tr>
  6. <uni-th align="center">排行</uni-th>
  7. <uni-th align="center">民宿名称</uni-th>
  8. <uni-th align="center">销售额(元)</uni-th>
  9. </uni-tr>
  10. <!-- 表格数据行 -->
  11. <uni-tr v-for="(item,index) in xiaoshou" :key="index">
  12. <uni-td align="center">
  13. <view class="uni-group">
  14. <button class="uni-button" v-if="item.rank==1">{{item.rank}}</button>
  15. <button class="uni-button2" v-if="item.rank==2">{{item.rank}}</button>
  16. <button class="uni-button3" v-if="item.rank==3">{{item.rank}}</button>
  17. <button class="uni-button4" v-if="item.rank>3">{{item.rank}}</button>
  18. </view>
  19. <!-- <view>{{item.measureTime.slice(11,19)}}</view> -->
  20. </uni-td>
  21. <uni-td align="center">{{item.hotelName}}
  22. <!-- <template v-if="item.status==0">
  23. 空腹
  24. </template> -->
  25. </uni-td>
  26. <uni-td align="center">{{item.salesAmount}}
  27. </uni-td>
  28. </uni-tr>
  29. </uni-table>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. props: {
  35. xiaoshou:{
  36. type: Array,
  37. // 定义是否必须传
  38. required: false,
  39. // 定义默认值
  40. default: []
  41. },
  42. },
  43. mounted() {
  44. },
  45. data() {
  46. return {
  47. xiaoshou:[]
  48. }
  49. },
  50. xiaoshou: {
  51. immediate: true,
  52. handler(value) {
  53. this.xiaoshou = value
  54. }
  55. },
  56. methods: {},
  57. }
  58. </script>
  59. <style>
  60. /* >>>.uni-table-tr[data-v-c2c83a8e] {
  61. margin-top: 18rpx;
  62. display: table-row;
  63. transition: all 0.3s;
  64. box-sizing: border-box;
  65. height: 103rpx;
  66. opacity: 1;
  67. background: rgba(242, 246, 250, 1);
  68. }
  69. >>>.uni-table-th[data-v-511e81f9] {
  70. padding: 12px 10px;
  71. display: table-cell;
  72. box-sizing: border-box;
  73. font-size: 28rpx;
  74. font-weight: 500;
  75. color: rgba(0, 0, 0, 1);
  76. border-bottom: 1px #ebeef5 solid;
  77. }
  78. >>>.uni-table-td[data-v-321f8e79] {
  79. display: table-cell;
  80. border-bottom: 1px #EBEEF5 solid;
  81. font-size: 24px;
  82. transform: scale(0.6);
  83. font-weight: 500;
  84. color: rgba(0, 0, 0, 1);
  85. line-height: 24px;
  86. box-sizing: border-box;
  87. } */
  88. /* 排行图标 */
  89. .uni-group {
  90. display: flex;
  91. align-items: center;
  92. }
  93. .uni-button{
  94. color:#FFFFFF;
  95. /* width: 30px;
  96. height: 30px; */
  97. box-shadow: rgba(255, 255, 255, 0) 0px 0px 1px;
  98. transition: unset;
  99. color:#FFFFFF;
  100. font-size: 28rpx;
  101. background: linear-gradient(183deg, #d93f52 0%, #f6909c 100%);
  102. border-radius:50%;
  103. }
  104. .uni-button2{
  105. color:#FFFFFF;
  106. box-shadow: rgba(255, 255, 255, 0) 0px 0px 1px;
  107. transition: unset;
  108. color:#FFFFFF;
  109. font-size: 28rpx;
  110. background: linear-gradient(183deg, #7ebc1c 0%, #c4eb88 100%);
  111. border-radius:50%;
  112. }
  113. .uni-button3{
  114. color:#FFFFFF;
  115. box-shadow: rgba(255, 255, 255, 0) 0px 0px 1px;
  116. transition: unset;
  117. color:#FFFFFF;
  118. font-size: 28rpx;
  119. background: linear-gradient(183deg, #ef9237 0%, #efaa66 100%);
  120. border-radius:50%;
  121. }
  122. .uni-button4{
  123. color:#FFFFFF;
  124. box-shadow: rgba(255, 255, 255, 0) 0px 0px 1px;
  125. transition: unset;
  126. color:#FFFFFF;
  127. font-size: 28rpx;
  128. background-color:rgba(165, 165, 165, 255);
  129. border-radius:50%;
  130. }
  131. </style>