| | |
| | | <template> |
| | | <view class="content"> |
| | | <!-- 自定义顶部导航栏 --> |
| | | <view class="uni-nav-bar-info" :fixed="true" :status-bar="true"> |
| | | <!-- <view class="uni-nav-bar-info" :fixed="true" :status-bar="true"> |
| | | <view class="uni-nav-bar-left" @click="goBack()"> |
| | | <image src="../../static/images/nav/back02.png" /> |
| | | </view> |
| | |
| | | <view class="right"> |
| | | <view class="title-right">打卡记录</view> |
| | | </view> |
| | | </view> |
| | | </view> --> |
| | | <u-navbar |
| | | :is-back="true" |
| | | title="考勤打卡" |
| | | :background="background" |
| | | back-icon-color="#FFF" |
| | | title-color="#FFF" |
| | | > |
| | | <view class="navbar-right" slot="right">考勤记录</view> |
| | | </u-navbar> |
| | | <view class="clock-time-background"></view> |
| | | <view class="clock-time"> |
| | | <view class="clock-info"> |
| | |
| | | name:'', |
| | | jd:'', |
| | | wd:'', |
| | | address:'' |
| | | address:'', |
| | | background:{ |
| | | backgroundColor:"#0BB9C8" |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | //去打卡 |
| | | goClock() { |
| | | var that = this; |
| | | axios({ |
| | | method: "POST", |
| | | url: this.$store.state.piAPI + `/attendance/AppSave`, |
| | | params: { |
| | | number: this.$store.state.puserID, |
| | | name: this.name, |
| | | clockTime: this.getNowTime(1), |
| | | jd: this.jd, |
| | | wd: this.wd, |
| | | address: this.address |
| | | }, |
| | | }).then((resdata) => { |
| | | //不在考勤范围内 |
| | | if (resdata.data.code == 400) { |
| | | layui.use('layer', function() { |
| | | var layer = layui.layer; |
| | | layer.msg('打卡失败,不在考勤范围', { |
| | | icon: 0 |
| | | }); |
| | | }); |
| | | } |
| | | //打卡成功 |
| | | if (resdata.data.code == 200) { |
| | | layui.use('layer', function() { |
| | | var layer = layui.layer; |
| | | layer.msg('打卡成功!', { |
| | | icon: 1 |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | }); |
| | | uni.request({ |
| | | url: this.$store.state.piAPI + `/attendance/AppSave`, |
| | | method: "POST", |
| | | data:{ |
| | | number: this.$store.state.puserID, |
| | | name: this.name, |
| | | clockTime: this.getNowTime(1), |
| | | jd: this.jd, |
| | | wd: this.wd, |
| | | address: this.address |
| | | }, |
| | | success(resdata) { |
| | | //不在考勤范围内 |
| | | if (resdata.data.code == 400) { |
| | | uni.showToast({ |
| | | title: '不在考勤范围,打卡失败!', |
| | | icon:'none', |
| | | duration: 2000 |
| | | }); |
| | | } |
| | | //打卡成功 |
| | | if (resdata.data.code == 200) { |
| | | uni.showToast({ |
| | | title: '打卡成功!', |
| | | icon:'success', |
| | | duration: 2000 |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | //获取当前时间 |
| | |
| | | page{ |
| | | width: 100%; |
| | | height: 100%; |
| | | background-color: #FCFBFC; |
| | | /* background-color: #FCFBFC; */ |
| | | background-color: #F7f7f7; |
| | | } |
| | | </style> |
| | | |
| | |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | |
| | | .navbar-right{ |
| | | color: #fff; |
| | | font-size: 0.7rem; |
| | | margin-right: 1.5rem; |
| | | margin-top: 0.2rem; |
| | | } |
| | | |
| | | .content{ |
| | |
| | | .clock-time-background{ |
| | | width: 100%; |
| | | height: 15rem; |
| | | background-color: #F5F5F5; |
| | | // background-color: #F5F5F5; |
| | | background-color: #F3F3F3; |
| | | } |
| | | |
| | | |
| | |
| | | height: 6rem; |
| | | border-radius: 100px; |
| | | color: #FFFFFF; |
| | | background-image: linear-gradient(to bottom,#65CBA9,#66D0AC); |
| | | background-image: linear-gradient(to bottom,#0FD0E1,#0FD0E1); |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |