floorPop.wpy 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <style lang="less" scoped>
  2. .title{
  3. padding-top: 40rpx;
  4. font-family: PingFang SC;
  5. font-size: 44rpx;
  6. font-weight: 500;
  7. line-height: 62rpx;
  8. color: #000000;
  9. }
  10. .text{
  11. font-family: PingFang SC;
  12. font-size: 32rpx;
  13. font-weight: 600;
  14. line-height: 44rpx;
  15. color: #1B2129;
  16. }
  17. .dir{
  18. border-right: 1px solid #E1E5EB;
  19. height: 30rpx;
  20. margin-left: 24rpx;
  21. margin-right: 24rpx;
  22. }
  23. .set-value{
  24. display: flex;
  25. align-items: center;
  26. padding-top: 96rpx;
  27. padding-bottom: 34rpx
  28. }
  29. .value{
  30. font-family: Montserrat;
  31. font-size: 32rpx;
  32. font-weight: 400;
  33. line-height: 38rpx;
  34. color: #626C78;
  35. }
  36. .silder-box{
  37. margin-bottom: 190rpx;
  38. }
  39. </style>
  40. <template>
  41. <div>
  42. <div class="title">地暖</div>
  43. <div class="set-value">
  44. <div class="text">设定温度</div>
  45. <div class="dir"></div>
  46. <div class="value">{{temp}}℃</div>
  47. </div>
  48. <div class="silder-box">
  49. <Floorfeat-Slider
  50. :typeValue="floorFeatItem.tempSet"
  51. :maxValue="maxValue"
  52. :minValue="minValue"
  53. @silder-mouseEnd="changeSwitch($event)"
  54. ></Floorfeat-Slider>
  55. </div>
  56. </div>
  57. </template>
  58. <script>
  59. import wepy from '@wepy/core';
  60. import { setSocketHttp } from '@/packagesEnv/api/officehome.js'
  61. wepy.component({
  62. props: {
  63. maxValue: Number,
  64. minValue: Number,
  65. floorFeatItem: Object,
  66. floorfeatVisible: Boolean
  67. },
  68. data: {
  69. defaultInactiveColor: 'rgba(196, 196, 196, 0.2)',
  70. temp: '--',
  71. changeWatchVal: true
  72. },
  73. computed: {
  74. },
  75. watch: {
  76. floorFeatItem(val) {
  77. if (this.changeWatchVal) {
  78. this.temp = val.tempSet || '--';
  79. }
  80. }
  81. },
  82. methods: {
  83. changeSwitch(val) {
  84. this.changeWatchVal = false;
  85. this.temp = val;
  86. let obj = {
  87. id: this.floorFeatItem.id,
  88. value: val,
  89. code: this.floorFeatItem.tempSetCode
  90. }
  91. let paramArr = [];
  92. paramArr.push(obj)
  93. console.log(paramArr, '----child下发指令');
  94. setSocketHttp(paramArr).then(res => {
  95. })
  96. }
  97. }
  98. });
  99. </script>
  100. <config>
  101. {
  102. usingComponents: {
  103. "Floorfeat-Slider": "../comComponents/FloorfeatSlider"
  104. }
  105. }
  106. </config>