tianhui 3 years ago
parent
commit
7c44c4a37f

+ 2 - 2
common/config.js

@@ -1,5 +1,5 @@
-// const host = 'http://wx.hw.hongweisoft.com/parking';//本地
-const host = 'http://parking.pdzhtc.com';//正式
+const host = 'http://wx.hw.hongweisoft.com/parking';//本地
+// const host = 'http://parking.pdzhtc.com';//正式
 // const host = 'http://172.16.90.64:7000';
 const config = {
 	wxAppid:'wxbe90cc7c5233dd84',// wxAppid 

+ 184 - 0
components/select-timer/select-timer.vue

@@ -0,0 +1,184 @@
+<template>
+	<view class="actions" v-if="visible">
+		<view class="mask" @click="visibleChange()"></view>
+		<view class="tabBar">
+			<view class="left">
+				<text @click="visibleChange()">取消</text>
+			</view>
+			<view class="right">
+				<text @click="visibleChange()">确认</text>
+			</view>
+		</view>
+		<picker-view :indicator-style="indicatorStyle" :value="value" @change="bindChange">
+			<picker-view-column>
+				<view class="item" v-for="(item,index) in years" :key="index">{{item}}年</view>
+			</picker-view-column>
+			<picker-view-column>
+				<view class="item" v-for="(item,index) in months" :key="index">{{item}}月</view>
+			</picker-view-column>
+			<picker-view-column>
+				<view class="item" v-for="(item,index) in days" :key="index">{{item}}日</view>				
+			</picker-view-column>
+			<picker-view-column>
+				<view class="item" v-for="(item,index) in hours" :key="index">{{item}}时</view>				
+			</picker-view-column>
+			<picker-view-column>
+				<view class="item" v-for="(item,index) in minutes" :key="index">{{item}}分</view>				
+			</picker-view-column>
+			<picker-view-column>
+				<view class="item" v-for="(item,index) in seconds" :key="index">{{item}}秒</view>				
+			</picker-view-column>
+		</picker-view>
+	</view>
+</template>
+<script>
+	export default {
+		data(){
+			return {
+				value: [0,0,0,0,0,0],
+				years: [],
+				months: [],
+				days: [],
+				hours: [],
+				minutes: [],
+				seconds: [],
+				indicatorStyle: `height: ${Math.round(uni.getSystemInfoSync().screenWidth/(750/100))}px;`
+			}
+		},
+		props:{
+			visible: {
+				type:Boolean,
+				default: false
+			}
+		},
+		created() {
+			//用最古老的方式做最有效的事
+			//记录一下当前时间
+			let data = new Date();
+			// 初始化选择器中的年份
+			for(let i=1970;i<=2099;i++){
+				this.years.push(i)
+			}
+			// 初始化选择器中的月份
+			for(let j=1;j<=12;j++){
+				this.months.push(j)
+			}
+			// 初始化选择器中的天数
+			this.init(data.getFullYear(),data.getMonth())
+			// 初始化选择器选中的时间
+			//定义到当前时间
+			this.value[0] = data.getFullYear() - 1970;
+			this.value[1] = data.getMonth();
+			this.value[2] = data.getDate()-1;
+			this.value[3] = data.getHours();
+			this.value[4] = data.getMinutes();
+			this.value[5] = data.getSeconds();
+			this.$emit('changeTime',this.value)
+		},
+		methods:{
+			visibleChange(){
+				this.$emit('timeCofirm',this.visible)
+			},
+			bindChange(e){
+				this.init(
+					this.years[e.detail.value[0]],
+					this.months[e.detail.value[1]] - 1
+				)
+				this.value = e.detail.value;
+				this.$emit('changeTime',this.value)
+			},
+			// 初始化选择器中的天数
+			init(inYear,inMonth,inDay,inHours,inMinutes,inSeconds){
+				this.days = [];
+				this.hours = [];
+				this.minutes = [];
+				this.seconds = [];
+				// 当前月数为2月
+				if(inMonth == 1){
+					if(inYear %4 ==0){
+						// 为闰年为29天
+						for(let s=1;s<=29;s++){
+							this.days.push(s)
+						}
+					}else {
+						// 否则为28天
+						for(let s=1;s<=28;s++){
+							this.days.push(s)
+						}
+					}
+				}else if(
+					inMonth == 0 ||
+					inMonth == 2 ||
+					inMonth == 4 ||
+					inMonth == 6 ||
+					inMonth == 7 ||
+					inMonth == 9 ||
+					inMonth == 11 
+				){
+					// 如果为1,3,5,7,8,10,12月份为31天
+					for(let s=1;s<=31;s++){
+						this.days.push(s)
+					}
+				}else {
+					// 其他月份为30天
+					for(let s=1;s<=30;s++){
+						this.days.push(s)
+					}
+				}
+			}
+		}
+	}
+</script>
+<style lang="scss">
+	.actions{
+		width: 100%;
+		position: absolute;
+		background-color: rgba(0,0,0,0.1);
+		bottom: 0;
+		/* #ifdef H5 */
+		min-height: calc(100vh - 44px);
+		/* #endif */
+		/* #ifndef H5 */
+		min-height: 100vh;
+		/* #endif */
+		z-index: 10076;
+	}
+	.mask{
+		width: 100%;
+		/* #ifdef H5 */
+		height: calc(100vh - 640rpx - 44px);
+		/* #endif */
+		/* #ifndef H5 */
+		height: calc(100vh - 640rpx);
+		/* #endif */
+	}
+	.tabBar{
+		z-index: 10076;
+		width: 100%;
+		padding: 2% 5%;
+		background-color: #FFFFFF;
+		display: flex;
+		height: 80rpx;
+		line-height: 40rpx;
+		view{
+			width: 50%;
+		}
+		.left{
+			color: #14ADF9;
+		}
+		.right{
+			text-align: right;
+			color: #09BB07;
+		}
+	}
+	picker-view {
+		background-color: #FFFFFF;
+	    width: 100%;
+	    height: 600rpx;
+		picker-view-column{
+			width: 100%;
+			text-align: center;
+		}
+		
+	}
+</style>

+ 1 - 0
pages/attence/attence.scss

@@ -130,6 +130,7 @@ page{
 }
 
 .remark{
+	z-index: 99;
 	.submit-btn{
 		position: absolute;
 		right: 40rpx;

+ 60 - 0
pages/getin/getin.scss

@@ -90,3 +90,63 @@
 .bottom-btn-box{
 	bottom: 20rpx;
 }
+.popup-confirmTime{
+	.popup-title{
+		font-size: 40rpx;
+		text-align: center;
+		padding: 40rpx 0 10rpx;
+	}
+	.popup-content{
+		padding: 0 20rpx;
+	}
+	.popup-confirm{
+		
+		// border: 1px solid #3397FA;
+		margin: 19rpx 9rpx 20rpx;
+		.popup-intime {
+			flex: 5;
+			border: 1px solid #3397FA;
+			border-right: none;
+			border-bottom: none;
+			margin: 10rpx 0;
+			.popup-intime-top {
+				border: 1px solid #3397FA;
+				text-align: center;
+				border-top: none;
+			}
+			.popup-intime-bottom {
+				border: 1px solid #3397FA;
+				text-align: center;
+				border-top: none;
+			}
+		}
+		.pop-right{
+			flex: 1;
+			margin: 10rpx 0;
+			.upset{
+				
+			}
+		}
+		
+	}
+}
+.button-wrap{
+	display: flex;
+	.btn1{
+		background-color: #3397FA;
+		color: #FFFFFF;
+	}
+	.btn2{
+		color: #208CF9;
+		background-color: #EBF1FF;
+	}
+}
+.u-radio-group{
+	width: 100%;
+}
+.popup-confirm /deep/ .u-radio__label {
+	width: 100%;
+	margin-right: 0;
+	display: flex;
+	flex-direction:row;
+}

+ 147 - 5
pages/getin/getin.vue

@@ -67,12 +67,47 @@
 		<u-select v-model="carColorShow" :default-value="[2]" :list="carColorList" @confirm="carColorConfirm"></u-select>
 		<u-toast ref="uToast" />
 		<u-keyboard ref="uKeyboard" mode="car" @change="keyboardChange" @backspace="backspace" v-model="keyboardshow"></u-keyboard>
+		<u-popup class="popup-confirmTime" v-model="timeshow" :mask-close-able="false" mode="center" border-radius="20" width="90%" style="z-index: 99;">
+			<view class="popup-title">入场时间确认:</view>
+			<view class="popup-content">请在地磁时间和当前时间里选择一个来做为入场时间:</view>
+			<view class="popup-confirm  u-flex">
+					<u-radio-group v-model="timevalue" @change="radioGroupChange" :wrap="true">
+						<u-radio 
+							@change="radioChange" 
+							v-for="(item, index) in timeList" :key="index" 
+							:name="item.time"
+							:disabled="item.disabled"
+						>
+						<view class="popup-intime">
+						<view class="popup-intime-top" > {{item.name}}</view>
+						<!-- <view class="popup-intime-bottom" v-if="item.time !=0">{{item.time}}</view> -->
+						<picker class="openTime" mode="time"  :value="time" start="09:01" end="21:01" @change="bindTimeChange">
+							<view class="popup-intime-bottom" v-if="index==1">{{item.time}}</view>
+						</picker>
+						</view>
+						<!-- <view class="pop-right"><u-button class="upset" size="mini" @click="upset()" v-if="index==0">修正</u-button></view> -->
+						</u-radio>
+					</u-radio-group>
+			</view>
+			<view class="button-wrap">
+				<u-button class="btn1" @click="timesubmit">确认</u-button>
+				<u-button class="btn2" @click="cancel">取消</u-button>
+			</view>
+		</u-popup>
+		<!-- <u-popup class="timeopen" v-model="visible" mode="center" border-radius="20" width="90%"height="50%">
+			<picker class="openTime" mode="time"  :value="time" start="09:01" end="21:01" @change="bindTimeChange">
+				<view class="uni-input">{{time}}</view>
+			</picker>
+		</u-popup> -->
+		
+		<!-- <select-timer :visible="visible"></select-timer> -->
 	</view>
 </template>
 
 <script>
 	import { config } from '@/common/config.js';
 	import { mydata } from '@/common/data.js';
+	import selectTimer from '../../components/select-timer/select-timer.vue';
 	console.log('mydata',mydata.carColorList)
 	//#ifdef APP-PLUS
 	import speak from '@/utils/speaks.js';
@@ -81,8 +116,13 @@
 	let ocr = uni.requireNativePlugin("OcrPlug");
 	//#endif
 	export default {
+		components: {
+			selectTimer
+		},
 		data() {
 			return {
+				time: '12:01',
+				visible:false,
 				carImg:'',
 				uploadAction:config.baseUrl+'/file/tencent/upload',
 				spaceId:'',
@@ -101,6 +141,26 @@
 				balance:null,
 				images:[],
 				keyboardshow:false,
+				timeshow:false,
+				timevalue:'',
+				timechangeList:[],
+				timeList:[
+					{
+						name:'地磁时间',
+						disabled: false,
+						time:''
+					},
+					{
+						name:'当前时间',
+						disabled: false,
+						time:''
+					}
+				],
+				inTime:'',
+				confirmTime:'',
+				time:'',
+				placeStatus:'',
+				finialtime:''
 			}
 		},
 		onLoad(page) {
@@ -110,12 +170,67 @@
 			this.spaceName = page.spaceName;
 			this.roadNo = page.roadNo;
 			this.carImg = page.carImg;
-			this.vehicleNo = page.vehicleNo
+			this.vehicleNo = page.vehicleNo;
+			this.inTime = page.inTime;
+			this.placeStatus=page.placeStatus;
 		},
 		onShow() {
-			
+			this.timeList[1].time = this.getTimer();
+			// this.timeList[1].time=this.currentTime.getFullYear()+ '-' +(this.currentTime.getMonth()+1)+ '-' +this.currentTime.getDate()+ ' ' +this.finialtime+ ':'+"00";
+			setInterval( () => {
+				this.timeList[0].time = this.inTime;
+				
+			}, 1000);
 		},
 		methods:{
+			upset(){
+				this.visible=true;
+			},
+			bindTimeChange(e) {
+				this.finialtime = e.target.value;
+				console.log(this.finialtime)
+				this.timeList[1].time=this.getYMD()+ ' ' +this.finialtime+ ':'+"00";
+				console.log(this.timeList[0].time)
+				this.confirmTime=this.timeList[1].time
+			},
+			cancel(){
+				this.timeshow=false;
+			},
+			submit(){
+				this.time = this.confirmTime;
+				console.log(this.time)
+				this.timeshow=true;
+			},
+			radioGroupChange(){
+				
+			},
+			getYMD(){
+				var time = new Date();
+				var y = time.getFullYear();
+				var mon = time.getMonth() + 1;
+				mon = mon <10 ? '0' + mon : mon;
+				var d = time.getDate();
+				d = d <10 ? '0' + d : d;
+				return y + '-' + mon + '-' + d ;
+			},
+			getTimer(){
+				var time = new Date();
+				var y = time.getFullYear();
+				var mon = time.getMonth() + 1;
+				mon = mon <10 ? '0' + mon : mon;
+				var d = time.getDate();
+				d = d <10 ? '0' + d : d;
+				var h = time.getHours();
+				h = h < 10 ? '0' + h : h;
+				var m = time.getMinutes();
+				m = m < 10 ? '0' + m : m;
+				var s = time.getSeconds();
+				s = s < 10 ? '0' + s : s;
+				return y + '-' + mon + '-' + d + ' ' + h + ':' + m + ':' + s;
+			},
+			radioChange(e) {
+				this.confirmTime = e;
+			},
 			customBack(){
 				this.$u.route({
 					// type:'switchTab',
@@ -138,7 +253,9 @@
 				console.log('e',e)
 				this.vehicleColor = e[0].value;
 			},
-			submit(){
+			timesubmit(){
+				this.time = this.confirmTime;
+				console.log(this.time)
 				let files = [];
 				let that = this;
 				// 通过filter,筛选出上传进度为100的文件(因为某些上传失败的文件,进度值不为100,这个是可选的操作)
@@ -158,9 +275,32 @@
 					vehicleType:this.vehicleType,
 					memberId:this.memberId,
 					depositAmount:this.depositAmount,
-					images:this.images
+					images:this.images,
+					inTime:this.time
 				};
-				this.$u.api.entrance(param)
+				if(this.placeStatus==1&&(this.vehicleNo=='')){
+					this.$u.api.parkInConfirm(param)//有车但是车牌为空
+					.then(res=>{
+						this.$refs.uToast.show({
+							title: res.msg,
+							type: 'success',
+							url:'pages/getout/getout'
+						});
+						//#ifdef APP-PLUS
+						device.print(res.data.print);
+						speak(res.data.speak);
+						//#endif
+						console.log('parkInConfirm',res)
+					}).catch(err=>{
+						this.$refs.uToast.show({
+							title: err.msg,
+							type: 'error',
+							// url:'pages/parking/parking'
+						});
+						console.log('parkInConfirm ',err)
+					});
+				}else{
+					this.$u.api.entrance(param)//车位空闲调
 				.then(res=>{
 					this.$refs.uToast.show({
 						title: res.msg,
@@ -180,6 +320,8 @@
 					});
 					console.log('entrance ',err)
 				});
+				}
+				
 			},
 			handleParkInInfo(){
 				let param ={

+ 1 - 0
pages/getout/getout.scss

@@ -178,6 +178,7 @@
 			color: #767676;
 			.time{
 				margin-left: 29rpx;
+				font-size: 20rpx;
 			}
 		}
 		

+ 19 - 14
pages/getout/getout.vue

@@ -10,8 +10,8 @@
 		<u-empty class="u-m-t-80" text="暂无停车" mode="data" v-if="roadspaceList.length == 0"></u-empty>
 		<view class="search"><u-search placeholder="请输入车位名称"  v-model="roadspaceList.spaceName" shape="round" @search="spaceSearch()" @custom="spaceSearch()"></u-search></view>
 		<view class="roadspace-list wrap">
-			<view class="roadspace-list-item" :class="{used:item.placeStatus==1}" @click="roadspaceClick(item)" v-for="item in roadspaceList" :key="item.id">
-				<view class="block"  :class="{'flashing': item.vehicleNo == 0 }">
+			<view class="roadspace-list-item" :class="{used:item.placeStatus==1}" v-if="item.placeStatus==1&&item.vehicleNo != 0" @click="roadspaceClick(item)" v-for="item in roadspaceList" :key="item.id">
+				<view class="block"  >
 					<view class="block-top">
 						<u-icon name="car-fill" size="40" color="#fff"></u-icon>
 						<view class="car-no">{{ item.vehicleNo }}</view>
@@ -49,7 +49,7 @@
 						<view>车牌号</view>
 						<view class="u-flex-1 u-m-l-40">
 							<u-input v-model="confirmData.vehicleNo" height="80" width="100" type="text" @focus="messageInputClick" placeholder="输入车牌号" />
-							<!-- <u-button type="primary" size="s" @click="handleParkInInfo">确认</u-button> -->
+							
 						</view>
 					</view>
 					<view class="text-item u-flex u-flex u-row-between">
@@ -83,6 +83,7 @@
 		<u-keyboard ref="uKeyboard" mode="car" @change="keyboardChange" @backspace="backspace" v-model="keyboardshow"></u-keyboard>
 		<u-select v-model="carTypeShow" :default-value="[2]" :list="carTypeList" @confirm="carTypeConfirm"></u-select>
 		<u-select v-model="carColorShow" :default-value="[2]" :list="carColorList" @confirm="carColorConfirm"></u-select>
+		
 	</view>
 </template>
 
@@ -129,19 +130,25 @@
 				},
 				pages:'',
 				pageNum:'',
-				currentPageNum:''
+				currentPageNum:'',
+				
 			}
+		},
+		onLoad() {
+			
 		},
 		onShow() {
 			let that = this;
 			this.roadNo = this.$store.state.vuex_user?.roadList?.[0].roadNo || '';
 			this.handleGetRoadspace(this.roadNo);
-			
-			setInterval(function () {
+			// this.timeList[0].time = this.roadspaceList[0].inTime;
+			// this.timeList[1].time = this.currentTime.getFullYear()+'-'+(this.currentTime.getMonth()+1)+'-'+this.currentTime.getDay()+' '+this.getTimer();
+			setInterval( () => {
 				that.currentTime = new Date()//修改数据让他可以实时更新
 			}, 1000);
 		},
 		methods:{
+			
 			jump(){
 				this.$u.api.getRoadspace({roadNo:this.roadNo,placeStatus:1,pageNum:this.pageNum || ''})
 				.then(res => {
@@ -199,11 +206,9 @@
 					// 	type: 'success',
 					// });
 					this.currentPageNum=res.data.page;
-					console.log(res.data.rows)
 					this.pages=res.data.pages;
 					this.list.pageNum=res.data.page;
 					this.roadspaceList = res.data.rows;
-					console.log('handleGetRoadspace',res)
 				}).catch(err=>{
 					if(err.errMsg){
 						this.$refs.uToast.show({
@@ -389,7 +394,7 @@
 				  that.confirmData.images.push(element.response.data.url);
 				});
 				let param = this.confirmData;
-				this.$u.api.parkInConfirm(param)
+				this.$u.api.parkInConfirm(param)//有车但是车牌为空
 				.then(res=>{
 					this.$refs.uToast.show({
 						title: res.msg,
@@ -431,10 +436,10 @@
 				var days = Math.floor(i_total_secs / (24 * 3600 * 1000))
 					 
 				//计算出小时数
-				// var leave1 = i_total_secs % (24 * 3600 * 1000)    //计算天数后剩余的毫秒数
-				// var hours = Math.floor(leave1 / (3600 * 1000))
+				var leave1 = i_total_secs % (24 * 3600 * 1000)    //计算天数后剩余的毫秒数
+				var hours = Math.floor(leave1 / (3600 * 1000))
 				
-				var hours = Math.floor(i_total_secs / (3600 * 1000))
+				// var hours = Math.floor(i_total_secs / (3600 * 1000))
 				
 				//计算相差分钟数
 				var leave2 = i_total_secs % (3600 * 1000)        //计算小时数后剩余的毫秒数
@@ -442,12 +447,12 @@
 				//计算相差秒数
 				var leave3 = leave2 % (60 * 1000)      //计算分钟数后剩余的毫秒数
 				var seconds = Math.round(leave3 / 1000)
-				
+				days = formatNumber(hours)
 				hours = formatNumber(hours);
 				minutes = formatNumber(minutes);
 				seconds = formatNumber(seconds);
 				// console.log(days + '天' + hours + '个小时' + minutes + '分钟' + seconds + '秒');
-				return hours + ':' + minutes + ':' + seconds
+				return days + '天' + hours + '个小时' + minutes + '分钟' + seconds + '秒'
 			}
 		}
 		

+ 88 - 2
pages/parking/parking.vue

@@ -11,8 +11,11 @@
 		<view class="search"><u-search placeholder="请输入车位名称" v-model="roadspaceList.spaceName" shape="round" @search="spaceSearch()" @custom="spaceSearch()"></u-search></view>
 		<view class="roadspace-list wrap">
 			<view class="roadspace-list-item" @click="roadspaceClick(item)" v-for="(item,index) in roadspaceList" :key="index + item.id">
-				<view class="block" :class="{flashing: item.deviceStatus ==1||item.deviceStatus ==5}">
-					
+				<view class="block" :class="{flashing: (item.deviceStatus ==1||item.deviceStatus ==5)||(item.placeStatus==1&&(item.vehicleNo==''))}">
+					<view class="block-bottom" v-if="item.placeStatus==1&&(item.vehicleNo=='')">
+						<u-icon name="clock-fill" size="40" color="#3397FA"></u-icon>
+						<view class="time">{{ item.inTime | timeago(currentTime)}}</view>
+					</view>
 				</view>
 				<view class="text">{{item.spaceName}}</view>
 			</view>			
@@ -43,6 +46,7 @@
 		components: {uniPagination},
 		data() {
 			return {
+				currentTime: new Date(), 
 				roadNo:null,//路段编码 ,示例值(RN000000004)
 				actionList:[
 					{text: '停车',},
@@ -69,6 +73,12 @@
 			this.handleGetRoadspace(this.roadNo);
 			
 		},
+		onShow(){
+			let that = this;
+			setInterval( () => {
+				that.currentTime = new Date()//修改数据让他可以实时更新
+			}, 1000);
+		},
 		methods:{
 			// uni_pagination_change(e){
 			
@@ -159,6 +169,7 @@
 				this.actionShow = true;
 				this.spaceId = roadspace.id;
 				this.spaceName = roadspace.spaceName;
+				this.inTime = roadspace.inTime;
 				console.log('roadspace',roadspace);
 				// let that = this;
 				ocr.ocrVehicleNo((ret) => {
@@ -182,6 +193,8 @@
 								vehicleNo:this.vehicleNo,
 								carImg:this.carImg,
 								vehicleImage:this.vehicleImage,
+								inTime:this.inTime,
+								placeStatus:this.placeStatus
 							}
 						});
 					}else {
@@ -189,6 +202,42 @@
 					}
 				});
 			},
+			confirmIn(){
+				let files = [];
+				let that = this;
+				// 通过filter,筛选出上传进度为100的文件(因为某些上传失败的文件,进度值不为100,这个是可选的操作)
+				files = this.$refs.uUpload.lists.filter(val => {
+					return val.progress == 100;
+				});
+				// 如果不需要进行太多的处理,直接如下即可
+				// files = this.$refs.uUpload.lists;
+				that.confirmData.images = [];
+				this.confirmData.spaceId = that.confirmData.id;
+				files.forEach(function(element) {
+				  that.confirmData.images.push(element.response.data.url);
+				});
+				let param = this.confirmData;
+				this.$u.api.parkInConfirm(param)//有车但是车牌为空
+				.then(res=>{
+					this.$refs.uToast.show({
+						title: res.msg,
+						type: 'success',
+						url:'pages/getout/getout'
+					});
+					//#ifdef APP-PLUS
+					device.print(res.data.print);
+					speak(res.data.speak);
+					//#endif
+					console.log('parkInConfirm',res)
+				}).catch(err=>{
+					this.$refs.uToast.show({
+						title: err.msg,
+						type: 'error',
+						// url:'pages/parking/parking'
+					});
+					console.log('parkInConfirm ',err)
+				});
+			},
 			// actionClick(e){
 			// 	console.log('actionClick',e);
 			// 	switch (e){
@@ -209,6 +258,43 @@
 			// 	}
 			// }
 			
+		},
+		filters:{
+			timeago(inTime,currentTime){
+				var time_start = '', clock_start = ''
+				if (inTime) {
+					time_start = new Date(inTime.replace(/-/g,'/'));
+					time_start.getTime();
+				}
+				// console.log('currentTime',this.currentTime)
+				
+				const formatNumber = (num) => {
+					num = num.toString()
+					return num[1] ? num : '0' + num
+				};
+				var i_total_secs = Math.round(currentTime.getTime() - time_start);
+				//计算出相差天数
+				var days = Math.floor(i_total_secs / (24 * 3600 * 1000))
+					 
+				//计算出小时数
+				var leave1 = i_total_secs % (24 * 3600 * 1000)    //计算天数后剩余的毫秒数
+				var hours = Math.floor(leave1 / (3600 * 1000))
+				
+				// var hours = Math.floor(i_total_secs / (3600 * 1000))
+				
+				//计算相差分钟数
+				var leave2 = i_total_secs % (3600 * 1000)        //计算小时数后剩余的毫秒数
+				var minutes = Math.floor(leave2 / (60 * 1000))
+				//计算相差秒数
+				var leave3 = leave2 % (60 * 1000)      //计算分钟数后剩余的毫秒数
+				var seconds = Math.round(leave3 / 1000)
+				days = formatNumber(hours)
+				hours = formatNumber(hours);
+				minutes = formatNumber(minutes);
+				seconds = formatNumber(seconds);
+				// console.log(days + '天' + hours + '个小时' + minutes + '分钟' + seconds + '秒');
+				return days + '天' + hours + '个小时' + minutes + '分钟' + seconds + '秒'
+			}
 		}
 		
 	}