// 日期回显
export function formatTime(data,famet='YYYY-MM-DD HH:MMM:SS') {if(famet == 'YYYY-MM-DD HH:MMM:SS'){const time = new Date(data)const year = time.getFullYear()const month = time.getMonth() + 1const day = time.getDate()const hour = time.getHours()const minute = time.getMinutes()const second = time.getSeconds()return year + '-' + month + '-' + day}
}// 校验
export function reg(data) {//你输入的手机号长度或格式错误let reg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/// 姓名格式校验let reg = /^[\u4E00-\u9FA5\uf900-\ufa2d·s]{2,6}$/;//身份证号校验let reg = /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2])){数据.substr(6, 8).replace(/(.{4})(.{2})/, "$1-$2-") , 身份证年月日回显}if (!reg.test(data)) {uni.showToast({title: "你输入的手机号长度或格式错误",icon: 'none'});return false}return true
}