|
|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="nfc-popup">
|
|
|
- <van-popup v-model="visible" v-show="!globalLoading" get-container="nfc-popup" lock-scroll>
|
|
|
+ <van-popup v-model="visible" v-show="!globalLoading" get-container="nfc-popup" lock-scroll>
|
|
|
<div class="nfc-panel">
|
|
|
<div>
|
|
|
<p class="top-text">将手机背部靠近NFC标签扫描</p>
|
|
|
@@ -66,7 +66,7 @@ export default {
|
|
|
this.useNFC()
|
|
|
},
|
|
|
openCameraCallBack(data) {
|
|
|
- this.globalLoading=true
|
|
|
+ this.globalLoading = true
|
|
|
let params = {}
|
|
|
try {
|
|
|
let img = JSON.parse(data)
|
|
|
@@ -76,8 +76,8 @@ export default {
|
|
|
content: img.content
|
|
|
}
|
|
|
} catch (e) {
|
|
|
- if(data.errorCode === 1 || data.errorCode === '1'){
|
|
|
- throw new Error("ios取消相机操作")
|
|
|
+ if (data.errorCode === 1 || data.errorCode === '1') {
|
|
|
+ throw new Error('ios取消相机操作')
|
|
|
}
|
|
|
params = {
|
|
|
extension: data.extension,
|
|
|
@@ -99,18 +99,17 @@ export default {
|
|
|
|
|
|
this.imageList.push({ name: res.data.name, url: imgUrl(res.data.url), imgPath: res.data.url })
|
|
|
this.$emit('input', this.imageList)
|
|
|
-
|
|
|
})
|
|
|
.catch(err => {
|
|
|
/*上传失败*/
|
|
|
-
|
|
|
+
|
|
|
this.visible = false
|
|
|
- this.$toast.fail('上传失败111')
|
|
|
+ this.$toast.fail('上传失败')
|
|
|
this.fileList.splice(this.fileList.length - 1, 1)
|
|
|
})
|
|
|
},
|
|
|
openNFCScanCallBack(data) {
|
|
|
- this.globalLoading=true
|
|
|
+ this.globalLoading = true
|
|
|
let nfc = null
|
|
|
try {
|
|
|
nfc = JSON.parse(data)
|
|
|
@@ -118,17 +117,17 @@ export default {
|
|
|
nfc = data
|
|
|
}
|
|
|
this.objNfc = nfc
|
|
|
-
|
|
|
+
|
|
|
if (this.objNfc.errorCode == 0) {
|
|
|
this.$emit('changeNFC', this.objNfc.content)
|
|
|
- Toast.success('扫描成功')
|
|
|
- window.openNFCScanCallBack =null
|
|
|
+ Toast.success({ message: '扫描成功', position: 'top' })
|
|
|
+ window.openNFCScanCallBack = null
|
|
|
this.visible = false
|
|
|
} else {
|
|
|
- Toast.error(this.objNfc.errorString)
|
|
|
+ // Toast.error({ message: this.objNfc.errorString, position: 'top' })
|
|
|
}
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
// destroyed() {
|
|
|
// window.openCameraCallBack = null
|
|
|
// window.openNFCScanCallBack = null
|