Browse Source

页面开发

heikabujianai 5 years ago
parent
commit
39311fa6f6
40 changed files with 1422 additions and 215 deletions
  1. 6 2
      app.json
  2. BIN
      images/clock/refresh.png
  3. BIN
      images/happyjob/identification-shcg.png
  4. BIN
      images/id-upload-back.png
  5. BIN
      images/id-upload-positive.png
  6. BIN
      images/id-uploaded.png
  7. 79 0
      pages/clock/clock-rule/clock-rule.js
  8. 3 0
      pages/clock/clock-rule/clock-rule.json
  9. 6 0
      pages/clock/clock-rule/clock-rule.wxml
  10. 17 0
      pages/clock/clock-rule/clock-rule.wxss
  11. 78 0
      pages/clock/clock-success/clock-success.js
  12. 3 0
      pages/clock/clock-success/clock-success.json
  13. 35 0
      pages/clock/clock-success/clock-success.wxml
  14. 78 0
      pages/clock/clock-success/clock-success.wxss
  15. 137 0
      pages/clock/clock-tongji/calendar/calendar.js
  16. 4 0
      pages/clock/clock-tongji/calendar/calendar.json
  17. 6 0
      pages/clock/clock-tongji/calendar/calendar.wxml
  18. 26 0
      pages/clock/clock-tongji/calendar/calendar.wxss
  19. 66 0
      pages/clock/clock-tongji/index.js
  20. 5 0
      pages/clock/clock-tongji/index.json
  21. 2 0
      pages/clock/clock-tongji/index.wxml
  22. 2 0
      pages/clock/clock-tongji/index.wxss
  23. 80 0
      pages/clock/clock-tongji/list.js
  24. 3 0
      pages/clock/clock-tongji/list.json
  25. 64 0
      pages/clock/clock-tongji/list.wxml
  26. 94 0
      pages/clock/clock-tongji/list.wxss
  27. 139 17
      pages/clock/clock.js
  28. 1 0
      pages/clock/clock.json
  29. 20 8
      pages/clock/clock.wxml
  30. 42 0
      pages/clock/clock.wxss
  31. 72 6
      pages/identification/index.js
  32. 60 30
      pages/identification/index.wxml
  33. 127 102
      pages/identification/index.wxss
  34. 12 9
      pages/result/index.js
  35. 33 20
      pages/result/index.wxml
  36. 64 12
      pages/result/index.wxss
  37. 36 0
      project.config.json
  38. 3 3
      services/uploadFile.js
  39. 9 0
      utils/base.js
  40. 10 6
      utils/http.js

+ 6 - 2
app.json

@@ -1,7 +1,7 @@
 {
   "permission": {
     "scope.userLocation": {
-      "desc": "您的位置信息将用于小程序位置接口的效果展示"
+      "desc": "您的位置信息将用于获取当地职位列表、打卡等功能"
     }
   },
   "pages": [
@@ -67,7 +67,11 @@
     "pages/integral/pages/exchange-record/exchange-record",
     "pages/integral/pages/exchange-detail/exchange-detail",
     "pages/integral/pages/integral-pay/integral-pay",
-    "pages/clock/clock"
+    "pages/clock/clock",
+    "pages/clock/clock-success/clock-success",
+    "pages/clock/clock-rule/clock-rule",
+    "pages/clock/clock-tongji/index",
+    "pages/clock/clock-tongji/list"
   ],
   "subpackages": [{
       "root": "pages/expense",

BIN
images/clock/refresh.png


BIN
images/happyjob/identification-shcg.png


BIN
images/id-upload-back.png


BIN
images/id-upload-positive.png


BIN
images/id-uploaded.png


+ 79 - 0
pages/clock/clock-rule/clock-rule.js

@@ -0,0 +1,79 @@
+// pages/clock/clock-rule/clock-rule.js
+import {
+  imgServerUrl
+} from '../../../config/config.js'
+const WxParse = require('../../../plugins/wxParse/wxParse.js');
+
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    imgServerUrl
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    WxParse.wxParse('rule', 'html', `
+    这里是周结打卡细则:
+    1,这里是规则明细;
+    1,这里是规则明细;
+    1,这里是规则明细;
+    1,这里是规则明细;
+    1,这里是规则明细;
+    1,这里是规则明细;
+    1,这里是规则明细;`, this, 5);
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/clock/clock-rule/clock-rule.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 6 - 0
pages/clock/clock-rule/clock-rule.wxml

@@ -0,0 +1,6 @@
+<!--pages/clock/clock-rule/clock-rule.wxml-->
+<import src="../../../plugins/wxParse/wxParse.wxml" />
+<image src='{{imgServerUrl}}/images/clock/clock-rule.png'></image>
+<view class="content">
+  <template is="wxParse" data="{{wxParseData:rule.nodes}}" />
+</view>

+ 17 - 0
pages/clock/clock-rule/clock-rule.wxss

@@ -0,0 +1,17 @@
+/* pages/clock/clock-rule/clock-rule.wxss */
+page {
+  background-color: #f5f5f5;
+}
+
+image {
+  width: 100%;
+  height: 440rpx;
+  margin: 22rpx 0;
+}
+
+.content {
+  width: 100%;
+  box-sizing: border-box;
+  background-color: #fff;
+  padding: 30rpx;
+}

+ 78 - 0
pages/clock/clock-success/clock-success.js

@@ -0,0 +1,78 @@
+// pages/clock/clock-success/clock-success.js
+import {
+  imgServerUrl
+} from '../../../config/config.js'
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    imgServerUrl,
+    status: 0
+  },
+  checkResult() {
+    wx.navigateBack({
+      delta: 1,
+    })
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    if (options.status) {
+      this.setData({
+        status: options.status
+      })
+    }
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/clock/clock-success/clock-success.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 35 - 0
pages/clock/clock-success/clock-success.wxml

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

+ 78 - 0
pages/clock/clock-success/clock-success.wxss

@@ -0,0 +1,78 @@
+/* pages/clock/clock-success/clock-success.wxss */
+page {
+  background-color: #f5f5f5;
+}
+
+.container {
+  width: 690rpx;
+  background-color: #fff;
+  margin: 30rpx auto;
+  padding-top: 70rpx;
+  padding-bottom: 130rpx;
+}
+
+.clock-success {
+  font-size: 48rpx;
+  font-family: PingFangSC-Semibold, PingFang SC;
+  font-weight: 600;
+  color: #000000;
+  margin-left: 50rpx;
+}
+
+.time {
+  font-size: 30rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #000000;
+  margin-top: 10rpx;
+  margin-left: 50rpx;
+}
+
+image {
+  width: 100%;
+  height: 332rpx;
+  margin-top: 100rpx;
+}
+
+.money {
+  font-size: 34rpx;
+  font-family: PingFangSC-Semibold, PingFang SC;
+  font-weight: 600;
+  color: #000000;
+  text-align: center;
+}
+
+.number {
+  font-size: 58rpx;
+  font-family: DINCondensed-Bold, DINCondensed;
+  font-weight: bold;
+  color: #0177FF;
+  margin: 0 10rpx;
+}
+
+.end {
+  font-size: 30rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #000000;
+  margin-top: 24rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  flex-direction: column;
+}
+
+.btn {
+  width: 560rpx;
+  height: 88rpx;
+  line-height: 80rpx;
+  text-align: center;
+  font-size: 30rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #000000;
+  border-radius: 10px;
+  border: 2rpx solid #000000;
+  margin: 0 auto;
+  margin-top: 130rpx;
+}

+ 137 - 0
pages/clock/clock-tongji/calendar/calendar.js

@@ -0,0 +1,137 @@
+// pages/clock/clock-tongji/calendar/calendar.js
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    weeks: ["日", "一", "二", "三", "四", "五", "六"],
+
+    // 所选择日期
+    selectDate: {
+      'year': new Date().getFullYear(),
+      'month': new Date().getMonth() + 1,
+      'date': new Date().getDate(),
+    },
+
+    calendarTitle: '',
+
+    // 日期list 
+    calendarDays: []
+  },
+  ready() {
+    this.getMonthDaysCurrent(new Date())
+  },
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+
+    // 所选时间对应月份日期
+    getMonthDaysCurrent(e) {
+      let year = e.getFullYear()
+      let month = e.getMonth() + 1
+      let date = e.getDate()
+      let day = e.getDay() // 周几
+      let days = new Date(year, month, 0).getDate() //当月天数(即下个月0号=当月最后一天)
+
+      let firstDayDate = new Date(year, month - 1, 1) // 当月1号
+      let firstDay = firstDayDate.getDay() //当月1号对应的星期
+
+      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--) {
+        let date = new Date(year, month - 1, -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
+        })
+      }
+
+      // 当月显示的日期
+      for (let i = 1; i <= days; i++) {
+        calendarDays.push({
+          'year': year,
+          'month': month,
+          'date': i,
+          'day': new Date(year, month - 1, i).getDay(),
+          'current': true,
+          'selected': i == date // 判断当前日期
+        })
+      }
+
+      // 下个月显示的天数及日期
+      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
+      })
+    },
+
+    // 手动选中日期
+    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)
+          })
+        }
+      }
+
+      this.setData({
+        calendarDays: list
+      })
+    },
+  }
+})

+ 4 - 0
pages/clock/clock-tongji/calendar/calendar.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 6 - 0
pages/clock/clock-tongji/calendar/calendar.wxml

@@ -0,0 +1,6 @@
+<!--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>
+</view>

+ 26 - 0
pages/clock/clock-tongji/calendar/calendar.wxss

@@ -0,0 +1,26 @@
+/* pages/clock/clock-tongji/calendar/calendar.wxss */
+.calendar-background {
+  font-size: 24rpx;
+  padding-top: 20rpx;
+}
+
+.calendar-item {
+  width: 14%;
+  height: 50rpx;
+  text-align: center;
+}
+
+.display-space-between {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  flex-wrap: wrap;
+}
+
+.text-gray {
+  color: #878787;
+}
+
+.text-red {
+  color: #F87474;
+}

+ 66 - 0
pages/clock/clock-tongji/index.js

@@ -0,0 +1,66 @@
+// pages/clock/clock-tongji/index.js
+Page({
+
+  /**
+    * 页面的初始数据
+    */
+  data: {
+   
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 5 - 0
pages/clock/clock-tongji/index.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "calendar":"./calendar/calendar"
+  }
+}

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

@@ -0,0 +1,2 @@
+<!--pages/clock/clock-tongji/index.wxml-->
+<calendar />  

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

@@ -0,0 +1,2 @@
+/* pages/clock/clock-tongji/index.wxss */
+

+ 80 - 0
pages/clock/clock-tongji/list.js

@@ -0,0 +1,80 @@
+// pages/clock/clock-tongji/list.js
+import {
+  getCenterInfo
+} from '../../../services/index.js'
+import {
+  imgServerUrl
+} from '../../../config/config.js'
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    avatar: "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2034740944,4251903193&fm=26&gp=0.jpg",
+    imgServerUrl
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    getCenterInfo().then(data => {
+      let {
+        approveStatus
+      } = data.data
+      this.setData({
+        approveStatus, // 认证状态(0:未认证 1:等待认证 2:未通过 3:已认证) ,
+      })
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/clock/clock-tongji/list.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 64 - 0
pages/clock/clock-tongji/list.wxml

@@ -0,0 +1,64 @@
+<!--pages/clock/clock-tongji/list.wxml-->
+<view class="container">
+  <view class="header">
+    <view class="avatar">
+      <image src="{{avatar}}" class="avatar-img"></image>
+      <image class="avatar-icon" src="{{imgServerUrl}}/images/clock/clock-approved-icon.png"
+        wx:if="{{approveStatus === 3}}"></image>
+      <image class="avatar-icon" src="{{imgServerUrl}}/images/clock/clock-approving-icon.png" wx:else></image>
+    </view>
+    <view class="header-info">
+      <view>铁锤</view>
+      <view class="approveStatus {{approveStatus === 3 ? '' : 'approveStatus-color'}}">
+        {{approveStatus === 3 ? '开心工作认证用户' : '认证信息审核中'}}</view>
+    </view>
+  </view>
+  <view class="mouth">
+    <view class="title">
+      <view>月统计数据</view>
+      <view class="time">
+        <text>本月</text>
+      </view>
+    </view>
+    <view class="content">
+      <view class="label">总预支:</view>
+      <view class="value">261.44 元</view>
+    </view>
+    <view class="content">
+      <view class="label">总工时:</view>
+      <view class="value">23.0 小时</view>
+    </view>
+    <view class="content">
+      <view class="label">打卡天数:</view>
+      <view class="value"> 4 天</view>
+    </view>
+    <view class="content">
+      <view class="label">缺卡:</view>
+      <view class="value">0 次</view>
+    </view>
+  </view>
+  <view class="week">
+    <view class="title">
+      <view>周统计数据</view>
+      <view class="time">
+        <text>本周</text>
+      </view>
+    </view>
+    <view class="content">
+      <view class="label">总预支:</view>
+      <view class="value">261.44 元</view>
+    </view>
+    <view class="content">
+      <view class="label">总工时:</view>
+      <view class="value">23.0 小时</view>
+    </view>
+    <view class="content">
+      <view class="label">打卡天数:</view>
+      <view class="value"> 4 天</view>
+    </view>
+    <view class="content">
+      <view class="label">缺卡:</view>
+      <view class="value">0 次</view>
+    </view>
+  </view>
+</view>

+ 94 - 0
pages/clock/clock-tongji/list.wxss

@@ -0,0 +1,94 @@
+/* pages/clock/clock-tongji/list.wxss */
+page {
+  background-color: #F5F5F5;
+}
+
+.header {
+  height: 176rpx;
+  padding: 30rpx;
+  font-size: 36rpx;
+  font-family: PingFangSC-Semibold, PingFang SC;
+  font-weight: 600;
+  background: #fff;
+  color: #333333;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  margin-top: 20rpx;
+}
+
+.avatar {
+  height: 102rpx;
+  width: 102rpx;
+  border-radius: 50%;
+  position: relative;
+}
+
+.avatar-img {
+  height: 102rpx;
+  width: 102rpx;
+  border-radius: 50%;
+}
+
+.avatar-icon {
+  width: 32rpx;
+  height: 32rpx;
+  position: absolute;
+  right: -4rpx;
+  bottom: -4rpx;
+}
+
+.header-info {
+  margin-left: 40rpx;
+}
+
+.approveStatus {
+  font-size: 26rpx;
+  font-family: PingFangSC-Semibold, PingFang SC;
+  font-weight: 600;
+  color: #0177FF;
+}
+
+.approveStatus-color {
+  color: #999999;
+}
+
+.mouth,
+.week {
+  margin-top: 20rpx;
+  background: #fff;
+}
+
+.title {
+  font-size: 34rpx;
+  font-family: PingFangSC-Semibold, PingFang SC;
+  font-weight: 600;
+  color: #000000;
+  padding: 30rpx;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.time {
+  font-size: 28rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  color: #000000;
+}
+
+.content {
+  height: 116rpx;
+  font-size: 30rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  border-bottom: 1rpx solid #F5F5F5;
+  padding: 30rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.label {
+  color: #666666;
+}

+ 139 - 17
pages/clock/clock.js

@@ -15,22 +15,151 @@ Page({
     imgServerUrl,
     time: '42.0',
     money: '170.94',
-    navigation:[
+    navigation: [
       {
-        image:'/images/clock/clock-tongji.png',
-        text:'统计'
+        image: '/images/clock/clock-tongji.png',
+        text: '统计'
       },
       {
-        image:'/images/clock/clock-rule-icon.png',
-        text:'规则'
+        image: '/images/clock/clock-rule-icon.png',
+        text: '规则'
       },
       {
-        image:'/images/clock/clock-kefu.png',
-        text:'客服'
+        image: '/images/clock/clock-kefu.png',
+        text: '客服'
       },
-    ]
+    ],
+    status: 0,
+    statusImage: `${imgServerUrl}/images/clock/clock-beyond.png`,
+    statusIcon: `${imgServerUrl}/images/clock/clock-waring.png`,
+    statusMessage: `请进入企业后再进行打卡`,
   },
+  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)
+      }
+    })
+  },
+  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
+                    })
+                  }
+                },
+              })
+            }
+          })
+        }
+      }
+    })
+  },
+  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;
+    }
 
+  },
+  navigator(e) {
+    const { index } = e.currentTarget.dataset
+    if (index === 0) {
+      wx.navigateTo({
+        url: './clock-tongji/index',
+      })
+    }
+    if (index === 1) {
+      wx.navigateTo({
+        url: './clock-rule/clock-rule',
+      })
+    }
+    if (index === 2) {
+      wx.makePhoneCall({
+        phoneNumber: '4006920099',
+      })
+    }
+  },
+  load() {
+    getCenterInfo().then(data => {
+      let {
+        approveStatus
+      } = data.data
+      this.setData({
+        approveStatus, // 认证状态(0:未认证 1:等待认证 2:未通过 3:已认证) ,
+      })
+    })
+    this.location()
+  },
   /**
    * 生命周期函数--监听页面加载
    */
@@ -49,14 +178,7 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-    getCenterInfo().then(data => {
-      let {
-        approveStatus
-      } = data.data
-      this.setData({
-        approveStatus, // 认证状态(0:未认证 1:等待认证 2:未通过 3:已认证) ,
-      })
-    })
+    this.load()
   },
 
   /**
@@ -77,7 +199,7 @@ Page({
    * 页面相关事件处理函数--监听用户下拉动作
    */
   onPullDownRefresh: function () {
-
+    this.load()
   },
 
   /**

+ 1 - 0
pages/clock/clock.json

@@ -1,3 +1,4 @@
 {
+  "enablePullDownRefresh": true,
   "usingComponents": {}
 }

+ 20 - 8
pages/clock/clock.wxml

@@ -16,7 +16,7 @@
           </view>
         </view>
       </view>
-      <navigator class="no-authentication-content-button" url="../identification/index">
+      <navigator class="no-authentication-content-button" url="../identification/index?from=clock">
         前往认证
       </navigator>
     </view>
@@ -32,7 +32,7 @@
         <view>您还没有实名认证</view>
         <view>为保证账户安全,请完成实名认证后再进行打卡签到。</view>
       </view>
-      <navigator class="no-pass-content-button" url="../identification/index">
+      <navigator class="no-pass-content-button" url="../identification/index?from=clock">
         前往认证
       </navigator>
     </view>
@@ -59,13 +59,14 @@
       </view>
       <view class="pass-header-message">实际预支发放结合企业考勤,以上金额仅供参考。</view>
       <view class="pass-header-footer">
-        <view class="pass-header-footer-view" wx:for="{{navigation}}" wx:key='index'>
+        <view class="pass-header-footer-view" wx:for="{{navigation}}" wx:key='index' data-index="{{index}}"
+          bindtap="navigator">
           <image src='{{imgServerUrl}}{{item.image}}'></image>
           <text>{{item.text}}</text>
         </view>
       </view>
     </view>
-    <view class="pass-content">
+    <view class="pass-content {{status === 4 ?'height':''}}">
       <view class="status">
         <view class="clock-in">
           <text>上班打卡</text>
@@ -80,16 +81,27 @@
       <view wx:if="{{approveStatus === 1}}" class="image">
         <image src="{{imgServerUrl}}/images/clock/clock-approving.png"></image>
       </view>
-      <view wx:else class="image">
-        <image src="{{imgServerUrl}}/images/clock/clock-in.png"></image>
+      <view wx:else class="image" bindtap="click">
+        <image src="{{statusImage}}"></image>
       </view>
       <view class="clock-status" wx:if="{{approveStatus === 1}}">
         <image src="{{imgServerUrl}}/images/clock/clock-waring.png"></image>
         <text>我们会尽快完成实名认证审核</text>
       </view>
       <view class="clock-status" wx:else>
-        <image src="{{imgServerUrl}}/images/clock/clock-waring.png"></image>
-        <text>我们会尽快完成实名认证审核</text>
+        <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>
+        <text>重新定位</text>
+      </view>
+      <view class="prepayable">
+        <text>当日可预支工资:</text>
+        <view>
+          <text class="prepayable-number">37.0</text>
+          <text class="prepayable-unit">元</text>
+        </view>
       </view>
     </view>
     <image src="{{imgServerUrl}}/images/clock/clock-video-home.png" class="video"></image>

+ 42 - 0
pages/clock/clock.wxss

@@ -257,6 +257,48 @@ page {
   margin-right: 12rpx;
 }
 
+.reload-location {
+  font-size: 26rpx;
+  font-family: PingFangSC-Semibold, PingFang SC;
+  font-weight: 600;
+  color: #007AFF;
+  margin-top: 40rpx;
+}
+
+.reload-location image {
+  height: 24rpx;
+  width: 24rpx;
+  margin-right: 15rpx;
+}
+
+.prepayable {
+  width: 100%;
+  font-size: 26rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #000000;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  margin-top: 164rpx;
+}
+
+.prepayable-number {
+  font-size: 58rpx;
+  font-family: DINCondensed-Bold, DINCondensed;
+  font-weight: bold;
+  color: #0177FF;
+}
+
+.prepayable-unit {
+  font-family: PingFangSC-Semibold, PingFang SC;
+  margin-left: 8rpx;
+}
+
+.height {
+  height: 894rpx;
+}
+
 .video {
   height: 248rpx;
   width: 690rpx;

+ 72 - 6
pages/identification/index.js

@@ -8,6 +8,7 @@ import {
   imgServerUrl,
   imgServerUrl_new
 } from '../../config/config.js'
+import { isIDNum } from '../../utils/base'
 var app = getApp()
 
 Page({
@@ -18,10 +19,55 @@ Page({
     idNum: '',
     idFrontPic: '',
     idBackPic: '',
-    idPersonPic: ''
+    idPersonPic: '',
+    showMessage: false,
+    message: '',
+    canUpdate: false,
+    from: ''
   },
   onLoad: function (options) {
-
+    if (options.from) {
+      this.setData({
+        from: options.from
+      })
+    }
+  },
+  testCanUpdate() {
+    let {
+      realName,
+      idNum,
+      idFrontPic,
+      idBackPic,
+      // idPersonPic
+    } = this.data;
+    this.setData({
+      canUpdate: false
+    })
+    if (realName == "") {
+      return false;
+    }
+    if (!isIDNum(idNum)) {
+      return false;
+    }
+    if (idFrontPic == "") {
+      return false;
+    }
+    if (idBackPic == "") {
+      return false;
+    }
+    this.setData({
+      canUpdate: true
+    })
+  },
+  callPhone() {
+    wx.makePhoneCall({
+      phoneNumber: '4006920099',
+      success: () => {
+        this.setData({
+          showMessage: false
+        })
+      }
+    })
   },
   chooseImage(e) {
     let index = e.currentTarget.dataset.index
@@ -42,14 +88,20 @@ Page({
       if (index == 1) {
         this.setData({
           idFrontPic: image
+        }, _ => {
+          this.testCanUpdate()
         })
       } else if (index == 2) {
         this.setData({
           idBackPic: image
+        }, _ => {
+          this.testCanUpdate()
         })
       } else if (index == 3) {
         this.setData({
           idPersonPic: image
+        }, _ => {
+          this.testCanUpdate()
         })
       }
     })
@@ -57,17 +109,19 @@ Page({
   changeName(e) {
     this.setData({
       realName: e.detail.value.trim()
+    }, _ => {
+      this.testCanUpdate()
     })
   },
   changeId(e) {
     this.setData({
       idNum: e.detail.value.trim()
+    }, _ => {
+      this.testCanUpdate()
     })
   },
   submit(e) {
-    let {
-      formId
-    } = e.detail
+    this.testCanUpdate();
     let {
       realName,
       idNum,
@@ -82,7 +136,7 @@ Page({
       })
       return false;
     }
-    if (idNum.toString().length != 18) {
+    if (!isIDNum(idNum)) {
       wx.showToast({
         title: '请输入18位身份证号码',
         icon: 'none'
@@ -133,9 +187,21 @@ 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: '提交成功',
       })
+      if (this.data.from === 'clock') {
+        wx.redirectTo({
+          url: '../result/index?type=auth&status=2&from=clock',
+        })
+        return
+      }
       wx.redirectTo({
         url: '../result/index?type=auth&status=2',
       })

+ 60 - 30
pages/identification/index.wxml

@@ -1,41 +1,54 @@
-<view class='db'>
-  <image src='{{imgServerUrl}}/images/happyjob/tishi.png'></image>
-  <text class="nickName">身份信息</text>
+<view class="tips">
+  为确保您账户的安全,请确认上传您的真实信息
 </view>
 
-
-<view class='input-box'>
-  <input class="input" value="{{ realName }}" placeholder="您的名字" bindblur='changeName'maxlength="6"  />
+<view class="input-content">
+  <view class="input-lable">姓名:</view>
+  <input class="input" hidden="{{showMessage}}" value="{{ realName }}" placeholder="您的名字" bindblur='changeName'
+    maxlength="6" />
 </view>
-
-<view class='input-box'>
-  <input class="input" value="{{ idNum }}" placeholder="您的身份证号码" bindblur="changeId" maxlength="18"  />
-</view>
-
-<view class='db'>
-  <image src='{{imgServerUrl}}/images/happyjob/tishi.png'></image>
-  <text class="nickName">身份证件照片</text>
+<view class="input-content">
+  <view class="input-lable">身份证:</view>
+  <input class="input" hidden="{{showMessage}}" value="{{ idNum }}" placeholder="您的身份证号码" bindblur="changeId"
+    maxlength="18" />
 </view>
 
-
 <view class='idphoto'>
   <view class='leftid' data-index="{{1}}" bindtap='chooseImage'>
-    <image class="idCard" wx:if="{{idFrontPic}}" src="{{imgServerUrl_new}}{{idFrontPic}}" />
-    <block wx:else>
-      <image class='smallicon' src='{{imgServerUrl}}/images/happyjob/leftid.png'></image>
-      <text class="zmphoto">点击上传证件正面照</text>
-    </block>
+    <view class="id-img">
+      <image class="idCard" wx:if="{{idFrontPic}}" src="{{imgServerUrl_new}}{{idFrontPic}}" />
+      <image class='smallicon' wx:if="{{idFrontPic}}" src='{{imgServerUrl}}/images/happyjob/id-uploaded.png'>
+      </image>
+      <image class='smallicon' wx:else src='{{imgServerUrl}}/images/happyjob/id-upload-positive.png'></image>
+    </view>
+    <!-- <text class="zmphoto">点击上传证件正面照</text> -->
   </view>
   <view class='leftid' data-index="{{2}}" bindtap='chooseImage'>
-    <image class="idCard" wx:if="{{idBackPic}}" src="{{imgServerUrl_new}}{{idBackPic}}" />
-    <block wx:else>
-      <image class='smallicon'  src='{{imgServerUrl}}/images/happyjob/rightid.png'></image>
-      <text class="zmphoto">点击上传证件背面照</text>
-    </block>
+    <view class="id-img">
+      <image class="idCard" wx:if="{{idBackPic}}" src="{{imgServerUrl_new}}{{idBackPic}}" />
+      <image class='smallicon' wx:if="{{idBackPic}}" src='{{imgServerUrl}}/images/happyjob/id-uploaded.png'></image>
+      <image class='smallicon' wx:else src='{{imgServerUrl}}/images/happyjob/id-upload-back.png'></image>
+    </view>
+    <!-- <text class="zmphoto">点击上传证件背面照</text> -->
   </view>
 </view>
+<!-- <view class='db'>
+  <image src='{{imgServerUrl}}/images/happyjob/tishi.png'></image>
+  <text class="nickName">身份证件照片</text>
+</view> -->
+<!-- <view class='db'>
+  <image src='{{imgServerUrl}}/images/happyjob/tishi.png'></image>
+  <text class="nickName">身份信息</text>
+</view>
 
 
+<view class='input-box'>
+  <input class="input" value="{{ realName }}" placeholder="您的名字" bindblur='changeName' maxlength="6" />
+</view>
+
+<view class='input-box'>
+  <input class="input" value="{{ idNum }}" placeholder="您的身份证号码" bindblur="changeId" maxlength="18" />
+</view> -->
 <!-- <view class='db'>
   <image src='{{imgServerUrl}}/images/happyjob/tishi.png'></image>
   <text class="nickName">手持身份证照片</text>
@@ -53,13 +66,30 @@
     </block>
   </view>
 </view> -->
-
-<view class='bor'>
+<!-- <view class='bor'>
   <text>1,身份证信息仅供开心工作平台提供诚信保证使用;</text>
   <text>2,开心工作承诺不向其他第三方透露您的个人信息。</text>
-</view>
+</view> -->
 
 
 <form bindsubmit="submit" report-submit='true' class="btn-group fixed-footer safe_area">
-  <button class="distance selfBtn" form-type="submit">提交</button>
-</form>
+  <button class="distance selfBtn  {{canUpdate?'':'bg'}}" form-type="submit">同意并上传</button>
+</form>
+
+<view class="message" hidden="{{!showMessage}}">
+
+  <view class="message-content">
+    <image src="{{imgServerUrl}}/images/clock/clock-waring-certified.png"></image>
+    <view class="message-tips">您的身份证已经被实名认证</view>
+    <view class="message-func">
+      <view>如果非您本人操作认证,</view>
+      <view> 请联系开心客服为您解决问题。</view>
+    </view>
+    <view class="message-number">400-692-0099</view>
+    <view class="message-btn" bindtap="callPhone">
+      <image src="{{imgServerUrl}}/images/clock/clock-phone-call.png"></image>
+      <text>一键拨号</text>
+    </view>
+  </view>
+
+</view>

+ 127 - 102
pages/identification/index.wxss

@@ -1,130 +1,77 @@
-.db {
-  display: flex;
-  align-items: center;
-  width: 100%;
-  height: 78rpx;
-  background: rgba(238, 238, 238, 1);
+page {
+  padding-bottom: 139rpx;
 }
 
-.db image {
-  width: 32rpx;
-  height: 32rpx;
-  padding-left: 30rpx;
+.tips {
+  width: 100%;
+  height: 82rpx;
+  background-color: #007AFF;
+  color: #fff;
+  font-size: 26rpx;
+  font-family: PingFangSC-Semibold, PingFang SC;
+  font-weight: 600;
+  line-height: 82rpx;
+  text-align: center;
 }
 
-.db text {
+.input-content {
+  height: 116rpx;
   font-size: 30rpx;
-  font-family: SourceHanSansCN-Regular;
+  font-family: PingFangSC-Regular, PingFang SC;
   font-weight: 400;
-  color: rgba(102, 102, 102, 1);
-  padding-left: 20rpx;
-}
-
-.input-box {
+  color: #666666;
+  background: #FFFFFF;
+  padding: 30rpx;
+  box-sizing: border-box;
   display: flex;
   align-items: center;
-  width: 100%;
-  height: 79rpx;
-  border-bottom: 2rpx solid rgba(221, 221, 221, 1);
-  padding-left: 82rpx;
+  justify-content: space-between;
+  border-bottom: 2rpx solid #eee;
 }
 
-.input-box input {
-  font-size: 26rpx;
-  font-family: SourceHanSansCN-Regular;
-  font-weight: 400;
-  color: rgba(153, 153, 153, 1);
+.input {
+  flex: 1;
+  text-align: right;
 }
 
 .idphoto {
   display: flex;
-  width: 100%;
-  height: 278rpx;
-  flex-direction: row;
-  align-items: center;
-  justify-content: space-around;
-  flex: 1 0 auto;
-}
-
-.idphoto .leftid {
-  display: flex;
-  flex-direction: column;
   align-items: center;
-  width: 300rpx;
-  height: 206rpx;
-  border: 2px solid rgba(204, 204, 204, 1);
-  border-radius: 12px;
-}
-
-.idphoto .leftid .smallicon {
-  width: 64rpx;
-  height: 45rpx;
-  padding-top: 60rpx;
-}
-
-.idCard{
-  width: 100%;
-  height: 100%;
-  border-radius: 12px;
-}
-
-.idphoto .leftid .zmphoto {
-  font-size: 22rpx;
-  font-family: SourceHanSansCN-Regular;
-  font-weight: 400;
-  color: rgba(204, 204, 204, 1);
-  padding-top: 29rpx;
-}
-
-.idphoto .leftid1 {
-  display: flex;
+  justify-content: center;
   flex-direction: column;
-  align-items: center;
-  width: 300rpx;
-  height: 206rpx;
-  border: 2px solid rgba(204, 204, 204, 1);
-  border-radius: 12px;
 }
 
-.idphoto .leftid1 .display {
-  width: 179rpx;
-  height: 100%;
-}
-
-.idphoto .shouchi {
+.leftid {
+  width: 630rpx;
+  height: 360rpx;
+  border: 1rpx dashed #000;
+  margin-top: 60rpx;
   display: flex;
-  flex-direction: column;
   align-items: center;
-  width: 300rpx;
-  height: 206rpx;
-  border: 2px solid rgba(204, 204, 204, 1);
-  border-radius: 12px;
+  justify-content: center;
 }
 
-.idphoto .shouchi .othersmallicon {
-  width: 48rpx;
-  height: 50rpx;
-  padding-top: 60rpx;
+.id-img {
+  width: 592rpx;
+  height: 322rpx;
+  border: 1rpx dashed #000;
+  position: relative;
 }
 
-.idphoto .shouchi .zmphoto {
-  font-size: 22rpx;
-  font-family: SourceHanSansCN-Regular;
-  font-weight: 400;
-  color: rgba(204, 204, 204, 1);
-  padding-top: 29rpx;
+.idCard {
+  width: 590rpx;
+  height: 320rpx;
+  position: absolute;
+  left: 1rpx;
+  top: 1rpx;
 }
 
-.bor {
-  display: flex;
-  align-items: center;
-  flex-direction: column;
-  width: 100%;
-  margin-top: 45rpx;
-  font-size: 19rpx;
-  font-family: SourceHanSansCN-Regular;
-  font-weight: 400;
-  color: rgba(187, 187, 187, 1);
+.smallicon {
+  width: 590rpx;
+  height: 320rpx;
+  position: absolute;
+  left: 1rpx;
+  top: 1rpx;
 }
 
 /* btn */
@@ -135,7 +82,6 @@
   left: 0;
   bottom: 0;
   width: 100%;
-
 }
 
 .btn-group {
@@ -161,3 +107,82 @@
   font-weight: 400;
   color: rgba(255, 254, 254, 1);
 }
+
+.message {
+  height: 100%;
+  width: 100%;
+  background: rgba(0, 0, 0, 0.6);
+  position: fixed;
+  left: 0;
+  top: 0;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.message-content {
+  width: 600rpx;
+  height: 748rpx;
+  background: #FFFFFF;
+  border-radius: 30rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  flex-direction: column;
+}
+
+
+.message-content image {
+  width: 114rpx;
+  height: 137rpx;
+}
+
+.message-tips {
+  font-size: 34rpx;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: bolder;
+  color: #333333;
+  margin-top: 53rpx;
+}
+
+.message-func {
+  text-align: center;
+  font-size: 28rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #666666;
+  margin-top: 20rpx;
+  margin-bottom: 30rpx;
+}
+
+.message-number {
+  font-size: 48rpx;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: 500;
+  color: #333333;
+  margin-bottom: 73rpx;
+}
+
+.message-btn {
+  height: 88rpx;
+  width: 392rpx;
+  font-size: 34rpx;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: 500;
+  color: #FFFFFF;
+  background: #007AFF;
+  border-radius: 44rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.message-btn image {
+  height: 35rpx;
+  width: 36rpx;
+  margin-right: 15rpx;
+}
+
+.bg {
+  background: rgba(1, 119, 255, 0.4);
+}

+ 12 - 9
pages/result/index.js

@@ -2,12 +2,14 @@ import { imgServerUrl } from '../../config/config.js'
 Page({
   data: {
     imgServerUrl: imgServerUrl,
-    type:'',
-    status:''
+    type: '',
+    status: '',
+    from: ''
   },
   onLoad: function (options) {
-    let { type='auth',status=0 } = options 
-    let { hpPositionGroupId =""} = options//拼团成功 拼团id
+    let { type = 'auth', status = 0 } = options
+    let { hpPositionGroupId = "" } = options//拼团成功 拼团id
+    let { from } = options
     /**
      * Region:
      * 
@@ -25,20 +27,21 @@ Page({
      * */
     this.setData({
       type,
-      status
+      status,
+      from
     })
 
     //拼团成功跳转参团详情
-    if (type == 'pt' && status==1){
-      setTimeout(()=>{
+    if (type == 'pt' && status == 1) {
+      setTimeout(() => {
         wx.redirectTo({
           url: '../pt-detail/index?hpPositionGroupId=' + hpPositionGroupId,
         })
-      },2000)
+      }, 2000)
     }
   },
   //身份认证失败重新认证
-  toAuth(){
+  toAuth() {
     wx.redirectTo({
       url: '../identification/index',
     })

+ 33 - 20
pages/result/index.wxml

@@ -1,28 +1,41 @@
-<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==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>
-</view>
+<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==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>
+  </view>
 
 
 
 
-<view class='shz' wx:if="{{type=='auth'&& status==2}}">
-  <text class='sfshz'>身份审核中</text>
-  <text class='sqtjdht'>您的申请已经提交到后台</text>
-  <text class='wait'>请耐心等待</text>
-</view>
+  <view class='shz' wx:if="{{type=='auth'&& status==2}}">
+    <text class='sfshz'>身份审核中</text>
+    <text class='sqtjdht'>您的申请已经提交到后台</text>
+    <text class='wait'>请耐心等待</text>
+  </view>
 
 
-<view class='shz' wx:if="{{type=='auth'&& status==0}}">
-  <text class='sfshz'>审核未通过</text>
-  <view class='shwtg'>
-    <text bindtap='toAuth'>重拍靓照</text>
+  <view class='shz' wx:if="{{type=='auth'&& status==0}}">
+    <text class='sfshz'>审核未通过</text>
+    <view class='shwtg'>
+      <text bindtap='toAuth'>重拍靓照</text>
+    </view>
   </view>
-</view>
 
-<view class='shz' wx:if="{{type=='submit'&& status==2}}">
-  <text class='sfshz'>审核已提交</text>
-  <text class='sqtjdht'>您的身份认证审核已提交</text>
-  <text class='wait'>请耐心等待我们的审核...</text>
-</view>
+  <view class='shz' wx:if="{{type=='submit'&& status==2}}">
+    <text class='sfshz'>审核已提交</text>
+    <text class='sqtjdht'>您的身份认证审核已提交</text>
+    <text class='wait'>请耐心等待我们的审核...</text>
+  </view>
+</block>

+ 64 - 12
pages/result/index.wxss

@@ -1,3 +1,55 @@
+.submit-content {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  flex-direction: column;
+}
+
+.submit-content image {
+  width: 749rpx;
+  height: 450rpx;
+  margin-top: 153rpx;
+}
+
+.identification-submit {
+  font-size: 42rpx;
+  font-family: PingFangSC-Semibold, PingFang SC;
+  font-weight: 600;
+  color: #000000;
+}
+
+.identification-message {
+  font-size: 30rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #666666;
+  margin-top: 20rpx;
+}
+
+.identification-btn {
+  width: 100%;
+  height: 128rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  position: fixed;
+  bottom: 0;
+  left: 0;
+}
+
+.identification-btn navigator {
+  width: 690rpx;
+  height: 88rpx;
+  font-size: 34rpx;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: 500;
+  color: #FFFFFF;
+  background: #0177FF;
+  border-radius: 10rpx;
+  text-align: center;
+  line-height: 88rpx;
+}
+
 .db image {
   width: 100%;
   /* height: 641rpx; */
@@ -40,16 +92,16 @@
   display: flex;
   align-items: center;
   justify-content: center;
-  width:287rpx;
-height:85rpx;
-background:linear-gradient(-60deg,rgba(237,141,93,1),rgba(251,174,111,1));
-border-radius:42rpx;
-margin-top: 54rpx
-}
-
-.shz .shwtg text{
-font-size:38rpx;
-font-family:SourceHanSansCN-Regular;
-font-weight:400;
-color:rgba(255,254,254,1);
+  width: 287rpx;
+  height: 85rpx;
+  background: linear-gradient(-60deg, rgba(237, 141, 93, 1), rgba(251, 174, 111, 1));
+  border-radius: 42rpx;
+  margin-top: 54rpx
+}
+
+.shz .shwtg text {
+  font-size: 38rpx;
+  font-family: SourceHanSansCN-Regular;
+  font-weight: 400;
+  color: rgba(255, 254, 254, 1);
 }

+ 36 - 0
project.config.json

@@ -376,6 +376,42 @@
           "id": -1,
           "name": "打卡",
           "pathName": "pages/clock/clock",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "打卡规则",
+          "pathName": "pages/clock/clock-rule/clock-rule",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": 44,
+          "name": "打卡成功",
+          "pathName": "pages/clock/clock-success/clock-success",
+          "query": "status=4",
+          "scene": null
+        },
+        {
+          "id": 45,
+          "name": "提交成功",
+          "pathName": "pages/result/index",
+          "query": "type=auth&status=2&from=clock",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "统计列表",
+          "pathName": "pages/clock/clock-tongji/list",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "统计首页",
+          "pathName": "pages/clock/clock-tongji/index",
+          "query": "",
           "scene": null
         }
       ]

+ 3 - 3
services/uploadFile.js

@@ -26,9 +26,9 @@ module.exports = {
             header: {},
             formData: {
               up_type: up_type,
-              user_id: app.globalData.userId,
-              user_token: app.globalData.userToken,
-              member_id: app.globalData.memberId
+              user_id: wx.getStorageSync("user_id"), 
+              user_token:  wx.getStorageSync("user_token"),
+              member_id: wx.getStorageSync("member_id")
             },
             success: function(res) {
               let data = JSON.parse(res.data)

+ 9 - 0
utils/base.js

@@ -36,6 +36,15 @@ const base = {
   },
 
   /**
+   * [功能方法]
+   * @param  {[type]}  item [description]
+   * @return {Boolean}      [description]
+   */
+  isIDNum(idNum) {
+    return /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(idNum)
+  },
+  
+  /**
    * [公共方法]
    * @param  {[type]}  item [description]
    * @return {Boolean}      [description]

+ 10 - 6
utils/http.js

@@ -93,12 +93,16 @@ const http = (params) => {
               url: '/pages/login/login',
             })
           } else if (errorCode == 2009) {
-            //用户信息重复,请选择用户信息
-            wx.setStorageSync('userList', res.data.data.userList);
-            wx.setStorageSync('currentUser', res.data.data.currentUser);
-            wx.redirectTo({
-              url: '/pages/select-info/index',
-            })
+            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',
+              })
+            }
           } else if (errorCode == 2008) {
             //账号不存在,或token无效
             if (model && params.data.task_id !== 10) {