|
|
@@ -150,69 +150,18 @@ export default {
|
|
|
}, 1500)
|
|
|
},
|
|
|
// 点击拍照图标回调
|
|
|
- // handlePhoto() {
|
|
|
- // // 获取用户摄像头权限
|
|
|
- // uni.authorize({
|
|
|
- // scope: 'scope.camera',
|
|
|
- // success: () => {
|
|
|
- // uni.chooseImage({
|
|
|
- // count: 1,
|
|
|
- // sourceType: ['camera'],
|
|
|
- // success: res => {
|
|
|
- // // console.log(res);
|
|
|
- // uni.uploadFile({
|
|
|
- // url: `https://chtech.ncjti.edu.cn/campusclock/attendance/api/file/upload`,
|
|
|
- // filePath: res.tempFilePaths[0],
|
|
|
- // name: 'file',
|
|
|
- // header: {
|
|
|
- // platform: 2,
|
|
|
- // 'Accept-Language': 'zh-CN,zh;q=0.9'
|
|
|
- // },
|
|
|
- // success: uploadFileRes => {
|
|
|
- // let imgUrl = JSON.parse(uploadFileRes.data).data
|
|
|
- // // if (this.flag == 1) {
|
|
|
- // // this.handleUploading(imgUrl)
|
|
|
- // // } else {
|
|
|
- // // uni.redirectTo({
|
|
|
- // // url: `/pages/authentication/authentication?imgUrl=${imgUrl}&id=${this.id}&address=${this.address}&latitude=${this.latitude}&longitude=${this.longitude}`
|
|
|
- // // })
|
|
|
- // // }
|
|
|
- // this.handleUploading(imgUrl)
|
|
|
- // },
|
|
|
- // fail: () => {
|
|
|
- // uni.showToast({
|
|
|
- // title: '上传失败',
|
|
|
- // icon: 'error'
|
|
|
- // })
|
|
|
- // }
|
|
|
- // })
|
|
|
- // }
|
|
|
- // })
|
|
|
- // },
|
|
|
- // fail() {
|
|
|
- // uni.showModal({
|
|
|
- // title: '提示',
|
|
|
- // content: '请先开启摄像头权限,否则将无法使用打卡功能',
|
|
|
- // cancelText: '不授权',
|
|
|
- // confirmText: '授权',
|
|
|
- // success: function(res) {
|
|
|
- // if (res.confirm) {
|
|
|
- // uni.openSetting({
|
|
|
- // success(res) {}
|
|
|
- // })
|
|
|
- // }
|
|
|
- // }
|
|
|
- // })
|
|
|
- // }
|
|
|
- // })
|
|
|
- // },
|
|
|
handlePhoto() {
|
|
|
// 选择图片
|
|
|
uni.chooseImage({
|
|
|
count: 1,
|
|
|
+ sizeType: ['compressed'],
|
|
|
sourceType: ['camera'],
|
|
|
success: res => {
|
|
|
// console.log(res);
|
|
|
+ uni.showLoading({
|
|
|
+ title: '上传中',
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
uni.uploadFile({
|
|
|
url: `https://chtech.ncjti.edu.cn/campusclock/attendance/api/file/upload`,
|
|
|
filePath: res.tempFilePaths[0],
|
|
|
@@ -232,7 +181,6 @@ export default {
|
|
|
}`
|
|
|
})
|
|
|
}
|
|
|
- // this.handleUploading(imgUrl)
|
|
|
},
|
|
|
fail: () => {
|
|
|
uni.showToast({
|