瀏覽代碼

定时,时间段定时,自动关闭。

常志远 1 年之前
父節點
當前提交
a5c380c8b1

+ 6 - 0
assets/img/arcoDesign-select-all.svg

@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 48 48" width="24" height="24" style="" filter="none">
+    
+    <g>
+    <path d="M17.3137 7.24268L10.2426 14.3137L6 10.0711" stroke="rgba(16,16,16,1)" stroke-width="4" fill="none"></path><path d="M17.3137 20.2427L10.2426 27.3137L6 23.0711" stroke="rgba(16,16,16,1)" stroke-width="4" fill="none"></path><path d="M17.3137 33.2427L10.2426 40.3137L6 36.0711" stroke="rgba(16,16,16,1)" stroke-width="4" fill="none"></path><path d="M21 25H43" stroke="rgba(16,16,16,1)" stroke-width="4" fill="none"></path><path d="M21 11H43" stroke="rgba(16,16,16,1)" stroke-width="4" fill="none"></path><path d="M21 39H43" stroke="rgba(16,16,16,1)" stroke-width="4" fill="none"></path>
+    </g>
+  </svg>

+ 6 - 0
assets/img/riLine-add-line 1.svg

@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" width="40" height="40" style="" filter="none">
+    
+    <g>
+    <path d="M14.667 14.667v-8h2.667v8h8v2.667h-8v8h-2.667v-8h-8v-2.667z" fill="rgba(255,255,255,1)"></path>
+    </g>
+  </svg>

+ 6 - 0
assets/img/riLine-check-line 1.svg

@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" width="24" height="24" style="" filter="none">
+    
+    <g>
+    <path d="M13.333 20.229l12.256-12.257 1.887 1.885-14.143 14.143-8.485-8.485 1.885-1.885z" fill="rgba(16,16,16,1)"></path>
+    </g>
+  </svg>

+ 6 - 0
assets/img/riLine-check-line.svg

@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" width="24" height="24" style="" filter="none">
+    
+    <g>
+    <path d="M13.333 20.229l12.256-12.257 1.887 1.885-14.143 14.143-8.485-8.485 1.885-1.885z" fill="rgba(22,119,255,1)"></path>
+    </g>
+  </svg>

+ 6 - 0
assets/img/riLine-delete-bin-7-line 1.svg

@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" width="24" height="24" style="" filter="none">
+    
+    <g>
+    <path d="M22.667 8h6.667v2.667h-2.667v17.333c0 0.736-0.597 1.333-1.333 1.333v0h-18.667c-0.736 0-1.333-0.597-1.333-1.333v0-17.333h-2.667v-2.667h6.667v-4c0-0.736 0.597-1.333 1.333-1.333v0h10.667c0.736 0 1.333 0.597 1.333 1.333v0 4zM24 10.667h-16v16h16v-16zM12 5.333v2.667h8v-2.667h-8z" fill="rgba(51,51,51,1)"></path>
+    </g>
+  </svg>

+ 6 - 0
assets/img/riLine-list-settings-line.svg

@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" width="24" height="24" style="" filter="none">
+    
+    <g>
+    <path d="M2.667 24h9.333v2.667h-9.333v-2.667zM2.667 14.667h12v2.667h-12v-2.667zM2.667 5.333h26.667v2.667h-26.667v-2.667zM27.565 17.367l1.541-0.521 1.333 2.309-1.221 1.073c0.073 0.332 0.115 0.714 0.115 1.105s-0.042 0.773-0.122 1.141l0.006-0.035 1.221 1.073-1.333 2.309-1.541-0.521c-0.547 0.493-1.197 0.873-1.913 1.107l-0.319 1.593h-2.667l-0.32-1.595c-0.741-0.246-1.379-0.624-1.917-1.111l0.005 0.004-1.541 0.523-1.333-2.309 1.221-1.073c-0.073-0.332-0.115-0.714-0.115-1.105s0.042-0.773 0.122-1.141l-0.006 0.035-1.221-1.073 1.333-2.309 1.541 0.521c0.547-0.493 1.197-0.873 1.913-1.107l0.319-1.593h2.667l0.32 1.595c0.715 0.232 1.365 0.613 1.912 1.107zM24 24c1.473 0 2.667-1.194 2.667-2.667s-1.194-2.667-2.667-2.667v0c-1.473 0-2.667 1.194-2.667 2.667s1.194 2.667 2.667 2.667v0z" fill="rgba(16,16,16,1)"></path>
+    </g>
+  </svg>

+ 714 - 0
components/u-picker.vue

@@ -0,0 +1,714 @@
+<template>
+	<u-popup :maskCloseAble="maskCloseAble" mode="bottom" :popup="false" v-model="value" length="auto" :safeAreaInsetBottom="safeAreaInsetBottom" @close="close" :z-index="uZIndex">
+		<view class="u-datetime-picker">
+			<view class="u-picker-title">
+				定时关闭
+			</view>
+			<view class="expiration-time">
+				次日 00:01
+			</view>
+			
+			</view>
+			<view class="u-picker-body">
+				<picker-view v-if="mode == 'region'" :value="valueArr" @change="change" class="u-picker-view" @pickstart="pickstart" @pickend="pickend">
+					<picker-view-column v-if="!reset && params.province">
+						<view class="u-column-item" v-for="(item, index) in provinces" :key="index">
+							<view class="u-line-1">{{ item.label }}</view>
+						</view>
+					</picker-view-column>
+					<picker-view-column v-if="!reset && params.city">
+						<view class="u-column-item" v-for="(item, index) in citys" :key="index">
+							<view class="u-line-1">{{ item.label }}</view>
+						</view>
+					</picker-view-column>
+					<picker-view-column v-if="!reset && params.area">
+						<view class="u-column-item" v-for="(item, index) in areas" :key="index">
+							<view class="u-line-1">{{ item.label }}</view>
+						</view>
+					</picker-view-column>
+				</picker-view>
+				<picker-view v-else-if="mode == 'time'" :value="valueArr" @change="change" class="u-picker-view" @pickstart="pickstart" @pickend="pickend">
+					<picker-view-column v-if="!reset && params.year">
+						<view class="u-column-item" v-for="(item, index) in years" :key="index">
+							{{ item }}
+							<text class="u-text" v-if="showTimeTag">年</text>
+						</view>
+					</picker-view-column>
+					<picker-view-column v-if="!reset && params.month">
+						<view class="u-column-item" v-for="(item, index) in months" :key="index">
+							{{ formatNumber(item) }}
+							<text class="u-text" v-if="showTimeTag">月</text>
+						</view>
+					</picker-view-column>
+					<picker-view-column v-if="!reset && params.day">
+						<view class="u-column-item" v-for="(item, index) in days" :key="index">
+							{{ formatNumber(item) }}
+							<text class="u-text" v-if="showTimeTag">日</text>
+						</view>
+					</picker-view-column>
+					<picker-view-column v-if="!reset && params.hour">
+						<view class="u-column-item" v-for="(item, index) in hours" :key="index">
+							{{ formatNumber(item) }}
+							<text class="u-text" v-if="showTimeTag">时</text>
+						</view>
+					</picker-view-column>
+					<picker-view-column v-if="!reset && params.minute">
+						<view class="u-column-item" v-for="(item, index) in minutes" :key="index">
+							{{ formatNumber(item) }}
+							<text class="u-text" v-if="showTimeTag">分</text>
+						</view>
+					</picker-view-column>
+					<picker-view-column v-if="!reset && params.second">
+						<view class="u-column-item" v-for="(item, index) in seconds" :key="index">
+							{{ formatNumber(item) }}
+							<text class="u-text" v-if="showTimeTag">秒</text>
+						</view>
+					</picker-view-column>
+				</picker-view>
+				<picker-view v-else-if="mode == 'selector'" :value="valueArr" @change="change" class="u-picker-view" @pickstart="pickstart" @pickend="pickend">
+					<picker-view-column v-if="!reset">
+						<view class="u-column-item" v-for="(item, index) in range" :key="index">
+							<view class="u-line-1">{{ getItemValue(item, 'selector') }}</view>
+						</view>
+					</picker-view-column>
+				</picker-view>
+				<picker-view v-else-if="mode == 'multiSelector'" :value="valueArr" @change="change" class="u-picker-view" @pickstart="pickstart" @pickend="pickend">
+					<picker-view-column v-if="!reset" v-for="(item, index) in range" :key="index">
+						<view class="u-column-item" v-for="(item1, index1) in item" :key="index1">
+							<view class="u-line-1">{{ getItemValue(item1, 'multiSelector') }}</view>
+						</view>
+					</picker-view-column>
+				</picker-view>
+			</view>
+		
+		
+		<view class="u-picker-header" @touchmove.stop.prevent="">
+						<view class="u-btn-picker u-btn-picker--tips u-btn1" 
+							:style="{ color: cancelColor }" 
+							hover-class="u-opacity" 
+							:hover-stay-time="150" 
+							@tap="getResult('cancel')"
+						>{{cancelText}}</view>
+						<view class="u-picker__title">{{ title }}</view>
+						<view
+							class="u-btn-picker u-btn-picker--primary u-btn2"
+							:style="{ color: moving ? cancelColor : confirmColor }"
+							hover-class="u-opacity"
+							:hover-stay-time="150"
+							@touchmove.stop=""
+							@tap.stop="getResult('confirm')"
+						>
+							{{confirmText}}
+						</view>
+		
+		</view>
+	</u-popup>
+</template>
+
+<script>
+// import provinces from './util/province.js';
+// import citys from './util/city.js';
+// import areas from './util/area.js';
+
+/**
+ * picker picker弹出选择器
+ * @description 此选择器有两种弹出模式:一是时间模式,可以配置年,日,月,时,分,秒参数 二是地区模式,可以配置省,市,区参数
+ * @tutorial https://www.uviewui.com/components/picker.html
+ * @property {Object} params 需要显示的参数,见官网说明
+ * @property {String} mode 模式选择,region-地区类型,time-时间类型(默认time)
+ * @property {String Number} start-year 可选的开始年份,mode=time时有效(默认1950)
+ * @property {String Number} end-year 可选的结束年份,mode=time时有效(默认2050)
+ * @property {Boolean} safe-area-inset-bottom 是否开启底部安全区适配(默认false)
+ * @property {Boolean} show-time-tag 时间模式时,是否显示后面的年月日中文提示
+ * @property {String} cancel-color 取消按钮的颜色(默认#606266)
+ * @property {String} confirm-color 确认按钮的颜色(默认#2979ff)
+ * @property {String} default-time 默认选中的时间,mode=time时有效
+ * @property {String} confirm-text 确认按钮的文字
+ * @property {String} cancel-text 取消按钮的文字
+ * @property {String} default-region 默认选中的地区,中文形式,mode=region时有效
+ * @property {String} default-code 默认选中的地区,编号形式,mode=region时有效
+ * @property {Boolean} mask-close-able 是否允许通过点击遮罩关闭Picker(默认true)
+ * @property {String Number} z-index 弹出时的z-index值(默认1075)
+ * @property {Array} default-selector 数组形式,其中每一项表示选择了range对应项中的第几个
+ * @property {Array} range 自定义选择的数据,mode=selector或mode=multiSelector时有效
+ * @property {String} range-key 当range参数的元素为对象时,指定Object中的哪个key的值作为选择器显示内容
+ * @event {Function} confirm 点击确定按钮,返回当前选择的值
+ * @event {Function} cancel 点击取消按钮,返回当前选择的值
+ * @example <u-picker v-model="show" mode="time"></u-picker>
+ */
+export default {
+	name: 'u-picker',
+	props: {
+		// picker中需要显示的参数
+		params: {
+			type: Object,
+			default() {
+				return {
+					year: true,
+					month: true,
+					day: true,
+					hour: false,
+					minute: false,
+					second: false,
+					province: true,
+					city: true,
+					area: true,
+					timestamp: true,
+				};
+			}
+		},
+		// 当mode=selector或者mode=multiSelector时,提供的数组
+		range: {
+			type: Array,
+			default() {
+				return [];
+			}
+		},
+		// 当mode=selector或者mode=multiSelector时,提供的默认选中的下标
+		defaultSelector: {
+			type: Array,
+			default() {
+				return [0];
+			}
+		},
+		// 当 range 是一个 Array<Object> 时,通过 range-key 来指定 Object 中 key 的值作为选择器显示内容
+		rangeKey: {
+			type: String,
+			default: ''
+		},
+		// 模式选择,region-地区类型,time-时间类型,selector-单列模式,multiSelector-多列模式
+		mode: {
+			type: String,
+			default: 'time'
+		},
+		// 年份开始时间
+		startYear: {
+			type: [String, Number],
+			default: 1950
+		},
+		// 年份结束时间
+		endYear: {
+			type: [String, Number],
+			default: 2050
+		},
+		// "取消"按钮的颜色
+		cancelColor: {
+			type: String,
+			default: '#606266'
+		},
+		// "确定"按钮的颜色
+		confirmColor: {
+			type: String,
+			default: '#2979ff'
+		},
+		// 默认显示的时间,2025-07-02 || 2025-07-02 13:01:00 || 2025/07/02
+		defaultTime: {
+			type: String,
+			default: ''
+		},
+		// 默认显示的地区,可传类似["河北省", "秦皇岛市", "北戴河区"]
+		defaultRegion: {
+			type: Array,
+			default() {
+				return [];
+			}
+		},
+		// 时间模式时,是否显示后面的年月日中文提示
+		showTimeTag: {
+			type: Boolean,
+			default: true
+		},
+		// 默认显示地区的编码,defaultRegion和areaCode同时存在,areaCode优先,可传类似["13", "1303", "130304"]
+		areaCode: {
+			type: Array,
+			default() {
+				return [];
+			}
+		},
+		safeAreaInsetBottom: {
+			type: Boolean,
+			default: false
+		},
+		// 是否允许通过点击遮罩关闭Picker
+		maskCloseAble: {
+			type: Boolean,
+			default: true
+		},
+		// 通过双向绑定控制组件的弹出与收起
+		value: {
+			type: Boolean,
+			default: false
+		},
+		// 弹出的z-index值
+		zIndex: {
+			type: [String, Number],
+			default: 0
+		},
+		// 顶部标题
+		title: {
+			type: String,
+			default: ''
+		},
+		// 取消按钮的文字
+		cancelText: {
+			type: String,
+			default: '取消'
+		},
+		// 确认按钮的文字
+		confirmText: {
+			type: String,
+			default: '确认'
+		}
+	},
+	data() {
+		return {
+			years: [],
+			months: [],
+			days: [],
+			hours: [],
+			minutes: [],
+			seconds: [],
+			year: 0,
+			month: 0,
+			day: 0,
+			hour: 0,
+			minute: 0,
+			second: 0,
+			reset: false,
+			startDate: '',
+			endDate: '',
+			valueArr: [],
+			// provinces: provinces,
+			// citys: citys[0],
+			// areas: areas[0][0],
+			province: 0,
+			city: 0,
+			area: 0,
+			moving: false // 列是否还在滑动中,微信小程序如果在滑动中就点确定,结果可能不准确
+		};
+	},
+	mounted() {
+		this.init();
+	},
+	computed: {
+		propsChange() {
+			// 引用这几个变量,是为了监听其变化
+			return `${this.mode}-${this.defaultTime}-${this.startYear}-${this.endYear}-${this.defaultRegion}-${this.areaCode}`;
+		},
+		regionChange() {
+			// 引用这几个变量,是为了监听其变化
+			return `${this.province}-${this.city}`;
+		},
+		yearAndMonth() {
+			return `${this.year}-${this.month}`;
+		},
+		uZIndex() {
+			// 如果用户有传递z-index值,优先使用
+			return this.zIndex ? this.zIndex : this.$u.zIndex.popup;
+		}
+	},
+	watch: {
+		propsChange() {
+			this.reset = true;
+			setTimeout(() => this.init(), 10);
+		},
+		// 如果地区发生变化,为了让picker联动起来,必须重置this.citys和this.areas
+		regionChange(val) {
+			this.citys = citys[this.province];
+			this.areas = areas[this.province][this.city];
+		},
+		// watch监听月份的变化,实时变更日的天数,因为不同月份,天数不一样
+		// 一个月可能有30,31天,甚至闰年2月的29天,平年2月28天
+		yearAndMonth(val) {
+			if (this.params.year) this.setDays();
+		},
+		// 微信和QQ小程序由于一些奇怪的原因(故同时对所有平台均初始化一遍),需要重新初始化才能显示正确的值
+		value(n) {
+			if (n) {
+				this.reset = true;
+				setTimeout(() => this.init(), 10);
+			}
+		}
+	},
+	methods: {
+		// 标识滑动开始,只有微信小程序才有这样的事件
+		pickstart() {
+			// #ifdef MP-WEIXIN
+			this.moving = true;
+			// #endif
+		},
+		// 标识滑动结束
+		pickend() {
+			// #ifdef MP-WEIXIN
+			this.moving = false;
+			// #endif
+		},
+		// 对单列和多列形式的判断是否有传入变量的情况
+		getItemValue(item, mode) {
+			// 目前(2020-05-25)uni-app对微信小程序编译有错误,导致v-if为false中的内容也执行,错误导致
+			// 单列模式或者多列模式中的getItemValue同时被执行,故在这里再加一层判断
+			if (this.mode == mode) {
+				return typeof item == 'object' ? item[this.rangeKey] : item;
+			}
+		},
+		// 小于10前面补0,用于月份,日期,时分秒等
+		formatNumber(num) {
+			return +num < 10 ? '0' + num : String(num);
+		},
+		// 生成递进的数组
+		generateArray: function(start, end) {
+			// 转为数值格式,否则用户给end-year等传递字符串值时,下面的end+1会导致字符串拼接,而不是相加
+			start = Number(start);
+			end = Number(end);
+			end = end > start ? end : start;
+			// 生成数组,获取其中的索引,并剪出来
+			return [...Array(end + 1).keys()].slice(start);
+		},
+		getIndex: function(arr, val) {
+			let index = arr.indexOf(val);
+			// 如果index为-1(即找不到index值),~(-1)=-(-1)-1=0,导致条件不成立
+			return ~index ? index : 0;
+		},
+		//日期时间处理
+		initTimeValue() {
+			// 格式化时间,在IE浏览器(uni不存在此情况),无法识别日期间的"-"间隔符号
+			let fdate = this.defaultTime.replace(/\-/g, '/');
+			fdate = fdate && fdate.indexOf('/') == -1 ? `2020/01/01 ${fdate}` : fdate;
+			let time = null;
+			if (fdate) time = new Date(fdate);
+			else time = new Date();
+			// 获取年日月时分秒
+			this.year = time.getFullYear();
+			this.month = Number(time.getMonth()) + 1;
+			this.day = time.getDate();
+			this.hour = time.getHours();
+			this.minute = time.getMinutes();
+			this.second = time.getSeconds();
+		},
+		init() {
+			this.valueArr = [];
+			this.reset = false;
+			if (this.mode == 'time') {
+				this.initTimeValue();
+				if (this.params.year) {
+					this.valueArr.push(0);
+					this.setYears();
+				}
+				if (this.params.month) {
+					this.valueArr.push(0);
+					this.setMonths();
+				}
+				if (this.params.day) {
+					this.valueArr.push(0);
+					this.setDays();
+				}
+				if (this.params.hour) {
+					this.valueArr.push(0);
+					this.setHours();
+				}
+				if (this.params.minute) {
+					this.valueArr.push(0);
+					this.setMinutes();
+				}
+				if (this.params.second) {
+					this.valueArr.push(0);
+					this.setSeconds();
+				}
+			} else if (this.mode == 'region') {
+				if (this.params.province) {
+					this.valueArr.push(0);
+					this.setProvinces();
+				}
+				if (this.params.city) {
+					this.valueArr.push(0);
+					this.setCitys();
+				}
+				if (this.params.area) {
+					this.valueArr.push(0);
+					this.setAreas();
+				}
+			} else if (this.mode == 'selector') {
+				this.valueArr = this.defaultSelector;
+			} else if (this.mode == 'multiSelector') {
+				this.valueArr = this.defaultSelector;
+				this.multiSelectorValue = this.defaultSelector;
+			}
+			this.$forceUpdate();
+		},
+		// 设置picker的某一列值
+		setYears() {
+			// 获取年份集合
+			this.years = this.generateArray(this.startYear, this.endYear);
+			// 设置this.valueArr某一项的值,是为了让picker预选中某一个值
+			this.valueArr.splice(this.valueArr.length - 1, 1, this.getIndex(this.years, this.year));
+		},
+		setMonths() {
+			this.months = this.generateArray(1, 12);
+			this.valueArr.splice(this.valueArr.length - 1, 1, this.getIndex(this.months, this.month));
+		},
+		setDays() {
+			let totalDays = new Date(this.year, this.month, 0).getDate();
+			this.days = this.generateArray(1, totalDays);
+			let index = 0;
+			// 这里不能使用类似setMonths()中的this.valueArr.splice(this.valueArr.length - 1, xxx)做法
+			// 因为this.month和this.year变化时,会触发watch中的this.setDays(),导致this.valueArr.length计算有误
+			if (this.params.year && this.params.month) index = 2;
+			else if (this.params.month) index = 1;
+			else if (this.params.year) index = 1;
+			else index = 0;
+			// 当月份变化时,会导致日期的天数也会变化,如果原来选的天数大于变化后的天数,则重置为变化后的最大值
+			// 比如原来选中3月31日,调整为2月后,日期变为最大29,这时如果day值继续为31显然不合理,于是将其置为29(picker-column从1开始)
+			if(this.day > this.days.length) this.day = this.days.length;
+			this.valueArr.splice(index, 1, this.getIndex(this.days, this.day));
+		},
+		setHours() {
+			this.hours = this.generateArray(0, 23);
+			this.valueArr.splice(this.valueArr.length - 1, 1, this.getIndex(this.hours, this.hour));
+		},
+		setMinutes() {
+			this.minutes = this.generateArray(0, 59);
+			this.valueArr.splice(this.valueArr.length - 1, 1, this.getIndex(this.minutes, this.minute));
+		},
+		setSeconds() {
+			this.seconds = this.generateArray(0, 59);
+			this.valueArr.splice(this.valueArr.length - 1, 1, this.getIndex(this.seconds, this.second));
+		},
+		setProvinces() {
+			// 判断是否需要province参数
+			if (!this.params.province) return;
+			let tmp = '';
+			let useCode = false;
+			// 如果同时配置了defaultRegion和areaCode,优先使用areaCode参数
+			if (this.areaCode.length) {
+				tmp = this.areaCode[0];
+				useCode = true;
+			} else if (this.defaultRegion.length) tmp = this.defaultRegion[0];
+			else tmp = 0;
+			// 历遍省份数组匹配
+			provinces.map((v, k) => {
+				if (useCode ? v.value == tmp : v.label == tmp) {
+					tmp = k;
+				}
+			});
+			this.province = tmp;
+			this.provinces = provinces;
+			// 设置默认省份的值
+			this.valueArr.splice(0, 1, this.province);
+		},
+		setCitys() {
+			if (!this.params.city) return;
+			let tmp = '';
+			let useCode = false;
+			if (this.areaCode.length) {
+				tmp = this.areaCode[1];
+				useCode = true;
+			} else if (this.defaultRegion.length) tmp = this.defaultRegion[1];
+			else tmp = 0;
+			citys[this.province].map((v, k) => {
+				if (useCode ? v.value == tmp : v.label == tmp) {
+					tmp = k;
+				}
+			});
+			this.city = tmp;
+			this.citys = citys[this.province];
+			this.valueArr.splice(1, 1, this.city);
+		},
+		setAreas() {
+			if (!this.params.area) return;
+			let tmp = '';
+			let useCode = false;
+			if (this.areaCode.length) {
+				tmp = this.areaCode[2];
+				useCode = true;
+			} else if (this.defaultRegion.length) tmp = this.defaultRegion[2];
+			else tmp = 0;
+			areas[this.province][this.city].map((v, k) => {
+				if (useCode ? v.value == tmp : v.label == tmp) {
+					tmp = k;
+				}
+			});
+			this.area = tmp;
+			this.areas = areas[this.province][this.city];
+			this.valueArr.splice(2, 1, this.area);
+		},
+		close() {
+			this.$emit('input', false);
+		},
+		// 用户更改picker的列选项
+		change(e) {
+			this.valueArr = e.detail.value;
+			let i = 0;
+			if (this.mode == 'time') {
+				// 这里使用i++,是因为this.valueArr数组的长度是不确定长度的,它根据this.params的值来配置长度
+				// 进入if规则,i会加1,保证了能获取准确的值
+				if (this.params.year) this.year = this.years[this.valueArr[i++]];
+				if (this.params.month) this.month = this.months[this.valueArr[i++]];
+				if (this.params.day) this.day = this.days[this.valueArr[i++]];
+				if (this.params.hour) this.hour = this.hours[this.valueArr[i++]];
+				if (this.params.minute) this.minute = this.minutes[this.valueArr[i++]];
+				if (this.params.second) this.second = this.seconds[this.valueArr[i++]];
+			} else if (this.mode == 'region') {
+				if (this.params.province) this.province = this.valueArr[i++];
+				if (this.params.city) this.city = this.valueArr[i++];
+				if (this.params.area) this.area = this.valueArr[i++];
+			} else if (this.mode == 'multiSelector') {
+				let index = null;
+				// 对比前后两个数组,寻找变更的是哪一列,如果某一个元素不同,即可判定该列发生了变化
+				this.defaultSelector.map((val, idx) => {
+					if (val != e.detail.value[idx]) index = idx;
+				});
+				// 为了让用户对多列变化时,对动态设置其他列的变更
+				if (index != null) {
+					this.$emit('columnchange', {
+						column: index,
+						index: e.detail.value[index]
+					});
+				}
+			}
+		},
+		// 用户点击确定按钮
+		getResult(event = null) {
+			// #ifdef MP-WEIXIN
+			if (this.moving) return;
+			// #endif
+			let result = {};
+			// 只返回用户在this.params中配置了为true的字段
+			if (this.mode == 'time') {
+				if (this.params.year) result.year = this.formatNumber(this.year || 0);
+				if (this.params.month) result.month = this.formatNumber(this.month || 0);
+				if (this.params.day) result.day = this.formatNumber(this.day || 0);
+				if (this.params.hour) result.hour = this.formatNumber(this.hour || 0);
+				if (this.params.minute) result.minute = this.formatNumber(this.minute || 0);
+				if (this.params.second) result.second = this.formatNumber(this.second || 0);
+				if (this.params.timestamp) result.timestamp = this.getTimestamp();
+			} else if (this.mode == 'region') {
+				if (this.params.province) result.province = provinces[this.province];
+				if (this.params.city) result.city = citys[this.province][this.city];
+				if (this.params.area) result.area = areas[this.province][this.city][this.area];
+			} else if (this.mode == 'selector') {
+				result = this.valueArr;
+			} else if (this.mode == 'multiSelector') {
+				result = this.valueArr;
+			}
+			if (event) this.$emit(event, result);
+			this.close();
+		},
+		// 获取时间戳
+		getTimestamp() {
+			// yyyy-mm-dd为安卓写法,不支持iOS,需要使用"/"分隔,才能二者兼容
+			let time = this.year + '/' + this.month + '/' + this.day + ' ' + this.hour + ':' + this.minute + ':' + this.second;
+			return new Date(time).getTime() / 1000;
+		}
+	}
+};
+</script>
+
+<style lang="scss" scoped>
+
+.u-datetime-picker {
+	position: relative;
+	z-index: 999;
+}
+
+.u-picker-view {
+	height: 100%;
+	box-sizing: border-box;
+	
+}
+
+.u-picker-title{
+	text-align: center;
+	margin-top: 24rpx;
+	color: rgba(16,16,16,1);
+	font-size: 36rpx;
+	font-weight: bold;
+	margin-bottom: 4rpx;
+}
+.expiration-time{
+	text-align: center;
+	color: rgba(119,119,119,1);
+	font-size: 24rpx;
+	margin-bottom: 24rpx;
+}
+.u-picker-header {
+	width: 100%;
+	height: 90rpx;
+	padding: 0 40rpx;
+	display: flex;
+	flex-direction: row;
+	justify-content: space-between;
+	align-items: center;
+	box-sizing: border-box;
+	font-size: 32rpx;
+	position: relative;
+	margin-bottom: 20rpx;
+}
+
+.u-picker-header::after {
+	content: '';
+	position: absolute;
+	border-bottom: 1rpx solid #eaeef1;
+	-webkit-transform: scaleY(0.5);
+	transform: scaleY(0.5);
+	bottom: 0;
+	right: 0;
+	left: 0;
+}
+
+.u-picker__title {
+	color: $u-content-color;
+}
+
+.u-picker-body {
+	text-align: center;
+	width: 80%;
+	height: 350rpx;
+	overflow: hidden;
+	background-color: #fff;
+	margin: 0 auto 24rpx;
+}
+
+.u-column-item {
+	display: flex;
+	flex-direction: row;
+	align-items: center;
+	justify-content: center;
+	font-size: 36rpx;
+	color: $u-main-color;
+	padding: 0 8rpx;
+}
+
+.u-text {
+	font-size: 24rpx;
+	padding-left: 8rpx;
+}
+
+.u-btn-picker {
+	padding: 16rpx;
+	width: 328rpx;
+	box-sizing: border-box;
+	text-align: center;
+	text-decoration: none;
+	border-radius: 8rpx;
+	
+}
+.u-btn1{
+	background-color: rgba(222,225,228,1);
+	color: rgba(51,51,51,1) !important;
+}
+.u-btn2{
+	background-color: rgba(22,119,255,1);
+	color: rgba(255,255,255,1) !important;
+}
+.u-opacity {
+	opacity: 0.5;
+}
+
+.u-btn-picker--primary {
+	color: $u-type-primary;
+}
+
+.u-btn-picker--tips {
+	color: $u-tips-color;
+}
+</style>

+ 24 - 0
pages.json

@@ -365,6 +365,30 @@
         	{
         		"navigationBarTitleText" : ""
         	}
+        },
+        {
+        	"path" : "pages/timing/timing",
+        	"style" : 
+        	{
+        		"navigationBarTitleText" : "",
+        		"enablePullDownRefresh" : false
+        	}
+        },
+        {
+        	"path" : "pages/timing/timeSlotTiming",
+        	"style" : 
+        	{
+        		"navigationBarTitleText" : "",
+        		"enablePullDownRefresh" : false
+        	}
+        },
+        {
+        	"path" : "pages/timing/autoOff",
+        	"style" : 
+        	{
+        		"navigationBarTitleText" : "",
+        		"enablePullDownRefresh" : false
+        	}
         }
       
        

+ 420 - 0
pages/timing/autoOff.vue

@@ -0,0 +1,420 @@
+<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 class="time-item" @click="thresholdsPopup=true" >
+				<view class="time">
+					<view class="time-slot">
+						最大功率阈值
+					</view>
+					<view class="type">
+						5kW
+					</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>
+		<!-- 最大功率阈值 -->
+		<u-popup v-model="thresholdsPopup" mode="bottom">
+			<view class="thresholds">
+				<view class="headline">
+					最大功率阈值(kW)
+				</view>
+				<view class="input">
+				  <input type="text" value="" placeholder="填写触发自动关闭的功率数值" />
+				</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,
+				thresholdsPopup: 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 {
+			margin-top: 24rpx;
+
+			.item {
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				height: 96rpx;
+				line-height: 96rpx;
+				border-bottom: 1px solid rgba(245,245,245,1);
+				padding: 0 32rpx;
+			}
+			.time-item:last-of-type{
+				border: none;
+			}
+
+			.item-title {
+				color: rgb(16, 16, 16);
+				font-size: 32rpx;
+			}
+
+			.item-title-checked {
+				color: rgba(22, 119, 255, 1);
+			}
+		}
+	}
+
+
+
+	// 自定义重复
+	.custom,
+	.thresholds {
+		padding: 32rpx 0;
+
+		.headline {
+			color: rgba(16, 16, 16, 1);
+			font-size: 36rpx;
+			margin-bottom: 32rpx;
+			font-weight: bold;
+			text-align: center;
+		}
+
+		.radio-group {
+			.radio-item {
+				padding: 0 32rpx;
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				height: 96rpx;
+				line-height: 96rpx;
+				border-bottom: 1px solid rgba(245,245,245,1);
+
+				.item-title {
+					color: rgba(16, 16, 16, 1);
+					font-size: 32rpx;
+				}
+			}
+
+
+		}
+
+		.btn-group {
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+            padding: 0 32rpx;
+			.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;
+	}
+	/deep/uni-input{
+		background-color: rgba(241,242,245,1);
+		color: rgba(119,119,119,1);
+		font-size: 36rpx;
+		height: 80rpx;
+		padding-left: 16rpx;
+	}
+</style>

+ 360 - 0
pages/timing/timeSlotTiming.vue

@@ -0,0 +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 ;
+ }
+
+
+
+</style>

+ 231 - 0
pages/timing/timing.vue

@@ -0,0 +1,231 @@
+<template>
+	<view>
+		<u-navbar title="定时" title-color="#101010">
+			
+			<view slot="right" @click="deleteShow=true" >
+				
+				<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">
+			<view class="time-item"  v-for="item in 4" >
+				<view class="time">
+					<view class="time-slot">
+						18:00
+					</view>
+					<view class="type">
+						定时关闭 | 每天
+					</view>
+				</view>
+				<!-- 开关 -->
+				<view class="switch" v-if="!deleteShow" >
+					<u-switch v-model="checked" size="40" ></u-switch>
+				</view>
+				<!-- 单选框 -->
+				<view class="radio" v-if="deleteShow" >
+					<radio icon-size="40"  ></radio>
+				</view>
+			</view>
+		</view>
+		
+		<!-- 添加按钮 -->
+		<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" v-model="show" border-radius="16"  ></u-action-sheet>
+		</view>
+		
+		<!-- 删除 -->
+		<view class="delete" v-if="deleteShow" @click="deletePopup=true" >
+			<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" >
+						取消
+					</view>
+					<view class="confirm"  >
+						确认删除
+					</view>
+				</view>
+			</view>
+		</u-popup>
+		
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				checked:false,
+				show: false,
+				popShow:false,
+				deleteShow:false,
+				deletePopup:false,
+					list: [{
+									text: '时间段定时',
+									
+								}, {
+									text: '定时开启'
+								}, {
+									text: '定时关闭' 
+								},{
+									text:'自动关闭'
+								}],
+								
+			}
+		},
+		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;
+		}
+	}
+   
+   // 添加按钮
+   .add{
+	   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>