//方便复制
getPhoneType(){
var u = navigator.userAgent;
var isXiaomi = u.indexOf('XiaoMi') > -1; // 小米手机
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; // 其它安卓
var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); // ios
if (isAndroid || isXiaomi) {
return 'android';
}else if (isIOS) {
return 'ios';
}
},
theKnowTime() {
let that = this
let nowTime = new Date().getTime()
let u = navigator.userAgent;
let time = ''
let beginTime = that.interviewData.beginTime || ''
if (that.getPhoneType() === 'android') {
time = new Date(beginTime).getTime()
} else if (that.getPhoneType() === 'ios') {
if (beginTime) {
beginTime = beginTime.replace(/-/g,"/")
}
time = new Date(beginTime).getTime()
}
that.interStr = setInterval(() => {
//获取时间差
let timediff = Math.round((time - nowTime) / 1000)
if (timediff > 0) {
that.timeStr = that.$helper.theCountdown(beginTime)
} else {
that.timeStr = ''
clearInterval(that.interStr)
}
}, 1000)
},