Compare commits

..

No commits in common. "5b66f6f9cb1e9aa971ed846ff4e8a8d5b035a949" and "08b0121560328bd63318b59c82f429690baa4bb7" have entirely different histories.

67 changed files with 1542 additions and 1938 deletions

View File

@ -25,13 +25,13 @@
} }
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
if (this.envVersion === 'develop') { if (this.envVersion === 'develop') {
return 'SKY' return 'XHJ'
} }
if (this.envVersion === 'trial') { if (this.envVersion === 'trial') {
return 'SKY' return 'XHJ'
} }
// #endif // #endif
return 'SKY' return 'XHJ'
} }
}, },
computed: { computed: {

View File

@ -17,7 +17,7 @@
:style="{ width: size * 0.75 - 2 + 'rpx', height: size * 0.75 - 2 + 'rpx' }" :style="{ width: size * 0.75 - 2 + 'rpx', height: size * 0.75 - 2 + 'rpx' }"
> >
<image <image
src="https://cos-lock.skychip.top/mp/icon_lock.png" src="https://oss-lock.xhjcn.ltd/mp/icon_lock_transparent.png"
mode="aspectFill" mode="aspectFill"
:style="{ width: size * 0.35 + 'rpx', height: size * 0.35 + 'rpx' }" :style="{ width: size * 0.35 + 'rpx', height: size * 0.35 + 'rpx' }"
></image> ></image>
@ -74,8 +74,8 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 3upx; padding: 3upx;
background: #4777ee; background: rgb(99, 184, 175);
background: linear-gradient(0deg, rgba(99, 184, 175, 0.1) 33%, rgba(71, 119, 238, 1) 100%); background: linear-gradient(0deg, rgba(99, 184, 175, 0.1) 33%, rgba(99, 184, 175, 1) 100%);
border-radius: 50%; border-radius: 50%;
animation: spin 0.8s linear 0s infinite; animation: spin 0.8s linear 0s infinite;
} }
@ -87,7 +87,7 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 3upx; padding: 3upx;
background: #4777ee; background: rgb(99, 184, 175);
border-radius: 50%; border-radius: 50%;
} }

View File

@ -1,72 +1,56 @@
let version = '-' let version = '-'
let buildNumber = '-' let buildNumber = '-'
uni.getSystemInfo({ uni.getSystemInfo({
success(res) { success(res) {
version = res.appVersion version = res.appVersion
buildNumber = res.appVersionCode buildNumber = res.appVersionCode
} }
}) })
const DEV = { const DEV = {
name: 'dev', name: 'dev',
appName: '星星锁Lite', appName: '星星锁Lite',
baseUrl: 'https://lock.dev.star-lock.cn/api', baseUrl: 'https://lock.dev.star-lock.cn/api',
webviewBaseUrl: 'https://lock.dev.star-lock.cn', webviewBaseUrl: 'https://lock.dev.star-lock.cn',
officialEmail: '', version,
officialWebsite: '', buildNumber
version,
buildNumber
} }
const PRE = { const PRE = {
name: 'pre', name: 'pre',
appName: '星星锁Lite', appName: '星星锁Lite',
baseUrl: 'https://lock.pre.star-lock.cn/api', baseUrl: 'https://lock.pre.star-lock.cn/api',
webviewBaseUrl: 'https://lock.xhjcn.ltd', webviewBaseUrl: 'https://lock.xhjcn.ltd',
officialEmail: '', version,
officialWebsite: '', buildNumber
version,
buildNumber
} }
const XHJ = { const XHJ = {
name: 'xhj', name: 'xhj',
appName: '星星锁Lite', appName: '星星锁Lite',
baseUrl: 'https://lock.xhjcn.ltd/api', baseUrl: 'https://lock.xhjcn.ltd/api',
webviewBaseUrl: 'https://lock.xhjcn.ltd', webviewBaseUrl: 'https://lock.xhjcn.ltd',
officialEmail: '', version,
officialWebsite: '', buildNumber
version,
buildNumber
} }
const SKY = { const SKY = {
name: 'sky', name: 'sky',
appName: '锁通通', appName: '星星锁Lite',
baseUrl: 'https://lock.skychip.top/api', baseUrl: 'https://lock.skychip.top/api',
webviewBaseUrl: 'https://lock.skychip.top', webviewBaseUrl: 'https://lock.skychip.top',
officialEmail: 'contact@skychip.top', version,
officialWebsite: 'www.skychip.top', buildNumber
version,
buildNumber
} }
const GE = { const GE = {
name: 'ge', name: 'ge',
appName: '星星锁Lite', appName: '星星锁Lite',
baseUrl: 'http://lock.ge.star-lock.cn/api', baseUrl: 'http://lock.ge.star-lock.cn/api',
webviewBaseUrl: 'http://lock.ge.star-lock.cn', webviewBaseUrl: 'http://lock.ge.star-lock.cn',
officialEmail: '', version,
officialWebsite: '', buildNumber
version,
buildNumber
} }
// 更换环境的时候 切换导出就行 // 更换环境的时候 切换导出就行
export default { export default { DEV, PRE, XHJ, SKY, GE }
DEV,
PRE,
XHJ,
SKY,
GE
}

View File

@ -1,116 +1,118 @@
{ {
"name" : "锁通通", "name": "星星锁Lite",
"appid" : "__UNI__933D519", "appid": "__UNI__933D519",
"description" : "", "description": "",
"versionName" : "1.3.5", "versionName": "1.3.2",
"versionCode" : "42", "versionCode": "40",
"mp-weixin" : { "mp-weixin": {
"appid" : "wx7991ace56366dd9a", "appid": "wx9829a39e65550757",
"setting" : { "setting": {
"urlCheck" : true, "urlCheck": true,
"minified" : true "minified": true
},
"permission" : {
"scope.bluetooth" : {
"desc" : "蓝牙将用于控制和管理您的智能门锁"
}
},
"usingComponents" : true,
"lazyCodeLoading" : "requiredComponents",
"optimization" : {
"subPackages" : true
},
"plugins" : {}
}, },
"vueVersion" : "3", "permission": {
"app-plus" : { "scope.bluetooth": {
"optimization" : { "desc": "蓝牙将用于控制和管理您的智能门锁"
"subPackages" : true }
}, },
"runmode" : "liberate", "usingComponents": true,
"distribute" : { "lazyCodeLoading": "requiredComponents",
"icons" : { "optimization": {
"android" : { "subPackages": true
"hdpi" : "unpackage/res/icons/72x72.png", },
"xhdpi" : "unpackage/res/icons/96x96.png", "plugins": {
"xxhdpi" : "unpackage/res/icons/144x144.png", "wmpf-voip": {
"xxxhdpi" : "unpackage/res/icons/192x192.png" "version": "latest",
}, "provider": "wxf830863afde621eb",
"ios" : { "genericsImplementation": {
"appstore" : "unpackage/res/icons/1024x1024.png", "call-page-plugin": {
"ipad" : { "custombox": "pages/main/customBox"
"app" : "unpackage/res/icons/76x76.png", }
"app@2x" : "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png"
},
"iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png"
}
}
},
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" />",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" />",
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\" />",
"<uses-permission android:name=\"android.permission.BLUETOOTH\" />",
"<uses-permission android:name=\"android.permission.BLUETOOTH_SCAN\" />",
"<uses-permission android:name=\"android.permission.BLUETOOTH_CONNECT\" />",
"<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.READ_MEDIA_IMAGES\"/>",
"<uses-permission android:name=\"android.permission.READ_MEDIA_VIDEO\"/>",
"<uses-permission android:name=\"android.permission.READ_MEDIA_AUDIO\"/>"
],
"packagename" : "com.xhs.lock",
"password" : "xhs2025",
"aliasname" : "xhs2025",
"keystore" : "./android.jks",
"targetSdkVersion" : 35,
"abiFilters" : [ "armeabi-v7a", "arm64-v8a" ]
},
"ios" : {
"dSYMs" : false
}
},
"modules" : {
"Bluetooth" : {
"description" : "低功耗蓝牙"
},
"VideoPlayer" : {
"description" : "视频播放"
},
"Camera" : {
"description" : "相机和相册"
},
"Record" : {
"description" : "录音"
}
},
"splashscreen" : {
"waiting" : false
} }
}
} }
},
"vueVersion": "3",
"app-plus": {
"distribute": {
"icons": {
"android": {
"hdpi": "unpackage/res/icons/72x72.png",
"xhdpi": "unpackage/res/icons/96x96.png",
"xxhdpi": "unpackage/res/icons/144x144.png",
"xxxhdpi": "unpackage/res/icons/192x192.png"
},
"ios": {
"appstore": "unpackage/res/icons/1024x1024.png",
"ipad": {
"app": "unpackage/res/icons/76x76.png",
"app@2x": "unpackage/res/icons/152x152.png",
"notification": "unpackage/res/icons/20x20.png",
"notification@2x": "unpackage/res/icons/40x40.png",
"proapp@2x": "unpackage/res/icons/167x167.png",
"settings": "unpackage/res/icons/29x29.png",
"settings@2x": "unpackage/res/icons/58x58.png",
"spotlight": "unpackage/res/icons/40x40.png",
"spotlight@2x": "unpackage/res/icons/80x80.png"
},
"iphone": {
"app@2x": "unpackage/res/icons/120x120.png",
"app@3x": "unpackage/res/icons/180x180.png",
"notification@2x": "unpackage/res/icons/40x40.png",
"notification@3x": "unpackage/res/icons/60x60.png",
"settings@2x": "unpackage/res/icons/58x58.png",
"settings@3x": "unpackage/res/icons/87x87.png",
"spotlight@2x": "unpackage/res/icons/80x80.png",
"spotlight@3x": "unpackage/res/icons/120x120.png"
}
}
},
"android": {
"permissions": [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" />",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" />",
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\" />",
"<uses-permission android:name=\"android.permission.BLUETOOTH\" />",
"<uses-permission android:name=\"android.permission.BLUETOOTH_SCAN\" />",
"<uses-permission android:name=\"android.permission.BLUETOOTH_CONNECT\" />",
"<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.MANAGE_EXTERNAL_STORAGE\"/>"
],
"packagename": "com.xhs.lock",
"password": "xhs2025",
"aliasname": "xhs2025",
"keystore": "./android.jks",
"targetSdkVersion": 34,
"abiFilters": ["armeabi-v7a", "arm64-v8a"]
},
"ios": {
"dSYMs": false
}
},
"modules": {
"Bluetooth": {},
"VideoPlayer": {},
"Camera": {},
"Record": {}
},
"splashscreen": {
"waiting": false
}
}
} }

1343
pages.json

File diff suppressed because it is too large Load Diff

View File

@ -19,14 +19,14 @@
const basicStore = useBasicStore() const basicStore = useBasicStore()
const toSearchDevice = async () => { const toSearchDevice = async () => {
// if (bluetoothStore.bluetoothStatus !== 0) { if (bluetoothStore.bluetoothStatus !== 0) {
// bluetoothStore.getBluetoothStatus() bluetoothStore.getBluetoothStatus()
// return return
// } }
let result = true let result = true
// if (!bluetoothStore.isInitBluetooth) { if (!bluetoothStore.isInitBluetooth) {
result = await bluetoothStore.initAndListenBluetooth() result = await bluetoothStore.initAndListenBluetooth()
// } }
if (result) { if (result) {
basicStore.routeJump({ basicStore.routeJump({
type: 'redirectTo', type: 'redirectTo',
@ -68,7 +68,7 @@
line-height: 100rpx; line-height: 100rpx;
color: #fff; color: #fff;
text-align: center; text-align: center;
background-color: #4777ee; background-color: #63b8af;
border-radius: 50rpx; border-radius: 50rpx;
} }
</style> </style>

View File

@ -142,11 +142,11 @@
const { code, message } = await bindLockAdmin(params) const { code, message } = await bindLockAdmin(params)
console.log('添加锁返回', code, message) console.log('添加锁返回', code, message)
if (code === 0) { if (code === 0) {
await this.updateLockSearch({ this.updateLockSearch({
...this.lockSearch, ...this.lockSearch,
pageNo: 1 pageNo: 1
}) })
await this.getLockList(this.lockSearch) this.getLockList(this.lockSearch)
setTimeout(() => { setTimeout(() => {
uni.hideLoading() uni.hideLoading()
this.backAndToast('添加成功', 2) this.backAndToast('添加成功', 2)
@ -204,7 +204,7 @@
line-height: 96rpx; line-height: 96rpx;
color: #ffffff; color: #ffffff;
text-align: center; text-align: center;
background: #4777ee; background: #63b8af;
border-radius: 16rpx; border-radius: 16rpx;
} }
</style> </style>

View File

@ -20,7 +20,7 @@
></image> ></image>
<view class="device-name">{{ device.name }}</view> <view class="device-name">{{ device.name }}</view>
</view> </view>
<image class="device-add" src="https://cos-lock.skychip.top/mp/icon_add.png"></image> <image class="device-add" src="https://oss-lock.xhjcn.ltd/mp/icon_add.png"></image>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>

View File

@ -50,10 +50,10 @@
<up-icon name="arrow-right"></up-icon> <up-icon name="arrow-right"></up-icon>
</view> </view>
<view class="m-4 flex items-center justify-between text-base"> <view class="m-4 flex items-center justify-between text-base">
<view :class="[info.keyStatus === 110405 ? 'text-#4777ee' : 'text-red']" @click="freeze">{{ <view :class="[info.keyStatus === 110405 ? 'text-#63b8af' : 'text-red']" @click="freeze">{{
info.keyStatus === 110405 ? '解冻' : '冻结' info.keyStatus === 110405 ? '解冻' : '冻结'
}}</view> }}</view>
<view :class="[info.keyRight === 1 ? 'text-red' : 'text-#4777ee']" @click="authorize">{{ <view :class="[info.keyRight === 1 ? 'text-red' : 'text-#63b8af']" @click="authorize">{{
info.keyRight === 1 ? '取消授权管理员' : '授权管理员' info.keyRight === 1 ? '取消授权管理员' : '授权管理员'
}}</view> }}</view>
</view> </view>

View File

@ -336,7 +336,7 @@
line-height: 88rpx; line-height: 88rpx;
color: white; color: white;
text-align: center; text-align: center;
background-color: #4777ee; background-color: #63b8af;
border-radius: 44rpx; border-radius: 44rpx;
} }
} }

View File

@ -124,7 +124,7 @@
line-height: 100rpx; line-height: 100rpx;
color: #fff; color: #fff;
text-align: center; text-align: center;
background-color: #4777ee; background-color: #63b8af;
border-radius: 64rpx; border-radius: 64rpx;
} }
</style> </style>

View File

@ -402,7 +402,7 @@
line-height: 88rpx; line-height: 88rpx;
color: white; color: white;
text-align: center; text-align: center;
background-color: #4777ee; background-color: #63b8af;
border-radius: 44rpx; border-radius: 44rpx;
} }
} }

View File

@ -6,10 +6,10 @@
lineWidth="40rpx" lineWidth="40rpx"
lineHeight="5rpx" lineHeight="5rpx"
:current="currentIndex" :current="currentIndex"
lineColor="#4777ee" lineColor="#63b8af"
@click="clickTab" @click="clickTab"
:inactiveStyle="{ color: '#a3a3a3', fontSize: '32rpx', fontWeight: 'bold' }" :inactiveStyle="{ color: '#a3a3a3', fontSize: '32rpx', fontWeight: 'bold' }"
:activeStyle="{ color: '#4777ee', fontSize: '32rpx', fontWeight: 'bold' }" :activeStyle="{ color: '#63b8af', fontSize: '32rpx', fontWeight: 'bold' }"
> >
</up-tabs> </up-tabs>
</view> </view>
@ -363,7 +363,7 @@
line-height: 100rpx; line-height: 100rpx;
color: #fff; color: #fff;
text-align: center; text-align: center;
background-color: #4777ee; background-color: #63b8af;
border-radius: 64rpx; border-radius: 64rpx;
} }
</style> </style>

View File

@ -6,10 +6,10 @@
lineWidth="40rpx" lineWidth="40rpx"
lineHeight="5rpx" lineHeight="5rpx"
:current="currentIndex" :current="currentIndex"
lineColor="#4777ee" lineColor="#63b8af"
@click="clickTab" @click="clickTab"
:inactiveStyle="{ color: '#a3a3a3', fontSize: '32rpx', fontWeight: 'bold' }" :inactiveStyle="{ color: '#a3a3a3', fontSize: '32rpx', fontWeight: 'bold' }"
:activeStyle="{ color: '#4777ee', fontSize: '32rpx', fontWeight: 'bold' }" :activeStyle="{ color: '#63b8af', fontSize: '32rpx', fontWeight: 'bold' }"
> >
</up-tabs> </up-tabs>
</view> </view>
@ -414,7 +414,7 @@
line-height: 100rpx; line-height: 100rpx;
color: #fff; color: #fff;
text-align: center; text-align: center;
background-color: #4777ee; background-color: #63b8af;
border-radius: 64rpx; border-radius: 64rpx;
} }
</style> </style>

View File

@ -6,10 +6,10 @@
lineWidth="40rpx" lineWidth="40rpx"
lineHeight="5rpx" lineHeight="5rpx"
:current="currentIndex" :current="currentIndex"
lineColor="#4777ee" lineColor="#63b8af"
@click="clickTab" @click="clickTab"
:inactiveStyle="{ color: '#a3a3a3', fontSize: '32rpx', fontWeight: 'bold' }" :inactiveStyle="{ color: '#a3a3a3', fontSize: '32rpx', fontWeight: 'bold' }"
:activeStyle="{ color: '#4777ee', fontSize: '32rpx', fontWeight: 'bold' }" :activeStyle="{ color: '#63b8af', fontSize: '32rpx', fontWeight: 'bold' }"
> >
</up-tabs> </up-tabs>
</view> </view>
@ -373,7 +373,7 @@
line-height: 100rpx; line-height: 100rpx;
color: #fff; color: #fff;
text-align: center; text-align: center;
background-color: #4777ee; background-color: #63b8af;
border-radius: 64rpx; border-radius: 64rpx;
} }
</style> </style>

View File

@ -6,10 +6,10 @@
lineWidth="40rpx" lineWidth="40rpx"
lineHeight="5rpx" lineHeight="5rpx"
:current="currentIndex" :current="currentIndex"
lineColor="#4777ee" lineColor="#63b8af"
@click="clickTab" @click="clickTab"
:inactiveStyle="{ color: '#a3a3a3', fontSize: '32rpx', fontWeight: 'bold' }" :inactiveStyle="{ color: '#a3a3a3', fontSize: '32rpx', fontWeight: 'bold' }"
:activeStyle="{ color: '#4777ee', fontSize: '32rpx', fontWeight: 'bold' }" :activeStyle="{ color: '#63b8af', fontSize: '32rpx', fontWeight: 'bold' }"
> >
</up-tabs> </up-tabs>
</view> </view>
@ -414,7 +414,7 @@
line-height: 100rpx; line-height: 100rpx;
color: #fff; color: #fff;
text-align: center; text-align: center;
background-color: #4777ee; background-color: #63b8af;
border-radius: 64rpx; border-radius: 64rpx;
} }
</style> </style>

View File

@ -6,10 +6,10 @@
lineWidth="40rpx" lineWidth="40rpx"
lineHeight="5rpx" lineHeight="5rpx"
:current="current" :current="current"
lineColor="#4777ee" lineColor="#63b8af"
@click="clickTab" @click="clickTab"
:inactiveStyle="{ color: '#a3a3a3', fontSize: '32rpx', fontWeight: 'bold' }" :inactiveStyle="{ color: '#a3a3a3', fontSize: '32rpx', fontWeight: 'bold' }"
:activeStyle="{ color: '#4777ee', fontSize: '32rpx', fontWeight: 'bold' }" :activeStyle="{ color: '#63b8af', fontSize: '32rpx', fontWeight: 'bold' }"
> >
</up-tabs> </up-tabs>
</view> </view>
@ -389,7 +389,7 @@
line-height: 100rpx; line-height: 100rpx;
color: #fff; color: #fff;
text-align: center; text-align: center;
background-color: #4777ee; background-color: #63b8af;
border-radius: 64rpx; border-radius: 64rpx;
} }
</style> </style>

View File

@ -6,10 +6,10 @@
lineWidth="40rpx" lineWidth="40rpx"
lineHeight="5rpx" lineHeight="5rpx"
:current="currentIndex" :current="currentIndex"
lineColor="#4777ee" lineColor="#63b8af"
@click="clickTab" @click="clickTab"
:inactiveStyle="{ color: '#a3a3a3', fontSize: '32rpx', fontWeight: 'bold' }" :inactiveStyle="{ color: '#a3a3a3', fontSize: '32rpx', fontWeight: 'bold' }"
:activeStyle="{ color: '#4777ee', fontSize: '32rpx', fontWeight: 'bold' }" :activeStyle="{ color: '#63b8af', fontSize: '32rpx', fontWeight: 'bold' }"
> >
</up-tabs> </up-tabs>
</view> </view>
@ -415,7 +415,7 @@
line-height: 100rpx; line-height: 100rpx;
color: #fff; color: #fff;
text-align: center; text-align: center;
background-color: #4777ee; background-color: #63b8af;
border-radius: 64rpx; border-radius: 64rpx;
} }
</style> </style>

View File

@ -6,10 +6,10 @@
lineWidth="40rpx" lineWidth="40rpx"
lineHeight="5rpx" lineHeight="5rpx"
:current="currentIndex" :current="currentIndex"
lineColor="#4777ee" lineColor="#63b8af"
@click="clickTab" @click="clickTab"
:inactiveStyle="{ color: '#a3a3a3', fontSize: '32rpx', fontWeight: 'bold' }" :inactiveStyle="{ color: '#a3a3a3', fontSize: '32rpx', fontWeight: 'bold' }"
:activeStyle="{ color: '#4777ee', fontSize: '32rpx', fontWeight: 'bold' }" :activeStyle="{ color: '#63b8af', fontSize: '32rpx', fontWeight: 'bold' }"
> >
</up-tabs> </up-tabs>
</view> </view>
@ -659,7 +659,7 @@
line-height: 100rpx; line-height: 100rpx;
color: #fff; color: #fff;
text-align: center; text-align: center;
background-color: #4777ee; background-color: #63b8af;
border-radius: 64rpx; border-radius: 64rpx;
} }
</style> </style>

View File

@ -6,10 +6,10 @@
lineWidth="40rpx" lineWidth="40rpx"
lineHeight="5rpx" lineHeight="5rpx"
:current="currentIndex" :current="currentIndex"
lineColor="#4777ee" lineColor="#63b8af"
@click="clickTab" @click="clickTab"
:inactiveStyle="{ color: '#a3a3a3', fontSize: '32rpx', fontWeight: 'bold' }" :inactiveStyle="{ color: '#a3a3a3', fontSize: '32rpx', fontWeight: 'bold' }"
:activeStyle="{ color: '#4777ee', fontSize: '32rpx', fontWeight: 'bold' }" :activeStyle="{ color: '#63b8af', fontSize: '32rpx', fontWeight: 'bold' }"
> >
</up-tabs> </up-tabs>
</view> </view>
@ -336,7 +336,7 @@
line-height: 100rpx; line-height: 100rpx;
color: #fff; color: #fff;
text-align: center; text-align: center;
background-color: #4777ee; background-color: #63b8af;
border-radius: 64rpx; border-radius: 64rpx;
} }
</style> </style>

View File

@ -403,7 +403,7 @@
line-height: 88rpx; line-height: 88rpx;
color: white; color: white;
text-align: center; text-align: center;
background-color: #4777ee; background-color: #63b8af;
border-radius: 44rpx; border-radius: 44rpx;
} }
} }

View File

@ -402,7 +402,7 @@
line-height: 88rpx; line-height: 88rpx;
color: white; color: white;
text-align: center; text-align: center;
background-color: #4777ee; background-color: #63b8af;
border-radius: 44rpx; border-radius: 44rpx;
} }
} }

View File

@ -94,7 +94,7 @@
<view class="m-4 flex items-center justify-between text-base"> <view class="m-4 flex items-center justify-between text-base">
<view <view
v-if="$lock.currentKeyInfo.keyType !== 3" v-if="$lock.currentKeyInfo.keyType !== 3"
:class="[$lock.currentKeyInfo.keyStatus === 110405 ? 'text-#4777ee' : 'text-red']" :class="[$lock.currentKeyInfo.keyStatus === 110405 ? 'text-#63b8af' : 'text-red']"
@click="freeze" @click="freeze"
>{{ $lock.currentKeyInfo.keyStatus === 110405 ? '解冻' : '冻结' }}</view >{{ $lock.currentKeyInfo.keyStatus === 110405 ? '解冻' : '冻结' }}</view
> >
@ -104,7 +104,7 @@
$lock.currentKeyInfo.keyType !== 3 && $lock.currentKeyInfo.keyType !== 3 &&
$lock.currentKeyInfo.keyType !== 4 $lock.currentKeyInfo.keyType !== 4
" "
:class="[$lock.currentKeyInfo.keyRight === 1 ? 'text-red' : 'text-#4777ee']" :class="[$lock.currentKeyInfo.keyRight === 1 ? 'text-red' : 'text-#63b8af']"
@click="authorize" @click="authorize"
>{{ $lock.currentKeyInfo.keyRight === 1 ? '取消授权管理员' : '授权管理员' }}</view >{{ $lock.currentKeyInfo.keyRight === 1 ? '取消授权管理员' : '授权管理员' }}</view
> >

View File

@ -69,7 +69,7 @@
></image> ></image>
<view <view
class="key-status" class="key-status"
:style="{ color: key.keyStatus === 110401 ? '#4777ee' : '#df282d' }" :style="{ color: key.keyStatus === 110401 ? '#63b8af' : '#df282d' }"
> >
{{ getKeyStatus(key.keyStatus) }} {{ getKeyStatus(key.keyStatus) }}
</view> </view>
@ -396,7 +396,7 @@
line-height: 88rpx; line-height: 88rpx;
color: white; color: white;
text-align: center; text-align: center;
background-color: #4777ee; background-color: #63b8af;
border-radius: 44rpx; border-radius: 44rpx;
} }
} }

View File

@ -407,7 +407,7 @@
line-height: 88rpx; line-height: 88rpx;
color: white; color: white;
text-align: center; text-align: center;
background-color: #4777ee; background-color: #63b8af;
border-radius: 44rpx; border-radius: 44rpx;
} }
} }

View File

@ -371,7 +371,7 @@
line-height: 88rpx; line-height: 88rpx;
color: white; color: white;
text-align: center; text-align: center;
background-color: #4777ee; background-color: #63b8af;
border-radius: 44rpx; border-radius: 44rpx;
} }
} }

View File

@ -413,7 +413,7 @@
line-height: 88rpx; line-height: 88rpx;
color: white; color: white;
text-align: center; text-align: center;
background-color: #4777ee; background-color: #63b8af;
border-radius: 44rpx; border-radius: 44rpx;
} }
} }

View File

@ -405,7 +405,7 @@
line-height: 88rpx; line-height: 88rpx;
color: white; color: white;
text-align: center; text-align: center;
background-color: #4777ee; background-color: #63b8af;
border-radius: 44rpx; border-radius: 44rpx;
} }
} }

View File

@ -34,7 +34,7 @@
<view class="lock-list" v-if="!pending"> <view class="lock-list" v-if="!pending">
<view v-if="lockList.length === 0 && lockSearch.searchStr === '' && !focus"> <view v-if="lockList.length === 0 && lockSearch.searchStr === '' && !focus">
<image <image
src="https://cos-lock.skychip.top/mp/icon_add_round.png" src="https://oss-lock.xhjcn.ltd/mp/icon_add_round.png"
mode="aspectFill" mode="aspectFill"
class="button-add-big" class="button-add-big"
@click="toSearchDevice" @click="toSearchDevice"
@ -61,7 +61,7 @@
<view class="lock-top"> <view class="lock-top">
<image <image
class="lock-image-lock" class="lock-image-lock"
src="https://cos-lock.skychip.top/mp/icon_lock.png" src="https://oss-lock.xhjcn.ltd/mp/icon_lock.png"
></image> ></image>
<view class="lock-top-right"> <view class="lock-top-right">
<view class="lock-top-right-power"> <view class="lock-top-right-power">
@ -134,7 +134,7 @@
</scroll-view> </scroll-view>
<image <image
v-if="lockList.length !== 0" v-if="lockList.length !== 0"
src="https://cos-lock.skychip.top/mp/icon_add_round.png" src="https://oss-lock.xhjcn.ltd/mp/icon_add_round.png"
mode="aspectFill" mode="aspectFill"
class="button-add" class="button-add"
@click="toSearchDevice" @click="toSearchDevice"
@ -651,7 +651,7 @@
line-height: 120rpx; line-height: 120rpx;
color: #ffffff; color: #ffffff;
text-align: center; text-align: center;
background: #4777ee; background: #63b8af;
border-radius: 46rpx; border-radius: 46rpx;
} }

View File

@ -3,104 +3,79 @@
<scroll-view <scroll-view
v-if="deviceInfo" v-if="deviceInfo"
scroll-y="true" scroll-y="true"
:style="{ :style="{ height: deviceInfo.windowHeight - deviceInfo.safeArea.top + 'px' }"
height: deviceInfo.windowHeight - deviceInfo.safeArea.top + 'px'
}"
@refresherrefresh="refresher" @refresherrefresh="refresher"
:refresher-enabled="true" :refresher-enabled="true"
:refresher-triggered="refresherTriggered" :refresher-triggered="refresherTriggered"
> >
<view class="select-lock-row">
<image
src="https://cos-lock.skychip.top/mp/icon_add_round.png"
mode="aspectFill"
style="width: 48rpx; height: 48rpx"
@click="toSearchDevice"
></image>
<!-- 普通 picker -->
<picker :range="pickerOptions" @change="onPickerChange">
<view class="lock-name">
<text>
{{ $bluetooth.currentLockInfo.lockAlias }}
</text>
<image
class="icon-down"
src="https://cos-lock.skychip.top/mp/icon_down.png"
mode="aspectFill"
>
</image>
</view>
</picker>
<view class="power" @click="powerTip">
<image
class="power-icon"
:src="$lock.getPowerIcon($bluetooth.currentLockInfo.electricQuantity)"
mode="aspectFill"
></image>
<view class="power-text">{{ $bluetooth.currentLockInfo.electricQuantity }}%</view>
<image
class="power-tips"
src="https://cos-lock.skychip.top/mp/icon_tips.png"
mode="aspectFill"
>
</image>
</view>
</view>
<view
class="open-lock-btn"
@click="openDoorOperate('open')"
@longpress="openDoorOperate('close')"
>
<image
class="open-lock-btn-image-1"
ref="sLoading"
src="https://cos-lock.skychip.top/mp/icon_main_openLockBtn_center.png"
></image>
<image
class="open-lock-btn-image-2"
:class="{ rotate: isRotating }"
src="https://cos-lock.skychip.top/mp/icon_main_openLockBtn_circle.png"
></image>
</view>
<view class="days" v-if="$bluetooth.currentLockInfo.days" <view class="days" v-if="$bluetooth.currentLockInfo.days"
>钥匙将在{{ $bluetooth.currentLockInfo.days }}天后失效 >钥匙将在{{ $bluetooth.currentLockInfo.days }}天后失效</view
</view> >
<view class="lock-name">{{ $bluetooth.currentLockInfo.lockAlias }}</view>
<view class="switch-text">点击开锁长按闭锁</view> <view class="top">
<view class="other-text"> <image
<view class="bottom-side"> class="top-background"
<image src="https://oss-lock.xhjcn.ltd/mp/background_main.jpg"
class="bottom-icon" mode="aspectFill"
style="width: 32rpx; height: 32rpx" ></image>
src="https://cos-lock.skychip.top/mp/icon_role.png" <view style="width: 100%; height: 50rpx">
mode="aspectFill" <view class="power" @click="powerTip">
></image> <image
<view>{{ class="power-icon"
$lock.getRole($bluetooth.currentLockInfo.userType, $bluetooth.currentLockInfo.keyRight) :src="$lock.getPowerIcon($bluetooth.currentLockInfo.electricQuantity)"
}}</view> mode="aspectFill"
></image>
<view class="power-text">{{ $bluetooth.currentLockInfo.electricQuantity }}%</view>
<image
class="power-tips"
src="https://oss-lock.xhjcn.ltd/mp/icon_tips.png"
mode="aspectFill"
></image>
</view>
</view> </view>
<view class="bottom-side"> <view class="switch" @click="openDoorOperate('open')" @longpress="openDoorOperate('close')">
<image <SwitchLoading :size="220" ref="sLoading"></SwitchLoading>
class="bottom-icon" </view>
:src=" <view class="switch-text">点击开锁长按闭锁</view>
$bluetooth.currentLockInfo.appUnlockOnline <view class="bottom">
? 'https://cos-lock.skychip.top/mp/icon_cloud_active.png' <view class="bottom-side">
: 'https://cos-lock.skychip.top/mp/icon_cloud.png' <image
" class="bottom-icon"
mode="aspectFill" src="https://oss-lock.xhjcn.ltd/mp/icon_role.png"
style="width: 40rpx; height: 40rpx" mode="aspectFill"
></image> ></image>
<view <view>{{
:style="{ $lock.getRole(
color: $bluetooth.currentLockInfo.appUnlockOnline ? '#4777ee' : '#a3a3a3' $bluetooth.currentLockInfo.userType,
}" $bluetooth.currentLockInfo.keyRight
>手机需联网</view )
> }}</view>
</view>
<view class="bottom-side">
<image
class="bottom-icon"
:src="
$bluetooth.currentLockInfo.appUnlockOnline
? 'https://oss-lock.xhjcn.ltd/mp/icon_cloud_active.png'
: 'https://oss-lock.xhjcn.ltd/mp/icon_cloud.png'
"
mode="aspectFill"
style="width: 40rpx; height: 40rpx"
></image>
<view
:style="{
color: $bluetooth.currentLockInfo.appUnlockOnline ? '#63b8af' : '#a3a3a3'
}"
>手机需联网</view
>
</view>
</view> </view>
</view> </view>
<view class="menu"> <view class="menu">
<view class="menu-title">
<image class="menu-image" src="https://oss-lock.xhjcn.ltd/mp/icon_menu.png"></image>
<view>功能</view>
</view>
<view class="menu-main"> <view class="menu-main">
<view <view
v-if=" v-if="
@ -111,8 +86,8 @@
@click="$basic.routeJump({ name: 'keyList' })" @click="$basic.routeJump({ name: 'keyList' })"
> >
<image <image
class="menu-main-image" class="menu-main-image transform-scale-90"
src="https://cos-lock.skychip.top/mp/icon_main_electronicKey.png" src="https://oss-lock.xhjcn.ltd/mp/icon_key.png"
></image> ></image>
<view>电子钥匙</view> <view>电子钥匙</view>
</view> </view>
@ -127,9 +102,8 @@
> >
<image <image
class="menu-main-image" class="menu-main-image"
src="https://cos-lock.skychip.top/mp/icon_main_password.png" src="https://oss-lock.xhjcn.ltd/mp/icon_password_green.png"
> ></image>
</image>
<view>密码</view> <view>密码</view>
</view> </view>
<view <view
@ -143,7 +117,7 @@
> >
<image <image
class="menu-main-image transform-scale-110" class="menu-main-image transform-scale-110"
src="https://cos-lock.skychip.top/mp/icon_main_icCard.png" src="https://oss-lock.xhjcn.ltd/mp/icon_card.png"
></image> ></image>
<view></view> <view></view>
</view> </view>
@ -158,9 +132,8 @@
> >
<image <image
class="menu-main-image" class="menu-main-image"
src="https://cos-lock.skychip.top/mp/icon_main_fingerprint.png" src="https://oss-lock.xhjcn.ltd/mp/icon_fingerprint.png"
> ></image>
</image>
<view>指纹</view> <view>指纹</view>
</view> </view>
<view <view
@ -174,7 +147,7 @@
> >
<image <image
class="menu-main-image" class="menu-main-image"
src="https://cos-lock.skychip.top/mp/icon_main_remoteControl.png" src="https://oss-lock.xhjcn.ltd/mp/icon_remote.png"
></image> ></image>
<view>遥控</view> <view>遥控</view>
</view> </view>
@ -189,7 +162,7 @@
> >
<image <image
class="menu-main-image" class="menu-main-image"
src="https://cos-lock.skychip.top/mp/icon_face.png" src="https://oss-lock.xhjcn.ltd/mp/icon_face.png"
></image> ></image>
<view>人脸</view> <view>人脸</view>
</view> </view>
@ -204,7 +177,7 @@
> >
<image <image
class="menu-main-image" class="menu-main-image"
src="https://cos-lock.skychip.top/mp/icon_palm.png" src="https://oss-lock.xhjcn.ltd/mp/icon_palm_vein.png"
></image> ></image>
<view>掌静脉</view> <view>掌静脉</view>
</view> </view>
@ -215,7 +188,7 @@
> >
<image <image
class="menu-main-image transform-scale-140" class="menu-main-image transform-scale-140"
src="https://oss-lock.xhjcn.ltd/mp/icon_catEyes.png" src="https://oss-lock.xhjcn.ltd/mp/icon_control.png"
></image> ></image>
<view>监控</view> <view>监控</view>
</view> </view>
@ -229,7 +202,7 @@
> >
<image <image
class="menu-main-image transform-scale-140" class="menu-main-image transform-scale-140"
src="https://cos-lock.skychip.top/mp/icon_main_authorizedAdmin.png" src="https://oss-lock.xhjcn.ltd/mp/icon_admin_black.png"
></image> ></image>
<view>授权管理员</view> <view>授权管理员</view>
</view> </view>
@ -240,7 +213,7 @@
> >
<image <image
class="menu-main-image" class="menu-main-image"
src="https://cos-lock.skychip.top/mp/icon_main_operatingRecord.png" src="https://oss-lock.xhjcn.ltd/mp/icon_record.png"
></image> ></image>
<view>操作记录</view> <view>操作记录</view>
</view> </view>
@ -251,31 +224,57 @@
> >
<image <image
class="menu-main-image" class="menu-main-image"
src="https://cos-lock.skychip.top/mp/icon_main_operatingRecord.png" src="https://oss-lock.xhjcn.ltd/mp/icon_record.png"
></image> ></image>
<view>门锁记录</view> <view>门锁记录</view>
</view> </view>
<view class="menu-main-view" @click="$basic.routeJump({ name: 'setting' })"> <view
v-if="
$bluetooth.currentLockInfo.keyRight === 1 &&
$bluetooth.currentLockInfo.transportType !== transportType.TRANSPORT_TENCENT_YUN
"
class="menu-main-view"
@click="$basic.routeJump({ name: 'messageReminder' })"
>
<image <image
class="menu-main-image transform-scale-110" class="menu-main-image transform-scale-110"
src="https://cos-lock.skychip.top/mp/icon_main_set.png" src="https://oss-lock.xhjcn.ltd/mp/icon_remind.png"
></image> ></image>
<view>设置</view> <view>消息提醒</view>
</view>
<view
class="menu-main-view transform-scale-105"
v-if="$bluetooth.currentLockInfo.transportType === transportType.TRANSPORT_TENCENT_YUN"
@click="$basic.routeJump({ name: 'authorizeWechat' })"
>
<image
class="menu-main-image"
src="https://oss-lock.xhjcn.ltd/mp/icon_wechat_call.png"
></image>
<view>微信呼叫</view>
</view> </view>
</view> </view>
</view> </view>
<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>
<view class="setting-text">设置</view>
<image
class="setting-arrow"
mode="aspectFill"
src="https://oss-lock.xhjcn.ltd/mp/icon_arrow.png"
></image>
</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>
<view v-else class="not-devices-box">
<image class="menu-main-image" src="https://cos-lock.skychip.top/mp/icon_noData.png"></image>
<text>暂无智能锁</text>
<image
src="https://cos-lock.skychip.top/mp/icon_add_round.png"
mode="aspectFill"
class="button-add-big"
@click="toSearchDevice"
></image>
</view>
<up-popup <up-popup
:show="show" :show="show"
@close="closePopup" @close="closePopup"
@ -304,7 +303,7 @@
<script setup> <script setup>
import { timeFormat } from 'uview-plus' import { timeFormat } from 'uview-plus'
import { onMounted, onUnmounted, ref } from 'vue' import { onMounted, ref } from 'vue'
import { useBluetoothStore } from '@/stores/bluetooth' import { useBluetoothStore } from '@/stores/bluetooth'
import { useBasicStore } from '@/stores/basic' import { useBasicStore } from '@/stores/basic'
import SwitchLoading from '@/components/SwitchLoading/SwitchLoading.vue' import SwitchLoading from '@/components/SwitchLoading/SwitchLoading.vue'
@ -313,9 +312,6 @@
import { getLockDetailRequest, getLockNetTokenRequest, deleteLockRequest } 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'
import { loginRequest } from '@/api/user'
import { setStorage, getStorage } from '@/utils/storage'
import { onLoad, onShow } from '@dcloudio/uni-app' // UniApp
// #ifdef APP-PLUS // #ifdef APP-PLUS
import { requestPermission } from '@/uni_modules/xhj-record' import { requestPermission } from '@/uni_modules/xhj-record'
@ -326,7 +322,7 @@
const $lock = useLockStore() const $lock = useLockStore()
const $user = useUserStore() const $user = useUserStore()
// const sLoading = ref(null) const sLoading = ref(null)
const time = ref(0) const time = ref(0)
const onlineToken = ref('0') const onlineToken = ref('0')
@ -337,133 +333,9 @@
const deviceInfo = ref(null) const deviceInfo = ref(null)
//
const isRotating = ref(false)
//
const pickerOptions = ref([])
// picker 使
const selectedIndex = ref(0)
//
const selectedText = ref(pickerOptions.value[0])
onMounted(async () => { onMounted(async () => {
try { deviceInfo.value = await $basic.getDeviceInfo()
// #ifdef MP-WEIXIN await getServeTime()
const accountInfo = uni.getAccountInfoSync()
getApp().globalData.appid = accountInfo.miniProgram.appId
getApp().globalData.envVersion = accountInfo.miniProgram.envVersion
// #endif
uni.showLoading({
title: '加载中',
mask: true
})
const token = getStorage('token')
const list = getStorage('lockList')
const userInfo = getStorage('userInfo')
if (token) {
await Promise.all([$lock.getLockList($lock.lockSearch), $user.getUserInfo()]).then(res => {
pending.value = false
uni.hideLoading()
if (res[0].code === -1 && res[1] === -1 && list && userInfo) {
uni.showToast({
title: '网络访问失败,请检查网络是否正常',
icon: 'none'
})
$lock.updateLockList(list)
$user.updateUserInfo(userInfo)
$user.updateLoginStatus(true)
}
})
} else {
// uni.login() Promise
await new Promise((resolve, reject) => {
uni.login({
provider: 'weixin',
success: async loginRes => {
try {
const { code, data } = await loginRequest({
js_code: loginRes.code
})
if (code === 0) {
await setStorage('openid', data.openid)
if (data.accessToken) {
setStorage('token', data.accessToken)
const list = getStorage('lockList')
const userInfo = getStorage('userInfo')
if (!list && !userInfo) {
await $lock.getLockList($lock.lockSearch)
await $user.getUserInfo()
await $user.updateLoginStatus(true)
}
} else {
$user.updateLoginStatus(false)
}
resolve() // resolve Promise
} else {
throw new Error('登录请求失败')
}
} catch (err) {
console.error('登录过程出错:', err)
reject(err) // reject Promise
}
},
fail: err => {
console.error('微信登录失败:', err)
reject(err) // reject Promise
}
})
})
}
//
const lock = list.flatMap(item => item.lockList)
console.log('lock', lock)
if (lock) {
const defaultShowLockIndex = 0
const data = {
...lock[defaultShowLockIndex],
name: lock[defaultShowLockIndex].bluetooth.bluetoothDeviceName,
deviceId: lock[defaultShowLockIndex].bluetooth.bluetoothDeviceId,
commKey: lock[defaultShowLockIndex].bluetooth.privateKey,
signKey: lock[defaultShowLockIndex].bluetooth.signKey,
publicKey: lock[defaultShowLockIndex].bluetooth.publicKey
}
await $bluetooth.updateKeyId(lock[defaultShowLockIndex].keyId.toString())
await $bluetooth.updateCurrentLockInfo(data)
pickerOptions.value = lock.map(item => item.lockAlias)
}
if (Object.keys($bluetooth.currentLockInfo).length !== 0) {
if (!($bluetooth.bluetoothStatus === 0 || $bluetooth.bluetoothStatus === -1)) {
$bluetooth.getBluetoothStatus()
return
}
let result = true
if (!$bluetooth.isInitBluetooth) {
result = await $bluetooth.initAndListenBluetooth()
}
if (!result) {
$bluetooth.checkSetting()
}
}
//
deviceInfo.value = await $basic.getDeviceInfo()
await getServeTime()
} catch (err) {
console.error('初始化过程出错:', err)
uni.showToast({
title: '登录失败,请重试',
icon: 'none'
})
} finally {
uni.hideLoading() // loading
}
}) })
const jumpToPlayer = async () => { const jumpToPlayer = async () => {
@ -478,27 +350,10 @@
return return
} }
// #endif // #endif
$basic.routeJump({ $basic.routeJump({ name: 'p2pPlayer' })
name: 'p2pPlayer'
})
} }
const openDoorOperate = async type => { const openDoorOperate = async type => {
if (!($bluetooth.bluetoothStatus === 0 || $bluetooth.bluetoothStatus === -1)) {
$bluetooth.getBluetoothStatus()
return
}
let result = true
if (!$bluetooth.isInitBluetooth) {
result = await $bluetooth.initAndListenBluetooth()
}
if (!result) {
$bluetooth.checkSetting()
}
isRotating.value = true
const timestamp = new Date().getTime() const timestamp = new Date().getTime()
if ( if (
$bluetooth.currentLockInfo.faceAuthentication === 1 && $bluetooth.currentLockInfo.faceAuthentication === 1 &&
@ -510,37 +365,31 @@
content: '开门前需进行实名认证小程序暂不支持请使用APP认证开门', content: '开门前需进行实名认证小程序暂不支持请使用APP认证开门',
showCancel: false showCancel: false
}) })
isRotating.value = false
return return
} }
if (pending.value) { if (pending.value) {
isRotating.value = false
return return
} }
if ($bluetooth.currentLockInfo.appUnlockOnline && type !== 'close') { if ($bluetooth.currentLockInfo.appUnlockOnline && type !== 'close') {
const netWork = await $basic.getNetworkType() const netWork = await $basic.getNetworkType()
if (!netWork) { if (!netWork) {
isRotating.value = false
return return
} }
} }
uni.vibrateLong() uni.vibrateLong()
pending.value = true pending.value = true
sLoading.value.open()
if (type === 'close') { if (type === 'close') {
uni.showToast({ uni.showToast({
title: `正在尝试闭锁……`, title: `正在尝试闭锁……`,
icon: 'none' icon: 'none'
}) })
} }
// if ($bluetooth.currentLockInfo.appUnlockOnline && type !== 'close') { if ($bluetooth.currentLockInfo.appUnlockOnline && type !== 'close') {
if ($bluetooth.currentLockInfo.appUnlockOnline) {
const result = await getNetToken() const result = await getNetToken()
if (!result) { if (!result) {
// sLoading.value.close() sLoading.value.close()
pending.value = false pending.value = false
isRotating.value = false
return return
} }
} }
@ -550,7 +399,6 @@
} else { } else {
openMode = $bluetooth.currentLockInfo.appUnlockOnline ? 1 : 0 openMode = $bluetooth.currentLockInfo.appUnlockOnline ? 1 : 0
} }
const { code } = await $bluetooth.openDoor({ const { code } = await $bluetooth.openDoor({
name: $bluetooth.currentLockInfo.name, name: $bluetooth.currentLockInfo.name,
uid: $user.userInfo.uid.toString(), uid: $user.userInfo.uid.toString(),
@ -616,9 +464,8 @@
icon: 'none' icon: 'none'
}) })
} }
sLoading.value.close()
pending.value = false pending.value = false
isRotating.value = false
} }
const closePopup = () => { const closePopup = () => {
@ -662,10 +509,7 @@
lockId: $bluetooth.currentLockInfo.lockId lockId: $bluetooth.currentLockInfo.lockId
}) })
if (code === 0) { if (code === 0) {
$bluetooth.updateCurrentLockInfo({ $bluetooth.updateCurrentLockInfo({ ...$bluetooth.currentLockInfo, ...data })
...$bluetooth.currentLockInfo,
...data
})
uni.showToast({ uni.showToast({
title: '刷新成功', title: '刷新成功',
icon: 'none' icon: 'none'
@ -679,12 +523,6 @@
refresherTriggered.value = false refresherTriggered.value = false
} }
const toSearchDevice = async () => {
$basic.routeJump({
name: 'addLockGuid'
})
}
const deleteLock = async () => { const deleteLock = async () => {
const netWork = await $basic.getNetworkType() const netWork = await $basic.getNetworkType()
if (!netWork) { if (!netWork) {
@ -736,27 +574,6 @@
} }
}) })
} }
// picker
const onPickerChange = async e => {
const list = getStorage('lockList')
//
const lock = list.flatMap(item => item.lockList)
if (lock) {
const defaultShowLockIndex = e.detail.value
const data = {
...lock[defaultShowLockIndex],
name: lock[defaultShowLockIndex].bluetooth.bluetoothDeviceName,
deviceId: lock[defaultShowLockIndex].bluetooth.bluetoothDeviceId,
commKey: lock[defaultShowLockIndex].bluetooth.privateKey,
signKey: lock[defaultShowLockIndex].bluetooth.signKey,
publicKey: lock[defaultShowLockIndex].bluetooth.publicKey
}
await $bluetooth.updateKeyId(lock[defaultShowLockIndex].keyId.toString())
await $bluetooth.updateCurrentLockInfo(data)
pickerOptions.value = lock.map(item => item.lockAlias)
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -808,6 +625,14 @@
background: #faecc9; background: #faecc9;
} }
.lock-name {
padding: 32rpx 32rpx 0 32rpx;
font-size: 32rpx;
font-weight: bold;
text-align: center;
word-break: break-all;
}
.top { .top {
position: relative; position: relative;
width: 686rpx; width: 686rpx;
@ -844,21 +669,32 @@
align-items: center; align-items: center;
justify-content: flex-end; justify-content: flex-end;
height: 50rpx; height: 50rpx;
padding-top: 18rpx;
.power-icon { .power-icon {
width: 50rpx; width: 50rpx;
height: 30rpx; height: 30rpx;
margin-right: 10rpx;
} }
.power-text { .power-text {
margin-right: 10rpx;
font-size: 32rpx; font-size: 32rpx;
font-weight: bold;
line-height: 50rpx;
} }
.power-tips { .power-tips {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
margin-right: 32rpx;
} }
} }
.switch-text {
margin-top: 10rpx;
text-align: center;
}
} }
.bottom { .bottom {
@ -871,7 +707,7 @@
height: 48rpx; height: 48rpx;
font-size: 32rpx; font-size: 32rpx;
line-height: 48rpx; line-height: 48rpx;
color: #4777ee; color: #63b8af;
background-color: rgba(0, 0, 0, 0.1); background-color: rgba(0, 0, 0, 0.1);
border-radius: 0 0 32rpx 32rpx; border-radius: 0 0 32rpx 32rpx;
@ -922,8 +758,8 @@
margin-bottom: 48rpx; margin-bottom: 48rpx;
.menu-main-image { .menu-main-image {
width: 48rpx; width: 40rpx;
height: 48rpx; height: 40rpx;
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
} }
@ -959,138 +795,4 @@
margin-left: 32rpx; margin-left: 32rpx;
} }
} }
.not-devices-box {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: gray;
font-size: 24rpx;
width: 100%;
height: 100vh;
gap: 20rpx;
position: relative;
image {
width: 320rpx;
height: 240rpx;
}
.add-new-lock {
background-color: #4777ee;
color: white;
}
.button-add-big {
position: absolute;
width: 88rpx;
height: 88rpx;
right: 55rpx;
bottom: 55rpx;
}
}
.select-lock-row {
display: flex;
align-items: center;
justify-content: space-between;
border-radius: 15rpx;
padding: 8rpx 24rpx;
.lock-name {
display: flex;
align-items: center;
justify-content: center;
gap: 18rpx;
border-radius: 50rpx;
margin-top: 24rpx;
margin-bottom: 32rpx;
font-size: 32rpx;
background-color: #4777ee;
color: white;
padding: 12rpx 32rpx;
.icon-down {
width: 32rpx;
height: 32rpx;
}
}
.power {
display: flex;
align-items: center;
gap: 12rpx;
.power-icon {
width: 50rpx;
height: 30rpx;
}
.power-text {
font-size: 32rpx;
}
.power-tips {
width: 40rpx;
height: 40rpx;
}
}
}
.open-lock-btn {
display: flex;
justify-content: center;
position: relative;
height: 480rpx;
margin-top: 18rpx;
margin-bottom: 18rpx;
.open-lock-btn-image-1 {
width: 480rpx;
height: 480rpx;
position: absolute;
}
.open-lock-btn-image-2 {
width: 480rpx;
height: 480rpx;
position: absolute;
transition: transform 0.6s ease-in-out;
}
}
/* 旋转动画 class */
.rotate {
animation: rotate 2s linear infinite; /* 无限旋转动画 */
}
@keyframes rotate {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.switch-text {
margin-top: 35rpx;
font-size: 32rpx;
color: #414141;
text-align: center;
}
.other-text {
display: flex;
align-items: center;
justify-content: center;
gap: 15rpx;
margin-top: 35rpx;
.bottom-side {
display: flex;
align-items: center;
font-size: 32rpx;
gap: 10rpx;
}
.bottom-icon {
width: 48rpx;
height: 48rpx;
}
}
</style> </style>

View File

@ -1,543 +1,445 @@
<template> <template>
<view v-if="buttonInfo"> <view v-if="buttonInfo">
<view v-if="isLogin"> <view v-if="isLogin">
<view class="account-info" @click="toUsereInfo"> <view class="view">
<image class="avatar" :src="userInfo.headUrl" mode="aspectFill"></image> <view class="view-button" @click="toUsereInfo">
<view class="account-nickname"> <view>个人信息</view>
<text class="nickname">{{ userInfo.nickname }}</text> <image
<text class="account">{{ userInfo.mobile }}</text> class="icon-arrow"
</view> src="https://oss-lock.xhjcn.ltd/mp/icon_arrow.png"
</view> mode="aspectFill"
<view class="follow-official-account"> ></image>
<text>关注公众号接收更多消息提醒</text> </view>
<!-- #ifdef MP-WEIXIN --> <view class="view-line"></view>
<official-account><view class="follow-btn">关注公众号</view></official-account> <!-- #ifdef MP-WEIXIN -->
<!-- #endif --> <label for="contact">
<view class="follow-btn" @click="jumpToWeChatfficialAccount">关注公众号</view> <view class="view-button">
</view> <view>客服</view>
<label for="contact"> <image
<view class="option-item"> class="icon-arrow"
<view class="icon-label"> src="https://oss-lock.xhjcn.ltd/mp/icon_arrow.png"
<image class="left-icon" src="https://cos-lock.skychip.top/mp/icon_customer_service.png"> mode="aspectFill"
</image> ></image>
<text>人工客服</text> </view>
</view> </label>
<image class="icon-arrow" src="https://cos-lock.skychip.top/mp/icon_arrow.png" mode="aspectFill"> <!-- #endif -->
</image> <!-- #ifdef APP-PLUS -->
</view> <view @click="toContact">
</label> <view class="view-button">
<view class="view"> <view>客服</view>
<!-- #ifdef APP-PLUS --> <image
<view @click="toContact"> class="icon-arrow"
<view class="view-button"> src="https://oss-lock.xhjcn.ltd/mp/icon_arrow.png"
<view>客服</view> mode="aspectFill"
<image class="icon-arrow" src="https://cos-lock.skychip.top/mp/icon_arrow.png" ></image>
mode="aspectFill"> </view>
</image> </view>
</view> <!-- #endif -->
</view> <view class="view-line"></view>
<!-- #endif --> <view class="view-button" @click="toWebview()">
<view class="view-button"> <view>公司介绍</view>
<view>邮箱 / 商务合作</view> <image
<text class="right-text">{{env.officialEmail}}</text> class="icon-arrow"
</view> src="https://oss-lock.xhjcn.ltd/mp/icon_arrow.png"
<view class="view-line"></view> mode="aspectFill"
<view class="view-button"> ></image>
<view>官网</view> </view>
<text class="right-text">{{env.officialWebsite}}</text> <view class="view-line"></view>
</view> <view class="view-button" @click="toWebview('userAgreement')">
<view class="view-line"></view> <view>用户协议</view>
<view class="view-button" @click="toWebview()"> <image
<view>公司介绍</view> class="icon-arrow"
<image class="icon-arrow" src="https://cos-lock.skychip.top/mp/icon_arrow.png" mode="aspectFill"> src="https://oss-lock.xhjcn.ltd/mp/icon_arrow.png"
</image> mode="aspectFill"
</view> ></image>
<view class="view-line"></view> </view>
<view class="view-button" @click="toWebview('userAgreement')"> <view class="view-line"></view>
<view>用户协议</view> <view class="view-button" @click="toWebview('privacy')">
<image class="icon-arrow" src="https://cos-lock.skychip.top/mp/icon_arrow.png" mode="aspectFill"> <view>隐私政策</view>
</image> <image
</view> class="icon-arrow"
<view class="view-line"></view> src="https://oss-lock.xhjcn.ltd/mp/icon_arrow.png"
<view class="view-button" @click="toWebview('privacy')"> mode="aspectFill"
<view>隐私政策</view> ></image>
<image class="icon-arrow" src="https://cos-lock.skychip.top/mp/icon_arrow.png" mode="aspectFill"> </view>
</image> </view>
</view> <view class="env" v-if="env">
</view> <view class="env-text">{{ env.name }} {{ env.version }}+{{ env.buildNumber }}</view>
<view class="env" v-if="env"> <view>{{ env.baseUrl.split('/').slice(0, 3).join('/') }}</view>
<view class="env-text">{{ env.name }} {{ env.version }}+{{ env.buildNumber }}</view> <view v-if="envVersion !== 'release' && env" class="env-button" @click="show = true"
<view>{{ env.baseUrl.split('/').slice(0, 3).join('/') }}</view> >切换环境</view
<view v-if="!(envVersion === 'release' || nodeEnv === 'production') && env" class="env-button" >
@click="show = true">切换环境</view> </view>
</view> <!-- #ifdef MP-WEIXIN -->
<!-- #ifdef MP-WEIXIN --> <label for="changePhone">
<label for="changePhone"> <view class="switch-account">切换账号</view>
<view class="switch-account">切换账号</view> </label>
</label> <!-- #endif -->
<!-- #endif --> <!-- #ifdef APP-PLUS -->
<!-- #ifdef APP-PLUS --> <view class="switch-account !bg-red-500" @click="logout">退出</view>
<view class="switch-account !bg-red-500" @click="logout">退出</view> <view class="delete-account" @click="deleteAccount">删除账号</view>
<view class="delete-account" @click="deleteAccount">删除账号</view> <!-- #endif -->
<!-- #endif --> </view>
</view> <view v-else>
<view v-else> <view class="tips">因智能门锁与账号绑定登录为手机号登录</view>
<view class="tips">因智能门锁与账号绑定登录为手机号登录</view> <label for="phone">
<label for="phone"> <view class="button-login">登录</view>
<view class="button-login">登录</view> </label>
</label> <view class="env" v-if="env">
<view class="env" v-if="env"> <view class="env-text">{{ env.name }} {{ env.version }}+{{ env.buildNumber }}</view>
<view class="env-text">{{ env.name }} {{ env.version }}+{{ env.buildNumber }}</view> <view>{{ env.baseUrl.split('/').slice(0, 3).join('/') }}</view>
<view>{{ env.baseUrl.split('/').slice(0, 3).join('/') }}</view> <view
<view v-if="!(envVersion === 'release' || nodeEnv === 'production') && env" class="env-button" v-if="(envVersion !== 'release' || nodeEnv === 'development') && env"
@click="show = true"> class="env-button"
切换环境 @click="show = true"
</view> >
</view> 切换环境
</view> </view>
</view> </view>
<button open-type="contact" style="display: none" id="contact"></button> </view>
<button open-type="getPhoneNumber" style="display: none" id="phone" @getphonenumber="getphonenumber"></button> </view>
<button open-type="getPhoneNumber" style="display: none" id="changePhone" @getphonenumber="changePhone"></button> <button open-type="contact" style="display: none" id="contact"></button>
<up-action-sheet :actions="envList" :closeOnClickOverlay="true" title="切换环境" cancelText="取消" <button
:closeOnClickAction="true" :show="show" :safeAreaInsetBottom="true" @close="show = false" open-type="getPhoneNumber"
@select="selectEnv"></up-action-sheet> style="display: none"
id="phone"
@getphonenumber="getphonenumber"
></button>
<button
open-type="getPhoneNumber"
style="display: none"
id="changePhone"
@getphonenumber="changePhone"
></button>
<up-action-sheet
:actions="envList"
:closeOnClickOverlay="true"
title="切换环境"
cancelText="取消"
:closeOnClickAction="true"
:show="show"
:safeAreaInsetBottom="true"
@close="show = false"
@select="selectEnv"
></up-action-sheet>
</template> </template>
<script> <script>
import { import { mapState, mapActions } from 'pinia'
mapState, import { useBasicStore } from '@/stores/basic'
mapActions import { useUserStore } from '@/stores/user'
} from 'pinia' import { useLockStore } from '@/stores/lock'
import { import { phoneLoginRequest, logoutRequest } from '@/api/user'
useBasicStore import env from '@/config/env'
} from '@/stores/basic' import { setStorage, getStorage, removeStorage } from '@/utils/storage'
import { import { useNotificationStore } from '@/stores/notification'
useUserStore import { getAppInfoRequest } from '@/api/system'
} from '@/stores/user'
import {
useLockStore
} from '@/stores/lock'
import {
phoneLoginRequest,
logoutRequest
} from '@/api/user'
import env from '@/config/env'
import {
setStorage,
getStorage,
removeStorage
} from '@/utils/storage'
import {
useNotificationStore
} from '@/stores/notification'
import {
getAppInfoRequest
} from '@/api/system'
import {
loginRequest
} from '@/api/user'
export default {
data() {
return {
buttonInfo: null,
env: null,
envVersion: '',
envList: [],
show: false,
nodeEnv: ''
}
},
computed: {
...mapState(useUserStore, ['isLogin', 'userInfo']),
...mapState(useLockStore, ['lockSearch']),
...mapState(useNotificationStore, ['notificationSearch'])
},
async onLoad() {
this.buttonInfo = await this.getButtonInfo()
this.env = await env[await getApp().globalData.getEnvConfig()]
this.envVersion = getApp().globalData.envVersion
this.nodeEnv = process.env.NODE_ENV
// eslint-disable-next-line guard-for-in,no-restricted-syntax export default {
for (let key in env) { data() {
this.envList.push({ return {
...env[key], buttonInfo: null,
key env: null,
}) envVersion: '',
} envList: [],
}, show: false,
methods: { nodeEnv: ''
...mapActions(useBasicStore, ['getButtonInfo', 'routeJump']), }
...mapActions(useLockStore, ['getLockList', 'updateLockSearch']), },
...mapActions(useNotificationStore, ['getNotificationList', 'updateNotificationSearch']), computed: {
...mapActions(useUserStore, [ ...mapState(useUserStore, ['isLogin']),
'updateLoginStatus', ...mapState(useLockStore, ['lockSearch']),
'phoneLogin', ...mapState(useNotificationStore, ['notificationSearch'])
'updateUserInfo', },
'getUserInfo', async onLoad() {
'checkSession' this.buttonInfo = await this.getButtonInfo()
]), this.env = await env[await getApp().globalData.getEnvConfig()]
deleteAccount() { this.envVersion = getApp().globalData.envVersion
uni.showModal({ this.nodeEnv = process.env.NODE_ENV
title: '提示',
content: '删除账号后,你的所有信息及相关记录都会从平台彻底删除,且不可恢复,是否删除?',
success: res => {
if (res.confirm) {
this.routeJump({
name: 'deleteAccount'
})
}
}
})
},
selectEnv(env) {
setStorage('envVersion', env.key)
removeStorage('token')
removeStorage('openid')
removeStorage('userInfo')
removeStorage('lockList')
uni.reLaunch({
url: '/pages/main/home'
})
},
toContact() {
getAppInfoRequest().then(res => {
if (res.code === 0) {
plus.runtime.openURL(res.data.wechat_service_url)
}
})
},
async changePhone(res) {
if (res.detail.errMsg === 'getPhoneNumber:fail user deny') {
return
}
const that = this // eslint-disable-next-line guard-for-in,no-restricted-syntax
uni.showLoading({ for (let key in env) {
title: '登录中' this.envList.push({
}) ...env[key],
uni.login({ key
provider: 'weixin', })
async success(loginRes) { }
const openid = getStorage('openid') },
const { methods: {
code, ...mapActions(useBasicStore, ['getButtonInfo', 'routeJump']),
data, ...mapActions(useLockStore, ['getLockList', 'updateLockSearch']),
message ...mapActions(useNotificationStore, ['getNotificationList', 'updateNotificationSearch']),
} = await phoneLoginRequest({ ...mapActions(useUserStore, [
encryptedData: res.detail.encryptedData, 'updateLoginStatus',
iv: res.detail.iv, 'phoneLogin',
rebind: true, 'updateUserInfo',
openid, 'getUserInfo',
js_code: loginRes.code 'checkSession'
}) ]),
uni.hideLoading() deleteAccount() {
if (code === 0) { uni.showModal({
removeStorage('userInfo') title: '提示',
removeStorage('lockList') content: '删除账号后,你的所有信息及相关记录都会从平台彻底删除,且不可恢复,是否删除?',
setStorage('token', data.accessToken) success: res => {
that.updateLockSearch({ if (res.confirm) {
...that.lockSearch, this.routeJump({
pageNo: 1 name: 'deleteAccount'
}) })
that.getUserInfo() }
that.getLockList(that.lockSearch) }
that.updateNotificationSearch({ })
pageNo: 1 },
}) selectEnv(env) {
that.getNotificationList(that.notificationSearch) setStorage('envVersion', env.key)
uni.showToast({ removeStorage('token')
title: '账号切换成功', removeStorage('openid')
icon: 'none' removeStorage('userInfo')
}) removeStorage('lockList')
} else if (code === 438) { uni.reLaunch({
/* empty */ url: '/pages/main/home'
} else { })
uni.showToast({ },
title: message, toContact() {
icon: 'none' getAppInfoRequest().then(res => {
}) if (res.code === 0) {
} plus.runtime.openURL(res.data.wechat_service_url)
}, }
fail() { })
uni.hideLoading() },
uni.showToast({ async changePhone(res) {
title: '登录失败,请重试' if (res.detail.errMsg === 'getPhoneNumber:fail user deny') {
}) return
} }
})
}, const that = this
async getphonenumber(data) { uni.showLoading({
if (data.detail.errMsg === 'getPhoneNumber:fail user deny') { title: '登录中'
return })
} uni.login({
const that = this provider: 'weixin',
uni.showLoading({ async success(loginRes) {
title: '登录中' const openid = getStorage('openid')
}) const { code, data, message } = await phoneLoginRequest({
uni.login({ encryptedData: res.detail.encryptedData,
provider: 'weixin', iv: res.detail.iv,
async success(loginRes) { rebind: true,
const result = await that.phoneLogin({ openid,
encryptedData: data.detail.encryptedData, js_code: loginRes.code
iv: data.detail.iv, })
code: loginRes.code uni.hideLoading()
}) if (code === 0) {
uni.hideLoading() removeStorage('userInfo')
if (!result) { removeStorage('lockList')
uni.showToast({ setStorage('token', data.accessToken)
title: result.message, that.updateLockSearch({
icon: 'none' ...that.lockSearch,
}) pageNo: 1
} })
}, that.getUserInfo()
fail() { that.getLockList(that.lockSearch)
uni.hideLoading() that.updateNotificationSearch({
uni.showToast({ pageNo: 1
title: '登录失败,请重试' })
}) that.getNotificationList(that.notificationSearch)
} uni.showToast({
}) title: '账号切换成功',
}, icon: 'none'
toUsereInfo() { })
this.routeJump({ } else if (code === 438) {
name: 'userInfo' /* empty */
}) } else {
}, uni.showToast({
toWebview(type) { title: message,
this.routeJump({ icon: 'none'
name: 'webview', })
params: { }
type },
} fail() {
}) uni.hideLoading()
}, uni.showToast({
jumpToWeChatfficialAccount(){ title: '登录失败,请重试'
})
}, }
logout() { })
uni.showModal({ },
title: '提示', async getphonenumber(data) {
content: '确定退出登录吗?', if (data.detail.errMsg === 'getPhoneNumber:fail user deny') {
success: async res => { return
if (res.confirm) { }
await logoutRequest()
removeStorage('token') const that = this
removeStorage('openid') uni.showLoading({
removeStorage('userInfo') title: '登录中'
removeStorage('lockList') })
this.routeJump({ uni.login({
name: 'login', provider: 'weixin',
type: 'reLaunch' async success(loginRes) {
}) const result = await that.phoneLogin({
} encryptedData: data.detail.encryptedData,
} iv: data.detail.iv,
}) code: loginRes.code
} })
} uni.hideLoading()
} if (!result) {
uni.showToast({
title: result.message,
icon: 'none'
})
}
},
fail() {
uni.hideLoading()
uni.showToast({
title: '登录失败,请重试'
})
}
})
},
toUsereInfo() {
this.routeJump({
name: 'userInfo'
})
},
toWebview(type) {
this.routeJump({
name: 'webview',
params: {
type
}
})
},
logout() {
uni.showModal({
title: '提示',
content: '确定退出登录吗?',
success: async res => {
if (res.confirm) {
await logoutRequest()
removeStorage('token')
removeStorage('openid')
removeStorage('userInfo')
removeStorage('lockList')
this.routeJump({
name: 'login',
type: 'reLaunch'
})
}
}
})
}
}
}
</script> </script>
<style lang="scss"> <style lang="scss">
page { page {
background-color: $uni-bg-color-grey; background-color: $uni-bg-color-grey;
} }
</style> </style>
<style scoped lang="scss"> <style scoped lang="scss">
.background-image { .background-image {
width: 710rpx; width: 710rpx;
height: 156rpx; height: 156rpx;
margin-top: 32rpx; margin-top: 32rpx;
margin-left: 20rpx; margin-left: 20rpx;
border-radius: 32rpx; border-radius: 32rpx;
} }
.view { .view {
background: #ffffff; width: 710rpx;
border-radius: 16rpx; margin-top: 32rpx;
display: flex; margin-left: 20rpx;
flex-direction: column; background: #ffffff;
align-items: center; border-radius: 32rpx;
margin: 20rpx 20rpx; }
padding: 20rpx 20rpx;
gap: 20rpx;
}
.follow-official-account { .view-button {
margin: 20rpx 20rpx; display: flex;
background-image: url('https://cos-lock.skychip.top/mp/follow_official_account_bg.png'); align-items: center;
background-size: cover; justify-content: space-between;
background-position: center; padding: 0 20rpx 0 40rpx;
background-repeat: no-repeat; font-size: 32rpx;
height: 88rpx; font-weight: bold;
border-radius: 16rpx; line-height: 80rpx;
display: flex; color: #292826;
align-items: center; }
justify-content: space-between;
color: white;
font-weight: 400;
font-size: 28rpx;
padding-left: 20rpx;
padding-right: 20rpx;
.follow-btn { .icon-arrow {
display: flex; width: 40rpx;
align-items: center; height: 40rpx;
padding: 12rpx 20rpx; }
background-color: white;
border-radius: 16rpx;
color: #4777ee;
}
}
.account-info { .view-line {
margin: 20rpx 20rpx; width: 100%;
padding-left: 20rpx; height: 3rpx;
padding-top: 20rpx; background: #ebebeb;
padding-bottom: 20rpx; }
padding-right: 20rpx;
display: flex;
gap: 18rpx;
align-items: center;
border-radius: 16rpx;
background-color: white;
.avatar { .switch-account {
width: 120rpx; position: absolute;
height: 120rpx; bottom: 120rpx;
} width: 600rpx;
height: 80rpx;
margin-left: 75rpx;
font-size: 40rpx;
font-weight: bold;
line-height: 80rpx;
color: #ffffff;
text-align: center;
background: #63b8af;
border-radius: 46rpx;
}
.account-nickname { .delete-account {
display: flex; position: absolute;
flex-direction: column; right: 75rpx;
gap: 12rpx; bottom: 60rpx;
font-size: 28rpx;
color: #666;
}
.nickname { .env {
font-size: 32rpx; position: absolute;
font-weight: 600; bottom: 240rpx;
} width: 600rpx;
margin-left: 75rpx;
line-height: 80rpx;
text-align: center;
.account { .env-text {
font-size: 24rpx; font-size: 30rpx;
color: gray; font-weight: bold;
font-weight: 500; color: #999999;
} }
}
}
.view-button { .env-button {
width: 100%; font-size: 0.8rem;
display: flex; color: #022b7c;
align-items: center; text-align: right;
justify-content: space-between; text-decoration: underline;
border-radius: 16rpx; background: inherit;
font-size: 28rpx; }
}
.right-text { .button-login {
font-size: 28rpx; width: 650rpx;
color: gray; height: 120rpx;
} margin-left: 50rpx;
} font-size: 48rpx;
font-weight: bold;
line-height: 120rpx;
color: #ffffff;
text-align: center;
background: #63b8af;
border-radius: 46rpx;
}
.icon-arrow { .tips {
width: 40rpx; padding: 32rpx 0;
height: 40rpx; margin-top: 25vh;
} font-size: 28rpx;
color: #999999;
.view-line { text-align: center;
width: 100%; }
height: 3rpx; </style>
background: #ebebeb;
}
.switch-account {
position: absolute;
bottom: 120rpx;
width: 600rpx;
height: 80rpx;
margin-left: 75rpx;
font-size: 40rpx;
font-weight: bold;
line-height: 80rpx;
color: #ffffff;
text-align: center;
background: #4777ee;
border-radius: 46rpx;
}
.delete-account {
position: absolute;
right: 75rpx;
bottom: 60rpx;
font-size: 28rpx;
color: #666;
}
.env {
position: absolute;
bottom: 240rpx;
width: 600rpx;
margin-left: 75rpx;
line-height: 80rpx;
text-align: center;
.env-text {
font-size: 30rpx;
font-weight: bold;
color: #999999;
}
.env-button {
font-size: 0.8rem;
color: #022b7c;
text-align: right;
text-decoration: underline;
background: inherit;
}
}
.button-login {
width: 650rpx;
height: 120rpx;
margin-left: 50rpx;
font-size: 48rpx;
font-weight: bold;
line-height: 120rpx;
color: #ffffff;
text-align: center;
background: #4777ee;
border-radius: 46rpx;
}
.tips {
padding: 32rpx 0;
margin-top: 25vh;
font-size: 28rpx;
color: #999999;
text-align: center;
}
.option-item {
background-color: white;
display: flex;
padding: 20rpx 20rpx;
margin-left: 20rpx;
margin-right: 20rpx;
border-radius: 16rpx;
align-items: center;
justify-content: space-between;
.left-icon {
width: 52rpx;
height: 52rpx;
}
.icon-label {
display: flex;
align-items: center;
gap: 12rpx;
}
}
</style>

View File

@ -78,7 +78,7 @@
> >
<image <image
class="delete-image" class="delete-image"
src="https://cos-lock.skychip.top/mp/icon_delete.png" src="https://oss-lock.xhjcn.ltd/mp/icon_delete.png"
mode="aspectFill" mode="aspectFill"
/> />
</view> </view>
@ -409,7 +409,7 @@
justify-content: center; justify-content: center;
width: 100rpx; width: 100rpx;
height: 100rpx; height: 100rpx;
background-color: #4777ee; background-color: #5db5aa;
border-radius: 50%; border-radius: 50%;
.delete-image { .delete-image {
@ -448,7 +448,7 @@
line-height: 120rpx; line-height: 120rpx;
color: #ffffff; color: #ffffff;
text-align: center; text-align: center;
background: #4777ee; background: #63b8af;
border-radius: 46rpx; border-radius: 46rpx;
} }
</style> </style>

View File

@ -32,7 +32,7 @@
<view <view
v-for="(item, index) in list" v-for="(item, index) in list"
:key="index" :key="index"
:class="[weekDays.includes(index + 1) ? 'bg-#4777ee text-white' : '']" :class="[weekDays.includes(index + 1) ? 'bg-#5eb7ac text-white' : '']"
@click=" @click="
weekDays.includes(index + 1) weekDays.includes(index + 1)
? weekDays.splice(weekDays.indexOf(index + 1), 1) ? weekDays.splice(weekDays.indexOf(index + 1), 1)
@ -71,7 +71,7 @@
</view> </view>
<view <view
:class="[ :class="[
canSubmit ? 'bg-[#4777ee]' : 'bg-[#9d9da3]', canSubmit ? 'bg-[#5eb7ac]' : 'bg-[#9d9da3]',
'mx-4', 'mx-4',
'h-100', 'h-100',
'text-white', 'text-white',

View File

@ -26,7 +26,7 @@
</view> </view>
<view <view
:class="[ :class="[
canSubmit ? 'bg-[#4777ee]' : 'bg-[#9d9da3]', canSubmit ? 'bg-[#5eb7ac]' : 'bg-[#9d9da3]',
'mx-4', 'mx-4',
'h-100', 'h-100',
'text-white', 'text-white',

View File

@ -54,7 +54,7 @@
> >
<view class="mx-2"> <view class="mx-2">
<view class="flex items-start"> <view class="flex items-start">
<view class="bg-#4777ee size-15 rounded-full mr-2 mt-1.5"></view> <view class="bg-#63b8af size-15 rounded-full mr-2 mt-1.5"></view>
<view class="w-full"> <view class="w-full">
<view class="font-bold flex justify-between w-full"> <view class="font-bold flex justify-between w-full">
<view>{{ item.event_type_name }}</view> <view>{{ item.event_type_name }}</view>
@ -303,7 +303,7 @@
const color = computed(() => { const color = computed(() => {
if (info.value?.status === 1) { if (info.value?.status === 1) {
return '#4777ee' return '#63b8af'
} }
if (info.value?.status === 2) { if (info.value?.status === 2) {
return 'red' return 'red'

View File

@ -39,7 +39,7 @@
</view> </view>
<view <view
v-if="$bluetooth.currentLockSetting.lockBasicInfo.keyRight === 1" v-if="$bluetooth.currentLockSetting.lockBasicInfo.keyRight === 1"
:class="[canUpdate ? 'bg-#4777ee' : 'bg-#a3a3a3']" :class="[canUpdate ? 'bg-#63b8af' : 'bg-#a3a3a3']"
class="mt-4 rounded-3xl w-600 h-80 line-height-80rpx text-center mx-75rpx text-white text-xl font-bold" class="mt-4 rounded-3xl w-600 h-80 line-height-80rpx text-center mx-75rpx text-white text-xl font-bold"
@click="update" @click="update"
> >

View File

@ -238,7 +238,7 @@
</view> </view>
<view <view
@click="show = false" @click="show = false"
class="w-686 mx-4 text-center h-88 line-height-88rpx mt-5 text-white bg-#4777ee rounded-44rpx" class="w-686 mx-4 text-center h-88 line-height-88rpx mt-5 text-white bg-#63b8af rounded-44rpx"
>我知道了</view >我知道了</view
> >
</view> </view>

View File

@ -69,7 +69,7 @@
<view <view
v-if="list.length > 0" v-if="list.length > 0"
@click="confirm" @click="confirm"
class="pos-fixed bottom-[calc(env(safe-area-inset-bottom)+48rpx)] w-686 mx-4 h-88 line-height-88rpx text-center bg-#4777ee text-white rounded-3xl" class="pos-fixed bottom-[calc(env(safe-area-inset-bottom)+48rpx)] w-686 mx-4 h-88 line-height-88rpx text-center bg-#63b8af text-white rounded-3xl"
>确定 >确定
</view> </view>
</view> </view>
@ -266,7 +266,7 @@
line-height: 88rpx; line-height: 88rpx;
color: white; color: white;
text-align: center; text-align: center;
background-color: #4777ee; background-color: #63b8af;
border-radius: 44rpx; border-radius: 44rpx;
} }
} }

View File

@ -6,7 +6,7 @@
}}</view> }}</view>
</view> </view>
<view <view
class="bg-#4777ee mt-4 rounded-3xl w-600 h-80 line-height-80rpx text-center mx-75rpx text-white text-xl font-bold" class="bg-#63b8af mt-4 rounded-3xl w-600 h-80 line-height-80rpx text-center mx-75rpx text-white text-xl font-bold"
@click="update" @click="update"
> >
校准时间 校准时间

View File

@ -31,7 +31,7 @@
</view> </view>
</view> </view>
<view <view
:class="[canUpdate ? 'bg-#4777ee' : 'bg-#a3a3a3']" :class="[canUpdate ? 'bg-#63b8af' : 'bg-#a3a3a3']"
class="mt-4 rounded-3xl w-600 h-80 line-height-80rpx text-center mx-75rpx text-white text-xl font-bold" class="mt-4 rounded-3xl w-600 h-80 line-height-80rpx text-center mx-75rpx text-white text-xl font-bold"
@click="update" @click="update"
> >

View File

@ -65,7 +65,7 @@
<view <view
v-if="list.length > 0" v-if="list.length > 0"
@click="confirm" @click="confirm"
class="pos-fixed bottom-[calc(env(safe-area-inset-bottom)+48rpx)] w-686 mx-4 h-88 line-height-88rpx text-center bg-#4777ee text-white rounded-3xl" class="pos-fixed bottom-[calc(env(safe-area-inset-bottom)+48rpx)] w-686 mx-4 h-88 line-height-88rpx text-center bg-#63b8af text-white rounded-3xl"
>确定 >确定
</view> </view>
</view> </view>
@ -376,7 +376,7 @@
line-height: 88rpx; line-height: 88rpx;
color: white; color: white;
text-align: center; text-align: center;
background-color: #4777ee; background-color: #63b8af;
border-radius: 44rpx; border-radius: 44rpx;
} }
} }

View File

@ -46,7 +46,7 @@
</view> </view>
<view <view
@click="update" @click="update"
class="pos-fixed bg-#4777ee bottom-[calc(env(safe-area-inset-bottom)+48rpx)] w-686 mx-4 h-88 line-height-88rpx text-center text-white rounded-3xl" class="pos-fixed bg-#63b8af bottom-[calc(env(safe-area-inset-bottom)+48rpx)] w-686 mx-4 h-88 line-height-88rpx text-center text-white rounded-3xl"
>保存 >保存
</view> </view>
</view> </view>

View File

@ -55,7 +55,7 @@
</view> </view>
<view <view
@click="update" @click="update"
class="pos-fixed bg-#4777ee bottom-[calc(env(safe-area-inset-bottom)+48rpx)] w-686 mx-4 h-88 line-height-88rpx text-center text-white rounded-3xl" class="pos-fixed bg-#63b8af bottom-[calc(env(safe-area-inset-bottom)+48rpx)] w-686 mx-4 h-88 line-height-88rpx text-center text-white rounded-3xl"
>保存 >保存
</view> </view>
<up-picker <up-picker

View File

@ -89,7 +89,7 @@
v-else v-else
@click="create" @click="create"
class="pos-fixed bottom-[calc(env(safe-area-inset-bottom)+48rpx)] w-686 mx-4 h-88 line-height-88rpx text-center text-white rounded-3xl" class="pos-fixed bottom-[calc(env(safe-area-inset-bottom)+48rpx)] w-686 mx-4 h-88 line-height-88rpx text-center text-white rounded-3xl"
:class="[canCreate ? 'bg-#4777ee' : 'bg-#9d9ca1']" :class="[canCreate ? 'bg-#63b8af' : 'bg-#9d9ca1']"
>保存 >保存
</view> </view>
<ModalInput <ModalInput

View File

@ -86,7 +86,7 @@
<view <view
@click="confirm" @click="confirm"
class="mt-10 w-686 mx-4 h-88 line-height-88rpx text-center bg-#4777ee text-white rounded-3xl" class="mt-10 w-686 mx-4 h-88 line-height-88rpx text-center bg-#63b8af text-white rounded-3xl"
>确定 >确定
</view> </view>
</view> </view>

View File

@ -21,7 +21,7 @@
<view <view
v-for="(item, index) in list" v-for="(item, index) in list"
:key="index" :key="index"
:class="[weekDays.includes(index + 1) ? 'bg-#4777ee text-white' : '']" :class="[weekDays.includes(index + 1) ? 'bg-#5eb7ac text-white' : '']"
@click="changeSelect(index)" @click="changeSelect(index)"
class="rounded-50% border-solid border-3 border-gray-400 flex items-center justify-center w-70 h-70" class="rounded-50% border-solid border-3 border-gray-400 flex items-center justify-center w-70 h-70"
>{{ item }} >{{ item }}
@ -76,7 +76,7 @@
</view> </view>
<view <view
@click="confirm" @click="confirm"
:class="[canUpdate ? 'bg-#4777ee' : 'bg-#a3a3a3']" :class="[canUpdate ? 'bg-#63b8af' : 'bg-#a3a3a3']"
class="pos-fixed bottom-[calc(env(safe-area-inset-bottom)+48rpx)] w-686 mx-4 h-88 line-height-88rpx text-center text-white rounded-3xl" class="pos-fixed bottom-[calc(env(safe-area-inset-bottom)+48rpx)] w-686 mx-4 h-88 line-height-88rpx text-center text-white rounded-3xl"
>保存 >保存
</view> </view>

View File

@ -25,7 +25,7 @@
</scroll-view> </scroll-view>
<view <view
@click="() => $refs.modalInput.open()" @click="() => $refs.modalInput.open()"
class="bg-#4777ee text-white pos-fixed bottom-[calc(env(safe-area-inset-bottom)+48rpx)] rounded-44rpx w-686 ml-4 h-88 line-height-88rpx text-lg font-bold text-center" class="bg-#63b8af text-white pos-fixed bottom-[calc(env(safe-area-inset-bottom)+48rpx)] rounded-44rpx w-686 ml-4 h-88 line-height-88rpx text-lg font-bold text-center"
>创建新分组</view >创建新分组</view
> >
<ModalInput <ModalInput

View File

@ -321,9 +321,7 @@
icon: 'none' icon: 'none'
}) })
} }
// #ifdef MP
await asyncSetting() await asyncSetting()
// #endif
}) })
const upgrade = () => { const upgrade = () => {
@ -570,7 +568,6 @@
authUid: $user.userInfo.uid.toString(), authUid: $user.userInfo.uid.toString(),
keyId: $bluetooth.keyId.toString() keyId: $bluetooth.keyId.toString()
}) })
console.log('resetDeviceCode', resetDeviceCode)
if (resetDeviceCode === 0 || resetDeviceCode === -2) { if (resetDeviceCode === 0 || resetDeviceCode === -2) {
const { code, message } = await deleteLockRequest({ const { code, message } = await deleteLockRequest({
lockId: $bluetooth.currentLockInfo.lockId lockId: $bluetooth.currentLockInfo.lockId
@ -603,12 +600,11 @@
}) })
if (code === 0) { if (code === 0) {
uni.hideLoading() uni.hideLoading()
await $lock.updateLockSearch({ $lock.updateLockSearch({
...$lock.lockSearch, ...$lock.lockSearch,
pageNo: 1 pageNo: 1
}) })
await $lock.getLockList($lock.lockSearch) $lock.getLockList($lock.lockSearch)
await $bluetooth.updateCurrentLockInfo({})
$basic.backAndToast('删除成功', 2) $basic.backAndToast('删除成功', 2)
} else { } else {
uni.hideLoading() uni.hideLoading()

View File

@ -18,7 +18,7 @@
</view> </view>
<view <view
@click="updateElectricQuantity" @click="updateElectricQuantity"
class="w-full bg-#4777ee text-white line-height-80rpx h-80 rounded-40rpx text-center mt-4 text-lg font-bold" class="w-full bg-#63b8af text-white line-height-80rpx h-80 rounded-40rpx text-center mt-4 text-lg font-bold"
>更新</view >更新</view
> >
</view> </view>

View File

@ -20,7 +20,7 @@
</view> </view>
<view <view
@click="update" @click="update"
class="w-full bg-#4777ee text-white line-height-80rpx h-80 rounded-40rpx text-center mt-4 text-lg font-bold" class="w-full bg-#63b8af text-white line-height-80rpx h-80 rounded-40rpx text-center mt-4 text-lg font-bold"
>{{ $bluetooth.currentLockSetting.lockSettingInfo[type] === 1 ? '关闭' : '开启' }}</view >{{ $bluetooth.currentLockSetting.lockSettingInfo[type] === 1 ? '关闭' : '开启' }}</view
> >
</view></view </view></view

View File

@ -6,7 +6,7 @@
</view> </view>
<view <view
@click="asyncData" @click="asyncData"
class="w-full bg-#4777ee text-white line-height-80rpx h-80 rounded-40rpx text-center mt-4 text-lg font-bold" class="w-full bg-#63b8af text-white line-height-80rpx h-80 rounded-40rpx text-center mt-4 text-lg font-bold"
> >
开始 开始
</view> </view>

View File

@ -76,7 +76,7 @@
></up-picker> ></up-picker>
<view <view
@click="confirm" @click="confirm"
class="mt-10 w-686 mx-4 h-88 line-height-88rpx text-center bg-#4777ee text-white rounded-3xl" class="mt-10 w-686 mx-4 h-88 line-height-88rpx text-center bg-#63b8af text-white rounded-3xl"
>确定 >确定
</view> </view>
</view> </view>

View File

@ -141,7 +141,7 @@
line-height: 108rpx; line-height: 108rpx;
color: #ffffff; color: #ffffff;
text-align: center; text-align: center;
background: #4777ee; background: #63b8af;
border-radius: 16rpx; border-radius: 16rpx;
} }
@ -177,7 +177,7 @@
line-height: 96rpx; line-height: 96rpx;
color: #ffffff; color: #ffffff;
text-align: center; text-align: center;
background: #4777ee; background: #63b8af;
border-radius: 16rpx; border-radius: 16rpx;
} }
</style> </style>

View File

@ -105,7 +105,7 @@
</view> </view>
<view <view
class="w-full rounded-full h-88 text-center leading-[88rpx] text-white mt-6" class="w-full rounded-full h-88 text-center leading-[88rpx] text-white mt-6"
:class="[canResetPassword ? 'bg-#4777ee' : 'bg-#9d9da1']" :class="[canResetPassword ? 'bg-#63b8af' : 'bg-#9d9da1']"
@click="register" @click="register"
> >
重置密码 重置密码

View File

@ -64,7 +64,7 @@
</view> </view>
<view <view
class="mt-4 w-full rounded-full h-88 text-center leading-[88rpx] text-white" class="mt-4 w-full rounded-full h-88 text-center leading-[88rpx] text-white"
:class="[canLogin ? 'bg-#4777ee' : 'bg-#9d9da1']" :class="[canLogin ? 'bg-#63b8af' : 'bg-#9d9da1']"
@click="login" @click="login"
> >
登录 登录

View File

@ -5,9 +5,9 @@
@click="click" @click="click"
class="mx-4" class="mx-4"
lineWidth="300rpx" lineWidth="300rpx"
lineColor="#4777ee" lineColor="#63b8af"
:activeStyle="{ :activeStyle="{
color: '#4777ee', color: '#63b8af',
fontWeight: 'bold', fontWeight: 'bold',
transform: 'scale(1.05)' transform: 'scale(1.05)'
}" }"
@ -136,7 +136,7 @@
</view> </view>
<view <view
class="w-full rounded-full h-88 text-center leading-[88rpx] text-white" class="w-full rounded-full h-88 text-center leading-[88rpx] text-white"
:class="[canRegister ? 'bg-#4777ee' : 'bg-#9d9da1']" :class="[canRegister ? 'bg-#63b8af' : 'bg-#9d9da1']"
@click="register" @click="register"
> >
注册 注册

View File

@ -260,7 +260,7 @@
line-height: 108rpx; line-height: 108rpx;
color: #ffffff; color: #ffffff;
text-align: center; text-align: center;
background: #4777ee; background: #63b8af;
border-radius: 16rpx; border-radius: 16rpx;
} }
@ -296,7 +296,7 @@
line-height: 96rpx; line-height: 96rpx;
color: #ffffff; color: #ffffff;
text-align: center; text-align: center;
background: #4777ee; background: #63b8af;
border-radius: 16rpx; border-radius: 16rpx;
} }
</style> </style>

View File

@ -110,7 +110,7 @@
line-height: 96rpx; line-height: 96rpx;
color: #ffffff; color: #ffffff;
text-align: center; text-align: center;
background: #4777ee; background: #63b8af;
border-radius: 16rpx; border-radius: 16rpx;
} }
</style> </style>

View File

@ -171,7 +171,7 @@
line-height: 96rpx; line-height: 96rpx;
color: #ffffff; color: #ffffff;
text-align: center; text-align: center;
background: #4777ee; background: #63b8af;
border-radius: 16rpx; border-radius: 16rpx;
} }
@ -207,7 +207,7 @@
line-height: 108rpx; line-height: 108rpx;
color: #ffffff; color: #ffffff;
text-align: center; text-align: center;
background: #4777ee; background: #63b8af;
border-radius: 16rpx; border-radius: 16rpx;
} }
</style> </style>

View File

@ -139,7 +139,7 @@
line-height: 108rpx; line-height: 108rpx;
color: #ffffff; color: #ffffff;
text-align: center; text-align: center;
background: #4777ee; background: #63b8af;
border-radius: 16rpx; border-radius: 16rpx;
} }
@ -175,7 +175,7 @@
line-height: 96rpx; line-height: 96rpx;
color: #ffffff; color: #ffffff;
text-align: center; text-align: center;
background: #4777ee; background: #63b8af;
border-radius: 16rpx; border-radius: 16rpx;
} }
</style> </style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 816 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 816 B

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -299,14 +299,12 @@ export const useBluetoothStore = defineStore('ble', {
}, },
// 监听蓝牙设备连接状态 // 监听蓝牙设备连接状态
onBluetoothConnectStatus() { onBluetoothConnectStatus() {
// 使用箭头函数,直接继承外层的 this组件实例 const that = this
uni.onBLEConnectionStateChange(res => { uni.onBLEConnectionStateChange(function (res) {
// 直接访问 this.currentLockInfo最新值 if (res.deviceId === that.currentLockInfo.deviceId) {
if (res.deviceId === this.currentLockInfo?.deviceId) {
console.log('设备连接状态改变', res) console.log('设备连接状态改变', res)
// 更新 currentLockInfo确保是响应式更新 that.updateCurrentLockInfo({
this.updateCurrentLockInfo({ ...that.currentLockInfo,
...this.currentLockInfo,
connected: res.connected connected: res.connected
}) })
} }
@ -902,24 +900,20 @@ export const useBluetoothStore = defineStore('ble', {
}) })
// #endif // #endif
// #ifdef APP-PLUS // #ifdef APP-PLUS
uni.showModal({ const systemInfo = uni.getSystemInfoSync()
title: '提示', if (systemInfo.platform === 'android') {
content: '蓝牙尚未打开,请先打开蓝牙', const main = plus.android.runtimeMainActivity()
showCancel: false, const Intent = plus.android.importClass('android.content.Intent')
success(res) { const BluetoothAdapter = plus.android.importClass('android.bluetooth.BluetoothAdapter')
if (res.confirm) { const intent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE)
// #ifdef APP-ANDROID main.startActivity(intent)
const main = plus.android.runtimeMainActivity() } else if (systemInfo.platform === 'ios') {
const Intent = plus.android.importClass('android.content.Intent') uni.showModal({
const BluetoothAdapter = plus.android.importClass( title: '提示',
'android.bluetooth.BluetoothAdapter' content: '蓝牙尚未打开,请先打开蓝牙',
) showCancel: false
const intent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE) })
main.startActivity(intent) }
// #endif
}
}
})
// #endif // #endif
} }
} else if (this.bluetoothStatus === 2 || this.bluetoothStatus === 3) { } else if (this.bluetoothStatus === 2 || this.bluetoothStatus === 3) {
@ -1029,7 +1023,7 @@ export const useBluetoothStore = defineStore('ble', {
fail(res) { fail(res) {
if (res.errCode === 10006) { if (res.errCode === 10006) {
uni.showToast({ uni.showToast({
title: '连接失败,请靠近设备并保持设备处于唤醒状态1', title: '连接失败,请靠近设备并保持设备处于唤醒状态',
icon: 'none' icon: 'none'
}) })
} }
@ -1041,7 +1035,7 @@ export const useBluetoothStore = defineStore('ble', {
fail(res) { fail(res) {
if (res.errCode === 10006) { if (res.errCode === 10006) {
uni.showToast({ uni.showToast({
title: '连接失败,请靠近设备并保持设备处于唤醒状态2', title: '连接失败,请靠近设备并保持设备处于唤醒状态',
icon: 'none' icon: 'none'
}) })
} }
@ -1193,7 +1187,6 @@ export const useBluetoothStore = defineStore('ble', {
uuid && uuid &&
uuid.slice(2, 8) === '758824' && uuid.slice(2, 8) === '758824' &&
(uuid.slice(30, 32) === '01' || (uuid.slice(30, 32) === '01' ||
uuid.slice(30, 32) === '03' ||
that.bindedDeviceNameList.includes(that.currentLockInfo.name)) that.bindedDeviceNameList.includes(that.currentLockInfo.name))
) { ) {
uni.stopBluetoothDevicesDiscovery() uni.stopBluetoothDevicesDiscovery()
@ -1461,17 +1454,20 @@ export const useBluetoothStore = defineStore('ble', {
) )
// #ifdef APP-PLUS // #ifdef APP-PLUS
setTimeout(() => { setTimeout(
uni.writeBLECharacteristicValue({ () => {
deviceId: that.currentLockInfo.deviceId, uni.writeBLECharacteristicValue({
serviceId: that.currentLockInfo.serviceId, deviceId: that.currentLockInfo.deviceId,
characteristicId: that.currentLockInfo.writeCharacteristicId, serviceId: that.currentLockInfo.serviceId,
value: writeData.buffer, characteristicId: that.currentLockInfo.writeCharacteristicId,
fail(res) { value: writeData.buffer,
console.log('写入失败', res) fail(res) {
} console.log('写入失败', res)
}) }
}, (i + 1) * 250) })
},
(i + 1) * 250
)
// #endif // #endif
// #ifdef MP // #ifdef MP
@ -2320,7 +2316,6 @@ export const useBluetoothStore = defineStore('ble', {
this.currentLockInfo.transportType !== transportType.TRANSPORT_TENCENT_YUN this.currentLockInfo.transportType !== transportType.TRANSPORT_TENCENT_YUN
) { ) {
const searchResult = await this.searchAndConnectDevice() const searchResult = await this.searchAndConnectDevice()
console.log('searchResult', searchResult)
if (searchResult.code === 0) { if (searchResult.code === 0) {
log.info({ log.info({
code: searchResult.code, code: searchResult.code,