liuyg
2021-07-04 db9cf0e24e4d0a3953a98eb222a643eece4a6748
pages/clockSignIn/clockSignIn.vue
@@ -1,7 +1,7 @@
<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>
@@ -9,7 +9,16 @@
         <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">
@@ -51,7 +60,10 @@
            name:'',
            jd:'',
            wd:'',
            address:''
            address:'',
            background:{
               backgroundColor:"#0BB9C8"
            }
         }
      },
      mounted() {
@@ -105,38 +117,36 @@
         //去打卡
         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
                     });
                  }
               }
             })
         },
         
         //获取当前时间
@@ -185,7 +195,8 @@
   page{
      width: 100%;
      height: 100%;
      background-color: #FCFBFC;
      /* background-color: #FCFBFC; */
      background-color: #F7f7f7;
   }
</style>
@@ -211,6 +222,14 @@
      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{
@@ -266,7 +285,8 @@
      .clock-time-background{
         width: 100%;
         height: 15rem;
         background-color: #F5F5F5;
         // background-color: #F5F5F5;
         background-color: #F3F3F3;
      }
      
      
@@ -343,7 +363,7 @@
                     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;