airConditioning.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <!-- 空调 -->
  2. <template>
  3. <view class="airConditioning">
  4. <view class="null-box" @click="backPage()"></view>
  5. <!-- 空调按钮 -->
  6. <view class="panel">
  7. <view class="panel-t">
  8. <view>{{switchStatus==0?'空调未开启':'空调已开启'}}</view>
  9. <view @click="switchFun()" :class="switchStatus==0?'color-A':'color-B'">{{switchStatus==0?'开启':'关闭'}}</view>
  10. </view>
  11. <view class="panel-m">
  12. <view :class="keystrokeIndex==index?'color-C':''" v-for="(item,index) in keystrokeData">{{item}}</view>
  13. </view>
  14. <view class="panel-b">
  15. <view @click="subtract">-</view>
  16. <view>{{result}}℃</view>
  17. <view @click="add">+</view>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. import {} from '@/api/basicsModules/index.js'
  24. import { config } from '@/api/request/config.js'
  25. export default {
  26. name: "airConditioning",
  27. props: {
  28. subjectData: {},
  29. },
  30. data() {
  31. return {
  32. baseUrl:config.base_url,
  33. //开关状态
  34. switchStatus:0,
  35. keystrokeData:['制热 ','制冷','送风'],
  36. keystrokeIndex:0,
  37. num1: 0,
  38. }
  39. },
  40. computed: {
  41. result() {
  42. return this.num1;
  43. },
  44. },
  45. created() {
  46. },
  47. mounted() {
  48. },
  49. methods: {
  50. // 返回按钮
  51. backPage(){
  52. this.$parent.buttonClick('conditioningClose','');
  53. },
  54. switchFun(){
  55. if(this.switchStatus==0){
  56. this.$set(this, 'switchStatus',1);
  57. }else{
  58. this.$set(this, 'switchStatus',0);
  59. }
  60. },
  61. add() {
  62. this.num1 += 1;
  63. },
  64. subtract() {
  65. this.num1 -= 1;
  66. },
  67. },
  68. }
  69. </script>
  70. <style lang="stylus" scoped>
  71. .airConditioning{
  72. height: 100%;
  73. width: 100%;
  74. position: fixed;
  75. top: 0;
  76. display: flex;
  77. flex-direction: column;
  78. z-index: 10;
  79. background: rgba(0, 0, 0, 0.2);
  80. .null-box {
  81. flex: 1;
  82. }
  83. /* 空调面板 */
  84. .panel{
  85. width: 710rpx;
  86. height: 430rpx;
  87. background: #FFFFFF;
  88. border-radius: 20rpx;
  89. padding:34rpx 30rpx 0rpx;
  90. box-sizing: border-box;
  91. position: absolute;
  92. top: 320rpx;
  93. left:20rpx;
  94. .panel-t{
  95. display: flex;
  96. justify-content: flex-start;
  97. align-items: center;
  98. >view:nth-of-type(1){
  99. font-family: PingFang SC;
  100. font-weight: 500;
  101. font-size: 32rpx;
  102. color: #333333;
  103. line-height: 30rpx;
  104. margin-right: 16rpx;
  105. }
  106. .color-A{
  107. width: 100rpx;
  108. height: 50rpx;
  109. font-family: PingFang SC;
  110. font-weight: 500;
  111. font-size: 30rpx;
  112. color: #FFFFFF;
  113. line-height: 50rpx;
  114. text-align: center;
  115. background: #0183FA;
  116. border-radius: 25rpx;
  117. }
  118. .color-B{
  119. width: 100rpx;
  120. height: 50rpx;
  121. font-family: PingFang SC;
  122. font-weight: 500;
  123. font-size: 30rpx;
  124. color: #666666;
  125. line-height: 50rpx;
  126. text-align: center;
  127. background: #E0E0E0;
  128. border-radius: 25rpx;
  129. }
  130. }
  131. .panel-m{
  132. display: flex;
  133. justify-content: space-between;
  134. align-items: center;
  135. margin-top: 48rpx;
  136. >view{
  137. width: 200rpx;
  138. height: 80rpx;
  139. border-radius: 10rpx;
  140. border: 1px solid #E0E0E0;
  141. font-family: PingFang SC;
  142. font-weight: 500;
  143. font-size: 32rpx;
  144. color: #333333;
  145. line-height: 80rpx;
  146. text-align: center;
  147. }
  148. .color-C{
  149. width: 200rpx;
  150. height: 80rpx;
  151. border-radius: 10rpx;
  152. border: 1px solid #E0E0E0;
  153. font-family: PingFang SC;
  154. font-weight: 500;
  155. font-size: 32rpx;
  156. color: #FFFFFF;
  157. line-height: 80rpx;
  158. text-align: center;
  159. background: #0183FA;
  160. }
  161. }
  162. .panel-b{
  163. display: flex;
  164. justify-content: space-between;
  165. align-items: center;
  166. width: 650rpx;
  167. height: 100rpx;
  168. border-radius: 10rpx;
  169. border: 1px solid #E0E0E0;
  170. margin-top: 40rpx;
  171. >view:nth-of-type(1){
  172. font-weight: 500;
  173. font-size: 32rpx;
  174. color: #333333;
  175. line-height: 100rpx;
  176. width: 120rpx;
  177. text-align: center;
  178. }
  179. >view:nth-of-type(2){
  180. font-weight: 500;
  181. font-size: 32rpx;
  182. color: #333333;
  183. line-height: 30rpx;
  184. }
  185. >view:nth-of-type(3){
  186. font-family: PingFang SC;
  187. font-weight: 500;
  188. font-size: 32rpx;
  189. color: #333333;
  190. line-height: 100rpx;
  191. width: 120rpx;
  192. text-align: center;
  193. }
  194. }
  195. }
  196. }
  197. </style>