heikabujianai %!s(int64=5) %!d(string=hai) anos
pai
achega
f2895e7dd4

+ 9 - 1
api/api.js

@@ -73,8 +73,16 @@ const url = {
   saveHpComplaintAdvice: '/f/api/hpComplaintAdvice/saveHpComplaintAdvice',//POST保存投诉建议
   saveHpUserLog: '/f/api/hpComplaintAdvice/saveHpUserLog',//POST保存日志
   logout_new: '/f/api/login/logout_new',//POST注销账户
+  punchClockNeedInfo: '/f/api/punchClock/punchClockNeedInfo', // 进入打卡页面获取打卡信息
+  savePunchClock: '/f/api/punchClock/savePunchClock', // 打卡接口
+  currentSettlement: '/f/api/wsSettlement/currentSettlement',// 当月汇总
+  monthTotalSettlement: '/f/api/wsSettlement/monthTotalSettlement',// 月打卡情况集合
+  monthSettlement: '/f/api/wsSettlement/monthSettlement',// 当月汇总
+  daySettlement: '/f/api/wsSettlement/daySettlement',// 日数据查询
+  weekSettlement: '/f/api/wsSettlement/weekSettlement',// 周数据统计
+
   getCompanyStatus: '/f/api/hpinterview/getCompanyStatus',//GET面试登记获取企业状态
-  getIntentCompany:'/f/api/qdCheckIns/getIntentCompany', // GET 查询用户是否签到并在用户未签到情况下返回意向企业
+  getIntentCompany: '/f/api/qdCheckIns/getIntentCompany', // GET 查询用户是否签到并在用户未签到情况下返回意向企业
   /** +++++++++++++++++++++++++++  废弃接口 ++++++++++++++++++++++++++++++++++++++ */
   // userLogin: '/wxAppletsLogin/wxVoteLogin', // post ,根据微信CODE获取微信用户信息
   // userLogin: '/f/api/wxAppletsLogin/decodeUserInfo',

+ 13 - 3
pages/clock/clock-success/clock-success.js

@@ -9,7 +9,10 @@ Page({
    */
   data: {
     imgServerUrl,
-    status: 0
+    clockType: 0,
+    sumMoney: 0,
+    duration: 0,
+    todayMoney: 0,
   },
   checkResult() {
     wx.navigateBack({
@@ -20,11 +23,18 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    if (options.status) {
+    if (options.clockType) {
       this.setData({
-        status: options.status
+        clockType: options.clockType,
+        sumMoney: options.sumMoney,
+        duration: options.duration,
+todayMoney: options.todayMoney,
       })
     }
+    const date = new Date()
+    this.setData({
+      time: [date.getHours(), date.getMinutes()].map(val => val.toString()[1] ? val : '0' + val).join(':')
+    })
   },
 
   /**

+ 11 - 11
pages/clock/clock-success/clock-success.wxml

@@ -1,31 +1,31 @@
 <!--pages/clock/clock-success/clock-success.wxml-->
-
-<view class="container" wx:if="{{status}}">
+<wxs src="../clock.wxs" module="clock"></wxs>
+<view class="container" wx:if="{{clockType}}">
   <view class="clock-success">
-    <text wx:if="{{status === '3'}}">上班打卡成功</text>
-    <text wx:if="{{status === '4'}}">下班打卡成功</text>
+    <text wx:if="{{clockType === '1'}}">上班打卡成功</text>
+    <text wx:if="{{clockType === '2'}}">下班打卡成功</text>
   </view>
   <view class="time">
-    打卡时间 18:30
+    打卡时间 {{time}}
   </view>
   <image src="{{imgServerUrl}}/images/clock/clock-success.png"></image>
   <view class="money">
     <text>累计预支</text>
-    <text class="number">81.7</text>
+    <text class="number">{{clock.toFixed(sumMoney)}}</text>
     <text>元</text>
   </view>
-  <view class="end" wx:if="{{status === '3'}}">
+  <view class="end" wx:if="{{clockType === '1'}}">
     <view>新的一天开始啦!</view>
     <view>今天的你也要光芒万丈!记得下班也要打卡哦!</view>
   </view>
-  <view class="end" wx:if="{{status === '4'}}">
+  <view class="end" wx:if="{{clockType === '2'}}">
     <view>
-      <text>今日打卡已完成,打卡时长</text> <text class="number">10</text>
+      <text>今日打卡已完成,打卡时长</text> <text class="number">{{duration}}</text>
       <text>小时,</text>
     </view>
     <view>
-      <text>本周累计预支工资</text>
-      <text class="number">21.88</text>
+      <text> 可预支工资 </text>
+      <text class="number">{{clock.toFixed(todayMoney)}}</text>
       <text>元。明天也要努力哦!</text>
     </view>
   </view>

+ 32 - 53
pages/clock/clock-tongji/calendar/calendar.js

@@ -4,24 +4,19 @@ Component({
    * 组件的属性列表
    */
   properties: {
-
+    list: {
+      type: Array,
+      value: []
+    },
   },
 
   /**
    * 组件的初始数据
    */
   data: {
-    weeks: ["日", "一", "二", "三", "四", "五", "六"],
-
-    // 所选择日期
-    selectDate: {
-      'year': new Date().getFullYear(),
-      'month': new Date().getMonth() + 1,
-      'date': new Date().getDate(),
-    },
-
-    calendarTitle: '',
-
+    weeks: ["一", "二", "三", "四", "五", "六", "日"],
+    selectedIndex: '',
+    selectedDay: {},
     // 日期list 
     calendarDays: []
   },
@@ -47,22 +42,10 @@ Component({
       let lastDate = new Date(year, month - 1, days) //当月最后一天日期
       let lastDay = lastDate.getDay() //当月最后一天对应的星期
 
-      // 更新选择日期
-      this.data.selectDate = {
-        'year': year,
-        'month': month,
-        'date': date,
-      }
-
-      // 更新顶部显示日期
-      this.setData({
-        calendarTitle: year + "/" + (month > 9 ? month : "0" + month) + "/" + (date > 9 ? date : "0" + date)
-      })
-
       let calendarDays = []
 
       // 上个月显示的天数及日期
-      for (let i = firstDay - 1; i >= 0; i--) {
+      for (let i = firstDay - 2; i >= 0; i--) {
         let date = new Date(year, month - 1, -i)
         //console.log(date, date.getMonth() + 1)
 
@@ -72,39 +55,41 @@ Component({
           'date': date.getDate(),
           'day': date.getDay(),
           'current': false,
-          'selected': false
         })
       }
 
       // 当月显示的日期
       for (let i = 1; i <= days; i++) {
-        calendarDays.push({
+        let index = calendarDays.push({
           'year': year,
           'month': month,
           'date': i,
           'day': new Date(year, month - 1, i).getDay(),
           'current': true,
-          'selected': i == date // 判断当前日期
         })
+        if (i == date) {
+          this.setData({
+            selectedIndex: index - 1,
+            selectedDay: calendarDays[index - 1]
+          })
+          console.log(calendarDays[index - 1])
+        }
       }
 
       // 下个月显示的天数及日期
-      for (let i = 1; i < 7 - lastDay; i++) {
+      for (let i = 1; i <= 7 - lastDay; i++) {
         let date = new Date(year, month, i)
-        //console.log(date, date.getMonth() + 1)
-
         calendarDays.push({
           'year': date.getFullYear(),
           'month': date.getMonth() + 1,
           'date': date.getDate(),
           'day': date.getDay(),
           'current': false,
-          'selected': false
         })
       }
-      console.log(calendarDays)
       this.setData({
-        calendarDays: calendarDays
+        calendarDays,
+        month
       })
     },
 
@@ -112,26 +97,20 @@ Component({
     clickDate(e) {
       let index = e.currentTarget.dataset.index
       let list = this.data.calendarDays
-      for (let i = 0; i < list.length; i++) {
-        list[i].selected = i == index
-        if (i == index) {
-          console.log(list[i], this.data.selectDate)
-          // 如果选择日期不在当月范围内,则重新刷新日历数据
-          if (list[i].year != this.data.selectDate.year || list[i].month != this.data.selectDate.month) {
-            let date = new Date(list[i].year, list[i].month - 1, list[i].date)
-            this.getMonthDaysCurrent(date)
-            return
-          }
-          // 更新顶部显示日期
-          this.setData({
-            calendarTitle: list[i].year + "/" + (list[i].month > 9 ? list[i].month : "0" + list[i].month) + "/" + (list[i].date > 9 ? list[i].date : "0" + list[i].date)
-          })
-        }
+      if (list[index].current) {
+        this.triggerEvent('day', list[index])
+        this.setData({
+          calendarDays: list,
+          selectedIndex: index,
+          selectedDay: list[index]
+        })
       }
-
-      this.setData({
-        calendarDays: list
-      })
     },
+    next() {
+      this.getMonthDaysCurrent(new Date(this.data.selectedDay.year, this.data.selectedDay.month, 1))
+    },
+    last() {
+      this.getMonthDaysCurrent(new Date(this.data.selectedDay.year, this.data.selectedDay.month - 2, 1))
+    }
   }
 })

+ 17 - 4
pages/clock/clock-tongji/calendar/calendar.wxml

@@ -1,6 +1,19 @@
 <!--pages/clock/clock-tongji/calendar/calendar.wxml-->
-<view class='calendar-background display-space-between'>
-  <view class='calendar-item' wx:for="{{weeks}}" wx:key="index">{{item}}</view>
-  <view class='calendar-item {{item.current ? "":"text-gray"}} {{item.selected ? "text-red":""}}'
-    wx:for="{{calendarDays}}" wx:key="index" data-index='{{index}}' bindtap='clickDate'>{{item.date}}</view>
+<wxs src="./calendar.wxs" module="calendar"></wxs>
+<view class='calendar'>
+  <view class="title">
+    <view class='title-item' wx:for="{{weeks}}" wx:key="index">
+      <text>{{item}}</text>
+    </view>
+  </view>
+  <view class="calendar-content">
+    <view class='calendar-item {{item.current ? "":"text-gray"}} {{selectedIndex === index ? "text-red":""}}'
+      wx:for="{{calendarDays}}" wx:key="index" data-index='{{index}}' bindtap='clickDate'>
+      <text>{{item.date}}</text>
+      <block wx:if="{{item.current}}">
+        <view class="point {{calendar.getClass(list[item.date - 1])}}"></view>
+      </block>
+    </view>
+  </view>
+
 </view>

+ 14 - 0
pages/clock/clock-tongji/calendar/calendar.wxs

@@ -0,0 +1,14 @@
+// 获取是否打卡class
+function getClass(json) {
+  if (json) {
+    if (json.startPunchClock && json.endPunchClock) {
+      return 'all';
+    } else if (json.startPunchClock || json.endPunchClock) {
+      return 'shortage';
+    }
+  }
+  return ''
+}
+module.exports = {
+  getClass: getClass
+};

+ 68 - 8
pages/clock/clock-tongji/calendar/calendar.wxss

@@ -1,13 +1,49 @@
 /* pages/clock/clock-tongji/calendar/calendar.wxss */
-.calendar-background {
-  font-size: 24rpx;
-  padding-top: 20rpx;
+.calendar {
+  font-size: 30rpx;
+  box-sizing: border-box;
+}
+
+.title,
+.calendar-content {
+  overflow: hidden;
+}
+
+.title-item {
+  width: 72rpx;
+  height: 72rpx;
+  font-size: 26rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #999999;
+  margin-right: 30rpx;
+  float: left;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.title-item:last-child {
+  margin-right: 0;
 }
 
 .calendar-item {
-  width: 14%;
-  height: 50rpx;
-  text-align: center;
+  width: 72rpx;
+  height: 72rpx;
+  margin-top: 15rpx;
+  font-family: PingFangSC-Semibold, PingFang SC;
+  font-weight: 600;
+  color: #000;
+  float: left;
+  margin-right: 30rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  position: relative;
+}
+
+.calendar-item:nth-child(7n) {
+  margin-right: 0;
 }
 
 .display-space-between {
@@ -18,9 +54,33 @@
 }
 
 .text-gray {
-  color: #878787;
+  color: #999;
 }
 
 .text-red {
-  color: #F87474;
+  width: 72rpx;
+  height: 72rpx;
+  font-weight: 600;
+  color: #FFFFFF;
+  background: #0177FF;
+  border-radius: 100%;
+}
+
+.point {
+  height: 10rpx;
+  width: 10rpx;
+  position: absolute;
+  left: 30rpx;
+  bottom: -8rpx;
+  border-radius: 100%;
+}
+
+.all {
+  background-color: #FD7235;
+  border: 2rpx solid #FFFFFF;
+}
+
+.shortage {
+  background-color: #BCBCBC;
+  border: 2rpx solid #FFFFFF;
 }

+ 122 - 3
pages/clock/clock-tongji/index.js

@@ -1,18 +1,137 @@
 // pages/clock/clock-tongji/index.js
+import {
+  monthTotalSettlement,
+  currentSettlement,
+  daySettlement
+} from '../../../services/index.js'
+
+import {
+  imgServerUrl
+} from '../../../config/config.js'
 Page({
 
   /**
     * 页面的初始数据
     */
   data: {
-   
+    wsPunchClockList: [],
+    currentSettlement: {},
+    imgServerUrl,
+    next: `${imgServerUrl}/images/clock/clock-arrow-righr-disabled.png`,
+    last: `${imgServerUrl}/images/clock/clock-arrow-left.png`,
+    text: '',
+    currentDuration: 0,
+    punckClockList: [],
+    nextMoney: 0
+  },
+  toList() {
+    wx.navigateTo({
+      url: './list',
+    })
+  },
+  getList(month_type) {
+    monthTotalSettlement({ month_type }).then(data => {
+      this.setData({
+        wsPunchClockList: data.data.wsPunchClockList
+      })
+    })
+  },
+  getCurrent() {
+    currentSettlement().then(data => {
+      this.setData({
+        currentSettlement: data.data.currentSettlement
+      })
+    })
+  },
+  next() {
+    if (this.data.text < this.data.mouth) {
+      this.selectComponent('.calendar').next()
+      this.getList(1)
+      this.setData({
+        text: new Date().getMonth() + 1,
+        next: `${imgServerUrl}/images/clock/clock-arrow-righr-disabled.png`,
+        last: `${imgServerUrl}/images/clock/clock-arrow-left.png`,
+      }, _ => {
+        let { year, text } = this.data
+        const search_date = [year, text, 1].map(val => {
+          const number = val.toString()
+          return number[1] ? number : '0' + number
+        }).join('-')
+        this.getDay(search_date)
+      })
+    }
+  },
+  last() {
+    if (this.data.text === this.data.mouth) {
+      this.selectComponent('.calendar').last()
+      this.getList(2)
+      if (new Date().getMonth() - 1 < 0) {
+        this.setData({
+          text: 12
+        }, _ => {
+          let { year, month } = this.data
+          const search_date = [year, month, 1].map(val => {
+            const number = val.toString()
+            return number[1] ? number : '0' + number
+          }).join('-')
+          this.getDay(search_date)
+
+        })
+      } else {
+        this.setData({
+          text: new Date().getMonth()
+        }, _ => {
+          let { year, text } = this.data
+          const search_date = [year, text, 1].map(val => {
+            const number = val.toString()
+            return number[1] ? number : '0' + number
+          }).join('-')
+          this.getDay(search_date)
+        })
+      }
+      this.setData({
+        next: `${imgServerUrl}/images/clock/clock-arrow-righr.png`,
+        last: `${imgServerUrl}/images/clock/clock-arrow-left-disabled.png`,
+      })
+    }
+  },
+  getDay(search_date) {
+    daySettlement({ search_date }).then(data => {
+      this.setData({
+        punckClockList: data.data.punckClockList,
+        nextMoney: data.data.nextMoney,
+        currentDuration: data.data.currentDuration,
+      })
+    })
+  },
+  day(e) {
+    let { year, month, day } = e.detail
+    const search_date = [year, month, day].map(val => {
+      const number = val.toString()
+      return number[1] ? number : '0' + number
+    }).join('-')
+    this.getDay(search_date)
   },
-
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-
+    const date = new Date()
+    let year = date.getFullYear()
+    let month = date.getMonth() + 1
+    let day = date.getDate()
+    const search_date = [year, month, day].map(val => {
+      const number = val.toString()
+      return number[1] ? number : '0' + number
+    }).join('-')
+    this.getList(1)
+    this.getCurrent()
+    this.getDay(search_date)
+    this.setData({
+      text: month,
+      mouth: month,
+      year
+    })
   },
 
   /**

+ 86 - 1
pages/clock/clock-tongji/index.wxml

@@ -1,2 +1,87 @@
 <!--pages/clock/clock-tongji/index.wxml-->
-<calendar />  
+<wxs src="../clock.wxs" module="clock"></wxs>
+<view class="container">
+  <view class="header">
+    <view class="header-title" bindtap="toList">
+      <text>{{mouth}}月汇总</text>
+      <image src="{{imgServerUrl}}/images/clock/clock-arrow-righr-disabled.png"></image>
+    </view>
+    <view class="header-content">
+      <view class="header-content-items">
+        <view class="number">{{clock.toFixed(currentSettlement.nextMoney)}}</view>
+        <view class="name">总预支(元)</view>
+      </view>
+      <view class="header-content-items">
+        <view class="number">{{clock.toFixed(currentSettlement.countDuration)}}</view>
+        <view class="name">总工时(小时)</view>
+      </view>
+      <view class="header-content-items">
+        <view class="number">{{clock.toFixed(currentSettlement.lackClock)}}</view>
+        <view class="name">缺卡(次)</view>
+      </view>
+    </view>
+  </view>
+  <view class="calendar-content">
+    <view class="calendar-content-header">
+      <view>月统计数据</view>
+      <view class="calendar-content-choose">
+        <view class="last" bindtap="last">
+          <image src="{{last}}"></image>
+        </view>
+        <text class="calendar-content-choose-text">{{text}}月</text>
+        <view class="next" bindtap="next">
+          <image src="{{next}}"></image>
+        </view>
+      </view>
+    </view>
+    <calendar class="calendar" list="{{wsPunchClockList}}" bind:day='day' />
+  </view>
+  <view class="clock-detail">
+    <view class="titps">
+      <view>请根据企业实际上下班时间打卡</view>
+      <view>今日打卡{{punckClockList.length}}次,工时{{currentDuration}}小时</view>
+    </view>
+    <view class="clock" wx:if='{{punckClockList.length}}'>
+      <view class="clock-content" wx:for="{{punckClockList}}" wx:key='index'>
+        <view class="left">
+          <view class="top" wx:if="{{item.clockType === 1}}"></view>
+          <block wx:else>
+            <view class="midden"></view>
+            <view class="bottom"></view>
+          </block>
+        </view>
+        <view class="right">
+          <view class="clock-in" wx:if="{{item.clockType === 1}}">
+            <view class="clock-type">上班 {{item.punchClock}}</view>
+            <view class="address">
+              <image src="{{imgServerUrl}}/images/clock/clock-position.png" class="position"></image>
+              <text>{{item.companyName}}</text>
+            </view>
+          </view>
+          <view class="clock-out" wx:if="{{item.clockType === 2}}">
+            <view class="clock-type">下班 {{item.punchClock}}</view>
+            <view class="address">
+              <image src="{{imgServerUrl}}/images/clock/clock-position.png" class="position"></image>
+              <text>{{item.companyName}}</text>
+            </view>
+          </view>
+          <view class="clock-out" wx:if="{{item.clockType === 3}}">
+            <view class="clock-type">下班<text class="shortage">缺卡</text></view>
+            <view class="address">
+              <image src="{{imgServerUrl}}/images/clock/clock-position.png" class="position"></image>
+              <text>获取定位失败</text>
+            </view>
+          </view>
+        </view>
+      </view>
+    </view>
+    <view class="nextMoney">
+      <view class="nextMoney-message">当日可预支工资:</view>
+      <view class="money">
+        <text>{{nextMoney}}</text>
+        <text>元</text>
+      </view>
+    </view>
+  </view>
+
+</view>

+ 219 - 0
pages/clock/clock-tongji/index.wxss

@@ -1,2 +1,221 @@
 /* pages/clock/clock-tongji/index.wxss */
+page {
+  background: #F5F5F5;
+}
 
+.header {
+  height: 320rpx;
+  padding: 30rpx;
+  background: #fff;
+  box-sizing: border-box;
+  margin-top: 20rpx;
+  display: flex;
+  align-items: center;
+  justify-content: space-around;
+  flex-direction: column;
+}
+
+.header-title {
+  width: 100%;
+  font-size: 34rpx;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: 500;
+  color: #000000;
+  box-sizing: border-box;
+  padding: 0 15rpx;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.header-title image {
+  width: 18rpx;
+  height: 30rpx;
+}
+
+.header-content {
+  width: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: space-around;
+}
+
+.header-content-items {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  flex-direction: column;
+}
+
+.number {
+  font-size: 58rpx;
+  font-family: DINCondensed-Bold, DINCondensed;
+  font-weight: bold;
+  color: #000000;
+}
+
+.name {
+  font-size: 26rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #444444;
+}
+
+.calendar-content {
+  padding: 30rpx;
+  background: #fff;
+}
+
+.calendar-content-header {
+  height: 138rpx;
+  font-size: 34rpx;
+  font-family: PingFangSC-Semibold, PingFang SC;
+  font-weight: 600;
+  color: #000000;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.calendar-content-choose {
+  font-size: 28rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #000000;
+  display: flex;
+  align-items: center;
+}
+
+.last,
+.next {
+  height: 100%;
+  width: 60rpx;
+  display: flex;
+  align-items: center;
+}
+
+.next {
+  justify-content: flex-end;
+}
+
+.calendar-content-choose image {
+  height: 29rpx;
+  width: 17rpx;
+}
+
+.calendar {
+  background: #fff;
+}
+
+.clock-detail {
+  margin-top: 20rpx;
+  background: #fff;
+  padding: 30rpx;
+}
+
+.titps {
+  font-size: 26rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #666666;
+  margin-top: 20rpx;
+  margin-bottom: 100rpx;
+}
+
+.clock-content {
+  margin-top: 50rpx;
+  overflow: hidden;
+}
+
+.left {
+  float: left;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  flex-direction: column;
+  margin-right: 30rpx;
+}
+
+.top,
+.bottom {
+  width: 16rpx;
+  height: 16rpx;
+  background: #BBBBBB;
+  border-radius: 100%;
+}
+
+.top {
+  margin-top: 15rpx;
+}
+
+.midden {
+  width: 2rpx;
+  height: 154rpx;
+  background: #DDDDDD;
+}
+
+.right {
+  float: left;
+}
+
+.clock {
+  margin-bottom: 113rpx;
+}
+
+.clock-type {
+  font-size: 34rpx;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: 500;
+  color: #000000;
+}
+
+.address {
+  font-size: 28rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #666666;
+  margin-top: 10rpx;
+  display: flex;
+  align-items: center;
+}
+
+.position {
+  width: 23rpx;
+  height: 28rpx;
+  margin-right: 15rpx;
+}
+
+.clock-out {
+  margin-top: 75rpx;
+}
+
+.shortage {
+  font-size: 34rpx;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: 500;
+  color: #FD7235;
+}
+
+.nextMoney {
+  font-size: 26rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #000000;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.money {
+  font-size: 26rpx;
+  font-family: PingFangSC-Semibold, PingFang SC;
+  font-weight: 600;
+  color: #000000;
+}
+
+.money text:first-child {
+  font-size: 58rpx;
+  font-family: DINCondensed-Bold, DINCondensed;
+  font-weight: bold;
+  color: #0177FF;
+}

+ 91 - 3
pages/clock/clock-tongji/list.js

@@ -1,6 +1,8 @@
 // pages/clock/clock-tongji/list.js
 import {
-  getCenterInfo
+  getCenterInfo,
+  weekSettlement,
+  monthSettlement
 } from '../../../services/index.js'
 import {
   imgServerUrl
@@ -11,10 +13,86 @@ Page({
    * 页面的初始数据
    */
   data: {
-    avatar: "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2034740944,4251903193&fm=26&gp=0.jpg",
-    imgServerUrl
+    avatar: wx.getStorageSync('userInfo').avatarUrl,
+    imgServerUrl,
+    mouthNext: `${imgServerUrl}/images/clock/clock-arrow-righr-disabled.png`,
+    mouthLast: `${imgServerUrl}/images/clock/clock-arrow-left.png`,
+    weekNext: `${imgServerUrl}/images/clock/clock-arrow-righr-disabled.png`,
+    weekLast: `${imgServerUrl}/images/clock/clock-arrow-left.png`,
+    mouthData: {},
+    weekData: {},
+    mouth: '',
+    defaultmouth: '',
+    week: '本周'
+  },
+  getMouth(month_type) {
+    monthSettlement({ month_type }).then(data => {
+      this.setData({
+        mouthData: data.data.currentSettlement
+      })
+    })
   },
 
+  getWeek(week_type) {
+    weekSettlement({ week_type }).then(data => {
+      this.setData({
+        weekData: data.data.currentSettlement
+      })
+    })
+  },
+  mouthNext() {
+    if (this.data.mouth < this.data.defaultmouth) {
+      this.setData({
+        mouth: new Date().getMonth() + 1,
+        mouthNext: `${imgServerUrl}/images/clock/clock-arrow-righr-disabled.png`,
+        mouthLast: `${imgServerUrl}/images/clock/clock-arrow-left.png`,
+      }, _ => {
+        this.getMouth(1)
+      })
+    }
+  },
+  mouthLast() {
+    if (this.data.mouth === this.data.defaultmouth) {
+      if (new Date().getMonth() - 1 < 0) {
+        this.setData({
+          mouth: 12,
+          year: this.data.year - 1
+        }, _ => {
+          this.getMouth(2)
+        })
+      } else {
+        this.setData({
+          mouth: new Date().getMonth()
+        }, _ => {
+          this.getMouth(2)
+        })
+      }
+      this.setData({
+        mouthNext: `${imgServerUrl}/images/clock/clock-arrow-righr.png`,
+        mouthLast: `${imgServerUrl}/images/clock/clock-arrow-left-disabled.png`,
+      })
+    }
+  },
+  weekLast() {
+    if (this.data.week === '本周') {
+      this.setData({
+        week: '上周',
+        weekNext: `${imgServerUrl}/images/clock/clock-arrow-righr.png`,
+        weekLast: `${imgServerUrl}/images/clock/clock-arrow-left-disabled.png`,
+      })
+      this.getWeek(2)
+    }
+  },
+  weekNext() {
+    if (this.data.week === '上周') {
+      this.setData({
+        week: '本周',
+        weekLast: `${imgServerUrl}/images/clock/clock-arrow-left.png`,
+        weekNext: `${imgServerUrl}/images/clock/clock-arrow-right-disabled.png`,
+      })
+      this.getWeek(1)
+    }
+  },
   /**
    * 生命周期函数--监听页面加载
    */
@@ -27,6 +105,16 @@ Page({
         approveStatus, // 认证状态(0:未认证 1:等待认证 2:未通过 3:已认证) ,
       })
     })
+    this.getMouth(1)
+    this.getWeek(1)
+    const date = new Date()
+    let month = date.getMonth() + 1
+    let year = date.getFullYear()
+    this.setData({
+      defaultmouth: month,
+      mouth: month,
+      year
+    })
   },
 
   /**

+ 25 - 12
pages/clock/clock-tongji/list.wxml

@@ -1,4 +1,5 @@
 <!--pages/clock/clock-tongji/list.wxml-->
+<wxs src="../clock.wxs" module="clock"></wxs>
 <view class="container">
   <view class="header">
     <view class="avatar">
@@ -16,49 +17,61 @@
   <view class="mouth">
     <view class="title">
       <view>月统计数据</view>
-      <view class="time">
-        <text>本月</text>
+      <view class="calendar-content-choose">
+        <view class="last" bindtap="mouthLast">
+          <image src="{{mouthLast}}"></image>
+        </view>
+        <text class="calendar-content-choose-text">{{year}}-{{mouth>10?mouth:'0'+mouth}}</text>
+        <view class="next" bindtap="mouthNext">
+          <image src="{{mouthNext}}"></image>
+        </view>
       </view>
     </view>
     <view class="content">
       <view class="label">总预支:</view>
-      <view class="value">261.44 元</view>
+      <view class="value">{{clock.toFixed(mouthData.nextMoney)}} 元</view>
     </view>
     <view class="content">
       <view class="label">总工时:</view>
-      <view class="value">23.0 小时</view>
+      <view class="value">{{clock.toFixed(mouthData.countDuration)}} 小时</view>
     </view>
     <view class="content">
       <view class="label">打卡天数:</view>
-      <view class="value"> 4 天</view>
+      <view class="value">{{mouthData.attendance || 0}} 天</view>
     </view>
     <view class="content">
       <view class="label">缺卡:</view>
-      <view class="value">0 次</view>
+      <view class="value">{{mouthData.lackClock || 0}} 次</view>
     </view>
   </view>
   <view class="week">
     <view class="title">
       <view>周统计数据</view>
-      <view class="time">
-        <text>本周</text>
+      <view class="calendar-content-choose">
+        <view class="last" bindtap="weekLast">
+          <image src="{{weekLast}}"></image>
+        </view>
+        <text class="calendar-content-choose-text">{{week}}</text>
+        <view class="next" bindtap="weekNext">
+          <image src="{{weekNext}}"></image>
+        </view>
       </view>
     </view>
     <view class="content">
       <view class="label">总预支:</view>
-      <view class="value">261.44 元</view>
+      <view class="value">{{clock.toFixed(weekData.nextMoney)}} 元</view>
     </view>
     <view class="content">
       <view class="label">总工时:</view>
-      <view class="value">23.0 小时</view>
+      <view class="value">{{clock.toFixed(weekData.countDuration)}} 小时</view>
     </view>
     <view class="content">
       <view class="label">打卡天数:</view>
-      <view class="value"> 4 天</view>
+      <view class="value">{{weekData.attendance || 0}} 天</view>
     </view>
     <view class="content">
       <view class="label">缺卡:</view>
-      <view class="value">0 次</view>
+      <view class="value">{{weekData.lackClock || 0}} 次</view>
     </view>
   </view>
 </view>

+ 26 - 1
pages/clock/clock-tongji/list.wxss

@@ -91,4 +91,29 @@ page {
 
 .label {
   color: #666666;
-}
+}
+.calendar-content-choose {
+  font-size: 28rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #000000;
+  display: flex;
+  align-items: center;
+}
+
+.last,
+.next {
+  height: 100%;
+  width: 60rpx;
+  display: flex;
+  align-items: center;
+}
+
+.next {
+  justify-content: flex-end;
+}
+
+.calendar-content-choose image {
+  height: 29rpx;
+  width: 17rpx;
+}

+ 200 - 96
pages/clock/clock.js

@@ -1,6 +1,7 @@
 // pages/clock/clock.js
 import {
-  getCenterInfo
+  punchClockNeedInfo,
+  savePunchClock
 } from '../../services/index.js'
 import {
   imgServerUrl
@@ -13,8 +14,6 @@ Page({
   data: {
     approveStatus: false,
     imgServerUrl,
-    time: '42.0',
-    money: '170.94',
     navigation: [
       {
         image: '/images/clock/clock-tongji.png',
@@ -29,108 +28,162 @@ Page({
         text: '客服'
       },
     ],
-    status: 0,
+    clockType: 3,
     statusImage: `${imgServerUrl}/images/clock/clock-beyond.png`,
     statusIcon: `${imgServerUrl}/images/clock/clock-waring.png`,
     statusMessage: `请进入企业后再进行打卡`,
+    startPunch: "未完成",
+    endPunch: '未完成',
+    todayMoney: 0,
+    sumDuration: 0,
+    sumMoney: 0,
+    wsPunchClockId: null
   },
   getLocation() {
-    wx.getLocation({
-      success: data => {
-        console.log(data)
-        this.setData({
-          statusImage: `${imgServerUrl}/images/clock/clock-in.png`,
-          statusIcon: `${imgServerUrl}/images/clock/clock-can.png`,
-          status: 1
-        })
-      },
-      fail: res => {
-        console.log(res)
-      }
+    return new Promise(reslove => {
+      wx.getLocation({
+        type: 'gcj02 ',
+        success: data => {
+          reslove(data)
+        },
+        fail: res => {
+          console.log(res)
+        }
+      })
     })
   },
   location() {
-    wx.getSetting({
-      success: res => {
-        if (res.authSetting['scope.userLocation']) {
-          this.getLocation()
-        } else {
-          wx.authorize({
-            scope: 'scope.userLocation',
-            success: () => {
-              this.getLocation()
-            },
-            fail: () => {
-              wx.showModal({
-                content: '无法使用打卡功能',
-                confirmText: '去授权',
-                title: '位置信息未授权',
-                success: (result) => {
-                  if (result.confirm) {
-                    wx.openSetting({})
-                  } else {
-                    this.setData({
-                      status: 0
-                    })
-                  }
-                },
-              })
-            }
-          })
+    return new Promise((reslove, reject) => {
+      wx.getSetting({
+        success: async res => {
+          if (res.authSetting['scope.userLocation']) {
+            reslove(await this.getLocation())
+          } else {
+            wx.authorize({
+              scope: 'scope.userLocation',
+              success: async () => {
+                reslove(await this.getLocation())
+              },
+              fail: () => {
+                wx.showModal({
+                  content: '无法使用打卡功能',
+                  confirmText: '去授权',
+                  title: '位置信息未授权',
+                  success: (result) => {
+                    if (result.confirm) {
+                      wx.openSetting({})
+                    } else {
+                      this.setData({
+                        clockType: 3
+                      })
+                      reject()
+                    }
+                  },
+                })
+              }
+            })
+          }
         }
-      }
+      })
     })
   },
-  click() {
-    switch (this.data.status) {
-      case 0:
-        wx.showModal({
-          title: '提示',
-          content: '超出范围,请刷新页面获取当前位置',
-          showCancel: false,
-        })
-        break;
-      case 1:
-        this.setData({
-          statusImage: `${imgServerUrl}/images/clock/clock-out-disabled.png`,
-          statusIcon: `${imgServerUrl}/images/clock/clock-waring.png`,
-          statusMessage: `上班X小时候才能进行下班打卡`,
-          status: 2
-        })
-        setTimeout(() => {
-          this.setData({
-            statusImage: `${imgServerUrl}/images/clock/clock-out.png`,
-            statusIcon: `${imgServerUrl}/images/clock/clock-can.png`,
-            statusMessage: `已进入考勤打卡范围`,
-            status: 3
-          })
-        }, 2000)
-        wx.navigateTo({
-          url: './clock-success/clock-success?status=3'
-        })
-        break;
-      case 2:
-        wx.showModal({
-          title: '提示',
-          content: '未到下班时间,请刷新页面获取最新状态',
-          showCancel: false,
-        })
-        break;
-      case 3:
-        this.setData({
-          statusImage: `${imgServerUrl}/images/clock/clock-done.png`,
-          statusMessage: `今日打卡已完成`,
-          status: 4
-        })
-        wx.navigateTo({
-          url: './clock-success/clock-success?status=4'
-        })
-        break;
-      default:
-        break;
+  async click() {
+    const data = await this.location()
+    if (this.data.clockType === 1 && !this.data.wsPunchClockId) {
+      // this.clock(data.longitude, data.latitude)
+      this.clock(120.353312, 31.535582)
+    }
+    if (this.data.clockType === 1 && this.data.wsPunchClockId) {
+      wx.showModal({
+        title: '提示',
+        content: '未到下班时间,请刷新页面获取最新状态',
+        showCancel: false,
+      })
+    }
+    if (this.data.clockType === 2 && this.data.wsPunchClockId) {
+      this.clock(data.longitude, data.latitude)
+    }
+    if (this.data.clockType === 3) {
+      wx.showModal({
+        title: '提示',
+        content: '超出范围,请刷新页面获取当前位置',
+        showCancel: false,
+      })
+    }
+    if (this.data.clockType === 4) {
+      wx.showModal({
+        title: '提示',
+        content: '今日打卡已完成',
+        showCancel: false,
+      })
     }
+    // switch (this.data.status) {
+    //   case 0:
+    //     wx.showModal({
+    //       title: '提示',
+    //       content: '超出范围,请刷新页面获取当前位置',
+    //       showCancel: false,
+    //     })
+    //     break;
+    //   case 1:
+    //     this.setData({
+    //       statusImage: `${imgServerUrl}/images/clock/clock-out-disabled.png`,
+    //       statusIcon: `${imgServerUrl}/images/clock/clock-waring.png`,
+    //       statusMessage: `上班X小时候才能进行下班打卡`,
+    //       status: 2
+    //     })
+    //     setTimeout(() => {
+    //       this.setData({
+    //         statusImage: `${imgServerUrl}/images/clock/clock-out.png`,
+    //         statusIcon: `${imgServerUrl}/images/clock/clock-can.png`,
+    //         statusMessage: `已进入考勤打卡范围`,
+    //         status: 3
+    //       })
+    //     }, 2000)
+    //     wx.navigateTo({
+    //       url: './clock-success/clock-success?status=3'
+    //     })
+    //     break;
+    //   case 2:
+    //     wx.showModal({
+    //       title: '提示',
+    //       content: '未到下班时间,请刷新页面获取最新状态',
+    //       showCancel: false,
+    //     })
+    //     break;
+    //   case 3:
+    //     this.setData({
+    //       statusImage: `${imgServerUrl}/images/clock/clock-done.png`,
+    //       statusMessage: `今日打卡已完成`,
+    //       status: 4
+    //     })
+    //     wx.navigateTo({
+    //       url: './clock-success/clock-success?status=4'
+    //     })
+    //     break;
+    //   default:
+    //     break;
+    // }
 
   },
+  clock(longitude, latitude) {
+    savePunchClock({ longitude, latitude, clockType: this.data.clockType }).then(data => {
+      wx.showToast({
+        title: '打卡成功',
+        success: () => {
+          wx.navigateTo({
+            url: `./clock-success/clock-success?clockType=${this.data.clockType}&&sumMoney=${data.data.sumMoney}&&duration=${data.data.duration}&&todayMoney=${data.data.todayMoney}`
+          })
+        }
+      })
+    }).catch(data => {
+      wx.showModal({
+        title: '提示',
+        content: data.errmsg,
+        showCancel: false,
+      })
+    })
+  },
   navigator(e) {
     const { index } = e.currentTarget.dataset
     if (index === 0) {
@@ -149,16 +202,67 @@ Page({
       })
     }
   },
-  load() {
-    getCenterInfo().then(data => {
+  async load() {
+    const data = await this.location()
+    console.log(data)
+    // punchClockNeedInfo({ longitude: data.longitude, latitude: data.latitude }).then(data => {
+    punchClockNeedInfo({ longitude: 120.353312, latitude: 31.535582 }).then(data => {
       let {
-        approveStatus
+        authenticationStatus,
+        startPunch,
+        endPunch,
+        todayMoney,
+        clockType, // 1:上班打卡 2:下班打卡 3:超出范围 4:已完成
+        sumDuration,
+        sumMoney,
+        wsPunchClockId,
+        dailyAvailableMinHour
       } = data.data
       this.setData({
-        approveStatus, // 认证状态(0:未认证 1:等待认证 2:未通过 3:已认证) ,
+        approveStatus: authenticationStatus, // 认证状态(0:未认证 1:等待认证 2:未通过 3:已认证) ,
+        startPunch,
+        endPunch,
+        todayMoney,
+        clockType,
+        sumDuration,
+        sumMoney,
+        wsPunchClockId
       })
+      if (clockType === 1 && !wsPunchClockId) {
+        this.setData({
+          statusImage: `${imgServerUrl}/images/clock/clock-in.png`,
+          statusIcon: `${imgServerUrl}/images/clock/clock-can.png`,
+        })
+      }
+      if (clockType === 1 && wsPunchClockId) {
+        this.setData({
+          statusImage: `${imgServerUrl}/images/clock/clock-out-disabled.png`,
+          statusIcon: `${imgServerUrl}/images/clock/clock-waring.png`,
+          statusMessage: `上班${dailyAvailableMinHour}小时候才能进行下班打卡`,
+        })
+      }
+      if (clockType === 2 && wsPunchClockId) {
+        this.setData({
+          statusImage: `${imgServerUrl}/images/clock/clock-out.png`,
+          statusIcon: `${imgServerUrl}/images/clock/clock-can.png`,
+          statusMessage: `已进入考勤打卡范围`,
+        })
+      }
+      if (clockType === 3) {
+        this.setData({
+          statusImage: `${imgServerUrl}/images/clock/clock-beyond.png`,
+          statusIcon: `${imgServerUrl}/images/clock/clock-waring.png`,
+          statusMessage: `请进入企业后再进行打卡`,
+        })
+      }
+      if (clockType === 4) {
+        this.setData({
+          statusImage: `${imgServerUrl}/images/clock/clock-done.png`,
+          statusIcon: `${imgServerUrl}/images/clock/clock-can.png`,
+          statusMessage: `今日打卡已完成`,
+        })
+      }
     })
-    this.location()
   },
   /**
    * 生命周期函数--监听页面加载

+ 16 - 8
pages/clock/clock.wxml

@@ -1,5 +1,5 @@
 <!--pages/clock/clock.wxml-->
-
+<wxs src="./clock.wxs" module="clock"></wxs>
 <view class="container">
   <view class="no-authentication" wx:if="{{approveStatus === 0}}">
     <view class="header">
@@ -45,14 +45,14 @@
         <view class="time">
           <view>本周工时</view>
           <view>
-            <text class="number">{{time}}</text>
+            <text class="number">{{clock.toFixed(sumDuration)}}</text>
             <text class="unit">小时</text>
           </view>
         </view>
         <view class="money">
           <view>本周预支</view>
           <view>
-            <text class="number">{{money}}</text>
+            <text class="number">{{clock.toFixed(sumMoney)}}</text>
             <text class="unit">元</text>
           </view>
         </view>
@@ -66,15 +66,23 @@
         </view>
       </view>
     </view>
-    <view class="pass-content {{status === 4 ?'height':''}}">
+    <view class="pass-content {{clockType === 4 ?'height':''}}">
       <view class="status">
         <view class="clock-in">
           <text>上班打卡</text>
-          <text class="status-text">未完成</text>
+          <view class="clock-time">
+            <image src="{{imgServerUrl}}/images/clock/clock-success-icon.png" wx:if="{{startPunch !== '未完成' }}"></image>
+            <text class="status-text"  wx:if="{{startPunch !== '未完成' }}">{{clock.formateHS(startPunch)}} 已打卡</text>
+            <text class="status-text" wx:else>{{startPunch}}</text>
+          </view>
         </view>
         <view class="clock-out">
           <text>上班打卡</text>
-          <text class="status-text">未完成</text>
+          <view class="clock-time">
+            <image src="{{imgServerUrl}}/images/clock/clock-success-icon.png"  wx:if="{{endPunch !== '未完成' }}"></image>
+            <text class="status-text"  wx:if="{{endPunch !== '未完成' }}">{{clock.formateHS(endPunch)}} 已打卡</text>
+            <text class="status-text"  wx:else>{{endPunch}}</text>
+          </view>
         </view>
       </view>
       <view class="rule-messgae">规则:请根据企业实际上下班时间打卡</view>
@@ -92,8 +100,8 @@
         <image src="{{statusIcon}}"></image>
         <text>{{statusMessage}}</text>
       </view>
-      <view class="reload-location" bindtap="location" wx:if="{{status === 0}}">
-        <image src="../../images/clock/refresh.png"></image>
+      <view class="reload-location" bindtap="load" wx:if="{{clockType === 3}}">
+        <image src="../../images/clock/re fresh.png"></image>
         <text>重新定位</text>
       </view>
       <view class="prepayable">

+ 26 - 0
pages/clock/clock.wxs

@@ -0,0 +1,26 @@
+function formatNumber(n) {
+  n = n.toString()
+  return n[1] ? n : '0' + n
+}
+
+function toFixed(number) {
+  if (number) {
+    return Number(number).toFixed(2)
+  }
+  return '0.00'
+}
+
+// 时间戳转成年月日时分秒
+function formateHS(date) {
+  if (date.replace) {
+    date = date.replace(getRegExp('-', 'g'), '/');
+  }
+  date = getDate(date)
+  var hour = date.getHours()
+  var min = date.getMinutes()
+  return [hour, min].map(formatNumber).join(':');
+}
+module.exports = {
+  toFixed: toFixed,
+  formateHS: formateHS
+};

+ 13 - 1
pages/clock/clock.wxss

@@ -199,7 +199,8 @@ page {
   justify-content: space-between;
 }
 
-.status view {
+.clock-in,
+.clock-out {
   width: 310rpx;
   height: 98rpx;
   font-size: 28rpx;
@@ -213,6 +214,17 @@ page {
   justify-content: center;
 }
 
+.clock-time {
+  display: flex;
+  align-items: center;
+}
+
+.clock-time image {
+  width: 22rpx;
+  height: 22rpx;
+  margin-right: 10rpx;
+}
+
 .status-text {
   font-size: 26rpx;
   font-family: PingFangSC-Regular, PingFang SC;

+ 15 - 6
pages/identification/index.js

@@ -187,12 +187,6 @@ Page({
     Object.assign(paramsObj);
     postApprove(paramsObj).then(data => {
       wx.hideLoading()
-      if (data.errcode === 2009 || data.errcode === 2011) {
-        this.setData({
-          showMessage: true,
-        })
-        return
-      }
       wx.showToast({
         title: '提交成功',
       })
@@ -205,6 +199,21 @@ Page({
       wx.redirectTo({
         url: '../result/index?type=auth&status=2',
       })
+    }).catch(data => {
+      if (data.errcode === 2100) {
+        this.setData({
+          showMessage: true,
+          message:'您的身份证已经被实名认证'
+        })
+        return
+      }
+      if(data.errcode === 2101){
+        this.setData({
+          showMessage: true,
+          message:'您的身份证已实名认证,无需重复认证'
+        })
+        return
+      }
     })
     // 身份认证上报订阅信息
     wx.aldPushSubscribeMessage({

+ 1 - 1
pages/identification/index.wxml

@@ -80,7 +80,7 @@
 
   <view class="message-content">
     <image src="{{imgServerUrl}}/images/clock/clock-waring-certified.png"></image>
-    <view class="message-tips">您的身份证已经被实名认证</view>
+    <view class="message-tips">{{message}}</view>
     <view class="message-func">
       <view>如果非您本人操作认证,</view>
       <view> 请联系开心客服为您解决问题。</view>

+ 14 - 15
pages/result/index.wxml

@@ -1,16 +1,6 @@
-<block wx:if="{{from === 'clock'}}">
-  <view class="submit-content" wx:if="{{type=='auth'&& status==2}}">
-    <image src="../../images/happyjob/identification-shcg.png"></image>
-    <view class="identification-submit">实名认证提交成功</view>
-    <view class="identification-message">我们会尽快审核,请您耐心等待</view>
-    <view class="identification-btn">
-      <navigator>开启开心打卡之旅</navigator>
-    </view>
-  </view>
-</block>
-<block wx:else>
+
   <view class='db'>
-    <image wx:if="{{type=='auth'&& status==2}}" src='{{imgServerUrl}}/images/happyjob/shcg.png' mode="widthFix"></image>
+    <!-- <image wx:if="{{type=='auth'&& status==2}}" src='{{imgServerUrl}}/images/happyjob/shcg.png' mode="widthFix"></image> -->
     <image wx:if="{{type=='auth'&& status==0}}" src='{{imgServerUrl}}/images/happyjob/wtg.png' mode="widthFix"></image>
     <image wx:if="{{type=='submit'&& status==2}}" src='{{imgServerUrl}}/images/happyjob/tosubmit.png' mode="widthFix">
     </image>
@@ -19,11 +9,11 @@
 
 
 
-  <view class='shz' wx:if="{{type=='auth'&& status==2}}">
+  <!-- <view class='shz' wx:if="{{type=='auth'&& status==2}}">
     <text class='sfshz'>身份审核中</text>
     <text class='sqtjdht'>您的申请已经提交到后台</text>
     <text class='wait'>请耐心等待</text>
-  </view>
+  </view> -->
 
 
   <view class='shz' wx:if="{{type=='auth'&& status==0}}">
@@ -38,4 +28,13 @@
     <text class='sqtjdht'>您的身份认证审核已提交</text>
     <text class='wait'>请耐心等待我们的审核...</text>
   </view>
-</block>
+
+  <view class="submit-content" wx:if="{{type=='auth'&& status==2}}">
+    <image src="../../images/happyjob/identification-shcg.png"></image>
+    <view class="identification-submit">实名认证提交成功</view>
+    <view class="identification-message">我们会尽快审核,请您耐心等待</view>
+    <view class="identification-btn">
+      <navigator open-type='switchTab' wx:if="{{from === 'clock'}}" url="/pages/clock/clock">开启开心打卡之旅</navigator>
+      <navigator open-type='switchTab' url="/pages/mine/index" wx:else>返回个人中心</navigator>
+    </view>
+  </view>

+ 70 - 0
services/index.js

@@ -551,6 +551,7 @@ module.exports = {
       header: {}
     })
   },
+  // 注销账户
   logout_new(params) {
     return http({
       url: url.logout_new,
@@ -559,6 +560,7 @@ module.exports = {
       header: {}
     })
   },
+  // 面试登记获取企业状态
   getCompanyStatus(params){
     return http({
       url: url.getCompanyStatus,
@@ -567,6 +569,7 @@ module.exports = {
       header: {}
     })
   },
+  // 查询用户是否签到并在用户未签到情况下返回意向企业
   getIntentCompany(params){
     return http({
       url: url.getIntentCompany,
@@ -575,6 +578,73 @@ module.exports = {
       header: {}
     })
   },
+  // 进入打卡页面获取打卡信息
+  punchClockNeedInfo(params){
+    return http({
+      url: url.punchClockNeedInfo,
+      data: params,
+      method: 'GET',
+      header: {}
+    })
+  },
+  // 打卡接口
+  savePunchClock(params){
+    return http({
+      url: url.savePunchClock,
+      data: params,
+      method: 'POST',
+      header: {}
+    })
+  },
+  // 当月汇总
+  currentSettlement(params){
+    return http({
+      url: url.currentSettlement,
+      data: params,
+      method: 'GET',
+      header: {}
+    })
+  },
+  
+  // 月打卡情况集合
+  monthTotalSettlement(params){
+    return http({
+      url: url.monthTotalSettlement,
+      data: params,
+      method: 'GET',
+      header: {}
+    })
+  },
+  // 月数据统计
+  monthSettlement(params){
+    return http({
+      url: url.monthSettlement,
+      data: params,
+      method: 'GET',
+      header: {}
+    })
+  },
+  
+  // 日数据查询
+  daySettlement(params){
+    return http({
+      url: url.daySettlement,
+      data: params,
+      method: 'GET',
+      header: {}
+    })
+  },
+
+  
+  // 周数据统计
+  weekSettlement(params){
+    return http({
+      url: url.weekSettlement,
+      data: params,
+      method: 'GET',
+      header: {}
+    })
+  },
   /**************************废弃接口**************************** */
   //post 用户简历:用户教育背景编辑、新增
   resumeEdu(params) {

+ 16 - 10
utils/http.js

@@ -93,16 +93,12 @@ const http = (params) => {
               url: '/pages/login/login',
             })
           } else if (errorCode == 2009) {
-            if (pages[pages.length - 1].route === 'pages/identification/index') {
-              return resolve(res.data)
-            } else {
-              //用户信息重复,请选择用户信息
-              wx.setStorageSync('userList', res.data.data.userList);
-              wx.setStorageSync('currentUser', res.data.data.currentUser);
-              wx.redirectTo({
-                url: '/pages/select-info/index',
-              })
-            }
+            //用户信息重复,请选择用户信息
+            wx.setStorageSync('userList', res.data.data.userList);
+            wx.setStorageSync('currentUser', res.data.data.currentUser);
+            wx.redirectTo({
+              url: '/pages/select-info/index',
+            })
           } else if (errorCode == 2008) {
             //账号不存在,或token无效
             if (model && params.data.task_id !== 10) {
@@ -168,6 +164,16 @@ const http = (params) => {
               }
             })
             return
+          } else if (errorCode === 2100) {
+            return reject(res.data);
+          } else if (errorCode === 2101) {
+            return reject(res.data);
+          } else if (errorCode === 2101) {
+            return reject(res.data);
+          }else if (errorCode === 2102) {
+            return reject(res.data);
+          }else if (errorCode === 2103) {
+            return reject(res.data);
           }
           params.data.task_id !== 10 && showToast(res.data.errmsg);
           reject(res.data);