airConditioning.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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 @click="temperatureFun(index)" :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. temperatureFun(index){
  62. this.$set(this, 'keystrokeIndex',index);
  63. },
  64. add() {
  65. this.num1 += 1;
  66. },
  67. subtract() {
  68. this.num1 -= 1;
  69. },
  70. },
  71. }
  72. </script>
  73. <style lang="stylus" scoped>
  74. .airConditioning{
  75. height: 100%;
  76. width: 100%;
  77. position: fixed;
  78. top: 0;
  79. display: flex;
  80. flex-direction: column;
  81. z-index: 10;
  82. background: rgba(0, 0, 0, 0.2);
  83. .null-box {
  84. flex: 1;
  85. }
  86. /* 空调面板 */
  87. .panel{
  88. width: 710rpx;
  89. height: 430rpx;
  90. background: #FFFFFF;
  91. border-radius: 20rpx;
  92. padding:34rpx 30rpx 0rpx;
  93. box-sizing: border-box;
  94. position: absolute;
  95. top: 320rpx;
  96. left:20rpx;
  97. .panel-t{
  98. display: flex;
  99. justify-content: flex-start;
  100. align-items: center;
  101. >view:nth-of-type(1){
  102. font-family: PingFang SC;
  103. font-weight: 500;
  104. font-size: 32rpx;
  105. color: #333333;
  106. line-height: 30rpx;
  107. margin-right: 16rpx;
  108. }
  109. .color-A{
  110. width: 100rpx;
  111. height: 50rpx;
  112. font-family: PingFang SC;
  113. font-weight: 500;
  114. font-size: 30rpx;
  115. color: #FFFFFF;
  116. line-height: 50rpx;
  117. text-align: center;
  118. background: #0183FA;
  119. border-radius: 25rpx;
  120. }
  121. .color-B{
  122. width: 100rpx;
  123. height: 50rpx;
  124. font-family: PingFang SC;
  125. font-weight: 500;
  126. font-size: 30rpx;
  127. color: #666666;
  128. line-height: 50rpx;
  129. text-align: center;
  130. background: #E0E0E0;
  131. border-radius: 25rpx;
  132. }
  133. }
  134. .panel-m{
  135. display: flex;
  136. justify-content: space-between;
  137. align-items: center;
  138. margin-top: 48rpx;
  139. >view{
  140. width: 200rpx;
  141. height: 80rpx;
  142. border-radius: 10rpx;
  143. border: 1px solid #E0E0E0;
  144. font-family: PingFang SC;
  145. font-weight: 500;
  146. font-size: 32rpx;
  147. color: #333333;
  148. line-height: 80rpx;
  149. text-align: center;
  150. }
  151. .color-C{
  152. width: 200rpx;
  153. height: 80rpx;
  154. border-radius: 10rpx;
  155. border: 1px solid #E0E0E0;
  156. font-family: PingFang SC;
  157. font-weight: 500;
  158. font-size: 32rpx;
  159. color: #FFFFFF;
  160. line-height: 80rpx;
  161. text-align: center;
  162. background: #0183FA;
  163. }
  164. }
  165. .panel-b{
  166. display: flex;
  167. justify-content: space-between;
  168. align-items: center;
  169. width: 650rpx;
  170. height: 100rpx;
  171. border-radius: 10rpx;
  172. border: 1px solid #E0E0E0;
  173. margin-top: 40rpx;
  174. >view:nth-of-type(1){
  175. font-weight: 500;
  176. font-size: 32rpx;
  177. color: #333333;
  178. line-height: 100rpx;
  179. width: 120rpx;
  180. text-align: center;
  181. }
  182. >view:nth-of-type(2){
  183. font-weight: 500;
  184. font-size: 32rpx;
  185. color: #333333;
  186. line-height: 30rpx;
  187. }
  188. >view:nth-of-type(3){
  189. font-family: PingFang SC;
  190. font-weight: 500;
  191. font-size: 32rpx;
  192. color: #333333;
  193. line-height: 100rpx;
  194. width: 120rpx;
  195. text-align: center;
  196. }
  197. }
  198. }
  199. }
  200. </style>