dedsudiyu 11 months ago
parent
commit
46d8f425db

+ 246 - 238
App.vue

@@ -1,294 +1,298 @@
 <script>
 <script>
-	import {systemInfo} from '@/component/system-info.js'
-    import $mqtt from '@/utils/mqtt.min.js';
-    import { config } from '@/api/request/config.js'
+	import {
+		systemInfo
+	} from '@/component/system-info.js'
+	import $mqtt from '@/utils/mqtt.min.js';
+	import {
+		config
+	} from '@/api/request/config.js'
 	export default {
 	export default {
 		onLaunch: function() {
 		onLaunch: function() {
 			/* 获取设备信息 */
 			/* 获取设备信息 */
 			const SystemInfomations = systemInfo()
 			const SystemInfomations = systemInfo()
 			this.navHeight = SystemInfomations.navHeight + SystemInfomations.statusBarHeight //头部导航栏总高度
 			this.navHeight = SystemInfomations.navHeight + SystemInfomations.statusBarHeight //头部导航栏总高度
 			uni.setStorageSync('navHeight', this.navHeight)
 			uni.setStorageSync('navHeight', this.navHeight)
+			// #ifdef MP-WEIXIN
 			//小程序热更新
 			//小程序热更新
 			if (wx.canIUse('getUpdateManager')) {
 			if (wx.canIUse('getUpdateManager')) {
-			  const updateManager = wx.getUpdateManager()
-			  updateManager.onCheckForUpdate(function (res) {
-			   if (res.hasUpdate) {
-				updateManager.onUpdateReady(function () {
-				 wx.showModal({
-				  title: '更新提示',
-				  content: '新版本已经准备好,是否重启应用?',
-				  success: function (res) {
-				   if (res.confirm) {
-					updateManager.applyUpdate()
-				   }
-				  }
-				 })
+				const updateManager = wx.getUpdateManager()
+				updateManager.onCheckForUpdate(function(res) {
+					if (res.hasUpdate) {
+						updateManager.onUpdateReady(function() {
+							wx.showModal({
+								title: '更新提示',
+								content: '新版本已经准备好,是否重启应用?',
+								success: function(res) {
+									if (res.confirm) {
+										updateManager.applyUpdate()
+									}
+								}
+							})
+						})
+						updateManager.onUpdateFailed(function() {
+							wx.showModal({
+								title: '已经有新版本了哟~',
+								content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~'
+							})
+						})
+					}
 				})
 				})
-				updateManager.onUpdateFailed(function () {
-				 wx.showModal({
-				  title: '已经有新版本了哟~',
-				  content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~'
-				 })
+			} else {
+				wx.showModal({
+					title: '提示',
+					content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
 				})
 				})
-			   }
-			  })
-			 } else {
-			  wx.showModal({
-			   title: '提示',
-			   content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
-			  })
-			 }
+			}
+			// #endif
 		},
 		},
-		onShow: function() {
+		onShow: function() {},
+		onHide: function() {},
+		data() {
+			return {
+				//MQTT数据
+				client: {},
+				//MQTT请求参数
+				mtopicBigview: "lab/bigview",
+				mtopicFunction: "lab/function/data",
+				mtopicHardware: "lab/hardware/data",
+				mtopicLine: "lab/riskPlan/trigger/notice",
+				//监听数据
+				watchObj: {},
+				//当前通道数组
+				mqttIdList: [],
+			}
 		},
 		},
-		onHide: function() {
+		globalData: {
+			mqttAlarmData: {},
+			mqttSensorData: {},
+			mqttDeviceData: {},
+			warnData: {},
+			lineData: {},
+			mqttfireData: {}, //灭火传感器状态异常
+			mqttOnlineData: {}, //设备是否在线
+			mqttPerformData: {}, //是否正在执行灭火操作
 		},
 		},
-        data(){
-		    return{
-		        //MQTT数据
-                client:{},
-                //MQTT请求参数
-                mtopicBigview:"lab/bigview",
-                mtopicFunction:"lab/function/data",
-                mtopicHardware:"lab/hardware/data",
-				mtopicLine:"lab/riskPlan/trigger/notice",
-                //监听数据
-                watchObj:{},
-				//当前通道数组
-				mqttIdList:[],
-            }
-        },
-        globalData:{
-            mqttAlarmData:{},
-            mqttSensorData:{},
-            mqttDeviceData:{},
-			warnData:{},
-			lineData:{},
-			mqttfireData:{},//灭火传感器状态异常
-			mqttOnlineData:{},//设备是否在线
-			mqttPerformData:{},//是否正在执行灭火操作
-        },
 		created() {
 		created() {
 
 
 
 
 		},
 		},
-        methods: {
+		methods: {
 			//删除报警监听
 			//删除报警监听
-			delWarnData(){
+			delWarnData() {
 				delete this.watchObj.warnData;
 				delete this.watchObj.warnData;
 			},
 			},
-		    //删除报警监听
-            deleteAlarmWatch(){
-                delete this.watchObj.mqttAlarmData;
-            },
-		    //删除传感器监听
-            deleteSensorWatch(){
-                delete this.watchObj.mqttSensorData;
-            },
-		    //删除设备监听
-            deleteDeviceWatch(){
-                delete this.watchObj.mqttDeviceData;
-            },
-		    //删除应急监听
-            deleteLineData(){
-                delete this.watchObj.lineData;
-            },
+			//删除报警监听
+			deleteAlarmWatch() {
+				delete this.watchObj.mqttAlarmData;
+			},
+			//删除传感器监听
+			deleteSensorWatch() {
+				delete this.watchObj.mqttSensorData;
+			},
+			//删除设备监听
+			deleteDeviceWatch() {
+				delete this.watchObj.mqttDeviceData;
+			},
+			//删除应急监听
+			deleteLineData() {
+				delete this.watchObj.lineData;
+			},
 			//删除一键灭火-传感器状态
 			//删除一键灭火-传感器状态
-			deletefireData(){
-			    delete this.watchObj.mqttfireData;
+			deletefireData() {
+				delete this.watchObj.mqttfireData;
 			},
 			},
 			//删除一键灭火-设备是否在线
 			//删除一键灭火-设备是否在线
-			deleteOnlineData(){
-			    delete this.watchObj.mqttOnlineData;
+			deleteOnlineData() {
+				delete this.watchObj.mqttOnlineData;
 			},
 			},
 			//删除一键灭火-是否正在执行灭火
 			//删除一键灭火-是否正在执行灭火
-			deletePerformData(){
-			    delete this.watchObj.mqttPerformData;
+			deletePerformData() {
+				delete this.watchObj.mqttPerformData;
+			},
+			//监听对应的mqtt数据
+			watch: function(method, istr) {
+				this.watchObj = this.globalData;
+				Object.defineProperty(this.watchObj, istr, {
+					configurable: true,
+					enumerable: true,
+					immediate: true,
+					deep: true,
+					set: function(value) {
+						this._consumerGoodsStatus = value
+						method(value)
+					},
+					get: function(value) {
+						return this._consumerGoodsStatus
+					}
+				})
+			},
+			// 子页面调用
+			appMqttOn(type, list) {
+				let self = this;
+				if (this.mqttIdList) {
+					this.offMQTT();
+				}
+				uni.setStorageSync('mqttIdList', JSON.stringify(list));
+				this.mqttIdList = list;
+				setTimeout(function() {
+					self.subscriptionMQTT();
+				}, 100);
 			},
 			},
-            //监听对应的mqtt数据
-            watch:function(method,istr){
-                this.watchObj = this.globalData;
-                Object.defineProperty(this.watchObj,istr,{
-                    configurable:true,
-                    enumerable:true,
-                    immediate: true,
-                    deep: true,
-                    set:function(value){
-                        this._consumerGoodsStatus=value
-                        method(value)
-                    },
-                    get:function(value){
-                        return this._consumerGoodsStatus
-                    }
-                })
-            },
-            // 子页面调用
-            appMqttOn(type,list){
-            	let self = this;
-            	if(this.mqttIdList){
-            		this.offMQTT();
-            	}
-            	uni.setStorageSync('mqttIdList',JSON.stringify(list));
-            	this.mqttIdList = list;
-            	setTimeout(function(){
-            		self.subscriptionMQTT();
-            	},100);
-            },
 			//MQTT订阅
 			//MQTT订阅
-            subscriptionMQTT(){
-                let self = this;
-                const mqttOptions = {
-                    keepalive: 30,
-                    clean: true,//保留会话
-                    connectTimeout: 5000, // 超时时间
-                    reconnectPeriod:5000, // 重连间隔
-                    clientId: uni.getStorageSync('token')+'lab/function/data',
-                    username: uni.getStorageSync('mqttUser'),
-                    password: uni.getStorageSync('mqttPassword'),
-                }
-                const connectUrl = uni.getStorageSync('mqttUrl');
-                // this.client = $mqtt.connect('wxs://' + connectUrl, mqttOptions);
-                this.client = $mqtt.connect('wxs://' + connectUrl, mqttOptions);
-                this.client.on('connect', () => {
-                    // 这是为了给自己发条消息,其它无作用
-					for(let i=0;i<self.mqttIdList.length;i++){
-						if(self.mqttIdList[i].type == 'lab/function/data'){
+			subscriptionMQTT() {
+				let self = this;
+				const mqttOptions = {
+					keepalive: 30,
+					clean: true, //保留会话
+					connectTimeout: 5000, // 超时时间
+					reconnectPeriod: 5000, // 重连间隔
+					clientId: uni.getStorageSync('token') + 'lab/function/data',
+					username: uni.getStorageSync('mqttUser'),
+					password: uni.getStorageSync('mqttPassword'),
+				}
+				const connectUrl = uni.getStorageSync('mqttUrl');
+				// this.client = $mqtt.connect('wxs://' + connectUrl, mqttOptions);
+				this.client = $mqtt.connect('wxs://' + connectUrl, mqttOptions);
+				this.client.on('connect', () => {
+					// 这是为了给自己发条消息,其它无作用
+					for (let i = 0; i < self.mqttIdList.length; i++) {
+						if (self.mqttIdList[i].type == 'lab/function/data') {
 							//传感器
 							//传感器
-							for(let o=0;o<self.mqttIdList[i].idList.length;o++){
-								self.client.subscribe(self.mqttIdList[i].type+self.mqttIdList[i].idList[o], (err) => {
-								    if (!err) {
-								        console.log("传感器信息订阅成功",self.mqttIdList[i].type+self.mqttIdList[i].idList[o])
-								    }
+							for (let o = 0; o < self.mqttIdList[i].idList.length; o++) {
+								self.client.subscribe(self.mqttIdList[i].type + self.mqttIdList[i].idList[o], (err) => {
+									if (!err) {
+										console.log("传感器信息订阅成功", self.mqttIdList[i].type + self.mqttIdList[i].idList[o])
+									}
 								});
 								});
 							}
 							}
-						}else if(self.mqttIdList[i].type == 'lab/hardware/data'){
+						} else if (self.mqttIdList[i].type == 'lab/hardware/data') {
 							//传感器
 							//传感器
-							for(let o=0;o<self.mqttIdList[i].idList.length;o++){
-								self.client.subscribe(self.mqttIdList[i].type+self.mqttIdList[i].idList[o], (err) => {
-								    if (!err) {
-								        console.log("硬件订阅成功",self.mqttIdList[i].type+self.mqttIdList[i].idList[o])
-								    }
+							for (let o = 0; o < self.mqttIdList[i].idList.length; o++) {
+								self.client.subscribe(self.mqttIdList[i].type + self.mqttIdList[i].idList[o], (err) => {
+									if (!err) {
+										console.log("硬件订阅成功", self.mqttIdList[i].type + self.mqttIdList[i].idList[o])
+									}
 								});
 								});
 							}
 							}
-						}else if(self.mqttIdList[i].type == 'lab/bigview'){
+						} else if (self.mqttIdList[i].type == 'lab/bigview') {
 							self.client.subscribe(self.mqttIdList[i].type, (err) => {
 							self.client.subscribe(self.mqttIdList[i].type, (err) => {
-							    if (!err) {
-							        console.log("报警信息订阅成功",self.mqttIdList[i].type)
-							    }
+								if (!err) {
+									console.log("报警信息订阅成功", self.mqttIdList[i].type)
+								}
 							});
 							});
-						}else if(self.mqttIdList[i].type == 'lab/riskPlan/trigger/notice'){
+						} else if (self.mqttIdList[i].type == 'lab/riskPlan/trigger/notice') {
 							self.client.subscribe(self.mqttIdList[i].type, (err) => {
 							self.client.subscribe(self.mqttIdList[i].type, (err) => {
-							    if (!err) {
-							        console.log("应急疏散订阅成功",self.mqttIdList[i].type)
-							    }
+								if (!err) {
+									console.log("应急疏散订阅成功", self.mqttIdList[i].type)
+								}
 							});
 							});
-						}else if(self.mqttIdList[i].type == 'lab/fireDevice/Warn/'){
-							self.client.subscribe(self.mqttIdList[i].type+self.mqttIdList[i].fireCode, (err) => {
-							    if (!err) {
-							        console.log("火灾传感器状态-订阅成功",self.mqttIdList[i].type+self.mqttIdList[i].fireCode)
-							    }
+						} else if (self.mqttIdList[i].type == 'lab/fireDevice/Warn/') {
+							self.client.subscribe(self.mqttIdList[i].type + self.mqttIdList[i].fireCode, (err) => {
+								if (!err) {
+									console.log("火灾传感器状态-订阅成功", self.mqttIdList[i].type + self.mqttIdList[i].fireCode)
+								}
 							});
 							});
 
 
-						}else if(self.mqttIdList[i].type == 'lab/fireDevice/isOnline/'){
-							self.client.subscribe(self.mqttIdList[i].type+self.mqttIdList[i].fireCode, (err) => {
-							    if (!err) {
-							        console.log("火灾设备是否在线-订阅成功",self.mqttIdList[i].type+self.mqttIdList[i].fireCode)
-							    }
+						} else if (self.mqttIdList[i].type == 'lab/fireDevice/isOnline/') {
+							self.client.subscribe(self.mqttIdList[i].type + self.mqttIdList[i].fireCode, (err) => {
+								if (!err) {
+									console.log("火灾设备是否在线-订阅成功", self.mqttIdList[i].type + self.mqttIdList[i].fireCode)
+								}
 							});
 							});
 
 
-						}else if(self.mqttIdList[i].type == 'lab/fireDevice/executing/'){
-							self.client.subscribe(self.mqttIdList[i].type+self.mqttIdList[i].fireCode, (err) => {
-							    if (!err) {
-							        console.log("火灾是否正在执行灭火操作-订阅成功:",self.mqttIdList[i].type+self.mqttIdList[i].fireCode)
-							    }
+						} else if (self.mqttIdList[i].type == 'lab/fireDevice/executing/') {
+							self.client.subscribe(self.mqttIdList[i].type + self.mqttIdList[i].fireCode, (err) => {
+								if (!err) {
+									console.log("火灾是否正在执行灭火操作-订阅成功:", self.mqttIdList[i].type + self.mqttIdList[i].fireCode)
+								}
 							});
 							});
 
 
 						}
 						}
 					}
 					}
-                });
-                // 自动重连
-                this.client.on('reconnect', (msg) => {
-                    console.log('自动重连-reconnect-1', msg)
-                });
-                // 错误
-                this.client.on('error', () => {
-                    console.log('错误-error-1')
-                });
-                // 断开
-                this.client.on('end', () => {
-                    console.log('断开-end-1')
-                });
-                // 掉线
-                this.client.on('offline', (msg) => {
-                    console.log('掉线-offline-1',msg)
-                });
-                // 收到消息
-                this.client.on('message', (topic, message) => {
-                    let data = JSON.parse(message)
-					 //console.log('消息message',data);
-					if(data){
-						if(topic == 'lab/riskPlan/trigger/notice'){
+				});
+				// 自动重连
+				this.client.on('reconnect', (msg) => {
+					console.log('自动重连-reconnect-1', msg)
+				});
+				// 错误
+				this.client.on('error', () => {
+					console.log('错误-error-1')
+				});
+				// 断开
+				this.client.on('end', () => {
+					console.log('断开-end-1')
+				});
+				// 掉线
+				this.client.on('offline', (msg) => {
+					console.log('掉线-offline-1', msg)
+				});
+				// 收到消息
+				this.client.on('message', (topic, message) => {
+					let data = JSON.parse(message)
+					//console.log('消息message',data);
+					if (data) {
+						if (topic == 'lab/riskPlan/trigger/notice') {
 							// console.log("应急",data);
 							// console.log("应急",data);
 							this.globalData.lineData = data.data;
 							this.globalData.lineData = data.data;
-						}else if(topic.search("lab/fireDevice/Warn/") != -1){
-							 console.log("一键灭火-传感器状态",data);
+						} else if (topic.search("lab/fireDevice/Warn/") != -1) {
+							console.log("一键灭火-传感器状态", data);
 							this.globalData.mqttfireData = data;
 							this.globalData.mqttfireData = data;
-						}else if(topic.search("lab/fireDevice/isOnline/") != -1){
-							 console.log("一键灭火-设备是否在线",data);
+						} else if (topic.search("lab/fireDevice/isOnline/") != -1) {
+							console.log("一键灭火-设备是否在线", data);
 							this.globalData.mqttOnlineData = data;
 							this.globalData.mqttOnlineData = data;
-						}else if(topic.search("lab/fireDevice/executing/") != -1){
-							 console.log("一键灭火-是否正在执行灭火",data);
+						} else if (topic.search("lab/fireDevice/executing/") != -1) {
+							console.log("一键灭火-是否正在执行灭火", data);
 							this.globalData.mqttPerformData = data;
 							this.globalData.mqttPerformData = data;
-						}else if(topic == 'lab/bigview'){
-							if(data.data == 'SUB_RISKPLAN_GROUP'){
+						} else if (topic == 'lab/bigview') {
+							if (data.data == 'SUB_RISKPLAN_GROUP') {
 								this.globalData.mqttAlarmData = data.data;
 								this.globalData.mqttAlarmData = data.data;
 							}
 							}
-						}else {
-							if(data.data.subId){
-							    this.globalData.mqttSensorData = data.data;
-							}else{
+						} else {
+							if (data.data.subId) {
+								this.globalData.mqttSensorData = data.data;
+							} else {
 								this.globalData.mqttDeviceData = data.data;
 								this.globalData.mqttDeviceData = data.data;
 							}
 							}
 						}
 						}
 					}
 					}
-                })
-                // 全局监听是否有关闭mqtt的消息的事件
-                uni.$on('closeMqtt',() => {
-                    this.client.end(true); // 主动断开连接
-                })
-            },
-            //取消订阅关闭MQTT连接
-            offMQTT(){
+				})
+				// 全局监听是否有关闭mqtt的消息的事件
+				uni.$on('closeMqtt', () => {
+					this.client.end(true); // 主动断开连接
+				})
+			},
+			//取消订阅关闭MQTT连接
+			offMQTT() {
 				let self = this;
 				let self = this;
-				if(self.mqttIdList[0]){
+				if (self.mqttIdList[0]) {
 					uni.removeStorageSync('mqttIdList')
 					uni.removeStorageSync('mqttIdList')
-					for(let i=0;i<self.mqttIdList.length;i++){
-						if(self.mqttIdList[i].type == 'lab/function/data'){
+					for (let i = 0; i < self.mqttIdList.length; i++) {
+						if (self.mqttIdList[i].type == 'lab/function/data') {
 							//断开传感器
 							//断开传感器
-							for(let o=0;o<self.mqttIdList[i].idList.length;o++){
-								self.client.unsubscribe(self.mqttIdList[i].type+self.mqttIdList[i].idList[o], error => {
+							for (let o = 0; o < self.mqttIdList[i].idList.length; o++) {
+								self.client.unsubscribe(self.mqttIdList[i].type + self.mqttIdList[i].idList[o], error => {
 									if (error) {
 									if (error) {
 										console.log('Unsubscribe error mtopicBigview', error)
 										console.log('Unsubscribe error mtopicBigview', error)
 									}
 									}
 								})
 								})
 							}
 							}
-						}else if(self.mqttIdList[i].type == 'lab/hardware/data'){
+						} else if (self.mqttIdList[i].type == 'lab/hardware/data') {
 							//断开硬件
 							//断开硬件
-							for(let o=0;o<self.mqttIdList[i].idList.length;o++){
-								self.client.unsubscribe(self.mqttIdList[i].type+self.mqttIdList[i].idList[o], error => {
+							for (let o = 0; o < self.mqttIdList[i].idList.length; o++) {
+								self.client.unsubscribe(self.mqttIdList[i].type + self.mqttIdList[i].idList[o], error => {
 									if (error) {
 									if (error) {
 										console.log('Unsubscribe error mtopicBigview', error)
 										console.log('Unsubscribe error mtopicBigview', error)
 									}
 									}
 								})
 								})
 							}
 							}
-						}else if(self.mqttIdList[i].type == 'lab/bigview'){
+						} else if (self.mqttIdList[i].type == 'lab/bigview') {
 							//断开报警
 							//断开报警
 							self.client.unsubscribe(self.mqttIdList[i].type, error => {
 							self.client.unsubscribe(self.mqttIdList[i].type, error => {
 								if (error) {
 								if (error) {
 									console.log('Unsubscribe error mtopicBigview', error)
 									console.log('Unsubscribe error mtopicBigview', error)
 								}
 								}
 							})
 							})
-						}else if(self.mqttIdList[i].type == 'lab/riskPlan/trigger/notice'){
+						} else if (self.mqttIdList[i].type == 'lab/riskPlan/trigger/notice') {
 							//断开疏散
 							//断开疏散
 							self.client.unsubscribe(self.mqttIdList[i].type, error => {
 							self.client.unsubscribe(self.mqttIdList[i].type, error => {
 								if (error) {
 								if (error) {
@@ -301,36 +305,40 @@
 					this.client = null;
 					this.client = null;
 					this.mqttIdList = [];
 					this.mqttIdList = [];
 				}
 				}
-            },
-        }
+			},
+		}
 	}
 	}
 </script>
 </script>
 
 
 <style lang="stylus">
 <style lang="stylus">
-	page{
-		height:100%;
-		width:100%;
-		background:#f5f5f5;
+	page {
+		height: 100%;
+		width: 100%;
+		background: #f5f5f5;
 		font-family: PingFang SC;
 		font-family: PingFang SC;
 		font-weight: 400;
 		font-weight: 400;
-		font-size:30rpx;
-		color:#333;
+		font-size: 30rpx;
+		color: #333;
 	}
 	}
-	img{
-        margin:0;
-        padding:0;
-		display:block;
+
+	img {
+		margin: 0;
+		padding: 0;
+		display: block;
 	}
 	}
-	.name-box-p{
-		display block
-		overflow:hidden;
-		text-overflow:ellipsis;
-		white-space:nowrap;
+
+	.name-box-p {
+		display block;
+		overflow: hidden;
+		text-overflow: ellipsis;
+		white-space: nowrap;
+	}
+
+	view {
+		margin: 0;
+		padding: 0;
 	}
 	}
-    view{
-        margin:0;
-        padding:0;
-    }
-    /*每个页面公共css */
-    @import './styles/index.styl'
-</style>
+
+	/*每个页面公共css */
+	@import './styles/index.styl'
+</style>

components/mineConfigurationSlot.vue → component/mineConfigurationSlot.vue


components/tabBar.vue → component/tabBar.vue


+ 0 - 19
components/dengrq-datetime-picker/customPickerView/index.css

@@ -1,19 +0,0 @@
-.picker-view {
-  height: 356rpx;
-}
-
-.picker-view-column {
-  font-size: 14px;
-  line-height: 34px;
-  text-align: center;
-  color: #333;
-}
-
-/* 覆盖默认样式,样式可以按需自己改 */
-.uni-picker-view-indicator {
-  background-color: rgba(106, 123, 255, 0.1);
-}
-.uni-picker-view-indicator::before,
-.uni-picker-view-indicator::after {
-  content: none;
-}

+ 0 - 53
components/dengrq-datetime-picker/customPickerView/index.js

@@ -1,53 +0,0 @@
-export default {
-  data() {
-    return {};
-  },
-  props: {
-    // 所有列选项数据
-    columns: {
-      type: Array,
-      default: () => []
-    },
-    // 每一列默认选中值数组,不传默认选中第一项
-    selectVals: {
-      type: Array,
-      default: () => []
-    }
-  },
-  computed: {
-    // 每一列选中项的索引,当默认选中值变化的时候这个值也要变化
-    indexArr: {
-      // 多维数组,深度监听
-      cache: false,
-      get() {
-        if (this.selectVals.length > 0) {
-          return this.columns.map((col, cIdx) => {
-            return col.findIndex((i) => i == this.selectVals[cIdx]);
-          });
-        } else {
-          return [].fill(0, 0, this.columns.length);
-        }
-      }
-    }
-  },
-  methods: {
-    onChange(e) {
-      const { value } = e.detail;
-
-      let ret = this.columns.map((item, index) => {
-        let idx = value[index];
-        if (idx < 0) {
-          idx = 0;
-        }
-        if (idx > item.length - 1) {
-          idx = item.length - 1;
-        }
-        return item[idx];
-      });
-
-      this.$emit('onChange', {
-        value: ret
-      });
-    }
-  }
-};

+ 0 - 11
components/dengrq-datetime-picker/customPickerView/index.vue

@@ -1,11 +0,0 @@
-<template>
-  <picker-view class="picker-view" :value="indexArr" @change="onChange">
-    <picker-view-column class="picker-view-column" v-for="(col, colIdx) in columns" :key="colIdx">
-      <view v-for="(item, idx) in col" :key="idx">{{ item }}</view>
-    </picker-view-column>
-  </picker-view>
-</template>
-
-<script src="./index.js"></script>
-
-<style lang="css" scoped src="./index.css"></style>

+ 0 - 57
components/dengrq-datetime-picker/dateSelector/index.css

@@ -1,57 +0,0 @@
-.date-selector {
-  width: 100%;
-  font-size: 12px;
-  color: #333;
-}
-
-.select-date-wrapper {
-  margin-bottom: 8px;
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-}
-
-.select-date {
-  padding: 10px;
-  flex: 1;
-  border-radius: 2px;
-  border: 1px solid rgba(6, 7, 46, 0.05);
-  font-size: 12px;
-}
-
-.select-date.active {
-  border-color: #6a7bff;
-}
-
-.select-date-placeholder {
-  color: rgba(6, 7, 46, 0.3);
-}
-
-.btn-group {
-  display: flex;
-  margin: 48rpx 0;
-  justify-content: space-between;
-}
-
-.btn-confirm {
-  width: 180px;
-  height: 40px;
-  line-height: 40px;
-  background: rgba(33, 58, 255, 0.85);
-  border-radius: 4px;
-  font-size: 14px;
-  color: #fff;
-  text-align: center;
-}
-
-.btn-cancel {
-  width: 144px;
-  height: 40px;
-  line-height: 38px;
-  text-align: center;
-  background: #fff;
-  border-radius: 4px;
-  border: 1px solid #979797;
-  font-size: 14px;
-  color: #06072e;
-}

+ 0 - 209
components/dengrq-datetime-picker/dateSelector/index.js

@@ -1,209 +0,0 @@
-import DateTimePicker from '../dateTimePicker/index.vue';
-import DateUtil from '../dateTimePicker/dateUtil';
-import { DATE_TYPES } from '../dateTimePicker/constant';
-
-export default {
-  components: {
-    DateTimePicker
-  },
-  data() {
-    return {
-      showStartDatePicker: false,
-      showEndDatePicker: false,
-      startDate: '',
-      endDate: '',
-      activeDate: 'startDate' // 正在处理哪一个日期值,startDate/endDate
-    };
-  },
-  props: {
-    // 日期筛选模式,1:年月日(默认),2:年月,3:年,4:年月日时分秒,5:时分秒,6:时分
-    mode: {
-      type: Number,
-      default: DATE_TYPES.YMD
-    },
-    // 默认开始日期
-    defaultStartDate: {
-      type: String,
-      default: ''
-    },
-    // 默认结束日期
-    defaultEndDate: {
-      type: String,
-      default: ''
-    },
-    // 可选的最小日期
-    minDate: {
-      type: String,
-      default: ''
-    },
-    // 可选的最大日期
-    maxDate: {
-      type: String,
-      default: ''
-    }
-  },
-  watch: {
-    mode() {
-      // 筛选模式更换时清空一下数据
-      this.resetData();
-    },
-    startDate() {
-      this.$emit('onChange', {
-        startDate: this.startDate,
-        endDate: this.endDate
-      });
-    },
-    endDate() {
-      this.$emit('onChange', {
-        startDate: this.startDate,
-        endDate: this.endDate
-      });
-    },
-    defaultStartDate: {
-      handler(defaultStartDate) {
-        if (!defaultStartDate) {
-          return;
-        }
-
-        if (this.mode == DATE_TYPES.HMS || this.mode == DATE_TYPES.HM) {
-          console.error('时分秒/时分模式不支持设置默认开始时间');
-          return;
-        }
-
-        if (DateUtil.isBefore(defaultStartDate, this.minDate)) {
-          console.warn(
-            `默认开始日期不可小于最小可选日期,已把默认开始日期设为最小可选日期。默认开始日期:${defaultStartDate},最小可选日期:${this.minDate}`
-          );
-          this.startDate = this.getModeFormatDateString(this.minDate);
-        } else {
-          this.startDate = this.getModeFormatDateString(defaultStartDate);
-        }
-      },
-      immediate: true
-    },
-    defaultEndDate: {
-      handler(defaultEndDate) {
-        if (!defaultEndDate) {
-          return;
-        }
-
-        if (this.mode == DATE_TYPES.HMS || this.mode == DATE_TYPES.HM) {
-          console.error('时分秒/时分模式不支持设置默认结束时间');
-          return;
-        }
-
-        if (DateUtil.isAfter(defaultEndDate, this.maxDate)) {
-          console.warn(
-            `默认结束日期不可大于最大可选日期,已把默认结束日期设为最大可选日期。默认结束日期:${defaultEndDate},最大可选日期:${this.maxDate}`
-          );
-          this.endDate = this.getModeFormatDateString(this.maxDate);
-        } else {
-          this.endDate = this.getModeFormatDateString(defaultEndDate);
-        }
-      },
-      immediate: true
-    },
-    minDate(val) {
-      if ((val && this.mode == DATE_TYPES.HMS) || this.mode == DATE_TYPES.HM) {
-        console.error('时分秒/时分模式不支持设置最小可选时间');
-        return;
-      }
-    },
-    maxDate(val) {
-      if ((val && this.mode == DATE_TYPES.HMS) || this.mode == DATE_TYPES.HM) {
-        console.error('时分秒/时分模式不支持设置最大可选时间');
-        return;
-      }
-    }
-  },
-  methods: {
-    onTapStartDate() {
-      this.showEndDatePicker = false;
-      if (!this.startDate) {
-        this.startDate = this.getModeFormatDateString(new Date());
-      }
-      this.activeDate = 'startDate';
-      this.showStartDatePicker = true;
-    },
-    onTapEndDate() {
-      this.showStartDatePicker = false;
-      if (!this.endDate) {
-        this.endDate = this.startDate;
-      }
-      this.activeDate = 'endDate';
-      this.showEndDatePicker = true;
-    },
-    onChangeStartDate(date) {
-      this.startDate = date;
-    },
-    onChangeEndDate(date) {
-      this.endDate = date;
-    },
-    validateInput() {
-      if (!this.startDate) {
-        uni.showToast({
-          title: '请选择开始时间',
-          icon: 'none'
-        });
-        return false;
-      } else if (!this.endDate) {
-        uni.showToast({
-          title: '请选择结束时间',
-          icon: 'none'
-        });
-        return false;
-      } else if (DateUtil.isAfter(this.startDate, this.endDate)) {
-        uni.showToast({
-          title: '结束时间不能小于开始时间',
-          icon: 'none'
-        });
-        return false;
-      }
-      return true;
-    },
-    onCancel() {
-      this.resetData();
-    },
-    onConfirm() {
-      if (this.validateInput()) {
-        this.$emit('onSubmit', {
-          startDate: this.startDate,
-          endDate: this.endDate
-        });
-        this.showStartDatePicker = false;
-        this.showEndDatePicker = false;
-      }
-    },
-    resetData() {
-      this.startDate = '';
-      this.endDate = '';
-      this.activeDate = 'startDate';
-      this.showStartDatePicker = false;
-      this.showEndDatePicker = false;
-    },
-    // 返回对应日期模式的时间字符串
-    getModeFormatDateString(date) {
-      let fmt = 'YYYY-MM-DD';
-      switch (this.mode) {
-        case DATE_TYPES.YM:
-          fmt = 'YYYY-MM';
-          break;
-        case DATE_TYPES.Y:
-          fmt = 'YYYY';
-          break;
-        case DATE_TYPES['YMD-HMS']:
-          fmt = 'YYYY-MM-DD HH:mm:ss';
-          break;
-        case DATE_TYPES.HMS:
-          fmt = 'HH:mm:ss';
-          break;
-        case DATE_TYPES.HM:
-          fmt = 'HH:mm';
-          break;
-        default:
-          break;
-      }
-      return DateUtil.formatDate(date, fmt);
-    }
-  }
-};

+ 0 - 41
components/dengrq-datetime-picker/dateSelector/index.vue

@@ -1,41 +0,0 @@
-<template>
-  <view class="date-selector">
-    <view class="select-date-wrapper">
-      <view class="select-date" :class="{ active: activeDate == 'startDate' }" @tap="onTapStartDate">
-        <view class="select-date-value" v-if="startDate">{{ startDate }}</view>
-        <view class="select-date-placeholder" v-else>请选择时间</view>
-      </view>
-      <view style="margin: 0 16px">至</view>
-      <view class="select-date" :class="{ active: activeDate == 'endDate' }" @tap="onTapEndDate">
-        <view class="select-date-value" v-if="endDate">{{ endDate }}</view>
-        <view class="select-date-placeholder" v-else>请选择时间</view>
-      </view>
-    </view>
-
-    <DateTimePicker
-      v-if="showStartDatePicker"
-      @onChange="onChangeStartDate"
-      :defaultDate="startDate"
-      :minDate="minDate || ''"
-      :maxDate="endDate || maxDate || ''"
-      :mode="mode"
-    />
-    <DateTimePicker
-      v-if="showEndDatePicker"
-      @onChange="onChangeEndDate"
-      :defaultDate="endDate"
-      :minDate="startDate || minDate || ''"
-      :maxDate="maxDate || ''"
-      :mode="mode"
-    />
-
-    <view class="btn-group" v-if="showStartDatePicker || showEndDatePicker">
-      <view class="btn-cancel" @tap="onCancel">取消</view>
-      <view class="btn-confirm" @tap="onConfirm">确定</view>
-    </view>
-  </view>
-</template>
-
-<script src="./index.js"></script>
-
-<style lang="css" scoped src="./index.css"></style>

+ 0 - 15
components/dengrq-datetime-picker/dateTimePicker/constant.js

@@ -1,15 +0,0 @@
-// 日期模式
-export const DATE_TYPES = {
-  // 年月日
-  YMD: 1,
-  // 年月
-  YM: 2,
-  // 年份
-  Y: 3,
-  // 年月日时分秒
-  'YMD-HMS': 4,
-  // 时分秒
-  HMS: 5,
-  // 时分
-  HM: 6
-};

+ 0 - 93
components/dengrq-datetime-picker/dateTimePicker/dateUtil.js

@@ -1,93 +0,0 @@
-/**
- * 日期时间格式化
- * @param {Date} date 要格式化的日期对象
- * @param {String} fmt 格式化字符串,eg:YYYY-MM-DD HH:mm:ss
- * @returns 格式化后的日期字符串
- */
-function formatDate(date, fmt) {
-  if (typeof date == 'string') {
-    date = new Date(handleDateStr(date));
-  }
-
-  const o = {
-    'M+': date.getMonth() + 1, // 月份
-    'd+': date.getDate(), // 日
-    'D+': date.getDate(), // 日
-    'H+': date.getHours(), // 小时
-    'h+': date.getHours(), // 小时
-    'm+': date.getMinutes(), // 分
-    's+': date.getSeconds(), // 秒
-    'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
-    S: date.getMilliseconds() // 毫秒
-  };
-
-  if (/([y|Y]+)/.test(fmt)) {
-    fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').slice(4 - RegExp.$1.length));
-  }
-
-  for (const k in o) {
-    if (new RegExp('(' + k + ')').test(fmt)) {
-      fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).slice(('' + o[k]).length));
-    }
-  }
-
-  return fmt;
-}
-
-/**
- * 处理时间字符串,兼容ios下new Date()返回NaN问题
- * @param {*} dateStr 日期字符串
- * @returns
- */
-function handleDateStr(dateStr) {
-  return dateStr.replace(/\-/g, '/');
-}
-
-/**
- * 判断日期1是否在日期2之前,即日期1小于日期2
- * @param {Date} date1
- * @param {Date} date2
- * @returns
- */
-function isBefore(date1, date2) {
-  if (typeof date1 == 'string') {
-    date1 = new Date(handleDateStr(date1));
-  }
-  if (typeof date2 == 'string') {
-    date2 = new Date(handleDateStr(date2));
-  }
-  return date1.getTime() < date2.getTime();
-}
-
-/**
- * 判断日期1是否在日期2之后,即日期1大于日期2
- * @param {Date} date1
- * @param {Date} date2
- * @returns
- */
-function isAfter(date1, date2) {
-  if (typeof date1 == 'string') {
-    date1 = new Date(handleDateStr(date1));
-  }
-  if (typeof date2 == 'string') {
-    date2 = new Date(handleDateStr(date2));
-  }
-  return date1.getTime() > date2.getTime();
-}
-
-/**
- * 检查传入的字符串是否能转换为有效的Date对象
- * @param {String} date
- * @returns {Boolean}
- */
-function isValid(date) {
-  return new Date(date) !== 'Invalid Date' && !isNaN(new Date(date));
-}
-
-export default {
-  formatDate,
-  handleDateStr,
-  isBefore,
-  isAfter,
-  isValid
-};

+ 0 - 378
components/dengrq-datetime-picker/dateTimePicker/index.js

@@ -1,378 +0,0 @@
-import CustomPickerView from '../customPickerView/index.vue';
-import DateUtil from '../dateTimePicker/dateUtil';
-import { DATE_TYPES } from './constant';
-
-export default {
-  components: {
-    CustomPickerView
-  },
-  props: {
-    // 日期模式,1:年月日(默认),2:年月,3:年份,4:年月日时分秒,5:时分秒,6:时分
-    mode: {
-      type: Number,
-      default: DATE_TYPES.YMD
-    },
-    // 可选的最小日期,默认十年前
-    minDate: {
-      type: String,
-      default: ''
-    },
-    // 可选的最大日期,默认十年后
-    maxDate: {
-      type: String,
-      default: ''
-    },
-    // 默认选中日期(注意要跟日期模式对应)
-    defaultDate: {
-      type: String,
-      default: ''
-    }
-  },
-  data() {
-    return {
-      selectYear: new Date().getFullYear(),
-      selectMonth: new Date().getMonth() + 1, // 选中的月份,1~12
-      selectDay: new Date().getDate(),
-      selectHour: new Date().getHours(),
-      selectMinute: new Date().getMinutes(),
-      selectSecond: new Date().getSeconds()
-    };
-  },
-  watch: {
-    defaultDate: {
-      immediate: true,
-      handler(val) {
-        if (val) {
-          if (this.mode == DATE_TYPES.YM && val.replace(/\-/g, '/').split('/').length == 2) {
-            // 日期模式为年月时有可能传进来的defaultDate是2022-02这样的格式,在ios下new Date会报错,加上日期部分做兼容
-            val += '-01';
-          } else if (this.mode == DATE_TYPES.HMS || this.mode == DATE_TYPES.HM) {
-            // 只有时分秒或者只有时分是不能调用new Date生成Date对象的,先加上一个假设的年月日(就取当年一月一日)来兼容
-            const now = new Date();
-            val = `${now.getFullYear()}-01-01 ${val}`;
-          }
-
-          let date = new Date(DateUtil.handleDateStr(val));
-          this.selectYear = date.getFullYear();
-          this.selectMonth = date.getMonth() + 1;
-          this.selectDay = date.getDate();
-          this.selectHour = date.getHours();
-          this.selectMinute = date.getMinutes();
-          this.selectSecond = date.getSeconds();
-        }
-      }
-    }
-  },
-  computed: {
-    minDateObj() {
-      let minDate = this.minDate;
-      if (minDate) {
-        if (this.mode == DATE_TYPES.YM && minDate.replace(/\-/g, '/').split('/').length == 2) {
-          // 日期模式为年月时有可能传进来的minDate是2022-02这样的格式,在ios下new Date会报错,加上日期部分做兼容
-          minDate += '-01';
-        } else if (this.mode == DATE_TYPES.HMS || this.mode == DATE_TYPES.HM) {
-          // 只有时分秒或者只有时分是不能调用new Date生成Date对象的,先加上一个假设的年月日(就取当年一月一日)来兼容
-          const now = new Date();
-          minDate = `${now.getFullYear()}-01-01 ${minDate}`;
-        }
-        return new Date(DateUtil.handleDateStr(minDate));
-      } else {
-        // 没有传最小日期,默认十年前
-        let year = new Date().getFullYear() - 10;
-        minDate = new Date(year, 0, 1);
-        return minDate;
-      }
-    },
-    maxDateObj() {
-      let maxDate = this.maxDate;
-      if (maxDate) {
-        if (this.mode == DATE_TYPES.YM && maxDate.replace(/\-/g, '/').split('/').length == 2) {
-          // 日期模式为年月时有可能传进来的maxDate是2022-02这样的格式,在ios下new Date会报错,加上日期部分做兼容
-          maxDate += '-01';
-        } else if (this.mode == DATE_TYPES.HMS || this.mode == DATE_TYPES.HM) {
-          // 只有时分秒或者只有时分是不能调用new Date生成Date对象的,先加上一个假设的年月日(就取当年一月一日)来兼容
-          const now = new Date();
-          maxDate = `${now.getFullYear()}-01-01 ${maxDate}`;
-        }
-        return new Date(DateUtil.handleDateStr(maxDate));
-      } else {
-        // 没有传最大日期,默认十年后
-        let year = new Date().getFullYear() + 10;
-        maxDate = new Date(year, 11, 31);
-        return maxDate;
-      }
-    },
-    years() {
-      let years = [];
-      let minYear = this.minDateObj.getFullYear();
-      let maxYear = this.maxDateObj.getFullYear();
-      for (let i = minYear; i <= maxYear; i++) {
-        years.push(i);
-      }
-
-      return years;
-    },
-    months() {
-      let months = [];
-      let minMonth = 1;
-      let maxMonth = 12;
-
-      // 如果选中的年份刚好是最小可选日期的年份,那月份就要从最小日期的月份开始
-      if (this.selectYear == this.minDateObj.getFullYear()) {
-        minMonth = this.minDateObj.getMonth() + 1;
-      }
-      // 如果选中的年份刚好是最大可选日期的年份,那月份就要在最大日期的月份结束
-      if (this.selectYear == this.maxDateObj.getFullYear()) {
-        maxMonth = this.maxDateObj.getMonth() + 1;
-      }
-
-      for (let i = minMonth; i <= maxMonth; i++) {
-        months.push(i);
-      }
-
-      return months;
-    },
-    days() {
-      // 一年中12个月每个月的天数
-      let monthDaysConfig = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
-      // 闰年2月有29天
-      if (this.selectMonth == 2 && this.selectYear % 4 == 0) {
-        monthDaysConfig[1] = 29;
-      }
-
-      let minDay = 1;
-      let maxDay = monthDaysConfig[this.selectMonth - 1];
-
-      if (this.selectYear == this.minDateObj.getFullYear() && this.selectMonth == this.minDateObj.getMonth() + 1) {
-        minDay = this.minDateObj.getDate();
-      }
-      if (this.selectYear == this.maxDateObj.getFullYear() && this.selectMonth == this.maxDateObj.getMonth() + 1) {
-        maxDay = this.maxDateObj.getDate();
-      }
-
-      let days = [];
-      for (let i = minDay; i <= maxDay; i++) {
-        days.push(i);
-      }
-
-      return days;
-    },
-    hours() {
-      let hours = [];
-      let minHour = 0;
-      let maxHour = 23;
-
-      if (
-        this.selectYear == this.minDateObj.getFullYear() &&
-        this.selectMonth == this.minDateObj.getMonth() + 1 &&
-        this.selectDay == this.minDateObj.getDate()
-      ) {
-        minHour = this.minDateObj.getHours();
-      }
-      if (
-        this.selectYear == this.maxDateObj.getFullYear() &&
-        this.selectMonth == this.maxDateObj.getMonth() + 1 &&
-        this.selectDay == this.maxDateObj.getDate()
-      ) {
-        maxHour = this.maxDateObj.getHours();
-      }
-
-      for (let i = minHour; i <= maxHour; i++) {
-        hours.push(i);
-      }
-
-      return hours;
-    },
-    minutes() {
-      let mins = [];
-      let minMin = 0;
-      let maxMin = 59;
-
-      if (
-        this.selectYear == this.minDateObj.getFullYear() &&
-        this.selectMonth == this.minDateObj.getMonth() + 1 &&
-        this.selectDay == this.minDateObj.getDate() &&
-        this.selectHour == this.minDateObj.getHours()
-      ) {
-        minMin = this.minDateObj.getMinutes();
-      }
-      if (
-        this.selectYear == this.maxDateObj.getFullYear() &&
-        this.selectMonth == this.maxDateObj.getMonth() + 1 &&
-        this.selectDay == this.maxDateObj.getDate() &&
-        this.selectHour == this.maxDateObj.getHours()
-      ) {
-        maxMin = this.maxDateObj.getMinutes();
-      }
-
-      for (let i = minMin; i <= maxMin; i++) {
-        mins.push(i);
-      }
-
-      return mins;
-    },
-    seconds() {
-      let seconds = [];
-      let minSecond = 0;
-      let maxSecond = 59;
-
-      if (
-        this.selectYear == this.minDateObj.getFullYear() &&
-        this.selectMonth == this.minDateObj.getMonth() + 1 &&
-        this.selectDay == this.minDateObj.getDate() &&
-        this.selectHour == this.minDateObj.getHours() &&
-        this.selectMinute == this.minDateObj.getMinutes()
-      ) {
-        minSecond = this.minDateObj.getSeconds();
-      }
-      if (
-        this.selectYear == this.maxDateObj.getFullYear() &&
-        this.selectMonth == this.maxDateObj.getMonth() + 1 &&
-        this.selectDay == this.maxDateObj.getDate() &&
-        this.selectHour == this.maxDateObj.getHours() &&
-        this.selectMinute == this.maxDateObj.getMinutes()
-      ) {
-        maxSecond = this.maxDateObj.getSeconds();
-      }
-
-      for (let i = minSecond; i <= maxSecond; i++) {
-        seconds.push(i);
-      }
-
-      return seconds;
-    },
-    // 传给pickerView组件的数组,根据mode来生成不同的数据
-    dateConfig() {
-      let years = this.years.map((y) => y + '年');
-      let months = this.months.map((m) => m + '月');
-      let days = this.days.map((d) => d + '日');
-      let hours = this.hours.map((h) => h + '时');
-      let minutes = this.minutes.map((m) => m + '分');
-      let seconds = this.seconds.map((s) => s + '秒');
-
-      let ret = [];
-      switch (this.mode) {
-        case DATE_TYPES.YM:
-          ret = [years, months];
-          break;
-        case DATE_TYPES.Y:
-          ret = [years];
-          break;
-        case DATE_TYPES['YMD-HMS']:
-          ret = [years, months, days, hours, minutes, seconds];
-          break;
-        case DATE_TYPES.HMS:
-          ret = [hours, minutes, seconds];
-          break;
-        case DATE_TYPES.HM:
-          ret = [hours, minutes];
-          break;
-        default:
-          ret = [years, months, days];
-          break;
-      }
-
-      return ret;
-    },
-    selectVals() {
-      let ret = [];
-      switch (this.mode) {
-        case DATE_TYPES.YM:
-          ret = [this.selectYear + '年', this.selectMonth + '月'];
-          break;
-        case DATE_TYPES.Y:
-          ret = [this.selectYear + '年'];
-          break;
-        case DATE_TYPES['YMD-HMS']:
-          ret = [
-            this.selectYear + '年',
-            this.selectMonth + '月',
-            this.selectDay + '日',
-            this.selectHour + '时',
-            this.selectMinute + '分',
-            this.selectSecond + '秒'
-          ];
-          break;
-        case DATE_TYPES.HMS:
-          ret = [this.selectHour + '时', this.selectMinute + '分', this.selectSecond + '秒'];
-          break;
-        case DATE_TYPES.HM:
-          ret = [this.selectHour + '时', this.selectMinute + '分'];
-          break;
-        default:
-          ret = [this.selectYear + '年', this.selectMonth + '月', this.selectDay + '日'];
-          break;
-      }
-      return ret;
-    }
-  },
-  methods: {
-    onChangePickerValue(e) {
-      const { value } = e;
-
-      if (this.mode == DATE_TYPES.YM && value[0] && value[1]) {
-        // 年月模式
-        this.selectYear = Number(value[0].replace('年', ''));
-        this.selectMonth = Number(value[1].replace('月', ''));
-      } else if (this.mode == DATE_TYPES.Y && value[0]) {
-        // 只有年份模式
-        this.selectYear = Number(value[0].replace('年', ''));
-      } else if (this.mode == DATE_TYPES['YMD-HMS'] && value[0] && value[1] && value[2] != '' && value[3] && value[4] && value[5]) {
-        // 年月日时分秒模式
-        this.selectYear = Number(value[0].replace('年', ''));
-        this.selectMonth = Number(value[1].replace('月', ''));
-        this.selectDay = Number(value[2].replace('日', ''));
-        this.selectHour = Number(value[3].replace('时', ''));
-        this.selectMinute = Number(value[4].replace('分', ''));
-        this.selectSecond = Number(value[5].replace('秒', ''));
-      } else if (this.mode == DATE_TYPES.HMS && value[0] && value[1] && value[2]) {
-        // 时分秒模式
-        this.selectHour = Number(value[0].replace('时', ''));
-        this.selectMinute = Number(value[1].replace('分', ''));
-        this.selectSecond = Number(value[2].replace('秒', ''));
-      } else if (this.mode == DATE_TYPES.HM && value[0] && value[1]) {
-        // 时分模式
-        this.selectHour = Number(value[0].replace('时', ''));
-        this.selectMinute = Number(value[1].replace('分', ''));
-      } else if (value[0] && value[1] && value[2]) {
-        // 默认,年月日模式
-        this.selectYear = Number(value[0].replace('年', ''));
-        this.selectMonth = Number(value[1].replace('月', ''));
-        this.selectDay = Number(value[2].replace('日', ''));
-      } else {
-        // 其他情况可能是pickerView返回的数据有问题,不处理
-        console.log('onChangePickerValue其他情况');
-        return;
-      }
-
-      let formatTmpl = 'YYYY-MM-DD';
-      switch (this.mode) {
-        case DATE_TYPES.YM:
-          formatTmpl = 'YYYY-MM';
-          break;
-        case DATE_TYPES.Y:
-          formatTmpl = 'YYYY';
-          break;
-        case DATE_TYPES['YMD-HMS']:
-          formatTmpl = 'YYYY-MM-DD HH:mm';
-          break;
-        case DATE_TYPES.HMS:
-          formatTmpl = 'HH:mm:ss';
-          break;
-        case DATE_TYPES.HM:
-          formatTmpl = 'HH:mm';
-          break;
-        default:
-          break;
-      }
-
-      this.$emit(
-        'onChange',
-        DateUtil.formatDate(
-          new Date(`${this.selectYear}/${this.selectMonth}/${this.selectDay} ${this.selectHour}:${this.selectMinute}:${this.selectSecond}`),
-          formatTmpl
-        )
-      );
-    }
-  }
-};

+ 0 - 9
components/dengrq-datetime-picker/dateTimePicker/index.vue

@@ -1,9 +0,0 @@
-<template>
-  <view class="datetime-picker">
-    <CustomPickerView :columns="dateConfig" :selectVals="selectVals" @onChange="onChangePickerValue" />
-  </view>
-</template>
-
-<script src="./index.js"></script>
-
-<style scoped lang="css"></style>

+ 31 - 25
manifest.json

@@ -73,29 +73,35 @@
     "uniStatistics" : {
     "uniStatistics" : {
         "enable" : false
         "enable" : false
     },
     },
-	"h5" : {
-		"router" : {
-			"mode" : "hash" // 路由模式
-		},
-		"devServer" : {
-			"https" : false, // 是否启用 https 协议,默认false
-			"port": 8080, // 端口号
-			"disableHostCheck": true, // 禁用 Host 检查,默认false
-			"proxy": { // 与vue中的proxyTable配置大致上一致,此处我同时代理了两个
-				"/dev": { // 测试
-					"target": "http://xxx.xxx.x.xxx:xxxx", // 目标接口域名
-					"changeOrigin": true, // 是否跨域
-					"secure": false, // 设置支持https协议的代理
-					"pathRewrite":{"^/dev":""} // 这个一定要加,意思就是把你项目中一dev开头的接口自动替换为 target + pathRewrite第二个参数来进行数据的请求(pathRewrite没有第二个参数的话直接为target)
-				},
-				"/pre": { // 预发布
-					"target": "http://xxx.xxx.x.xxx", // 目标接口域名
-					"changeOrigin": true, // 是否跨域
-					"secure": false, // 设置支持https协议的代理
-					"pathRewrite":{"^/pre":"/api"} // 此处pathRewrite加第二个参数是因为我的接口最后都有一个/api,在这个地方加/api等价于直接在target后加/api
-				}
-			}
-		}
-	}
-
+    "h5" : {
+        "router" : {
+            "mode" : "hash" // 路由模式
+        },
+        "devServer" : {
+            "https" : false, // 是否启用 https 协议,默认false
+            "port" : 8080, // 端口号
+            "disableHostCheck" : true, // 禁用 Host 检查,默认false
+            "proxy" : {
+                // 与vue中的proxyTable配置大致上一致,此处我同时代理了两个
+                "/dev" : {
+                    // 测试
+                    "target" : "http://xxx.xxx.x.xxx:xxxx", // 目标接口域名
+                    "changeOrigin" : true, // 是否跨域
+                    "secure" : false, // 设置支持https协议的代理
+                    "pathRewrite" : {
+                        "^/dev" : ""
+                    } // 这个一定要加,意思就是把你项目中一dev开头的接口自动替换为 target + pathRewrite第二个参数来进行数据的请求(pathRewrite没有第二个参数的话直接为target)
+                },
+                "/pre" : {
+                    // 预发布
+                    "target" : "http://xxx.xxx.x.xxx", // 目标接口域名
+                    "changeOrigin" : true, // 是否跨域
+                    "secure" : false, // 设置支持https协议的代理
+                    "pathRewrite" : {
+                        "^/pre" : "/api"
+                    } // 此处pathRewrite加第二个参数是因为我的接口最后都有一个/api,在这个地方加/api等价于直接在target后加/api
+                }
+            }
+        }
+    }
 }
 }

+ 92 - 0
pages/demoPage.vue

@@ -0,0 +1,92 @@
+<!-- 我的 -->
+<template>
+	<view id="demoPage">
+		<view class="button-view">下载</view>
+
+		<uni-file-picker ref="files" :auto-upload="false" />
+		<button @click="upload">上传文件</button>
+		<view class="button-view"></view>
+		<view class="button-view">预览</view>
+		<view class="button-view">录音</view>
+	</view>
+</template>
+
+<script>
+	import {
+		systemFileUpload
+	} from '@/api/basicsModules/index.js'
+
+	export default {
+		data() {
+			return {
+
+				imageValue: []
+			}
+		},
+		onLoad() {
+
+		},
+		onShow() {
+
+		},
+		methods: {
+			upload() {
+				this.$refs.files.upload()
+			},
+			// 获取上传状态
+			select(e) {
+				console.log('选择文件:', e)
+			},
+			// 获取上传进度
+			progress(e) {
+				console.log('上传进度:', e)
+			},
+
+			// 上传成功
+			success(e) {
+				console.log('上传成功')
+			},
+
+			// 上传失败
+			fail(e) {
+				console.log('上传失败:', e)
+			},
+			//上传
+			async commonUploading(e) {
+				console.log('e', e);
+				return
+
+				let self = this;
+				const {
+					data
+				} = await systemFileUpload();
+				if (data.code == 200) {
+
+				}
+			},
+			// commonUploading(e) {
+			// 	let self = this;
+			// 	let str = "";
+			// 	console.log(e.target.files[0])
+			// 	let param = new FormData();
+			// 	param.append('api_name', `uploadImg`);
+			// 	param.append('openid', localStorage.getItem("openid"));
+			// 	param.append('cover', e.target.files[0]);
+			// 	let formData = new FormData();
+			// 	formData.append("file", file);
+			// 	systemFileUpload
+			// },
+		},
+	}
+</script>
+<style lang="stylus" scoped>
+	#demoPage {
+		.button-view {
+			width: 100rpx;
+			margin: 100rpx auto;
+			background: #dedede;
+			border-radius: 4rpx;
+			text-align: center;
+		}
+	}
+</style>

+ 3 - 3
pages/home/home.vue

@@ -19,7 +19,7 @@
 	} from '@/pages/home/supplierWorkbench.vue'
 	} from '@/pages/home/supplierWorkbench.vue'
 	import {
 	import {
 		tabBar
 		tabBar
-	} from '@/components/tabBar.vue'
+	} from '@/component/tabBar.vue'
 	// #endif
 	// #endif
 	export default {
 	export default {
 		name: "home",
 		name: "home",
@@ -36,7 +36,7 @@
 			"manageHome": () => import('@/pages/home/manageWorkbench.vue'),
 			"manageHome": () => import('@/pages/home/manageWorkbench.vue'),
 			"userHome": () => import('@/pages/home/studentWorkbench.vue'),
 			"userHome": () => import('@/pages/home/studentWorkbench.vue'),
 			"supplierHome": () => import('@/pages/home/supplierWorkbench.vue'),
 			"supplierHome": () => import('@/pages/home/supplierWorkbench.vue'),
-			"tabBar": () => import('@/components/tabBar.vue'),
+			"tabBar": () => import('@/component/tabBar.vue'),
 		},
 		},
 		// #endif
 		// #endif
 		data() {
 		data() {
@@ -45,7 +45,7 @@
 			}
 			}
 		},
 		},
 		onLoad() {
 		onLoad() {
-			console.log('permissionsVerify',this.permissionsVerify)
+			console.log('permissionsVerify', this.permissionsVerify)
 		},
 		},
 		onShow() {
 		onShow() {
 			if (uni.getStorageSync('token') && uni.getStorageSync('userId') && uni.getStorageSync('userType')) {
 			if (uni.getStorageSync('token') && uni.getStorageSync('userId') && uni.getStorageSync('userType')) {

+ 2 - 2
pages/home/manageWorkbench.vue

@@ -67,7 +67,7 @@
   } from '@/api/basicsModules/index.js'
   } from '@/api/basicsModules/index.js'
   import {getHomeConfig} from '@/utils/homeConfig'
   import {getHomeConfig} from '@/utils/homeConfig'
 	// #ifdef MP-WEIXIN
 	// #ifdef MP-WEIXIN
-	import {tabBar} from '@/components/tabBar.vue'
+	import {tabBar} from '@/component/tabBar.vue'
 	import {topWarn} from '@/component/topWarn.vue'
 	import {topWarn} from '@/component/topWarn.vue'
 	import {navBar} from '@/component/navbar.vue'
 	import {navBar} from '@/component/navbar.vue'
 	import {homeConfigurationSlot} from '@/component/homeConfigurationSlot'
 	import {homeConfigurationSlot} from '@/component/homeConfigurationSlot'
@@ -84,7 +84,7 @@
 		// #endif
 		// #endif
 		// #ifdef H5
 		// #ifdef H5
 		components: {
 		components: {
-			"tabBar": () => import('@/components/tabBar.vue'),
+			"tabBar": () => import('@/component/tabBar.vue'),
 			"topWarn": () => import('@/component/topWarn.vue'),
 			"topWarn": () => import('@/component/topWarn.vue'),
 			"navBar": () => import('@/component/navbar.vue'),
 			"navBar": () => import('@/component/navbar.vue'),
 			"homeConfigurationSlot": () => import('@/component/homeConfigurationSlot.vue'),
 			"homeConfigurationSlot": () => import('@/component/homeConfigurationSlot.vue'),

+ 1 - 1
pages/home/studentWorkbench.vue

@@ -35,7 +35,7 @@
 
 
 <script>
 <script>
 import { myViolationCount,queryMyCert,outSubjectPhoto,gradingControl,getGentleIdentifier,systemAppletLayoutSelect} from '@/api/basicsModules/index.js'
 import { myViolationCount,queryMyCert,outSubjectPhoto,gradingControl,getGentleIdentifier,systemAppletLayoutSelect} from '@/api/basicsModules/index.js'
-import { tabBar } from '@/components/tabBar.vue'
+import { tabBar } from '@/component/tabBar.vue'
 import { navBar } from '@/component/navbar.vue'
 import { navBar } from '@/component/navbar.vue'
 import { homeConfigurationSlot } from '@/component/homeConfigurationSlot'
 import { homeConfigurationSlot } from '@/component/homeConfigurationSlot'
 import { getHomeConfig } from '@/utils/homeConfig'
 import { getHomeConfig } from '@/utils/homeConfig'

+ 2 - 2
pages/information/information.vue

@@ -26,7 +26,7 @@
 	// #ifdef MP-WEIXIN
 	// #ifdef MP-WEIXIN
 	import {
 	import {
 		tabBar
 		tabBar
-	} from '@/components/tabBar.vue'
+	} from '@/component/tabBar.vue'
 	// #endif
 	// #endif
 	export default {
 	export default {
 		// #ifdef MP-WEIXIN
 		// #ifdef MP-WEIXIN
@@ -36,7 +36,7 @@
 		// #endif
 		// #endif
 		// #ifdef H5
 		// #ifdef H5
 		components: {
 		components: {
-			"tabBar": () => import('@/components/tabBar.vue'),
+			"tabBar": () => import('@/component/tabBar.vue'),
 		},
 		},
 		// #endif
 		// #endif
 		data() {
 		data() {

+ 6 - 6
pages/mine/mine.vue

@@ -89,24 +89,24 @@
 	// #ifdef MP-WEIXIN
 	// #ifdef MP-WEIXIN
 	import {
 	import {
 		tabBar
 		tabBar
-	} from '@/components/tabBar.vue'
+	} from '@/component/tabBar.vue'
 	import {
 	import {
 		mineConfigurationSlot
 		mineConfigurationSlot
-	} from '@/components/mineConfigurationSlot'
+	} from '@/component/mineConfigurationSlot'
 	// #endif
 	// #endif
 
 
 
 
 	export default {
 	export default {
-	// #ifdef MP-WEIXIN
+		// #ifdef MP-WEIXIN
 		components: {
 		components: {
 			tabBar,
 			tabBar,
 			mineConfigurationSlot,
 			mineConfigurationSlot,
 		},
 		},
-	// #endif
+		// #endif
 		// #ifdef H5
 		// #ifdef H5
 		components: {
 		components: {
-			"tabBar": () => import('@/components/tabBar.vue'),
-			"mineConfigurationSlot": () => import('@/components/mineConfigurationSlot.vue'),
+			"tabBar": () => import('@/component/tabBar.vue'),
+			"mineConfigurationSlot": () => import('@/component/mineConfigurationSlot.vue'),
 		},
 		},
 		// #endif
 		// #endif
 		data() {
 		data() {