index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <view class="share">
  3. <view class="share-top">
  4. <image src="../../static/image/machine.png" mode="widthFix"></image>
  5. <view class="right">
  6. <view class="no">
  7. 设备编号:41010010001
  8. </view>
  9. <view class="no">
  10. 绑定日期:2021-12-12
  11. </view>
  12. <view class="no">
  13. 设备状态:正常
  14. </view>
  15. <view class="no">
  16. 水位:正常
  17. </view>
  18. </view>
  19. </view>
  20. <view class="select-time">
  21. <view class="title">
  22. 时间选择
  23. </view>
  24. <view class="time-list">
  25. <view class="time-item" :class="currentTime==index?'timeActive':''" @click="changeTime(index)" v-for="(item,index) in timeList"
  26. :key='index'>
  27. {{item.time}}分钟
  28. </view>
  29. <view class="time-item" :class="currentTime==-1?'timeActive':''" @click="changeTime(-1)">
  30. 自定义
  31. </view>
  32. </view>
  33. <view class="customTime" v-show="isShow">
  34. <input type="number" value="" placeholder="请输入时间(/分钟)" v-model="customTime" @input="inputCustom()" />
  35. </view>
  36. </view>
  37. <view class="buttom-list">
  38. <view class="list-item">
  39. 开始
  40. </view>
  41. <view class="list-item" style="background-color: #e76953;">
  42. 暂停
  43. </view>
  44. <view class="list-item" style="background-color: #01356e;">
  45. 结束
  46. </view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. export default {
  52. data() {
  53. return {
  54. timeList: [{
  55. id: 0,
  56. time: 30
  57. },
  58. {
  59. id: 1,
  60. time: 50
  61. },
  62. {
  63. id: 2,
  64. time: 60
  65. },
  66. ],
  67. currentTime: 0,
  68. isShow: false
  69. }
  70. },
  71. methods: {
  72. changeTime: function(e) {
  73. console.log(e)
  74. if (e == -1) {
  75. console.log(this.customTime)
  76. this.currentTime = e
  77. this.isShow = true
  78. } else {
  79. console.log(this.customTime)
  80. this.isShow = false
  81. this.currentTime = e
  82. }
  83. }
  84. }
  85. }
  86. </script>
  87. <style lang="scss" scoped>
  88. .share {
  89. .share-top {
  90. display: flex;
  91. padding: 50upx 30upx;
  92. background-color: $mine-background-color;
  93. image {
  94. flex: 0 0 200upx;
  95. width: 200upx;
  96. margin-right: 30upx;
  97. }
  98. .right {
  99. flex: 1;
  100. font-size: 28upx;
  101. color: #FFFFFF;
  102. .no {
  103. line-height: 40upx;
  104. }
  105. }
  106. }
  107. .select-time {
  108. padding: 30upx 0;
  109. margin-top: 50upx;
  110. .title {
  111. padding: 0 30upx;
  112. font-size: 34upx;
  113. font-family: PingFang SC;
  114. font-weight: bold;
  115. color: #000000;
  116. }
  117. .time-list {
  118. display: flex;
  119. padding: 0 10upx;
  120. margin-top: 25upx;
  121. .time-item {
  122. flex: 1;
  123. margin: 0 10upx;
  124. height: 80upx;
  125. line-height: 80upx;
  126. text-align: center;
  127. font-size: 30upx;
  128. font-family: PingFang SC;
  129. font-weight: 500;
  130. background-color: #FFFFFF;
  131. border-radius: 37upx;
  132. }
  133. .timeActive {
  134. font-weight: bold;
  135. background: $mine-background-color;
  136. font-size: 33upx;
  137. box-shadow: 0upx 2upx 13upx 0upx rgba(150, 150, 150, 0.35);
  138. border-radius: 37upx;
  139. color: #FFFFFF;
  140. }
  141. }
  142. .customTime {
  143. height: 70upx;
  144. background-color: #FFFFFF;
  145. margin: 30upx;
  146. input {
  147. height: 70upx;
  148. padding: 0 30upx;
  149. line-height: 70upx;
  150. font-size: 26upx;
  151. }
  152. }
  153. }
  154. .buttom-list {
  155. margin-top: 100upx;
  156. .list-item {
  157. height: 90upx;
  158. line-height: 90upx;
  159. margin: 0 auto;
  160. border-radius: 50upx;
  161. text-align: center;
  162. width: 70%;
  163. margin-top: 50upx;
  164. color: #FFFFFF;
  165. font-size: 30upx;
  166. background-color: $mine-background-color;
  167. font-weight: 500;
  168. }
  169. }
  170. }
  171. </style>