moxibustion.nvue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <view class="container">
  3. <view class="list">
  4. <view class="item" v-if="num2 != '0'">
  5. <image class="img" src="/static/device/haocai1.png" mode="aspectFill"></image>
  6. <view class="info">
  7. <text class="txt1">尘盒滤芯</text>
  8. <text class="txt2">尘盒收集率:{{num2}}%</text>
  9. <view class="linebg">
  10. <view class="bar" :style="{width: num2+'%'}"></view>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="item" v-if="num1 != '0'">
  15. <image class="img" src="/static/device/haocai2.png" mode="aspectFill"></image>
  16. <view class="info">
  17. <text class="txt1">艾灸柱</text>
  18. <text class="txt2">剩余量:{{num1}}个</text>
  19. <view class="linebg">
  20. <view class="bar" :style="{width: persent+'rpx'}"></view>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="item" v-if="num3 != '0'">
  25. <image class="img" src="/static/device/haocai1.png" mode="aspectFill"></image>
  26. <view class="info">
  27. <text class="txt1">回收仓</text>
  28. <text class="txt2">占用率:{{num3}}%</text>
  29. <view class="linebg">
  30. <view class="bar" :style="{width: num3+'%'}"></view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. export default {
  39. data() {
  40. return {
  41. num1: '0',
  42. num2: '0',
  43. num3: '0',
  44. persent: 0
  45. }
  46. },
  47. onLoad(options) {
  48. this.num1 = options.p1 || '0'
  49. this.num2 = options.p2 || '0'
  50. this.num3 = options.p3 || '0'
  51. let num = parseInt(options.p1 || '0')
  52. this.persent = (400 * num / 12)
  53. },
  54. methods: {
  55. }
  56. }
  57. </script>
  58. <style>
  59. .container {
  60. flex: 1;
  61. background-color: #ffffff;
  62. }
  63. .list {
  64. padding-top: 30rpx;
  65. align-items: center;
  66. }
  67. .item {
  68. flex-direction: row;
  69. width: 676rpx;
  70. height: 204rpx;
  71. background-color: #F3F3F3;
  72. border-radius: 20rpx;
  73. align-items: center;
  74. margin-bottom: 16rpx;
  75. }
  76. .img {
  77. width: 140rpx;
  78. height: 140rpx;
  79. margin-left: 28rpx;
  80. margin-right: 48rpx;
  81. border-radius: 20rpx;
  82. }
  83. .info {
  84. flex: 1;
  85. }
  86. .txt1 {
  87. font-size: 32rpx;
  88. color: #545F71;
  89. line-height: 44rpx;
  90. margin-top: 8rpx;
  91. margin-bottom: 12rpx;
  92. }
  93. .txt2 {
  94. font-size: 26rpx;
  95. color: #9BA5B7;
  96. line-height: 44rpx;
  97. margin-bottom: 12rpx;
  98. }
  99. .linebg {
  100. width: 392rpx;
  101. height: 12rpx;
  102. background-color: #B6DAD5;
  103. border-radius: 20rpx;
  104. }
  105. .bar {
  106. height: 12rpx;
  107. background-color: #389588;
  108. border-radius: 20rpx;
  109. }
  110. </style>