|
|
@@ -66,27 +66,53 @@ |
|
|
|
}) |
|
|
|
|
|
|
|
const gotoNextStep = () => { |
|
|
|
noticeUser(() => { |
|
|
|
console.log("11111") |
|
|
|
uni.openBluetoothAdapter() |
|
|
|
/* 判断是否打开蓝牙 */ |
|
|
|
uni.getBluetoothAdapterState({ |
|
|
|
success(res) { |
|
|
|
console.log("2222",res) |
|
|
|
//如果res.avaliable==false 说明没打开蓝牙 反之则打开 |
|
|
|
if (res.available == false) { |
|
|
|
uni.showToast({ |
|
|
|
title: '请打开手机蓝牙', |
|
|
|
icon: "error", |
|
|
|
duration: 2000 |
|
|
|
uni.getSetting({ |
|
|
|
success(res) { |
|
|
|
console.log(res.authSetting) |
|
|
|
if (res.authSetting['scope.bluetooth'] == true) { |
|
|
|
uni.openBluetoothAdapter() |
|
|
|
noticeUser(() => { |
|
|
|
console.log("11111") |
|
|
|
/* 判断是否打开蓝牙 */ |
|
|
|
uni.getBluetoothAdapterState({ |
|
|
|
success(res) { |
|
|
|
console.log("2222", res) |
|
|
|
//如果res.avaliable==false 说明没打开蓝牙 反之则打开 |
|
|
|
if (res.available == false) { |
|
|
|
uni.showToast({ |
|
|
|
title: '请打开手机蓝牙', |
|
|
|
icon: "error", |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
return |
|
|
|
} else { |
|
|
|
navTo(`/subpackage/after-sale/activation/operation-upload?transfer=${transfer}`) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
return |
|
|
|
} else { |
|
|
|
navTo(`/subpackage/after-sale/activation/operation-upload?transfer=${transfer}`) |
|
|
|
} |
|
|
|
}); |
|
|
|
}else{ |
|
|
|
uni.showModal({ |
|
|
|
title: '提示', |
|
|
|
content: '请打开蓝牙权限', |
|
|
|
success: function (res) { |
|
|
|
if (res.confirm) { |
|
|
|
uni.openSetting({ |
|
|
|
success(res) { |
|
|
|
console.log("2222") |
|
|
|
console.log(res.authSetting) |
|
|
|
} |
|
|
|
}); |
|
|
|
} else if (res.cancel) { |
|
|
|
console.log('用户点击取消'); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
</script> |
|
|
|
|