소스 검색

更改图片

heikabujianai 5 년 전
부모
커밋
df7f2d0e9b
2개의 변경된 파일67개의 추가작업 그리고 64개의 파일을 삭제
  1. 65 62
      pages/clock/clock.js
  2. 2 2
      pages/clock/clock.wxml

+ 65 - 62
pages/clock/clock.js

@@ -194,70 +194,73 @@ Page({
     })
   },
   async load() {
-    if (locationStatus) {
-      locationStatus = false
-      const data = await this.location()
-      punchClockNeedInfo({ longitude: data.longitude, latitude: data.latitude }).then(data => {
-        // punchClockNeedInfo({ longitude: 120.353312, latitude: 31.535582 }).then(data => {
-        locationStatus = true
-        let {
-          authenticationStatus,
-          startPunch,
-          endPunch,
-          todayMoney,
-          clockType, // 1:上班打卡 2:下班打卡 3:超出范围 4:已完成
-          sumDuration,
-          sumMoney,
-          wsPunchClockId,
-          dailyAvailableMinHour
-        } = data.data
+    const data = await this.location()
+    punchClockNeedInfo({ longitude: data.longitude, latitude: data.latitude }).then(data => {
+      // punchClockNeedInfo({ longitude: 120.353312, latitude: 31.535582 }).then(data => {
+      locationStatus = true
+      let {
+        authenticationStatus,
+        startPunch,
+        endPunch,
+        todayMoney,
+        clockType, // 1:上班打卡 2:下班打卡 3:超出范围 4:已完成
+        sumDuration,
+        sumMoney,
+        wsPunchClockId,
+        dailyAvailableMinHour
+      } = data.data
+      this.setData({
+        approveStatus: authenticationStatus, // 认证状态(0:未认证 1:等待认证 2:未通过 3:已认证) ,
+        startPunch,
+        endPunch,
+        todayMoney,
+        clockType,
+        sumDuration,
+        sumMoney,
+        wsPunchClockId
+      })
+      if (clockType === 1 && !wsPunchClockId) {
         this.setData({
-          approveStatus: authenticationStatus, // 认证状态(0:未认证 1:等待认证 2:未通过 3:已认证) ,
-          startPunch,
-          endPunch,
-          todayMoney,
-          clockType,
-          sumDuration,
-          sumMoney,
-          wsPunchClockId
+          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-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: `今日打卡已完成`,
-          })
-        }
-      }).catch(data => {
-        locationStatus = true
-      })
+      }
+      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: `今日打卡已完成`,
+        })
+      }
+    }).catch(data => {
+      locationStatus = true
+    })
+  },
+  reload() {
+    if (locationStatus) {
+      locationStatus = false
+      this.load()
     } else {
       wx.showToast({
         icon: 'none',

+ 2 - 2
pages/clock/clock.wxml

@@ -6,7 +6,7 @@
       <image src="{{imgServerUrl}}/images/clock/clock-bg.png" class="no-authentication-bg" mode="widthFixed"></image>
     </view>
     <view class="no-authentication-content">
-      <image src="{{imgServerUrl}}/images/clock/clock-no-certified.png" class="no-authentication-img"></image>
+      <image src="{{imgServerUrl}}/images/clock/clock-no-pass.png" class="no-authentication-img"></image>
       <view class="no-authentication-content-text">
         <view>您的审核未通过</view>
         <view>
@@ -100,7 +100,7 @@
         <image src="{{statusIcon}}"></image>
         <text>{{statusMessage}}</text>
       </view>
-      <view class="reload-location" bindtap="load" wx:if="{{clockType === 3}}">
+      <view class="reload-location" bindtap="reload" wx:if="{{clockType === 3}}">
         <image src="{{imgServerUrl}}/images/clock/refresh.png"></image>
         <text>重新定位</text>
       </view>