This commit is contained in:
shijingjing
2023-03-30 10:39:45 +08:00
parent 4de065d59e
commit 2ec0060bbc
2 changed files with 23 additions and 2 deletions

View File

@@ -52,7 +52,7 @@
</div>
<div class="btn-clock" v-if="info.type == 0">
<div class="btn-circle" @click="clockIn" hover-class="text-hover" :class="isClock== 0? 'gray': isClock==3? 'gray': isClock== 2? 'opacity':''">
<div class="daka">打卡签到</div>
<div class="daka">{{ dkqd }}</div>
<div class="text" v-if="isClock==1">积分+{{ intoIntegral }}</div>
</div>
<div class="tips">{{ scope }}</div>
@@ -135,6 +135,21 @@ export default {
}
return `未到打卡时间/不在指定位置`
},
dkqd() {
const times = new Date().getTime()
const inSTimes = new Date(this.info.intoBegintime?.replaceAll('-', '/')).getTime() // 进场开始
const inETimes = new Date(this.info.intoEndtime?.replaceAll('-', '/')).getTime() // 进场结束
const outSTimes = new Date(this.info.exitBegintime?.replaceAll('-', '/')).getTime() // 离场开始
const outETimes = new Date(this.info.exitEndtime?.replaceAll('-', '/')).getTime() // 离场结束
if (this.info.clockRange > this.distance && (this.info.intoClock && (inSTimes < times && times < inETimes)) || (this.info.exitClock && outSTimes < times && times < outETimes)) {
return `已打卡`
}
if (this.info.clockRange > this.distance && (!this.info.intoClock && (times > inSTimes && times < inETimes)) || !this.info.exitClock && (times > outSTimes && times < outETimes)) {
return `打卡签到`
}
return `打卡签到`
}
},
methods: {