wangxin 5 år sedan
förälder
incheckning
7105aaaa0f

+ 9 - 9
pages/clock/clock-tongji/calendar/calendar.js

@@ -1,5 +1,4 @@
 // pages/clock/clock-tongji/calendar/calendar.js
-let first = true
 Component({
   /**
    * 组件的属性列表
@@ -86,13 +85,10 @@ Component({
           })
         }
         if (month === this.data.defaultMonth && i === this.data.defaultDate) {
-          if (first) {
-            first = false
-            this.setData({
-              selectedIndex: index - 1,
-              blue: index - 1,
-            })
-          }
+          this.setData({
+            selectedIndex: index - 1,
+            blue: index - 1,
+          })
         }
       }
 
@@ -122,7 +118,11 @@ Component({
         this.setData({
           calendarDays: list,
           selectedIndex: index,
-          selectedDay: list[index]
+          selectedDay: list[index],
+          selectedIndex: index,
+          blue: index,
+          defaultMonth: list[index].month,
+          defaultDate: list[index].date
         })
       }
     },

+ 2 - 2
pages/clock/clock-tongji/index.wxml

@@ -12,11 +12,11 @@
         <view class="name">总预支(元)</view>
       </view>
       <view class="header-content-items">
-        <view class="number">{{clock.toFixed(currentSettlement.countDuration)}}</view>
+        <view class="number">{{currentSettlement.countDuration}}</view>
         <view class="name">总工时(小时)</view>
       </view>
       <view class="header-content-items">
-        <view class="number">{{clock.toFixed(currentSettlement.lackClock)}}</view>
+        <view class="number">{{currentSettlement.lackClock}}</view>
         <view class="name">缺卡(次)</view>
       </view>
     </view>

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

@@ -45,7 +45,7 @@ Page({
   mouthNext() {
     if (this.data.mouth < this.data.defaultmouth) {
       this.setData({
-        mouth: new Date().getMonth() + 1,
+        mouth: this.data.defaultDate.getMonth() + 1,
         mouthNext: `${imgServerUrl}/images/clock/clock-arrow-righr-disabled.png`,
         mouthLast: `${imgServerUrl}/images/clock/clock-arrow-left.png`,
       }, _ => {
@@ -55,7 +55,7 @@ Page({
   },
   mouthLast() {
     if (this.data.mouth === this.data.defaultmouth) {
-      if (new Date().getMonth() - 1 < 0) {
+      if (this.data.defaultDate.getMonth() - 1 < 0) {
         this.setData({
           mouth: 12,
           year: this.data.year - 1
@@ -64,7 +64,7 @@ Page({
         })
       } else {
         this.setData({
-          mouth: new Date().getMonth()
+          mouth: this.data.defaultDate.getMonth()
         }, _ => {
           this.getMouth(2)
         })

+ 2 - 2
pages/clock/clock-tongji/list.wxml

@@ -33,7 +33,7 @@
     </view>
     <view class="content">
       <view class="label">总工时:</view>
-      <view class="value">{{clock.toFixed(mouthData.countDuration)}} 小时</view>
+      <view class="value">{{mouthData.countDuration}} 小时</view>
     </view>
     <view class="content">
       <view class="label">出勤次数:</view>
@@ -63,7 +63,7 @@
     </view>
     <view class="content">
       <view class="label">总工时:</view>
-      <view class="value">{{clock.toFixed(weekData.countDuration)}} 小时</view>
+      <view class="value">{{weekData.countDuration}} 小时</view>
     </view>
     <view class="content">
       <view class="label">出勤次数:</view>

+ 1 - 1
pages/clock/clock.wxml

@@ -77,7 +77,7 @@
           </view>
         </view>
         <view class="clock-out">
-          <text>班打卡</text>
+          <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>