|
@@ -18,17 +18,18 @@
|
|
|
},
|
|
|
methods:{
|
|
|
scanDevice(){
|
|
|
+ let that = this;
|
|
|
uni.scanCode({
|
|
|
success: (res) => {
|
|
|
let result = JSON.parse(res.result);
|
|
|
if(res.errMsg==='scanCode:ok'){
|
|
|
- this.$api.post('/device/bindAdd',{
|
|
|
+ that.$api.post('/device/bindAdd',{
|
|
|
...result,
|
|
|
"type": "",
|
|
|
"userId": 0,
|
|
|
"agentId": ""
|
|
|
}).then(res=>{
|
|
|
- if(res.data.code!==0) return this.$showToast(res.data.msg)
|
|
|
+ if(res.data.code!==0) return that.$showToast(res.data.msg)
|
|
|
uni.navigateTo({
|
|
|
url:'/pagesMy/scanResult'
|
|
|
})
|