wangxin před 4 roky
rodič
revize
618c64f372

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

@@ -14,7 +14,7 @@ Page({
    */
   data: {
     avatar: wx.getStorageSync('userInfo').avatarUrl,
-    name: wx.getStorageSync('userInfo').nickName,
+    name: wx.getStorageSync('hpMember').realName,
     imgServerUrl,
     mouthNext: `${imgServerUrl}/images/clock/clock-arrow-righr-disabled.png`,
     mouthLast: `${imgServerUrl}/images/clock/clock-arrow-left.png`,
@@ -101,7 +101,7 @@ Page({
   onLoad: function (options) {
     this.setData({
       avatar: wx.getStorageSync('userInfo').avatarUrl,
-      name: wx.getStorageSync('userInfo').nickName,
+      name: wx.getStorageSync('hpMember').realName,
       defaultDate: new Date(options.date)
     })
   },

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

@@ -1,3 +1,5 @@
 {
-  "usingComponents": {}
+  "usingComponents": {
+    "avatar": "../../../components/avatar/avatar"
+  }
 }

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

@@ -3,7 +3,7 @@
 <view class="container">
   <view class="header">
     <view class="avatar">
-      <image src="{{avatar}}" class="avatar-img"></image>
+      <avatar src="{{avatar}}" size='102' class="avatar-img"></avatar>
       <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>

+ 58 - 39
pages/clock/clock.js

@@ -7,9 +7,10 @@ import {
   imgServerUrl
 } from '../../config/config.js'
 import { transformFromWGSToGCJ } from '../../utils/util'
+import loading from '../../utils/loading.js'
 let clickStatus = true
 let locationStatus = true
-let inter = null
+let nowTime = 0
 Page({
 
   /**
@@ -57,7 +58,8 @@ Page({
         fontWeight: 600
       }
     ],
-    userInfo: wx.getStorageSync('userInfo')
+    userInfo: '',
+    hpMember: ''
   },
   closeSettingVisible(data) {
     const { index } = data.detail;
@@ -75,9 +77,11 @@ Page({
   getLocation() {
     return new Promise(reslove => {
       wx.getLocation({
+        type: 'gcj02',
         success: data => {
-          const { latitude, longitude } = transformFromWGSToGCJ(data.latitude, data.longitude)
-          reslove(Object.assign(data, { latitude, longitude }))
+          // const { latitude, longitude } = transformFromWGSToGCJ(data.latitude, data.longitude)
+          // reslove(Object.assign(data, { latitude, longitude }))
+          reslove(data)
         },
         fail: res => {
           reslove(res)
@@ -154,28 +158,28 @@ Page({
       // this.clock(120.35333936646411, 31.535590759589642)
     }
     if (this.data.clockType === 1 && this.data.wsPunchClockId) {
-      wx.showModal({
-        title: '提示',
-        content: '未到下班时间,请刷新页面获取最新状态',
-        showCancel: false,
-      })
+      // 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,
-      })
+      // wx.showModal({
+      //   title: '提示',
+      //   content: '超出范围,请刷新页面获取当前位置',
+      //   showCancel: false,
+      // })
     }
     if (this.data.clockType === 4) {
-      wx.showModal({
-        title: '提示',
-        content: '今日打卡已完成',
-        showCancel: false,
-      })
+      // wx.showModal({
+      //   title: '提示',
+      //   content: '今日打卡已完成',
+      //   showCancel: false,
+      // })
     }
   },
   clock(longitude, latitude) {
@@ -232,15 +236,14 @@ Page({
       showCover: !this.data.showCover
     })
   },
-  async load() {
+  async load(showLoading = true) {
     try {
-      wx.showLoading({
-        icon: 'none',
-        title: '定位中...',
-      })
-      await this.location()
-      wx.hideLoading()
-      this.locationLoop()
+      if (showLoading) {
+        wx.showLoading({
+          title: '定位中...',
+        })
+      }
+      nowTime = new Date().getTime()
       punchClockNeedInfo({ longitude: this.data.longitude, latitude: this.data.latitude }).then(data => {
         // punchClockNeedInfo({ longitude: 120.3533, latitude: 31.535590759589642 }).then(data => {
         locationStatus = true
@@ -265,7 +268,6 @@ Page({
           sumMoney,
           wsPunchClockId
         })
-        console.log(clockType === 1 && !wsPunchClockId)
         if (clockType === 1 && !wsPunchClockId) {
           this.setData({
             statusImage: `${imgServerUrl}/images/clock/clock-in.png`,
@@ -277,7 +279,7 @@ Page({
           this.setData({
             statusImage: `${imgServerUrl}/images/clock/clock-out-disabled.png`,
             statusIcon: `${imgServerUrl}/images/clock/clock-waring.png`,
-            statusMessage: `上班${dailyAvailableMinHour}小时才能进行下班打卡`,
+            statusMessage: `上班${dailyAvailableMinHour}小时才能进行下班打卡`,
           })
         }
         if (clockType === 2 && wsPunchClockId) {
@@ -303,6 +305,10 @@ Page({
         }
       }).catch(data => {
         locationStatus = true
+      }).finally(res => {
+        if (showLoading) {
+          wx.hideLoading()
+        }
       })
     } catch (e) {
       wx.hideLoading()
@@ -312,7 +318,6 @@ Page({
   reload() {
     if (locationStatus) {
       locationStatus = false
-      clearTimeout(inter)
       this.load()
     } else {
       wx.showToast({
@@ -321,13 +326,6 @@ Page({
       })
     }
   },
-  locationLoop() {
-    inter = setTimeout(() => {
-      console.log(222)
-      this.location()
-      this.locationLoop()
-    }, 60000)
-  },
   /**
    * 生命周期函数--监听页面加载
    */
@@ -345,15 +343,36 @@ Page({
   /**
    * 生命周期函数--监听页面显示
    */
-  onShow: function () {
+  onShow: async function () {
+    this.setData({
+      userInfo: wx.getStorageSync('userInfo'),
+      hpMember: wx.getStorageSync('hpMember')
+    })
+    await this.location()
     this.load()
+    wx.onLocationChange((result) => {
+      const { latitude, longitude } = result
+      this.setData({
+        latitude,
+        longitude
+      }, _ => {
+        if (this.data.userInfo && this.data.hpMember && new Date().getTime() - nowTime > 60000) {
+          this.load(false)
+        }
+      })
+    })
+    wx.startLocationUpdate({
+      success: (res) => {
+        console.log(res)
+      },
+    })
   },
 
   /**
    * 生命周期函数--监听页面隐藏
    */
   onHide: function () {
-    clearTimeout(inter)
+    wx.offLocationChange()
   },
 
   /**

+ 2 - 1
pages/clock/clock.json

@@ -1,6 +1,7 @@
 {
   "enablePullDownRefresh": true,
   "usingComponents": {
-    "modal":"../../ui/modal/index"
+    "modal":"../../ui/modal/index",
+    "avatar": "../../components/avatar/avatar"
   }
 }

+ 9 - 5
pages/clock/clock.wxml

@@ -44,9 +44,14 @@
       <view class="pass-header-content">
         <view class="pass-header-content-left">
           <view class="userinfo">
-            <image src="{{userInfo.avatarUrl}}" class="avatarUrl"></image>
+            <view class="avatar">
+              <avatar src="{{userInfo.avatarUrl}}" size='102' class="avatarUrl"></avatar>
+              <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="userinfo-status">
-              <text>{{userInfo.nickName}}</text>
+              <text>{{hpMember.realName}}</text>
               <text wx:if="{{approveStatus === false}}" class="approveStatus"> </text>
               <text wx:if="{{approveStatus === 0}}" class="approveStatus">已认证</text>
               <text wx:if="{{approveStatus === 1}}" class="approveStatus">等待认证</text>
@@ -128,8 +133,10 @@
           <text class="prepayable-unit">元</text>
         </view>
       </view> -->
+      <image src="../../images/happyjob/kefu.png" class="kefu" bindtap="navigator" data-index="{{2}}"></image>
     </view>
     <!-- <image bindtap="toRule" src="{{imgServerUrl}}/images/clock/clock-video.png" class="video"></image> -->
+
   </view>
 </view>
 <view class="cover" hidden="{{showCover}}" bindtap="changeCoverStatus">
@@ -144,9 +151,6 @@
   </view>
 </view>
 
-<view class="kefu" bindtap="navigator" data-index="{{2}}">
-  <image src="../../images/happyjob/kefu.png"></image>
-</view>
 
 <modal visible='{{settingVisible}}' actions='{{actions}}' bind:click='closeSettingVisible'>
   <view class="settingVisible">请前往设置打开用户定位权限</view>

+ 24 - 14
pages/clock/clock.wxss

@@ -144,12 +144,27 @@ page {
   justify-content: center;
 }
 
-.userinfo image {
+.avatar {
+  width: 102rpx;
+  height: 102rpx;
+  border-radius: 50%;
+  position: relative;
+}
+
+.avatarUrl {
   width: 102rpx;
   height: 102rpx;
   border-radius: 50%;
 }
 
+.avatar-icon {
+  width: 32rpx;
+  height: 32rpx;
+  position: absolute;
+  right: -4rpx;
+  bottom: -4rpx;
+}
+
 .userinfo-status {
   display: flex;
   justify-content: space-around;
@@ -184,6 +199,8 @@ page {
   width: 690rpx;
   height: 176rpx;
   background: #FFFFFF;
+  padding: 0 30rpx;
+  box-sizing: border-box;
   border-radius: 16px;
   font-weight: 400;
   color: #fff;
@@ -247,14 +264,15 @@ page {
 
 .pass-content {
   width: 690rpx;
-  height: 962rpx;
+  flex: 1;
   background: #fff;
   /* box-shadow: 0px 10rpx 10rpx 0rpx rgba(0, 0, 0, 0.06); */
   border-radius: 16rpx;
   margin-top: 20rpx;
   padding: 30rpx 27rpx;
-  padding-bottom: 0;
+  margin-bottom: 20rpx;
   box-sizing: border-box;
+  position: relative;
 }
 
 .status {
@@ -459,15 +477,7 @@ page {
 .kefu {
   width: 120rpx;
   height: 120rpx;
-  background: #FFFFFF;
-  box-shadow: 0px 0px 14rpx 0 rgba(0, 0, 0, 0.1);
-  border-radius: 70rpx;
-  position: fixed;
-  right: 30rpx;
-  bottom: 60rpx;
-}
-
-.kefu image {
-  width: 120rpx;
-  height: 120rpx;
+  position: absolute;
+  right: -14rpx;
+  bottom: 26rpx;
 }

+ 105 - 24
pages/identification/index.js

@@ -6,23 +6,29 @@ import {
   uploadImg
 } from '../../services/uploadFile.js'
 import {
+  apiUrl
+} from '../../config/config.js'
+import { url } from '../../api/api'
+import {
   imgServerUrl,
   imgServerUrl_new
 } from '../../config/config.js'
 import { isIDNum } from '../../utils/base'
 var app = getApp()
 const ocrSdk = require("../../ocrsdk/index");
-
+const fs = wx.getFileSystemManager()
 Page({
   data: {
     imgServerUrl: imgServerUrl,
     imgServerUrl_new: imgServerUrl_new,
     realName: '',
     idNum: '',
+    nation: '',
     idFrontPic: '',
     idBackPic: '',
     idPersonPic: '',
     showMessage: false,
+    showPass: false,
     message: '',
     canUpdate: false,
     from: '',
@@ -51,6 +57,11 @@ Page({
       showMessage: !this.data.showMessage
     })
   },
+  changeShowPass() {
+    this.setData({
+      showPass: !this.data.showPass
+    })
+  },
   testCanUpdate() {
     let {
       realName,
@@ -97,22 +108,65 @@ Page({
       case 1:
         up_type = '1';
         this.setData({
-          realName: data.Name,
-          idNum: data.IdNum,
-          idFrontPic: 'data:image/jpeg;base64,' + JSON.parse(data.AdvancedInfo).IdCard
+          idFrontPic: false
+        }, _ => {
+          fs.unlink({
+            filePath: this.data.idFrontPic,
+            complete: () => {
+              const filePath = `${wx.env.USER_DATA_PATH}/identificationIdFrontPic${new Date().getTime()}.png`
+              fs.writeFile({
+                filePath,
+                data: JSON.parse(data.AdvancedInfo).IdCard,
+                encoding: 'base64',
+                success: res => {
+                  this.setData({
+                    realName: data.Name,
+                    idNum: data.IdNum,
+                    nation: data.Nation,
+                    idFrontPic: filePath
+                  })
+                  this.testCanUpdate()
+                },
+                fail: (res) => {
+                  console.log(res)
+                }
+              })
+            }
+          })
         })
         break;
       case 2:
         up_type = '2';
         this.setData({
-          idBackPic: 'data:image/jpeg;base64,' + JSON.parse(data.AdvancedInfo).IdCard
+          idBackPic: false
+        }, _ => {
+          fs.unlink({
+            filePath: `${wx.env.USER_DATA_PATH}/identificationIdBackPic.png`,
+            complete: () => {
+              const filePath = `${wx.env.USER_DATA_PATH}/identificationIdBackPic${new Date().getTime()}.png`
+              fs.writeFile({
+                filePath,
+                data: JSON.parse(data.AdvancedInfo).IdCard,
+                encoding: 'base64',
+                success: res => {
+                  this.setData({
+                    idBackPic: filePath
+                  })
+                  this.testCanUpdate()
+                },
+                fail: (res) => {
+                  console.log(res)
+                }
+              })
+            }
+          })
         })
         break;
       case 3:
         up_type = '3';
         break;
     }
-    this.testCanUpdate()
+
     // uploadImg(up_type).then(res => {
     //   let image = res.data.imgUrl
     //   if (index == 1) {
@@ -150,13 +204,14 @@ Page({
       this.testCanUpdate()
     })
   },
-  submit(e) {
+  async submit(e) {
     this.testCanUpdate();
     let {
       realName,
       idNum,
       idFrontPic,
       idBackPic,
+      nation,
       // idPersonPic
     } = this.data;
     if (realName == "") {
@@ -208,13 +263,22 @@ Page({
       idCardNumber: idNum,
       idFrontPic: idFrontPic,
       idBackPic: idBackPic,
+      nation: nation,
       // idPersonPic: idPersonPic,
       minaType: 1, //1:代表小程序
       user_id: app.globalData.userId,
       user_token: app.globalData.userToken,
       member_id: app.globalData.memberId
     }
-    Object.assign(paramsObj);
+    const idFrontPicPath = paramsObj.idFrontPic
+    paramsObj.idFrontPic = await this.uploadFile(1, idFrontPicPath)
+
+    fs.unlinkSync(idFrontPicPath)
+    const idBackPicPath = paramsObj.idFrontPic
+    paramsObj.idBackPic = await this.uploadFile(2, idBackPicPath)
+
+    fs.unlinkSync(idBackPicPath)
+
     postApprove(paramsObj).then(data => {
       wx.hideLoading()
       wx.showToast({
@@ -224,12 +288,17 @@ Page({
         wx.redirectTo({
           url: '../result/index?type=auth&status=2&from=clock',
         })
+        // this.setData({
+        //   showPass: true,
+        //   message: '您的实名认证已通过'
+        // })
         return
       }
       wx.redirectTo({
         url: '../result/index?type=auth&status=2',
       })
     }).catch(data => {
+      wx.hideLoading()
       if (data.errcode === 2100) {
         this.setData({
           showMessage: true,
@@ -240,7 +309,7 @@ Page({
       if (data.errcode === 2101) {
         this.setData({
           showMessage: true,
-          message: '您的身份证已实名认证,无需重复认证'
+          message: '您已实名认证,无需重复认证'
         })
         return
       }
@@ -250,6 +319,29 @@ Page({
       eventId: '5ea25ae37739104342928e96'
     });
   },
+  uploadFile(up_type, filePath) {
+    return new Promise((reslove, reject) => {
+      wx.uploadFile({
+        url: apiUrl + url.imgUp,
+        filePath,
+        name: 'file',
+        header: {},
+        formData: {
+          up_type,
+          user_id: wx.getStorageSync("user_id"),
+          user_token: wx.getStorageSync("user_token"),
+          member_id: wx.getStorageSync("member_id")
+        },
+        success: (res) => {
+          let data = JSON.parse(res.data)
+          reslove(data.data.imgUrl)
+        },
+        fail: () => {
+          reject()
+        }
+      })
+    })
+  },
   ocrSdkStart(type) {
     return new Promise((reslove, reject) => {
       ocrSdk.start({
@@ -269,7 +361,7 @@ Page({
           }
         },
         cameraConfig: {
-          autoMode: true,
+          autoMode: false,
           maxTry: 3,
           disableAlbum: false
         },
@@ -286,12 +378,6 @@ Page({
           }
           wx.navigateBack({
             delta: 1,
-            success: () => {
-              wx.showToast({
-                icon: 'success',
-                title: '识别成功',
-              })
-            }
           })
         },
         fail: (error) => {
@@ -305,14 +391,9 @@ Page({
               backStatus: false
             })
           }
-          wx.navigateBack({
-            delta: 1,
-            success: () => {
-              wx.showToast({
-                icon: 'none',
-                title: '识别失败',
-              })
-            }
+          wx.showModal({
+            title: '提示',
+            content: error.Error.Message + ',请重试!',
           })
         }
       })

+ 26 - 8
pages/identification/index.wxml

@@ -1,5 +1,5 @@
 <view class="tips">
-  为确保您账户的安全,请确认上传您的真实信息
+  为了您的账户及资金安全,请上传本人真实身份证照片!
 </view>
 
 <view class='idphoto'>
@@ -82,21 +82,39 @@
   <button class="distance selfBtn  {{canUpdate?'':'bg'}}" form-type="submit">提交认证</button>
 </form>
 
-<view class="message" hidden="{{!showMessage}}">
+<view class="message" hidden="{{!showPass}}">
 
-  <view class="message-content">
+  <view class="pass-content">
     <!-- <image src="{{imgServerUrl}}/images/clock/clock-waring-certified.png"></image> -->
-    <view class="message-tips">{{message}}</view>
-    <view class="message-func">
+    <view class="pass-tips">{{message}}</view>
+    <view class="pass-func">
       <view>如果实名信息有误,</view>
       <view> 请联系开心客服帮您处理!</view>
     </view>
-    <view class="message-number">400-692-0099</view>
-    <view class="message-btn" bindtap="callPhone">
+    <view class="pass-number">400-692-0099</view>
+    <view class="pass-btn" bindtap="callPhone">
       <image src="{{imgServerUrl}}/images/clock/clock-phone-call.png"></image>
       <text>一键拨号</text>
     </view>
-    <image src="../../images/happyjob/identification-close.png" class="identification-close" bindtap="changeShowMessage"></image>
+    <image src="../../images/happyjob/identification-close.png" class="identification-close" bindtap="changeShowPass"></image>
   </view>
 
+</view>
+
+<view class="message" hidden="{{!showMessage}}" bindtap="changeShowMessage">
+
+<view class="message-content">
+  <image src="{{imgServerUrl}}/images/clock/clock-waring-certified.png"></image>
+  <view class="message-tips">{{message}}</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>

+ 79 - 8
pages/identification/index.wxss

@@ -33,6 +33,10 @@ page {
 
 .input {
   flex: 1;
+  font-size: 30rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #AAAAAA;
   text-align: right;
 }
 
@@ -64,13 +68,14 @@ page {
 .id-img {
   width: 320rpx;
   height: 194rpx;
-  border: 1rpx dashed #000;
+  /* border: 1rpx dashed #000; */
   position: relative;
 }
 
 .idCard {
   width: 100%;
   height: 100%;
+  border-radius: 20rpx;
   position: absolute;
   left: 0;
   top: 0;
@@ -79,6 +84,7 @@ page {
 .default-img {
   width: 100%;
   height: 100%;
+  border-radius: 20rpx;
   position: absolute;
   left: 0;
   top: 0;
@@ -153,6 +159,70 @@ page {
 
 .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;
+}
+
+
+.pass-content {
+  width: 600rpx;
   height: 640rpx;
   background: #FFFFFF;
   border-radius: 30rpx;
@@ -164,12 +234,12 @@ page {
   position: relative;
 }
 
-.message-content image {
+.pass-content image {
   width: 114rpx;
   height: 137rpx;
 }
 
-.message-content .identification-close{
+.pass-content .identification-close{
   width: 54rpx;
   height: 54rpx;
   position: absolute;
@@ -179,7 +249,7 @@ page {
 }
 
 
-.message-tips {
+.pass-tips {
   font-size: 42rpx;
   font-family: PingFangSC-Medium, PingFang SC;
   font-weight: bold;
@@ -188,7 +258,7 @@ page {
   box-sizing: border-box;
 }
 
-.message-func {
+.pass-func {
   text-align: center;
   font-size: 28rpx;
   font-family: PingFangSC-Regular, PingFang SC;
@@ -198,14 +268,14 @@ page {
   margin-bottom: 30rpx;
 }
 
-.message-number {
+.pass-number {
   font-size: 48rpx;
   font-family: PingFangSC-Medium, PingFang SC;
   font-weight: 500;
   color: #333333;
 }
 
-.message-btn {
+.pass-btn {
   height: 88rpx;
   width: 392rpx;
   font-size: 34rpx;
@@ -220,12 +290,13 @@ page {
   margin-top: 73rpx;
 }
 
-.message-btn image {
+.pass-btn image {
   height: 35rpx;
   width: 36rpx;
   margin-right: 15rpx;
 }
 
+
 .bg {
   background: rgba(1, 119, 255, 0.4);
 }

+ 19 - 20
pages/recommend-iphone/index.js

@@ -2,12 +2,13 @@ import { imgServerUrl } from '../../config/config.js'
 import { shareBound } from '../../services/index.js'
 import { showToast } from '../../utils/tips.js'
 import { updataStorageData } from '../../utils/storage.js'
+import { getUserInfo } from '../../utils/wx'
 var app = getApp()
 Page({
   data: {
     imgServerUrl: imgServerUrl,
-    errorFlag:0,
-    phoneNo:'',
+    errorFlag: 0,
+    phoneNo: '',
     shareToken: '',
   },
   onLoad: function (options) {
@@ -21,22 +22,20 @@ Page({
       }
     } else {
       // 在没有 open-type=getUserInfo 版本的兼容处理
-      wx.getUserInfo({
-        success: res => {
-          app.globalData.userInfo = res.userInfo
-          this.data.shareToken = updataStorageData('shareToken')
-        }
+      getUserInfo().then(res => {
+        app.globalData.userInfo = res.userInfo
+        this.data.shareToken = updataStorageData('shareToken')
       })
     }
   },
-// 手机号输入框
-  bindPhoneBlur(e){
+  // 手机号输入框
+  bindPhoneBlur(e) {
     this.setData({
-      phoneNo:e.detail.detail.value,
+      phoneNo: e.detail.detail.value,
     })
   },
   //确认按钮点击
-  dataSub(e){
+  dataSub(e) {
 
     if (this.data.phoneNo.length != 11) {
       showToast('请输入11位手机号码!')
@@ -45,20 +44,20 @@ Page({
     shareBound({
       shareToken: this.data.shareToken,
       phoneNo: this.data.phoneNo,
-    }).then(data=>{
+    }).then(data => {
       this.setData({
         errorFlag: 1,
       })
-    }).catch(err=>{
-      if(err.errorCode == 2){
+    }).catch(err => {
+      if (err.errorCode == 2) {
         this.setData({
-          errorFlag:2,
+          errorFlag: 2,
         })
       }
     })
   },
   // 绑定成功后确定进入首页
-  bindSuccessTap(e){
+  bindSuccessTap(e) {
     wx.switchTab({
       url: '../index/index'
     })
@@ -69,19 +68,19 @@ Page({
       errorFlag: 0,
     })
   },
-  goBack(){
+  goBack() {
     wx.navigateTo({
       url: '../recommend/index',
     })
   },
-  goHome(){
+  goHome() {
     wx.switchTab({
       url: '../index/index',
     })
   },
   onError(err) {
-    app.aldstat.sendEvent('报错',{
-        'err': err
+    app.aldstat.sendEvent('报错', {
+      'err': err
     });
   },
 })

+ 30 - 28
pages/result/index.wxml

@@ -1,40 +1,42 @@
-
-  <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='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}}">
+<!-- <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>
+<view class='shz' wx:if="{{type=='auth'&& status==0}}">
+  <text class='sfshz'>审核未通过</text>
+  <view class='shwtg'>
+    <text bindtap='toAuth'>重拍靓照</text>
   </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>
+
+<view class="submit-content" wx:if="{{type=='auth'&& status==2}}">
+  <image src="{{imgServerUrl}}/images/happyjob/identification-shcg.png"></image>
+  <view class="identification-submit">您的实名认证已通过</view>
+  <view class="identification-message">
+    <view>如果实名信息有误,</view>
+    <view>请联系开心客服帮您处理!</view>
   </view>
-
-  <view class="submit-content" wx:if="{{type=='auth'&& status==2}}">
-    <image src="{{imgServerUrl}}/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>
+  <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>

+ 1 - 0
pages/result/index.wxss

@@ -24,6 +24,7 @@
   font-weight: 400;
   color: #666666;
   margin-top: 20rpx;
+  text-align: center;
 }
 
 .identification-btn {

+ 1 - 1
project.config.json

@@ -48,7 +48,7 @@
     "minifyWXSS": true
   },
   "compileType": "miniprogram",
-  "libVersion": "2.8.3",
+  "libVersion": "2.11.2",
   "appid": "wx5ae6908ae55edcb7",
   "projectname": "kaixin",
   "debugOptions": {

+ 2 - 1
services/index.js

@@ -584,7 +584,8 @@ module.exports = {
       url: url.punchClockNeedInfo,
       data: params,
       method: 'GET',
-      header: {}
+      header: {},
+      noLoading:true
     })
   },
   // 打卡接口

+ 10 - 7
utils/http.js

@@ -58,13 +58,16 @@ const http = async (params) => {
     })
     return Promise.reject('网络未连接')
   }
-  _loading.showLoading({
-    mask: true,
-    title: '加载中...',
-    success: () => {
-      console.log('loding start')
-    }
-  })
+  if (!params.noLoading) {
+    _loading.showLoading({
+      mask: true,
+      title: '加载中...',
+      success: () => {
+        console.log('loding start')
+      }
+    })
+  }
+
   //返回promise 对象
   return new Promise((resolve, reject) => {
     const pages = getCurrentPages();

+ 1 - 1
utils/wx.js

@@ -2,7 +2,7 @@ import { url } from '../api/api.js'
 import { saveLogin } from '../services/wx.js'
 
 //获取code
-function getWxCode(){
+function getWxCode() {
   return new Promise((resolve, reject) => {
     wx.login({
       success(res) {