|
|
@@ -3,9 +3,9 @@ |
|
|
|
<view v-if="ready" class="contentBox"> |
|
|
|
<view class="content" id="attendContent"> |
|
|
|
<view id="show">{{now}}</view> |
|
|
|
<div class="pen" @click="action('dk')"> |
|
|
|
<view class="pen" @click="action('dk')"> |
|
|
|
<img id="attimg" :src="imgsrc" alt="" width="100%"> |
|
|
|
</div> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="footer"> |
|
|
|
<img src="../../common/images/2.png" alt="" width="100%"> |
|
|
@@ -26,7 +26,7 @@ |
|
|
|
*/ |
|
|
|
|
|
|
|
/** |
|
|
|
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 |
|
|
|
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 |
|
|
|
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录: |
|
|
|
* { "path": "pages/AttendanceCard/list", "style": { "navigationBarTitleText": "考勤打卡" } } |
|
|
|
* |
|
|
@@ -52,7 +52,7 @@ export default { |
|
|
|
now: null, |
|
|
|
imgsrc:dk, |
|
|
|
ready: false, |
|
|
|
|
|
|
|
timer:'', |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
@@ -66,7 +66,7 @@ export default { |
|
|
|
this.LOADING('加载数据中...') |
|
|
|
|
|
|
|
this.now = this.getCurrentTime() |
|
|
|
setInterval(this.getCurrentTime,1000) |
|
|
|
this.timer = setInterval(this.getCurrentTime,1000) |
|
|
|
|
|
|
|
await this.judgeIsDK() |
|
|
|
|
|
|
@@ -78,17 +78,18 @@ export default { |
|
|
|
async action(type) { |
|
|
|
switch (type) { |
|
|
|
case 'dk': |
|
|
|
if(this.imgsrc == "dkred"){ |
|
|
|
if(this.imgsrc == dkred){ |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.HTTP_POST('learun/adms/attendance/clockin', {}, '打卡失败').then(success => { |
|
|
|
this.LOADING() |
|
|
|
this.HTTP_POST('learun/adms/attendance/clockin', {}, '打卡失败').then(success => { |
|
|
|
this.HIDE_LOADING() |
|
|
|
if(!success) { |
|
|
|
this.TOAST('打卡失败') |
|
|
|
return |
|
|
|
} |
|
|
|
this.TOAST('打卡成功','success') |
|
|
|
setTimeout(this.back,1000) |
|
|
|
setTimeout(this.back,500) |
|
|
|
|
|
|
|
}) |
|
|
|
return |
|
|
@@ -122,9 +123,11 @@ export default { |
|
|
|
let mf = nowDate.getMinutes()<10 ? '0'+nowDate.getMinutes() : nowDate.getMinutes(); |
|
|
|
let ss = nowDate.getSeconds()<10 ? '0'+nowDate.getSeconds() : nowDate.getSeconds(); |
|
|
|
this.now = hh+':'+mf+':'+ss; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
destroyed() { |
|
|
|
clearInterval(this.timer) |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|