|
|
@@ -102,6 +102,26 @@
|
|
|
</view>
|
|
|
</navigator>
|
|
|
</view>
|
|
|
+
|
|
|
+ <!-- 认证结果弹窗 -->
|
|
|
+ <uni-popup ref="popup" :is-mask-click="false">
|
|
|
+ <view class="popup-content">
|
|
|
+ <view class="title">
|
|
|
+ <view class="icon">
|
|
|
+ <img src="./imgs/success2.png">
|
|
|
+ </view>
|
|
|
+ <view class="title_info">
|
|
|
+ 打卡成功
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="time">
|
|
|
+ {{nowTime_pop}}
|
|
|
+ </view>
|
|
|
+ <view class="popup_button" @click="handleGoHome">
|
|
|
+ 我知道了
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </uni-popup>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -117,6 +137,8 @@
|
|
|
list: [],
|
|
|
// 当前时间
|
|
|
nowTime: "",
|
|
|
+ // 弹窗当前时间
|
|
|
+ nowTime_pop: "",
|
|
|
// 当前定位位置信息
|
|
|
address: "",
|
|
|
// 定时器标识
|
|
|
@@ -146,7 +168,11 @@
|
|
|
// 当前页面的路由地址
|
|
|
pageUrl: "",
|
|
|
// 是否显示底部 我的 导航栏
|
|
|
- showTab: false
|
|
|
+ showTab: false,
|
|
|
+ // 是否需要人脸识别
|
|
|
+ faceRecognition: true,
|
|
|
+ // 是否需要拍摄场景照片
|
|
|
+ takePicture: true
|
|
|
};
|
|
|
},
|
|
|
onLoad() {
|
|
|
@@ -155,7 +181,7 @@
|
|
|
// 实例化API核心类
|
|
|
qqmapsdk = new QQMapWX({
|
|
|
// 申请的key
|
|
|
- key: 'R43BZ-2XROX-L7T45-T5OQI-IBDFT-GNBOI'
|
|
|
+ key: 'X57BZ-ZISE3-KTN3O-3P45H-C3J7Q-D5B67'
|
|
|
});
|
|
|
// 获取当前系统时间
|
|
|
this.getNowTime()
|
|
|
@@ -178,7 +204,7 @@
|
|
|
uni.removeStorageSync("sub-administrator")
|
|
|
qqmapsdk = new QQMapWX({
|
|
|
// 申请的key
|
|
|
- key: 'R43BZ-2XROX-L7T45-T5OQI-IBDFT-GNBOI'
|
|
|
+ key: 'X57BZ-ZISE3-KTN3O-3P45H-C3J7Q-D5B67'
|
|
|
});
|
|
|
this.getNowTime()
|
|
|
this.getTimestamp()
|
|
|
@@ -304,8 +330,10 @@
|
|
|
this.notes = "无打卡任务无需打卡"
|
|
|
} else {
|
|
|
this.flags = true
|
|
|
- this.list = res.data.reverse()
|
|
|
+ this.list = res.data
|
|
|
this.activeid = this.list[0].id
|
|
|
+ this.faceRecognition = this.list[0].faceRecognition
|
|
|
+ this.takePicture = this.list[0].takePicture
|
|
|
this.contrastObj = this.list[0]
|
|
|
this.changeType()
|
|
|
}
|
|
|
@@ -365,39 +393,75 @@
|
|
|
this.getTimestamp()
|
|
|
this.contrastObj = item
|
|
|
this.activeid = item.id
|
|
|
+ this.faceRecognition = item.faceRecognition
|
|
|
+ this.takePicture = item.takePicture
|
|
|
this.changeType()
|
|
|
},
|
|
|
// 点击打卡按钮回调
|
|
|
handlePunch(info) {
|
|
|
if (this.flags) {
|
|
|
let obj = JSON.stringify(info)
|
|
|
-
|
|
|
- // 获取用户位置权限
|
|
|
- uni.authorize({
|
|
|
- scope: 'scope.userLocation',
|
|
|
- success() {
|
|
|
- uni.navigateTo({
|
|
|
- url: `/pagesClockIn/location/location?obj=${obj}`
|
|
|
- })
|
|
|
- },
|
|
|
- fail() {
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '请先开启定位权限,否则将无法使用定位功能',
|
|
|
- cancelText: '不授权',
|
|
|
- confirmText: '授权',
|
|
|
- success: function(res) {
|
|
|
- if (res.confirm) {
|
|
|
- uni.openSetting({
|
|
|
- success(res) {}
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
+ // 如果场景照片和人脸识别都需要
|
|
|
+ if (this.faceRecognition && this.takePicture) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pagesClockIn/location/location?obj=${obj}`
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 如果都不需要
|
|
|
+ else if (!this.faceRecognition && !this.takePicture) {
|
|
|
+ this.handleUploading()
|
|
|
+ }
|
|
|
+ // 如果只需要场景照片
|
|
|
+ else if (this.takePicture) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pagesClockIn/location/location?obj=${obj}&flag=1`
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 如果只需要人脸识别
|
|
|
+ else if (this.faceRecognition) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pagesClockIn/authentication/authentication?id=${this.contrastObj.id}&address=${this.address}&latitude=${this.myLat}&longitude=${this.myLng}&flag=1`
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
+ // 打卡请求
|
|
|
+ async handleUploading() {
|
|
|
+ let res = await this.$myRequest_clockIn({
|
|
|
+ url: "/attendance/api/sign/check/in/update",
|
|
|
+ method: "put",
|
|
|
+ header: {
|
|
|
+ 'Authorization': uni.getStorageSync("token"),
|
|
|
+ 'platform': 2,
|
|
|
+ 'Accept-Language': 'zh-CN,zh;q=0.9'
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ id: this.contrastObj.id,
|
|
|
+ lat: this.myLat,
|
|
|
+ lng: this.myLng,
|
|
|
+ location: this.address,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // console.log(res);
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.getNowTimePop()
|
|
|
+ this.$refs.popup.open()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 点击 我知道了按钮 跳回首页
|
|
|
+ handleGoHome() {
|
|
|
+ this.$refs.popup.close()
|
|
|
+ uni.reLaunch({
|
|
|
+ url: "/pagesClockIn/home/home"
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getNowTimePop() {
|
|
|
+ let date = new Date()
|
|
|
+ let hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
|
|
|
+ let minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
|
|
|
+ let seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
|
|
|
+ this.nowTime_pop = hours + ':' + minutes + ':' + seconds
|
|
|
+ },
|
|
|
// 格式化时间
|
|
|
format_time(timestamp) {
|
|
|
//时间戳为10位需*1000,时间戳为13位的话不需乘1000
|
|
|
@@ -646,5 +710,50 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .popup-content {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-around;
|
|
|
+ align-items: center;
|
|
|
+ width: 630rpx;
|
|
|
+ height: 376rpx;
|
|
|
+ border-radius: 33rpx;
|
|
|
+ background-color: #fff;
|
|
|
+
|
|
|
+ .title {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .icon {
|
|
|
+ width: 40rpx;
|
|
|
+ height: 40rpx;
|
|
|
+
|
|
|
+ img {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .title_info {
|
|
|
+ margin-left: 8rpx;
|
|
|
+ font-size: 36rpx;
|
|
|
+ font-weight: 800;
|
|
|
+ color: #0082FC;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .time {
|
|
|
+ font-size: 32rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .popup_button {
|
|
|
+ width: 50%;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 32rpx;
|
|
|
+ color: #0082FC;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|