部分操作添加无网提示
This commit is contained in:
parent
a882dc9fc6
commit
d4c216b635
2
App.vue
2
App.vue
@ -26,7 +26,7 @@
|
|||||||
} else if(this.envVersion === 'trial') {
|
} else if(this.envVersion === 'trial') {
|
||||||
return 'PRE'
|
return 'PRE'
|
||||||
} else {
|
} else {
|
||||||
return 'PROD'
|
return 'XHJ'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,7 +70,7 @@ export default {
|
|||||||
this.temporaryTime = this.setTime()
|
this.temporaryTime = this.setTime()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(useBasicStore, ['getDeviceInfo', 'backAndToast']),
|
...mapActions(useBasicStore, ['getDeviceInfo', 'backAndToast', 'getNetworkType']),
|
||||||
...mapActions(useLockStore, ['getPasswordList', 'updatePasswordSearch']),
|
...mapActions(useLockStore, ['getPasswordList', 'updatePasswordSearch']),
|
||||||
setTime() {
|
setTime() {
|
||||||
const now = new Date()
|
const now = new Date()
|
||||||
@ -89,6 +89,11 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const netWork = await this.getNetworkType()
|
||||||
|
if(!netWork) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if(this.pending) {
|
if(this.pending) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -143,10 +143,6 @@ export default {
|
|||||||
if(this.currentLockInfo.lockSetting.appUnlockOnline) {
|
if(this.currentLockInfo.lockSetting.appUnlockOnline) {
|
||||||
const netWork = await this.getNetworkType()
|
const netWork = await this.getNetworkType()
|
||||||
if(!netWork) {
|
if(!netWork) {
|
||||||
uni.showToast({
|
|
||||||
title: '网络访问失败,请检查网络是否正常',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -54,8 +54,12 @@ export default {
|
|||||||
timeFormat,
|
timeFormat,
|
||||||
...mapActions(useBluetoothStore, ['setLockPassword', 'closeBluetoothConnection']),
|
...mapActions(useBluetoothStore, ['setLockPassword', 'closeBluetoothConnection']),
|
||||||
...mapActions(useLockStore, ['updatePasswordSearch', 'getPasswordList']),
|
...mapActions(useLockStore, ['updatePasswordSearch', 'getPasswordList']),
|
||||||
...mapActions(useBasicStore, ['backAndToast']),
|
...mapActions(useBasicStore, ['backAndToast', 'getNetworkType']),
|
||||||
async deletePassword () {
|
async deletePassword () {
|
||||||
|
const netWork = await this.getNetworkType()
|
||||||
|
if(!netWork) {
|
||||||
|
return
|
||||||
|
}
|
||||||
const that = this
|
const that = this
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
|
|||||||
@ -94,7 +94,7 @@ export default {
|
|||||||
this.clearList('password')
|
this.clearList('password')
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(useBasicStore, ['routeJump', 'getDeviceInfo']),
|
...mapActions(useBasicStore, ['routeJump', 'getDeviceInfo', 'getNetworkType']),
|
||||||
...mapActions(useLockStore, ['getPasswordList', 'updateCurrentPasswordInfo', 'updatePasswordSearch', 'getPasswordStatus']),
|
...mapActions(useLockStore, ['getPasswordList', 'updateCurrentPasswordInfo', 'updatePasswordSearch', 'getPasswordStatus']),
|
||||||
...mapActions(useBluetoothStore, ['resetLockPassword', 'setLockPassword', 'closeBluetoothConnection']),
|
...mapActions(useBluetoothStore, ['resetLockPassword', 'setLockPassword', 'closeBluetoothConnection']),
|
||||||
toPasswordDetail(password) {
|
toPasswordDetail(password) {
|
||||||
@ -104,6 +104,10 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
async deletePassword(data) {
|
async deletePassword(data) {
|
||||||
|
const netWork = await this.getNetworkType()
|
||||||
|
if(!netWork) {
|
||||||
|
return
|
||||||
|
}
|
||||||
const password = data
|
const password = data
|
||||||
const that = this
|
const that = this
|
||||||
let index = this.passwordList.findIndex(item => item.keyboardPwdId === password.keyboardPwdId)
|
let index = this.passwordList.findIndex(item => item.keyboardPwdId === password.keyboardPwdId)
|
||||||
@ -167,6 +171,10 @@ export default {
|
|||||||
},
|
},
|
||||||
async resetPassword() {
|
async resetPassword() {
|
||||||
const that = this
|
const that = this
|
||||||
|
const netWork = await this.getNetworkType()
|
||||||
|
if(!netWork) {
|
||||||
|
return
|
||||||
|
}
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '确定要重置密码,该锁的所有密码都将被删除',
|
content: '确定要重置密码,该锁的所有密码都将被删除',
|
||||||
|
|||||||
@ -43,8 +43,12 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
...mapActions(useBluetoothStore, ['getBluetoothDevices', 'stopGetBluetoothDevices', 'updateCurrentLockInfo',
|
...mapActions(useBluetoothStore, ['getBluetoothDevices', 'stopGetBluetoothDevices', 'updateCurrentLockInfo',
|
||||||
'getPublicKey', 'getCommKey', 'connectBluetoothDevice', 'updateServerTimestamp', 'getLockStatus']),
|
'getPublicKey', 'getCommKey', 'connectBluetoothDevice', 'updateServerTimestamp', 'getLockStatus']),
|
||||||
...mapActions(useBasicStore, ['getDeviceInfo', 'routeJump']),
|
...mapActions(useBasicStore, ['getDeviceInfo', 'routeJump', 'getNetworkType']),
|
||||||
async connect(device) {
|
async connect(device) {
|
||||||
|
const netWork = await this.getNetworkType()
|
||||||
|
if(!netWork) {
|
||||||
|
return
|
||||||
|
}
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '连接中',
|
title: '连接中',
|
||||||
mask: true
|
mask: true
|
||||||
|
|||||||
@ -120,7 +120,7 @@ export default {
|
|||||||
timeFormat,
|
timeFormat,
|
||||||
...mapActions(useBluetoothStore, ['resetDevice', 'updateCurrentLockInfo']),
|
...mapActions(useBluetoothStore, ['resetDevice', 'updateCurrentLockInfo']),
|
||||||
...mapActions(useLockStore, ['getLockList', 'updateLockSearch', 'convertWeekDaysToChineseString']),
|
...mapActions(useLockStore, ['getLockList', 'updateLockSearch', 'convertWeekDaysToChineseString']),
|
||||||
...mapActions(useBasicStore, ['backAndToast']),
|
...mapActions(useBasicStore, ['backAndToast', 'getNetworkType']),
|
||||||
changeRadio() {
|
changeRadio() {
|
||||||
this.checked = !this.checked
|
this.checked = !this.checked
|
||||||
},
|
},
|
||||||
@ -182,7 +182,11 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deleteLock() {
|
async deleteLock() {
|
||||||
|
const netWork = await this.getNetworkType()
|
||||||
|
if(!netWork) {
|
||||||
|
return
|
||||||
|
}
|
||||||
const that = this
|
const that = this
|
||||||
if(this.currentLockInfo.userType !== 110301 && this.currentLockInfo.keyRight === 1) {
|
if(this.currentLockInfo.userType !== 110301 && this.currentLockInfo.keyRight === 1) {
|
||||||
this.showModal = true
|
this.showModal = true
|
||||||
|
|||||||
@ -140,6 +140,10 @@ export const useBasicStore = defineStore('basic', {
|
|||||||
uni.getNetworkType({
|
uni.getNetworkType({
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
if(res.networkType === 'none') {
|
if(res.networkType === 'none') {
|
||||||
|
uni.showToast({
|
||||||
|
title: '网络访问失败,请检查网络是否正常',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
resolve(false)
|
resolve(false)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user