|
@@ -168,7 +168,7 @@
|
|
|
<view class="slider-container">
|
|
<view class="slider-container">
|
|
|
<view class="slider-min-value">10</view>
|
|
<view class="slider-min-value">10</view>
|
|
|
<view
|
|
<view
|
|
|
- class="custom-progress"
|
|
|
|
|
|
|
+ :class="['custom-progress', { dragging: sliderDragging }]"
|
|
|
@touchstart.stop="onSliderTouchStart($event, 'openingValue', 10, 100)"
|
|
@touchstart.stop="onSliderTouchStart($event, 'openingValue', 10, 100)"
|
|
|
@touchmove.stop.prevent="onSliderTouchMove($event, 10, 100)"
|
|
@touchmove.stop.prevent="onSliderTouchMove($event, 10, 100)"
|
|
|
@touchend.stop="onSliderTouchEnd"
|
|
@touchend.stop="onSliderTouchEnd"
|
|
@@ -192,7 +192,7 @@
|
|
|
<view class="slider-container">
|
|
<view class="slider-container">
|
|
|
<view class="slider-min-value">10</view>
|
|
<view class="slider-min-value">10</view>
|
|
|
<view
|
|
<view
|
|
|
- class="custom-progress"
|
|
|
|
|
|
|
+ :class="['custom-progress', { dragging: sliderDragging }]"
|
|
|
@touchstart.stop="onSliderTouchStart($event, 'openingValue', 10, 100)"
|
|
@touchstart.stop="onSliderTouchStart($event, 'openingValue', 10, 100)"
|
|
|
@touchmove.stop.prevent="onSliderTouchMove($event, 10, 100)"
|
|
@touchmove.stop.prevent="onSliderTouchMove($event, 10, 100)"
|
|
|
@touchend.stop="onSliderTouchEnd"
|
|
@touchend.stop="onSliderTouchEnd"
|
|
@@ -210,7 +210,14 @@
|
|
|
<u-button type="success" style="width: 94%;margin-left: 3%;margin-bottom: 40rpx" @click="submit2">提交</u-button>
|
|
<u-button type="success" style="width: 94%;margin-left: 3%;margin-bottom: 40rpx" @click="submit2">提交</u-button>
|
|
|
</u-form>
|
|
</u-form>
|
|
|
</u-popup>
|
|
</u-popup>
|
|
|
- <u-modal v-model="show3" :content="content" @confirm="confirmClose" @cancel="cancelClose"></u-modal>
|
|
|
|
|
|
|
+ <u-modal
|
|
|
|
|
+ v-model="show3"
|
|
|
|
|
+ :content="content"
|
|
|
|
|
+ @confirm="confirmClose"
|
|
|
|
|
+ @cancel="cancelClose"
|
|
|
|
|
+ :mask-close-able="true"
|
|
|
|
|
+ :show-cancel-button="true"
|
|
|
|
|
+ ></u-modal>
|
|
|
<u-select v-model="show1" :list="hours" @confirm="changeHour"></u-select>
|
|
<u-select v-model="show1" :list="hours" @confirm="changeHour"></u-select>
|
|
|
<u-select v-model="show2" :list="minutes" @confirm="changeMinute"></u-select>
|
|
<u-select v-model="show2" :list="minutes" @confirm="changeMinute"></u-select>
|
|
|
<u-popup v-model="show4" mode="center" width="80%" :mask-close-able="false">
|
|
<u-popup v-model="show4" mode="center" width="80%" :mask-close-able="false">
|
|
@@ -302,6 +309,7 @@ import openingDegree from '../assets/openingDegree.png';
|
|
|
current_device_id: '', //当前设备ID
|
|
current_device_id: '', //当前设备ID
|
|
|
menuList: [],
|
|
menuList: [],
|
|
|
sliderRect: {},
|
|
sliderRect: {},
|
|
|
|
|
+ sliderDragging: false,
|
|
|
equipContrlForm: {
|
|
equipContrlForm: {
|
|
|
openingValue: 60,
|
|
openingValue: 60,
|
|
|
},
|
|
},
|
|
@@ -437,6 +445,7 @@ import openingDegree from '../assets/openingDegree.png';
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onSliderTouchStart(e, field, min, max) {
|
|
onSliderTouchStart(e, field, min, max) {
|
|
|
|
|
+ this.sliderDragging = true
|
|
|
this.sliderField = field
|
|
this.sliderField = field
|
|
|
this.sliderMin = min
|
|
this.sliderMin = min
|
|
|
this.sliderMax = max
|
|
this.sliderMax = max
|
|
@@ -452,6 +461,7 @@ import openingDegree from '../assets/openingDegree.png';
|
|
|
},
|
|
},
|
|
|
onSliderTouchEnd() {
|
|
onSliderTouchEnd() {
|
|
|
this.sliderField = ''
|
|
this.sliderField = ''
|
|
|
|
|
+ this.sliderDragging = false
|
|
|
},
|
|
},
|
|
|
onSliderTap(e, field, min, max) {
|
|
onSliderTap(e, field, min, max) {
|
|
|
const query = uni.createSelectorQuery().in(this)
|
|
const query = uni.createSelectorQuery().in(this)
|
|
@@ -465,6 +475,7 @@ import openingDegree from '../assets/openingDegree.png';
|
|
|
let ratio = (clientX - this.sliderRect.left) / this.sliderRect.width
|
|
let ratio = (clientX - this.sliderRect.left) / this.sliderRect.width
|
|
|
ratio = Math.max(0, Math.min(1, ratio))
|
|
ratio = Math.max(0, Math.min(1, ratio))
|
|
|
const value = Math.round(min + ratio * (max - min))
|
|
const value = Math.round(min + ratio * (max - min))
|
|
|
|
|
+ if (this.equipContrlForm[field] === value) return
|
|
|
this.$set(this.equipContrlForm, field, value)
|
|
this.$set(this.equipContrlForm, field, value)
|
|
|
},
|
|
},
|
|
|
submit(){
|
|
submit(){
|
|
@@ -485,7 +496,7 @@ import openingDegree from '../assets/openingDegree.png';
|
|
|
this.showPopup2 = false;
|
|
this.showPopup2 = false;
|
|
|
},
|
|
},
|
|
|
getHours(){
|
|
getHours(){
|
|
|
- for(let i = 0; i < 24; i++){
|
|
|
|
|
|
|
+ for(let i = 1; i <= 12; i++){
|
|
|
this.hours.push({
|
|
this.hours.push({
|
|
|
label: i + ' 时',
|
|
label: i + ' 时',
|
|
|
value: i,
|
|
value: i,
|
|
@@ -1207,6 +1218,12 @@ import openingDegree from '../assets/openingDegree.png';
|
|
|
.custom-progress{
|
|
.custom-progress{
|
|
|
width: 500rpx;
|
|
width: 500rpx;
|
|
|
padding: 0;
|
|
padding: 0;
|
|
|
|
|
+ &.dragging{
|
|
|
|
|
+ .progress-fill,
|
|
|
|
|
+ .progress-thumb{
|
|
|
|
|
+ transition: none;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
.progress-track{
|
|
.progress-track{
|
|
|
position: relative;
|
|
position: relative;
|
|
|
height: 12rpx;
|
|
height: 12rpx;
|