index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <view class="container uni-container">
  3. <view class="">
  4. <uni-row :gutter="24">
  5. <uni-col :span="11" v-for="(item, index) in tableData" :key="index" style="">
  6. <view class="demo-layout bg-purple-light">
  7. <view class="top-title">
  8. <image :src="item.img" class="img-cl"></image>
  9. <text class="title-name">{{ item.name }}</text>
  10. </view>
  11. <view class="data-value">{{ item.value }}</view>
  12. </view>
  13. </uni-col>
  14. </uni-row>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. import config from '@/config'
  20. const baseUrlImg = config.baseUrlImg
  21. export default {
  22. data() {
  23. return {
  24. tableData: [{
  25. name: '巡查扫码总数',
  26. value: 786,
  27. img:`${baseUrlImg}/modal/shaoma.png`
  28. },
  29. {
  30. name: '日均扫码数',
  31. value: 30,
  32. img:`${baseUrlImg}/modal/shaoma.png`
  33. },
  34. {
  35. name: '人均扫码数',
  36. value: 14,
  37. img:`${baseUrlImg}/modal/shaoma.png`
  38. },
  39. {
  40. name: '设备覆盖率',
  41. value: 786,
  42. img:`${baseUrlImg}/modal/sheshi.png`
  43. },
  44. {
  45. name: '设备类型覆盖率',
  46. value: '86%',
  47. img:`${baseUrlImg}/modal/sheshi.png`
  48. },
  49. {
  50. name: '发现隐患总数',
  51. value: 786,
  52. img:`${baseUrlImg}/modal/jingao.png`
  53. },
  54. {
  55. name: '整改隐患总数',
  56. value: 786,
  57. img:`${baseUrlImg}/modal/jingao.png`
  58. },
  59. {
  60. name: '整改隐患平均时间',
  61. value: 786,
  62. img:`${baseUrlImg}/modal/jingao.png`
  63. }
  64. ]
  65. }
  66. },
  67. onShow() {},
  68. methods: {
  69. getData() {}
  70. }
  71. }
  72. </script>
  73. <style lang="scss" scoped>
  74. body {
  75. background-color: #f5f7f9;
  76. }
  77. page {
  78. background-color: #f5f7f9 !important;
  79. }
  80. /deep/ .uni-row {
  81. display: flex;
  82. flex-wrap: wrap;
  83. }
  84. .uni-col {
  85. flex-grow: 1;
  86. flex-basis: 50%;
  87. margin-bottom: 40rpx;
  88. /* 每个元素占据的宽度为一行的一半 */
  89. }
  90. .wrap {
  91. padding: 12px;
  92. }
  93. .demo-layout {
  94. height: 210rpx;
  95. border-radius: 24rpx;
  96. }
  97. .bg-purple {
  98. background: #fff;
  99. }
  100. .bg-purple-light {
  101. background: #fff;
  102. }
  103. .bg-purple-dark {
  104. background: #fff;
  105. }
  106. .img-cl {
  107. width: 48rpx;
  108. height: 48rpx;
  109. margin:40rpx 10rpx 16rpx 24rpx;
  110. }
  111. .title-name{
  112. font-size: 28rpx;
  113. color: #4CB2B6;
  114. padding-top: 20rpx;
  115. }
  116. .data-value{
  117. font-size: 44rpx;
  118. margin-left: 80rpx;
  119. }
  120. .top-title{
  121. display: flex;
  122. align-items: center;
  123. }
  124. </style>