Merge branch 'fanpeng' into 'develop'
Fanpeng See merge request StarlockTeam/wx-starlock!47
This commit is contained in:
commit
8bc344e173
@ -2,8 +2,8 @@
|
|||||||
"name": "星星锁Lite",
|
"name": "星星锁Lite",
|
||||||
"appid": "__UNI__933D519",
|
"appid": "__UNI__933D519",
|
||||||
"description": "",
|
"description": "",
|
||||||
"versionName" : "1.3.2",
|
"versionName": "1.3.0",
|
||||||
"versionCode" : "39",
|
"versionCode": "37",
|
||||||
"mp-weixin": {
|
"mp-weixin": {
|
||||||
"appid": "wx9829a39e65550757",
|
"appid": "wx9829a39e65550757",
|
||||||
"setting": {
|
"setting": {
|
||||||
|
|||||||
@ -78,7 +78,10 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="menu-main">
|
<view class="menu-main">
|
||||||
<view
|
<view
|
||||||
v-if="$bluetooth.currentLockInfo.keyRight === 1"
|
v-if="
|
||||||
|
$bluetooth.currentLockInfo.keyRight === 1 &&
|
||||||
|
$bluetooth.currentLockInfo.transportType !== transportType.TRANSPORT_TENCENT_YUN
|
||||||
|
"
|
||||||
class="menu-main-view"
|
class="menu-main-view"
|
||||||
@click="$basic.routeJump({ name: 'keyList' })"
|
@click="$basic.routeJump({ name: 'keyList' })"
|
||||||
>
|
>
|
||||||
@ -91,7 +94,8 @@
|
|||||||
<view
|
<view
|
||||||
v-if="
|
v-if="
|
||||||
$bluetooth.currentLockInfo.lockFeature.password &&
|
$bluetooth.currentLockInfo.lockFeature.password &&
|
||||||
$bluetooth.currentLockInfo.keyRight === 1
|
$bluetooth.currentLockInfo.keyRight === 1 &&
|
||||||
|
$bluetooth.currentLockInfo.transportType !== transportType.TRANSPORT_TENCENT_YUN
|
||||||
"
|
"
|
||||||
class="menu-main-view"
|
class="menu-main-view"
|
||||||
@click="$basic.routeJump({ name: 'passwordList' })"
|
@click="$basic.routeJump({ name: 'passwordList' })"
|
||||||
@ -105,7 +109,8 @@
|
|||||||
<view
|
<view
|
||||||
v-if="
|
v-if="
|
||||||
$bluetooth.currentLockInfo.lockFeature.icCard &&
|
$bluetooth.currentLockInfo.lockFeature.icCard &&
|
||||||
$bluetooth.currentLockInfo.keyRight === 1
|
$bluetooth.currentLockInfo.keyRight === 1 &&
|
||||||
|
$bluetooth.currentLockInfo.transportType !== transportType.TRANSPORT_TENCENT_YUN
|
||||||
"
|
"
|
||||||
class="menu-main-view"
|
class="menu-main-view"
|
||||||
@click="$basic.routeJump({ name: 'cardList' })"
|
@click="$basic.routeJump({ name: 'cardList' })"
|
||||||
@ -119,7 +124,8 @@
|
|||||||
<view
|
<view
|
||||||
v-if="
|
v-if="
|
||||||
$bluetooth.currentLockInfo.lockFeature.fingerprint &&
|
$bluetooth.currentLockInfo.lockFeature.fingerprint &&
|
||||||
$bluetooth.currentLockInfo.keyRight === 1
|
$bluetooth.currentLockInfo.keyRight === 1 &&
|
||||||
|
$bluetooth.currentLockInfo.transportType !== transportType.TRANSPORT_TENCENT_YUN
|
||||||
"
|
"
|
||||||
class="menu-main-view"
|
class="menu-main-view"
|
||||||
@click="$basic.routeJump({ name: 'fingerprintList' })"
|
@click="$basic.routeJump({ name: 'fingerprintList' })"
|
||||||
@ -133,7 +139,8 @@
|
|||||||
<view
|
<view
|
||||||
v-if="
|
v-if="
|
||||||
$bluetooth.currentLockInfo.lockFeature.bluetoothRemoteControl &&
|
$bluetooth.currentLockInfo.lockFeature.bluetoothRemoteControl &&
|
||||||
$bluetooth.currentLockInfo.keyRight === 1
|
$bluetooth.currentLockInfo.keyRight === 1 &&
|
||||||
|
$bluetooth.currentLockInfo.transportType !== transportType.TRANSPORT_TENCENT_YUN
|
||||||
"
|
"
|
||||||
class="menu-main-view transform-scale-110"
|
class="menu-main-view transform-scale-110"
|
||||||
@click="$basic.routeJump({ name: 'remoteList' })"
|
@click="$basic.routeJump({ name: 'remoteList' })"
|
||||||
@ -147,7 +154,8 @@
|
|||||||
<view
|
<view
|
||||||
v-if="
|
v-if="
|
||||||
$bluetooth.currentLockInfo.lockFeature.d3Face &&
|
$bluetooth.currentLockInfo.lockFeature.d3Face &&
|
||||||
$bluetooth.currentLockInfo.keyRight === 1
|
$bluetooth.currentLockInfo.keyRight === 1 &&
|
||||||
|
$bluetooth.currentLockInfo.transportType !== transportType.TRANSPORT_TENCENT_YUN
|
||||||
"
|
"
|
||||||
class="menu-main-view"
|
class="menu-main-view"
|
||||||
@click="$basic.routeJump({ name: 'faceList' })"
|
@click="$basic.routeJump({ name: 'faceList' })"
|
||||||
@ -161,7 +169,8 @@
|
|||||||
<view
|
<view
|
||||||
v-if="
|
v-if="
|
||||||
$bluetooth.currentLockInfo.lockFeature.palmVein &&
|
$bluetooth.currentLockInfo.lockFeature.palmVein &&
|
||||||
$bluetooth.currentLockInfo.keyRight === 1
|
$bluetooth.currentLockInfo.keyRight === 1 &&
|
||||||
|
$bluetooth.currentLockInfo.transportType !== transportType.TRANSPORT_TENCENT_YUN
|
||||||
"
|
"
|
||||||
class="menu-main-view"
|
class="menu-main-view"
|
||||||
@click="$basic.routeJump({ name: 'palmVeinList' })"
|
@click="$basic.routeJump({ name: 'palmVeinList' })"
|
||||||
@ -184,7 +193,10 @@
|
|||||||
<view>监控</view>
|
<view>监控</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
v-if="$bluetooth.currentLockInfo.userType === 110301"
|
v-if="
|
||||||
|
$bluetooth.currentLockInfo.userType === 110301 &&
|
||||||
|
$bluetooth.currentLockInfo.transportType !== transportType.TRANSPORT_TENCENT_YUN
|
||||||
|
"
|
||||||
class="menu-main-view"
|
class="menu-main-view"
|
||||||
@click="$basic.routeJump({ name: 'adminList' })"
|
@click="$basic.routeJump({ name: 'adminList' })"
|
||||||
>
|
>
|
||||||
@ -217,7 +229,10 @@
|
|||||||
<view>门锁记录</view>
|
<view>门锁记录</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
v-if="$bluetooth.currentLockInfo.keyRight === 1"
|
v-if="
|
||||||
|
$bluetooth.currentLockInfo.keyRight === 1 &&
|
||||||
|
$bluetooth.currentLockInfo.transportType !== transportType.TRANSPORT_TENCENT_YUN
|
||||||
|
"
|
||||||
class="menu-main-view"
|
class="menu-main-view"
|
||||||
@click="$basic.routeJump({ name: 'messageReminder' })"
|
@click="$basic.routeJump({ name: 'messageReminder' })"
|
||||||
>
|
>
|
||||||
@ -240,7 +255,11 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="setting" @click="$basic.routeJump({ name: 'setting' })">
|
<view
|
||||||
|
class="setting"
|
||||||
|
@click="$basic.routeJump({ name: 'setting' })"
|
||||||
|
v-if="$bluetooth.currentLockInfo.transportType !== transportType.TRANSPORT_TENCENT_YUN"
|
||||||
|
>
|
||||||
<image class="setting-image" src="https://oss-lock.xhjcn.ltd/mp/icon_setting.png"></image>
|
<image class="setting-image" src="https://oss-lock.xhjcn.ltd/mp/icon_setting.png"></image>
|
||||||
<view class="setting-text">设置</view>
|
<view class="setting-text">设置</view>
|
||||||
<image
|
<image
|
||||||
@ -249,6 +268,12 @@
|
|||||||
src="https://oss-lock.xhjcn.ltd/mp/icon_arrow.png"
|
src="https://oss-lock.xhjcn.ltd/mp/icon_arrow.png"
|
||||||
></image>
|
></image>
|
||||||
</view>
|
</view>
|
||||||
|
<view
|
||||||
|
v-if="$bluetooth.currentLockInfo.transportType === transportType.TRANSPORT_TENCENT_YUN"
|
||||||
|
class="fixed bottom-[calc(env(safe-area-inset-bottom)+120rpx)] mt-4 rounded-3xl w-686 h-80 line-height-80rpx text-center mx-32rpx bg-#ec433c text-white text-xl font-bold"
|
||||||
|
@click="deleteLock"
|
||||||
|
>删除
|
||||||
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<up-popup
|
<up-popup
|
||||||
:show="show"
|
:show="show"
|
||||||
@ -284,7 +309,7 @@
|
|||||||
import SwitchLoading from '@/components/SwitchLoading/SwitchLoading.vue'
|
import SwitchLoading from '@/components/SwitchLoading/SwitchLoading.vue'
|
||||||
import { useLockStore } from '@/stores/lock'
|
import { useLockStore } from '@/stores/lock'
|
||||||
import { useUserStore } from '@/stores/user'
|
import { useUserStore } from '@/stores/user'
|
||||||
import { getLockDetailRequest, getLockNetTokenRequest } from '@/api/lock'
|
import { getLockDetailRequest, getLockNetTokenRequest, deleteLockRequest } from '@/api/lock'
|
||||||
import { deleteKeyRequest } from '@/api/key'
|
import { deleteKeyRequest } from '@/api/key'
|
||||||
import { transportType } from '@/constant/transportType'
|
import { transportType } from '@/constant/transportType'
|
||||||
|
|
||||||
@ -497,6 +522,58 @@
|
|||||||
}
|
}
|
||||||
refresherTriggered.value = false
|
refresherTriggered.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const deleteLock = async () => {
|
||||||
|
const netWork = await $basic.getNetworkType()
|
||||||
|
if (!netWork) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const message = '删除锁后,所有信息都会一起删除,确定删除锁吗?'
|
||||||
|
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: message,
|
||||||
|
async success(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '删除中'
|
||||||
|
})
|
||||||
|
const { code: resetDeviceCode } = await $bluetooth.resetDevice({
|
||||||
|
name: $bluetooth.currentLockInfo.name,
|
||||||
|
authUid: $user.userInfo.uid.toString(),
|
||||||
|
keyId: $bluetooth.keyId.toString()
|
||||||
|
})
|
||||||
|
if (resetDeviceCode === 0 || resetDeviceCode === -2) {
|
||||||
|
const { code, message } = await deleteLockRequest({
|
||||||
|
lockId: $bluetooth.currentLockInfo.lockId
|
||||||
|
})
|
||||||
|
if (code === 0) {
|
||||||
|
uni.hideLoading()
|
||||||
|
$lock.updateLockSearch({
|
||||||
|
...$lock.lockSearch,
|
||||||
|
pageNo: 1
|
||||||
|
})
|
||||||
|
$lock.getLockList($lock.lockSearch)
|
||||||
|
$basic.backAndToast('删除成功', 1)
|
||||||
|
} else {
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.showToast({
|
||||||
|
title: message,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else if (resetDeviceCode === -1) {
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.showToast({
|
||||||
|
title: '删除失败,请保持在锁附近',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@ -42,12 +42,6 @@
|
|||||||
<view v-if="requestFinish" class="mt-4 text-center text-base font-bold text-[#999]">
|
<view v-if="requestFinish" class="mt-4 text-center text-base font-bold text-[#999]">
|
||||||
微信会收到视频通话请求
|
微信会收到视频通话请求
|
||||||
</view>
|
</view>
|
||||||
<view
|
|
||||||
class="fixed bottom-120rpx w-400rpx h-88rpx rounded-md leading-88rpx left-1/2 -translate-x-1/2 bg-[#63b8af] text-center text-base font-bold text-[#ffffff]"
|
|
||||||
@click="getTicket"
|
|
||||||
>
|
|
||||||
获取ticket
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -106,41 +100,6 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const getTicket = async () => {
|
|
||||||
uni.showLoading({
|
|
||||||
title: '加载中...'
|
|
||||||
})
|
|
||||||
const result = await getInfo()
|
|
||||||
uni.hideLoading()
|
|
||||||
if (result.code === 0) {
|
|
||||||
const ticket = result.data.WXIoTDeviceInfo.SNTicket
|
|
||||||
uni.showModal({
|
|
||||||
title: '票据',
|
|
||||||
content: ticket,
|
|
||||||
showCancel: false,
|
|
||||||
confirmText: '复制',
|
|
||||||
success: ({ confirm }) => {
|
|
||||||
if (confirm) {
|
|
||||||
uni.setClipboardData({
|
|
||||||
data: ticket,
|
|
||||||
success: () => {
|
|
||||||
uni.showToast({
|
|
||||||
title: '复制成功',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: result.message,
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const getDeviceVoIPList = async () => {
|
const getDeviceVoIPList = async () => {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
wx.getDeviceVoIPList({
|
wx.getDeviceVoIPList({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user