export default{
	getCurrentPageUrl(){//---获取当前页面url
		let pages = getCurrentPages() //获取加载的页面
		let currentPage = pages[pages.length-1] //获取当前页面的对象
		let url = currentPage.route //当前页面url
		let options = currentPage.options //如果要获取url中所带的参数可
		let queryTotal=""
		for (let key in options){
			 queryTotal+="&"+key+"="+options[key]
		}
		queryTotal=queryTotal.substr(1)
		let pageUrl=url+"?"+queryTotal//请求的全路径
		return pageUrl
	},
	today:function(){//默认当天
		var now = new Date();
		var day = ("0" + now.getDate()).slice(-2);
		var month = ("0" + (now.getMonth() + 1)).slice(-2);
		var today = now.getFullYear()+"-"+(month)+"-"+(day) ;
		return today
	},
	todayTime:function(){
		var now = new Date();
		var hour = now.getHours()<10?'0'+now.getHours():now.getHours()
		var minutes = now.getMinutes()<10?'0'+now.getMinutes():now.getMinutes()
		var seconds = now.getSeconds()<10?'0'+now.getSeconds():now.getSeconds()
		var time = hour+":"+minutes+":"+seconds
		return time
	}
}
//调用方法时--this.$commonjs.today()