zkx 1 ano atrás
pai
commit
8041c4e618

+ 1 - 1
pages/mine/electronicMonitoring.vue

@@ -94,7 +94,7 @@
 		@click="gotoUrl('/pages/remoteControl/switchDetail?id='+meterDetail.id)"
 		v-if="meterDetail.type!=6&&meterDetail.allowSwitch">
 			<view class="text">
-				远程控制电源开关
+				电源开关智能控制
 				 <u-icon name="arrow-right" color="#cccccc" size="24" ></u-icon>
 			</view>
 			<view class="icon">

+ 8 - 8
pages/timing/autoOff.vue

@@ -45,7 +45,7 @@
 			 @click="pickerShow1=true">
 				<view class="time">
 					<view class="time-slot">
-						定时开启
+						定时送电
 					</view>
 					<view class="type">
 						{{startTime?startTimeStr(startTime):'未设置'}}
@@ -62,7 +62,7 @@
 			 @click="pickerShow2=true">
 				<view class="time">
 					<view class="time-slot">
-						定时关闭
+						定时停电
 					</view>
 					<view class="type">
 						
@@ -200,7 +200,7 @@
 				</view>
 				<view class="input" style=" padding: 0 24rpx;">
 				  	<u-input type="digit" min="1"
-					 v-model="maxPower" placeholder="填写触发自动关闭的功率数值" />
+					 v-model="maxPower" placeholder="填写触发智能停电的功率数值" />
 				</view>
 				<view class="btn-group">
 					<view class="btn cancel" @click="thresholdsPopup=false" >
@@ -241,13 +241,13 @@
 									value:2
 									
 								}, {
-									text: '定时开启',
+									text: '定时送电',
 									value:1
 								}, {
-									text: '定时关闭' ,
+									text: '定时停电' ,
 									value:0
 								},{
-									text:'自动关闭',
+									text:'智能停电',
 									value:3
 								}],
 				params: {
@@ -436,7 +436,7 @@
 					}
 					if(br){
 						uni.showToast({
-							title: "请设置定时开启",
+							title: "请设置定时送电",
 							icon: "none"
 						})
 						return
@@ -455,7 +455,7 @@
 					}
 					if(br){
 						uni.showToast({
-							title: "请设置定时关闭",
+							title: "请设置定时停电",
 							icon: "none"
 						})
 						return

+ 359 - 359
pages/timing/timeSlotTiming.vue

@@ -1,360 +1,360 @@
-<template>
-	<view>
-		<u-navbar title="时间段定时" title-color="#101010">
-
-			<view slot="right" @click="deleteShow=true">
-				<img src="@/assets/img/riLine-check-line 1.svg" alt="" />
-			</view>
-
-		</u-navbar>
-
-		<view class="time-group">
-			<view class="time-item" @click="typeShow=true" >
-				<view class="time">
-					<view class="time-slot">
-						重复
-					</view>
-					<view class="type">
-						执行一次
-					</view>
-				</view>
-
-				<view class="more">
-					<u-icon name="arrow-right" color="#b2b2b2"></u-icon>
-				</view>
-
-			</view>
-
-			<view class="time-item"  @click="pickerShow=true">
-				<view class="time">
-					<view class="time-slot">
-						定时开启
-					</view>
-					<view class="type">
-						未设置
-					</view>
-				</view>
-
-				<view class="more">
-					<u-icon name="arrow-right" color="#b2b2b2"></u-icon>
-				</view>
-
-			</view>
-
-			<view class="time-item"   @click="pickerShow=true">
-				<view class="time">
-					<view class="time-slot">
-						定时关闭
-					</view>
-					<view class="type">
-						未设置
-					</view>
-				</view>
-
-				<view class="more">
-					<u-icon name="arrow-right" color="#b2b2b2"></u-icon>
-				</view>
-
-			</view>
-		</view>
-		<!-- 重复类型 -->
-		<view class="repeatType" v-if="typeShow" >
-			
-					<u-popup v-model="typeShow" mode="bottom" >
-						<view>
-							<view class="headline">
-								重复类型
-							</view>
-							<view class="type-group">
-								<view class="item">
-									<view class="item-title item-title-checked">
-										执行一次
-									</view>
-									<view class="item-icon">
-										<img src="@/assets/img/riLine-check-line.svg" alt="" />
-									</view>
-								</view>
-								<view class="item">
-									<view class="item-title">
-										每天
-									</view>
-									<view class="item-icon">
-										<img src="" alt="" />
-									</view>
-								</view>
-								<view class="item" @click="customPopup=true" >
-									<view class="item-title">
-										自定义
-									</view>
-									<view class="item-icon">
-										<img src="" alt="" />
-									</view>
-								</view>
-							</view>
-						</view>
-					</u-popup>
-				
-		</view>
-
-  <!-- 关闭时间 -->
-         <ujpPicker  mode="time" v-model="pickerShow" :params="params"></ujpPicker>
-	<!-- 自定义重复 -->
-	
-		<u-popup  v-model="customPopup" mode="bottom" >
-			<view class="custom">
-				<view class="headline">
-					自定义重复
-				</view>
-				<view class="radio-group">
-					<view class="radio-item">
-						<view class="item-title">
-							周一
-						</view>
-						<view class="item-value">
-							<label class="radio">
-								<radio value="" /><text></text>
-							</label>
-						</view>
-					</view>
-					<view class="radio-item">
-						<view class="item-title">
-							周二
-						</view>
-						<view class="item-value">
-							<label class="radio">
-								<radio value="" /><text></text>
-							</label>
-						</view>
-					</view>
-					<view class="radio-item">
-						<view class="item-title">
-							周三
-						</view>
-						<view class="item-value">
-							<label class="radio">
-								<radio value="" /><text></text>
-							</label>
-						</view>
-					</view>
-					<view class="radio-item">
-						<view class="item-title">
-							周四
-						</view>
-						<view class="item-value">
-							<label class="radio">
-								<radio value="" /><text></text>
-							</label>
-						</view>
-					</view>
-					<view class="radio-item">
-						<view class="item-title">
-							周五
-						</view>
-						<view class="item-value">
-							<label class="radio">
-								<radio value="" /><text></text>
-							</label>
-						</view>
-					</view>
-					<view class="radio-item">
-						<view class="item-title">
-							周六
-						</view>
-						<view class="item-value">
-							<label class="radio">
-								<radio value="" /><text></text>
-							</label>
-						</view>
-					</view>
-					<view class="radio-item">
-						<view class="item-title">
-							周日
-						</view>
-						<view class="item-value">
-							<label class="radio">
-								<radio value="" /><text></text>
-							</label>
-						</view>
-					</view>
-				</view>
-			
-			  <view class="btn-group">
-			  	<view class="btn cancel">
-			  		取消
-			  	</view>
-				<view class="btn confirm">
-					确认
-				</view>
-			  </view>
-			
-			
-			</view>
-		</u-popup>
-	
-	</view>
-</template>
-
-<script>
-	 
-	 import ujpPicker from '@/components/u-picker.vue'
-   
-	 export default {
-		 components: {
-		 	ujpPicker
-		 },
-		data() {
-			
-			return {
-				typeShow:true,
-				pickerShow :false,
-				typeShow:false,
-				customPopup:false,
-				
-				params: {
-					year: false,
-					month: false,
-					day: false,
-					hour: true,
-					minute: true,
-					second: false,
-				},
-								
-
-			}
-		},
-		methods: {
-
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
-	/deep/.u-slot-right {
-		margin-right: 32rpx;
-
-		img {
-			width: 48rpx;
-			height: 48rpx;
-		}
-	}
-
-	.time-group {
-		background-color: #fff;
-
-		.time-item {
-
-			padding: 24rpx 0;
-			margin: 0 32rpx;
-			display: flex;
-			justify-content: space-between;
-			align-items: center;
-			border-bottom: 1px solid rgba(221, 221, 221, 1);
-
-			.time {
-				.time-slot {
-					color: rgba(16, 16, 16, 1);
-					font-size: 32rpx;
-				}
-
-				.type {
-					color: rgba(119, 119, 119, 1);
-				}
-			}
-		}
-
-		.time-item:last-of-type {
-			border: none;
-		}
-	}
-
- 
- // 重复类型
- .repeatType{
-	 .headline{
-		 color: rgba(16,16,16,1);
-		 font-size: 36rpx;
-		 margin-top: 32rpx;
-		 font-weight: bold;
-		 text-align: center;
-	 }
-	 .type-group{
-		 padding: 32rpx;
-		 .item{
-			 display: flex;
-			 align-items: center;
-			 justify-content: space-between;
-			 height: 96rpx;
-			 line-height: 96rpx;
-		 }
-		 .item-title{
-			 color: rgb(16,16,16);
-			 font-size: 32rpx;
-		 }
-		 .item-title-checked{
-			 color: rgba(22,119,255,1);
-		 }
-	 }
- }
- 
- 
- 
- // 自定义重复
- .custom{
-	 padding: 32rpx;
-	 .headline{
-	 		 color: rgba(16,16,16,1);
-	 		 font-size: 36rpx;
-	 		 margin-bottom: 32rpx;
-	 		 font-weight: bold;
-	 		 text-align: center;
-			 }
-			 .radio-group{
-				 .radio-item{
-					 display: flex;
-					 align-items: center;
-					 justify-content: space-between;
-					 height: 96rpx;
-					 line-height: 96rpx;
-					 .item-title{
-						 color: rgba(16,16,16,1);
-						 font-size: 32rpx;
-					 }
-				 }
-				 
-			 
-	 }
-	 .btn-group{
-	 				 display: flex;
-	 				 align-items: center;
-	 				 justify-content: space-between;
-					 .btn{
-						 width: 328rpx;
-						 height: 80rpx;
-						 line-height: 80rpx;
-						 
-						 font-size: 32rpx;
-						 border-radius: 4px;
-						 text-align: center;
-						 margin-top: 24rpx;
-					 }
-					 .cancel{
-						 background-color: rgba(222,225,228,1);
-						 color: rgba(51,51,51,1);
-					 }
-					 .confirm{
-						 background-color: rgba(22,119,255,1);
-						 color: rgba(255,255,255,1);
-					 }
-	 			 }
- }
- 
- 
- 
- 
- /deep/.u-drawer-content-visible{
-	 border-radius: 12px 12px 0 0 ;
- }
-
-
-
+<template>
+	<view>
+		<u-navbar title="时间段定时" title-color="#101010">
+
+			<view slot="right" @click="deleteShow=true">
+				<img src="@/assets/img/riLine-check-line 1.svg" alt="" />
+			</view>
+
+		</u-navbar>
+
+		<view class="time-group">
+			<view class="time-item" @click="typeShow=true" >
+				<view class="time">
+					<view class="time-slot">
+						重复
+					</view>
+					<view class="type">
+						执行一次
+					</view>
+				</view>
+
+				<view class="more">
+					<u-icon name="arrow-right" color="#b2b2b2"></u-icon>
+				</view>
+
+			</view>
+
+			<view class="time-item"  @click="pickerShow=true">
+				<view class="time">
+					<view class="time-slot">
+						定时送电
+					</view>
+					<view class="type">
+						未设置
+					</view>
+				</view>
+
+				<view class="more">
+					<u-icon name="arrow-right" color="#b2b2b2"></u-icon>
+				</view>
+
+			</view>
+
+			<view class="time-item"   @click="pickerShow=true">
+				<view class="time">
+					<view class="time-slot">
+						定时关闭
+					</view>
+					<view class="type">
+						未设置
+					</view>
+				</view>
+
+				<view class="more">
+					<u-icon name="arrow-right" color="#b2b2b2"></u-icon>
+				</view>
+
+			</view>
+		</view>
+		<!-- 重复类型 -->
+		<view class="repeatType" v-if="typeShow" >
+			
+					<u-popup v-model="typeShow" mode="bottom" >
+						<view>
+							<view class="headline">
+								重复类型
+							</view>
+							<view class="type-group">
+								<view class="item">
+									<view class="item-title item-title-checked">
+										执行一次
+									</view>
+									<view class="item-icon">
+										<img src="@/assets/img/riLine-check-line.svg" alt="" />
+									</view>
+								</view>
+								<view class="item">
+									<view class="item-title">
+										每天
+									</view>
+									<view class="item-icon">
+										<img src="" alt="" />
+									</view>
+								</view>
+								<view class="item" @click="customPopup=true" >
+									<view class="item-title">
+										自定义
+									</view>
+									<view class="item-icon">
+										<img src="" alt="" />
+									</view>
+								</view>
+							</view>
+						</view>
+					</u-popup>
+				
+		</view>
+
+  <!-- 关闭时间 -->
+         <ujpPicker  mode="time" v-model="pickerShow" :params="params"></ujpPicker>
+	<!-- 自定义重复 -->
+	
+		<u-popup  v-model="customPopup" mode="bottom" >
+			<view class="custom">
+				<view class="headline">
+					自定义重复
+				</view>
+				<view class="radio-group">
+					<view class="radio-item">
+						<view class="item-title">
+							周一
+						</view>
+						<view class="item-value">
+							<label class="radio">
+								<radio value="" /><text></text>
+							</label>
+						</view>
+					</view>
+					<view class="radio-item">
+						<view class="item-title">
+							周二
+						</view>
+						<view class="item-value">
+							<label class="radio">
+								<radio value="" /><text></text>
+							</label>
+						</view>
+					</view>
+					<view class="radio-item">
+						<view class="item-title">
+							周三
+						</view>
+						<view class="item-value">
+							<label class="radio">
+								<radio value="" /><text></text>
+							</label>
+						</view>
+					</view>
+					<view class="radio-item">
+						<view class="item-title">
+							周四
+						</view>
+						<view class="item-value">
+							<label class="radio">
+								<radio value="" /><text></text>
+							</label>
+						</view>
+					</view>
+					<view class="radio-item">
+						<view class="item-title">
+							周五
+						</view>
+						<view class="item-value">
+							<label class="radio">
+								<radio value="" /><text></text>
+							</label>
+						</view>
+					</view>
+					<view class="radio-item">
+						<view class="item-title">
+							周六
+						</view>
+						<view class="item-value">
+							<label class="radio">
+								<radio value="" /><text></text>
+							</label>
+						</view>
+					</view>
+					<view class="radio-item">
+						<view class="item-title">
+							周日
+						</view>
+						<view class="item-value">
+							<label class="radio">
+								<radio value="" /><text></text>
+							</label>
+						</view>
+					</view>
+				</view>
+			
+			  <view class="btn-group">
+			  	<view class="btn cancel">
+			  		取消
+			  	</view>
+				<view class="btn confirm">
+					确认
+				</view>
+			  </view>
+			
+			
+			</view>
+		</u-popup>
+	
+	</view>
+</template>
+
+<script>
+	 
+	 import ujpPicker from '@/components/u-picker.vue'
+   
+	 export default {
+		 components: {
+		 	ujpPicker
+		 },
+		data() {
+			
+			return {
+				typeShow:true,
+				pickerShow :false,
+				typeShow:false,
+				customPopup:false,
+				
+				params: {
+					year: false,
+					month: false,
+					day: false,
+					hour: true,
+					minute: true,
+					second: false,
+				},
+								
+
+			}
+		},
+		methods: {
+
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	/deep/.u-slot-right {
+		margin-right: 32rpx;
+
+		img {
+			width: 48rpx;
+			height: 48rpx;
+		}
+	}
+
+	.time-group {
+		background-color: #fff;
+
+		.time-item {
+
+			padding: 24rpx 0;
+			margin: 0 32rpx;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			border-bottom: 1px solid rgba(221, 221, 221, 1);
+
+			.time {
+				.time-slot {
+					color: rgba(16, 16, 16, 1);
+					font-size: 32rpx;
+				}
+
+				.type {
+					color: rgba(119, 119, 119, 1);
+				}
+			}
+		}
+
+		.time-item:last-of-type {
+			border: none;
+		}
+	}
+
+ 
+ // 重复类型
+ .repeatType{
+	 .headline{
+		 color: rgba(16,16,16,1);
+		 font-size: 36rpx;
+		 margin-top: 32rpx;
+		 font-weight: bold;
+		 text-align: center;
+	 }
+	 .type-group{
+		 padding: 32rpx;
+		 .item{
+			 display: flex;
+			 align-items: center;
+			 justify-content: space-between;
+			 height: 96rpx;
+			 line-height: 96rpx;
+		 }
+		 .item-title{
+			 color: rgb(16,16,16);
+			 font-size: 32rpx;
+		 }
+		 .item-title-checked{
+			 color: rgba(22,119,255,1);
+		 }
+	 }
+ }
+ 
+ 
+ 
+ // 自定义重复
+ .custom{
+	 padding: 32rpx;
+	 .headline{
+	 		 color: rgba(16,16,16,1);
+	 		 font-size: 36rpx;
+	 		 margin-bottom: 32rpx;
+	 		 font-weight: bold;
+	 		 text-align: center;
+			 }
+			 .radio-group{
+				 .radio-item{
+					 display: flex;
+					 align-items: center;
+					 justify-content: space-between;
+					 height: 96rpx;
+					 line-height: 96rpx;
+					 .item-title{
+						 color: rgba(16,16,16,1);
+						 font-size: 32rpx;
+					 }
+				 }
+				 
+			 
+	 }
+	 .btn-group{
+	 				 display: flex;
+	 				 align-items: center;
+	 				 justify-content: space-between;
+					 .btn{
+						 width: 328rpx;
+						 height: 80rpx;
+						 line-height: 80rpx;
+						 
+						 font-size: 32rpx;
+						 border-radius: 4px;
+						 text-align: center;
+						 margin-top: 24rpx;
+					 }
+					 .cancel{
+						 background-color: rgba(222,225,228,1);
+						 color: rgba(51,51,51,1);
+					 }
+					 .confirm{
+						 background-color: rgba(22,119,255,1);
+						 color: rgba(255,255,255,1);
+					 }
+	 			 }
+ }
+ 
+ 
+ 
+ 
+ /deep/.u-drawer-content-visible{
+	 border-radius: 12px 12px 0 0 ;
+ }
+
+
+
 </style>

+ 387 - 387
pages/timing/timing.vue

@@ -1,387 +1,387 @@
-<template>
-	<view>
-		<u-navbar title="定时" title-color="#101010">
-			
-			<view slot="right" @click="deleteShow=!deleteShow" >
-				
-				<img  v-if="deleteShow==true"   src="@/assets/img/arcoDesign-select-all.svg" alt="" />
-			    <img  v-else src="@/assets/img/riLine-list-settings-line.svg" alt="" />
-			</view>
-			
-		</u-navbar>
-		<view class="time-group">
-			<checkbox-group @change="checkboxChange" >
-			<view class="time-item"  v-for="(item,i) in timerSwitchList"
-			 
-			 >
-				<view class="time" @click="clicksheetInfo(item)" >
-					<view class="time-slot">
-						{{item.startTime}}{{item.switchStatus==2||item.switchStatus==3?'-'+(showjp2time(item.startTime,item.endTime)?'次日':'')+item.endTime:''}}
-					</view>
-					<view class="type">
-						{{item.switchStatusN}} | {{item.type==1?'执行一次':''}}
-						<template v-if="item.type!=1">
-							<template v-if="item.weekdays=='1,2,3,4,5,6,7'">
-								每天
-							</template>
-							<template v-else >
-								<template v-for="(item,i) in item.weekdays.split(',')">
-									
-										<span :key="i">
-											{{weeklist[item]}}
-										</span>
-										<span class="weeklistclassSpan" :key="i+'a'" >
-											,
-										</span>
-								
-									
-								</template>
-							</template>
-						</template> 
-						<template v-if="item.switchStatus==3">
-							 <span style="margin-left: 8rpx;">| {{item.maxPower}}kW</span>
-						</template>
-					</view>
-				</view>
-				<!-- 开关 -->
-				<view class="switch" v-if="!deleteShow" >
-					<u-switch @change="switchBtn(item,$event)" 
-					 
-					 v-model="item.status" size="40" ></u-switch>
-				</view>
-				<!-- 单选框 -->
-				<view class="radio" v-if="deleteShow" >
-					
-					<checkbox
-					:value="item.id" ></checkbox>
-							
-				</view>
-			</view>
-			</checkbox-group  >
-		</view>
-		<u-divider :isnone="timerSwitchList.length==0"  nonetext="无记录"
-			border-color="#CFD2D5">已经到底了</u-divider>
-			
-		<!-- 添加按钮 -->
-		<view class="add"  @click="show=true"  v-if="deleteShow==false" >
-			<img src="@/assets/img/riLine-add-line 1.svg" alt="" />
-		</view>
-		
-		<!-- 新增弹窗 -->
-		<view class="add-popup">
-			<u-action-sheet :list="list"  @click="clicksheet" v-model="show" border-radius="16"  ></u-action-sheet>
-		</view>
-		
-		<!-- 删除 -->
-		<view class="delete" v-if="deleteShow" @click="deletePopupQuery" >
-			<view class="icon">
-				<img src="@/assets/img/riLine-delete-bin-7-line 1.svg" alt="" />
-			</view>
-			<view class="text">
-				删除
-			</view>
-		</view>
-		
-		<!-- 删除确认弹框 -->
-		<u-popup v-model="deletePopup"  mode="bottom" border-radius="12" >
-			<view class="popup">
-				<view class="headline">
-					删除定时
-				</view>
-				<view class="hint">
-					要删除选中的定时吗?
-				</view>
-				<view class="btn-box">
-					<view class="cancel" @click="deletePopup=false" >
-						取消
-					</view>
-					<view class="confirm"  @click="deletePopupApi"  >
-						确认删除
-					</view>
-				</view>
-			</view>
-		</u-popup>
-		
-	</view>
-</template>
-
-<script>
-	import * as API from '@/apis/pagejs/meterTimer.js'
-	
-	export default {
-		data() {
-			return {
-				checked:false,
-				show: false,
-				popShow:false,
-				deleteShow:false,
-				deletePopup:false,
-				weeklist:[
-					'','周一','周二','周三','周四','周五','周六','周日'
-				],
-				list: [{
-									text: '时间段定时',
-									
-								}, {
-									text: '定时开启'
-								}, {
-									text: '定时关闭' 
-								},{
-									text:'自动关闭'
-								}],
-				timerSwitchList:[],
-				getMeterTimerListReady:false,
-				deleteIds:"",
-								
-			}
-		},
-		onLoad(op) {
-			if(op.id){
-				
-				this.meterId=op.id;
-				this.getMeterTimerList()
-			}
-		},
-		onShow() {
-			if(this.meterId){
-				this.getMeterTimerList()
-			}
-			
-		},
-		methods: {
-			switchBtn(node,key){
-				uni.showLoading({
-					title: "加载中",
-					mask: true,
-				})
-				API.changeStatus({
-					id:node.id,
-					//enabled:key
-				}).then((res) => {
-					uni.hideLoading();
-					node.status=res.data.status
-					
-				}).catch(error => {
-					
-					uni.showToast({
-						title: error,
-						icon: "none"
-					})
-				})
-			},
-			showjp2time(time1,time2){
-				if(time1&&time2){
-					var num1=parseInt(time1.replace(":",''))
-					var num2=parseInt(time2.replace(":",''))
-					return num1>=num2
-				}else{
-					return false
-				}
-				
-			},
-			deletePopupQuery(){
-				if(this.deleteIds!=''){
-					this.deletePopup=true
-				}else{
-					uni.showToast({
-						title: "请至少勾选一项",
-						icon: "none"
-					})
-				}
-				
-			},
-			deletePopupApi(){
-				uni.showLoading({
-					title: "加载中",
-					mask: true,
-				})
-				API.deleteSwitch({
-					ids:this.deleteIds
-				}).then((response) => {
-					uni.hideLoading();
-					this.deletePopup=false
-					this.deleteShow=false
-					this.deleteIds=""
-					this.getMeterTimerList()
-				}).catch(error => {
-					uni.showToast({
-						title: error,
-						icon: "none"
-					})
-				})
-			},
-			checkboxChange(e){
-				var sz=e.detail.value;
-				 this.deleteIds=sz.join()
-				
-			},
-			clicksheetInfo(item){
-				if(!this.deleteShow){
-					var url=`/pages/timing/autoOff?id=${item.id}`
-					uni.navigateTo({
-						url:url
-					})
-				}
-				
-			},
-			clicksheet(index){
-				var url=`/pages/timing/autoOff?meterId=${this.meterId}&type=${index}`
-				uni.navigateTo({
-					url:url
-				})
-			},
-			getMeterTimerList(){
-				uni.showLoading({
-					title: "加载中",
-					mask: true,
-				})
-				API.meterTimerList({
-					meterId:this.meterId
-				}).then((response) => {
-					uni.hideLoading();
-					this.getMeterTimerListReady=true
-					this.timerSwitchList=response.data.timerSwitchList;
-					
-				}).catch(error => {
-					uni.showToast({
-						title: error,
-						icon: "none"
-					})
-				})
-			}
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
-	.weeklistclassSpan:last-child{
-		display: none;
-	}
-	/deep/.u-slot-right{
-		margin-right:32rpx;
-		img{
-			width: 48rpx;
-			height: 48rpx;
-		}
-	}
-	
-	.time-group{
-		background-color: #fff;
-		.time-item{
-			
-			padding: 24rpx 0;
-			margin: 0 32rpx;
-			display: flex;
-			justify-content: space-between;
-			align-items: center;
-			border-bottom: 1px solid rgba(221,221,221,1);
-			.time{
-				 width: 100%;
-				.time-slot{
-					color: rgba(16,16,16,1);
-					font-size: 32rpx;
-				}
-				.type{
-					color: rgba(119,119,119,1);
-				}
-			}
-		}
-		.time-item:last-of-type{
-			border: none;
-		}
-	}
-   
-   // 添加按钮
-   .add{
-	   z-index: 99;
-	   width: 128rpx;
-	   height: 128rpx;
-	   background-color: rgba(22,119,255,1);
-	   border-radius: 999px;
-	   display: flex;
-	   align-items: center;
-	   justify-content: center;
-	   position: fixed;
-	   bottom: 80rpx;
-	   right: 40rpx;
-	   img{
-		   width: 80rpx;
-		   height: 80rpx;
-	   }
-   }
-   
-   .add-popup{
-	   /deep/.u-drawer{
-	   	   left: 24rpx;
-	   	   right: 24rpx;
-	   	   bottom: 24rpx;
-	   	   border-radius: 8px;
-	   }
-	   /deep/.u-action-sheet-item{
-	   	   color: #101010;
-	   }
-	   
-   }
-  
-   // 删除
-   .delete{
-	   position: fixed;
-	   left: 0;
-	   right: 0;
-	   bottom: 0;
-	   background-color:#fff;
-	   display: flex;
-	   flex-direction: column;
-	   align-items: center;
-	   justify-content: center;
-	   // padding: 20rpx 0;
-	   height: 120rpx;
-	   img{
-		   width: 48rpx;
-		   height: 48rpx;
-	   }
-	   .text{
-		   color: rgba(51,51,51,1);
-		   font-size: 20rpx;
-	   }
-   }
-   
-   // 删除确认弹框
-   .popup{
-   	padding: 32rpx;
-   	text-align: center;
-	
-   	.headline{
-   		color: rgba(16,16,16,1);
-   		font-size: 36rpx;
-   		font-weight: bold;
-   	}
-   	.hint{
-   		color: rgba(16,16,16,1);
-   		font-size: 32rpx;
-   		margin-top: 40rpx;
-   	}
-   	.btn-box{
-   		margin-top: 82rpx;
-   		display: flex;
-   		justify-content: space-between;
-   		.cancel{
-   			width: 328rpx;
-   			line-height: 80rpx;
-   			border-radius: 4px;
-   			background-color: rgba(222,225,228,1);
-   			color: rgba(51,51,51,1);
-   			font-size: 32rpx;
-   		}
-   		.confirm{
-   			width: 328rpx;
-   			line-height: 80rpx;
-   			border-radius: 4px;
-   			background-color: rgba(255,68,68,1);
-   			color: rgba(255,255,255,1);
-   			font-size: 32rpx;
-   		}
-   	}
-   }
-   
-</style>
+<template>
+	<view>
+		<u-navbar title="定时" title-color="#101010">
+			
+			<view slot="right" @click="deleteShow=!deleteShow" >
+				
+				<img  v-if="deleteShow==true"   src="@/assets/img/arcoDesign-select-all.svg" alt="" />
+			    <img  v-else src="@/assets/img/riLine-list-settings-line.svg" alt="" />
+			</view>
+			
+		</u-navbar>
+		<view class="time-group">
+			<checkbox-group @change="checkboxChange" >
+			<view class="time-item"  v-for="(item,i) in timerSwitchList"
+			 
+			 >
+				<view class="time" @click="clicksheetInfo(item)" >
+					<view class="time-slot">
+						{{item.startTime}}{{item.switchStatus==2||item.switchStatus==3?'-'+(showjp2time(item.startTime,item.endTime)?'次日':'')+item.endTime:''}}
+					</view>
+					<view class="type">
+						{{item.switchStatusN}} | {{item.type==1?'执行一次':''}}
+						<template v-if="item.type!=1">
+							<template v-if="item.weekdays=='1,2,3,4,5,6,7'">
+								每天
+							</template>
+							<template v-else >
+								<template v-for="(item,i) in item.weekdays.split(',')">
+									
+										<span :key="i">
+											{{weeklist[item]}}
+										</span>
+										<span class="weeklistclassSpan" :key="i+'a'" >
+											,
+										</span>
+								
+									
+								</template>
+							</template>
+						</template> 
+						<template v-if="item.switchStatus==3">
+							 <span style="margin-left: 8rpx;">| {{item.maxPower}}kW</span>
+						</template>
+					</view>
+				</view>
+				<!-- 开关 -->
+				<view class="switch" v-if="!deleteShow" >
+					<u-switch @change="switchBtn(item,$event)" 
+					 
+					 v-model="item.status" size="40" ></u-switch>
+				</view>
+				<!-- 单选框 -->
+				<view class="radio" v-if="deleteShow" >
+					
+					<checkbox
+					:value="item.id" ></checkbox>
+							
+				</view>
+			</view>
+			</checkbox-group  >
+		</view>
+		<u-divider :isnone="timerSwitchList.length==0"  nonetext="无记录"
+			border-color="#CFD2D5">已经到底了</u-divider>
+			
+		<!-- 添加按钮 -->
+		<view class="add"  @click="show=true"  v-if="deleteShow==false" >
+			<img src="@/assets/img/riLine-add-line 1.svg" alt="" />
+		</view>
+		
+		<!-- 新增弹窗 -->
+		<view class="add-popup">
+			<u-action-sheet :list="list"  @click="clicksheet" v-model="show" border-radius="16"  ></u-action-sheet>
+		</view>
+		
+		<!-- 删除 -->
+		<view class="delete" v-if="deleteShow" @click="deletePopupQuery" >
+			<view class="icon">
+				<img src="@/assets/img/riLine-delete-bin-7-line 1.svg" alt="" />
+			</view>
+			<view class="text">
+				删除
+			</view>
+		</view>
+		
+		<!-- 删除确认弹框 -->
+		<u-popup v-model="deletePopup"  mode="bottom" border-radius="12" >
+			<view class="popup">
+				<view class="headline">
+					删除定时
+				</view>
+				<view class="hint">
+					要删除选中的定时吗?
+				</view>
+				<view class="btn-box">
+					<view class="cancel" @click="deletePopup=false" >
+						取消
+					</view>
+					<view class="confirm"  @click="deletePopupApi"  >
+						确认删除
+					</view>
+				</view>
+			</view>
+		</u-popup>
+		
+	</view>
+</template>
+
+<script>
+	import * as API from '@/apis/pagejs/meterTimer.js'
+	
+	export default {
+		data() {
+			return {
+				checked:false,
+				show: false,
+				popShow:false,
+				deleteShow:false,
+				deletePopup:false,
+				weeklist:[
+					'','周一','周二','周三','周四','周五','周六','周日'
+				],
+				list: [{
+									text: '时间段定时',
+									
+								}, {
+									text: '定时送电'
+								}, {
+									text: '定时停电' 
+								},{
+									text:'智能停电'
+								}],
+				timerSwitchList:[],
+				getMeterTimerListReady:false,
+				deleteIds:"",
+								
+			}
+		},
+		onLoad(op) {
+			if(op.id){
+				
+				this.meterId=op.id;
+				this.getMeterTimerList()
+			}
+		},
+		onShow() {
+			if(this.meterId){
+				this.getMeterTimerList()
+			}
+			
+		},
+		methods: {
+			switchBtn(node,key){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.changeStatus({
+					id:node.id,
+					//enabled:key
+				}).then((res) => {
+					uni.hideLoading();
+					node.status=res.data.status
+					
+				}).catch(error => {
+					
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			showjp2time(time1,time2){
+				if(time1&&time2){
+					var num1=parseInt(time1.replace(":",''))
+					var num2=parseInt(time2.replace(":",''))
+					return num1>=num2
+				}else{
+					return false
+				}
+				
+			},
+			deletePopupQuery(){
+				if(this.deleteIds!=''){
+					this.deletePopup=true
+				}else{
+					uni.showToast({
+						title: "请至少勾选一项",
+						icon: "none"
+					})
+				}
+				
+			},
+			deletePopupApi(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.deleteSwitch({
+					ids:this.deleteIds
+				}).then((response) => {
+					uni.hideLoading();
+					this.deletePopup=false
+					this.deleteShow=false
+					this.deleteIds=""
+					this.getMeterTimerList()
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			checkboxChange(e){
+				var sz=e.detail.value;
+				 this.deleteIds=sz.join()
+				
+			},
+			clicksheetInfo(item){
+				if(!this.deleteShow){
+					var url=`/pages/timing/autoOff?id=${item.id}`
+					uni.navigateTo({
+						url:url
+					})
+				}
+				
+			},
+			clicksheet(index){
+				var url=`/pages/timing/autoOff?meterId=${this.meterId}&type=${index}`
+				uni.navigateTo({
+					url:url
+				})
+			},
+			getMeterTimerList(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.meterTimerList({
+					meterId:this.meterId
+				}).then((response) => {
+					uni.hideLoading();
+					this.getMeterTimerListReady=true
+					this.timerSwitchList=response.data.timerSwitchList;
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.weeklistclassSpan:last-child{
+		display: none;
+	}
+	/deep/.u-slot-right{
+		margin-right:32rpx;
+		img{
+			width: 48rpx;
+			height: 48rpx;
+		}
+	}
+	
+	.time-group{
+		background-color: #fff;
+		.time-item{
+			
+			padding: 24rpx 0;
+			margin: 0 32rpx;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			border-bottom: 1px solid rgba(221,221,221,1);
+			.time{
+				 width: 100%;
+				.time-slot{
+					color: rgba(16,16,16,1);
+					font-size: 32rpx;
+				}
+				.type{
+					color: rgba(119,119,119,1);
+				}
+			}
+		}
+		.time-item:last-of-type{
+			border: none;
+		}
+	}
+   
+   // 添加按钮
+   .add{
+	   z-index: 99;
+	   width: 128rpx;
+	   height: 128rpx;
+	   background-color: rgba(22,119,255,1);
+	   border-radius: 999px;
+	   display: flex;
+	   align-items: center;
+	   justify-content: center;
+	   position: fixed;
+	   bottom: 80rpx;
+	   right: 40rpx;
+	   img{
+		   width: 80rpx;
+		   height: 80rpx;
+	   }
+   }
+   
+   .add-popup{
+	   /deep/.u-drawer{
+	   	   left: 24rpx;
+	   	   right: 24rpx;
+	   	   bottom: 24rpx;
+	   	   border-radius: 8px;
+	   }
+	   /deep/.u-action-sheet-item{
+	   	   color: #101010;
+	   }
+	   
+   }
+  
+   // 删除
+   .delete{
+	   position: fixed;
+	   left: 0;
+	   right: 0;
+	   bottom: 0;
+	   background-color:#fff;
+	   display: flex;
+	   flex-direction: column;
+	   align-items: center;
+	   justify-content: center;
+	   // padding: 20rpx 0;
+	   height: 120rpx;
+	   img{
+		   width: 48rpx;
+		   height: 48rpx;
+	   }
+	   .text{
+		   color: rgba(51,51,51,1);
+		   font-size: 20rpx;
+	   }
+   }
+   
+   // 删除确认弹框
+   .popup{
+   	padding: 32rpx;
+   	text-align: center;
+	
+   	.headline{
+   		color: rgba(16,16,16,1);
+   		font-size: 36rpx;
+   		font-weight: bold;
+   	}
+   	.hint{
+   		color: rgba(16,16,16,1);
+   		font-size: 32rpx;
+   		margin-top: 40rpx;
+   	}
+   	.btn-box{
+   		margin-top: 82rpx;
+   		display: flex;
+   		justify-content: space-between;
+   		.cancel{
+   			width: 328rpx;
+   			line-height: 80rpx;
+   			border-radius: 4px;
+   			background-color: rgba(222,225,228,1);
+   			color: rgba(51,51,51,1);
+   			font-size: 32rpx;
+   		}
+   		.confirm{
+   			width: 328rpx;
+   			line-height: 80rpx;
+   			border-radius: 4px;
+   			background-color: rgba(255,68,68,1);
+   			color: rgba(255,255,255,1);
+   			font-size: 32rpx;
+   		}
+   	}
+   }
+   
+</style>