build: v1.2.1+36

This commit is contained in:
范鹏 2025-05-04 14:46:20 +08:00
parent 0cc4dc3ec5
commit 6ddfae9bdd
16 changed files with 54 additions and 347 deletions

View File

@ -7,7 +7,7 @@
v-if="tip"
name="question-circle-fill"
color="#555555"
size="38"
size="38rpx"
@click="tipDialog"
></up-icon>
</view>

View File

@ -2,8 +2,8 @@
"name": "wx-starlock",
"appid": "__UNI__933D519",
"description": "",
"versionName": "1.2.0",
"versionCode": "35",
"versionName": "1.3.0",
"versionCode": "37",
"mp-weixin": {
"appid": "wx9829a39e65550757",
"setting": {
@ -13,12 +13,11 @@
"permission": {
"scope.bluetooth": {
"desc": "蓝牙将用于控制和管理您的智能门锁"
},
"scope.userLocation": {
"desc": "获取您的位置信息将用于智能门锁的位置服务"
}
},
"requiredPrivateInfos": ["getLocation"],
"requiredPrivateInfos": [
"getLocation"
],
"usingComponents": true,
"lazyCodeLoading": "requiredComponents",
"optimization": {
@ -42,4 +41,4 @@
}
},
"vueVersion": "3"
}
}

View File

@ -82,13 +82,6 @@
"navigationBarTitleText": "附近设备"
}
},
{
"path": "selectAddress",
"style": {
"navigationBarTitleText": "锁地址",
"disableScroll": true
}
},
{
"path": "distributionNetwork",
"style": {
@ -611,13 +604,22 @@
],
"preloadRule": {
"pages/main/home": {
"packages": ["pages/others", "pages/addDevice", "pages/p2p"]
"packages": [
"pages/others",
"pages/addDevice",
"pages/p2p"
]
},
"pages/main/lockDetail": {
"packages": ["pages/feature", "pages/setting"]
"packages": [
"pages/feature",
"pages/setting"
]
},
"pages/main/mine": {
"packages": ["pages/user"]
"packages": [
"pages/user"
]
}
},
"globalStyle": {
@ -654,4 +656,4 @@
}
]
}
}
}

View File

@ -131,7 +131,7 @@
if (data.status === 0) {
$basic.routeJump({
type: 'redirectTo',
name: 'selectAddress'
name: 'bindLock'
})
setTimeout(() => {
uni.showToast({

View File

@ -143,7 +143,7 @@
name:
this.currentLockInfo.lockConfig.model === model.TENCENT_YUN_LOCK
? 'distributionNetwork'
: 'selectAddress'
: 'bindLock'
})
} else {
uni.hideLoading()

View File

@ -1,283 +0,0 @@
<template>
<view>
<view class="title">地理位置</view>
<view v-if="show">
<map
class="map"
:longitude="longitude"
:latitude="latitude"
:scale="16"
:markers="markers"
:enable-zoom="true"
:enable-scroll="true"
></map>
</view>
<view v-else class="map"></view>
<view class="explain">检查以确保以下地址是正确的</view>
<view
class="view-address"
:style="{ height: calculateStringTotalWidth(address) > 44 ? '120rpx' : '80rpx' }"
>
<view class="address">{{ address }}</view>
</view>
<view class="bottom">
<view class="skip" @click="skipAddress">跳过</view>
<view class="confirm" @click="toBindLock">下一步</view>
</view>
</view>
</template>
<script>
import { mapState, mapActions } from 'pinia'
import { useBasicStore } from '@/stores/basic'
import { getGeocodeAddress } from '@/api/geocode'
import { useBluetoothStore } from '@/stores/bluetooth'
export default {
data() {
return {
latitude: null,
longitude: null,
show: false,
markers: [],
address: '',
first: true
}
},
computed: {
...mapState(useBluetoothStore, ['currentLockInfo'])
},
onLoad() {
this.getLocation()
},
onShow() {
if (this.first) {
this.first = false
} else if (!this.show) {
this.getLocation()
}
},
methods: {
...mapActions(useBasicStore, ['routeJump', 'calculateStringTotalWidth']),
...mapActions(useBluetoothStore, ['updateCurrentLockInfo']),
toBindLock() {
const that = this
if (this.address === '') {
uni.showModal({
title: '提示',
content: '暂未获取到地理位置信息,请重试',
confirmText: '重试',
success: res => {
if (res.confirm) {
that.getLocation()
}
}
})
return
}
this.routeJump({
type: 'redirectTo',
name: 'bindLock'
})
},
skipAddress() {
const that = this
if (this.address !== '') {
uni.showModal({
title: '提示',
content: '已获取当前地理位置,确定跳过吗',
confirmText: '跳过',
cancelText: '取消',
success: res => {
if (res.confirm) {
const lockInfo = that.currentLockInfo
delete lockInfo.position
that.updateCurrentLockInfo(lockInfo)
this.routeJump({
type: 'redirectTo',
name: 'bindLock'
})
}
}
})
return
}
this.routeJump({
type: 'redirectTo',
name: 'bindLock'
})
},
async getLocation() {
const that = this
uni.getLocation({
isHighAccuracy: true,
type: 'gcj02',
async success(res) {
that.latitude = res.latitude
that.longitude = res.longitude
that.markers = [
{
id: 1,
latitude: res.latitude,
longitude: res.longitude,
iconPath: 'https://oss-lock.xhjcn.ltd/mp/icon_address.png',
width: '48rpx',
height: '48rpx'
}
]
that.show = true
const { code, data: result } = await getGeocodeAddress({
latitude: that.latitude,
longitude: that.longitude
})
if (code === 0) {
that.address = result.addr
const position = {
...result,
latitude: that.latitude,
longitude: that.longitude
}
console.log('获取地理位置信息', that.currentLockInfo)
that.updateCurrentLockInfo({
...that.currentLockInfo,
position
})
console.log('获取地理位置信息', that.currentLockInfo)
}
},
fail(res) {
console.log('获取地理位置信息失败', res)
if (res.errMsg === 'getLocation:fail auth deny') {
uni.showModal({
title: '提示',
content: '拒绝授权将无法使用定位功能',
confirmText: '去授权',
cancelText: '跳过',
success(res) {
if (res.confirm) {
uni.openSetting()
} else {
that.routeJump({
type: 'redirectTo',
name: 'bindLock'
})
}
}
})
} else if (res.errMsg === 'getLocation:fail system permission denied') {
uni.showModal({
title: '提示',
content: '定位失败,请打开微信的位置权限',
confirmText: '去打开',
cancelText: '跳过',
success(res) {
if (res.confirm) {
uni.openAppAuthorizeSetting()
} else {
that.routeJump({
type: 'redirectTo',
name: 'bindLock'
})
}
}
})
} else {
uni.showModal({
title: '提示',
content: '获取地理位置信息失败',
confirmText: '重试',
cancelText: '跳过',
success(res) {
if (res.confirm) {
that.getLocation()
} else {
that.routeJump({
type: 'redirectTo',
name: 'bindLock'
})
}
}
})
}
}
})
}
}
}
</script>
<style lang="scss">
page {
background-color: $uni-bg-color-grey;
}
</style>
<style lang="scss" scoped>
.map {
width: 750rpx;
height: 650rpx;
}
.title {
padding: 40rpx 30rpx;
font-size: 80rpx;
font-weight: bold;
}
.explain {
padding: 20rpx 30rpx 0 30rpx;
font-size: 40rpx;
}
.view-address {
display: flex;
align-items: center;
width: 690rpx;
color: #c4c4c4;
font-size: 32rpx;
margin: 0 30rpx;
border-bottom: #63b8af 3rpx solid;
.address {
width: 690rpx;
text-align: left;
word-break: break-all;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
white-space: normal;
}
}
.bottom {
width: 600rpx;
display: flex;
justify-content: space-between;
padding: 0 75rpx;
position: fixed;
bottom: calc(30rpx + env(safe-area-inset-bottom));
.skip {
width: 225rpx;
height: 80rpx;
line-height: 80rpx;
text-align: center;
font-size: 36rpx;
border-radius: 64rpx;
border: 3rpx solid #63b8af;
}
.confirm {
border-radius: 64rpx;
color: #ffffff;
background-color: #63b8af;
width: 225rpx;
height: 80rpx;
line-height: 80rpx;
text-align: center;
font-size: 36rpx;
}
}
</style>

View File

@ -30,7 +30,7 @@
v-else
class="absolute inset-0 bg-black bg-opacity-30 flex items-center justify-center"
>
<up-icon name="play-right-fill" color="#ffffff" size="40"></up-icon>
<up-icon name="play-right-fill" color="#ffffff" size="40rpx"></up-icon>
</view>
</image>
<view class="text-xs">{{ timeFormat(video.operateDate, 'yyyy-mm-dd hh:MM') }}</view>

View File

@ -18,7 +18,7 @@
"
name="checkbox-mark"
color="#2a85ec"
size="40"
size="40rpx"
></up-icon>
</view>
<view class="flex-1">
@ -70,7 +70,7 @@
"
name="checkbox-mark"
color="#2a85ec"
size="40"
size="40rpx"
></up-icon>
</view>
<view class="flex-1">
@ -122,7 +122,7 @@
"
name="checkbox-mark"
color="#2a85ec"
size="40"
size="40rpx"
></up-icon>
</view>
<view class="flex-1">
@ -174,7 +174,7 @@
"
name="checkbox-mark"
color="#2a85ec"
size="40"
size="40rpx"
></up-icon>
</view>
<view class="flex-1">

View File

@ -49,7 +49,7 @@
@click="toJump(null)"
class="flex items-center justify-center bg-white shadow-sm rounded-md pos-fixed bottom-[calc(env(safe-area-inset-bottom)+48rpx)] w-686 mx-4 h-100"
><view class="flex items-center">
<up-icon name="plus-circle-fill" color="#002ce5" size="50"></up-icon
<up-icon name="plus-circle-fill" color="#002ce5" size="50rpx"></up-icon
><view class="text-lg text-#63b8af ml-2 font-bold">胁迫指纹</view>
</view></view
>

View File

@ -105,12 +105,6 @@
<up-icon name="arrow-right"></up-icon>
</view>
</view>
<view class="py-3 px-4 bg-white flex items-center justify-between text-base">
<view>位置信息</view>
<view class="flex items-center max-w-400">
<view>{{ $bluetooth.currentLockSetting.lockBasicInfo.address }}</view>
</view>
</view>
<ModalInput
ref="modalInput"
title="请输入名称"

View File

@ -9,7 +9,7 @@
:class="[value === 1 ? 'bg-#d9e8fd' : 'bg-#ececec']"
>
<view class="w-80 h-full flex items-center justify-center">
<up-icon name="checkbox-mark" color="#2a85ec" v-if="value === 1" size="40"></up-icon>
<up-icon name="checkbox-mark" color="#2a85ec" v-if="value === 1" size="40rpx"></up-icon>
</view>
<view class="flex-1">
<view>小功率</view>
@ -22,7 +22,7 @@
:class="[value === 2 ? 'bg-#d9e8fd' : 'bg-#ececec']"
>
<view class="w-80 h-full flex items-center justify-center">
<up-icon name="checkbox-mark" color="#2a85ec" v-if="value === 2" size="40"></up-icon>
<up-icon name="checkbox-mark" color="#2a85ec" v-if="value === 2" size="40rpx"></up-icon>
</view>
<view class="flex-1">
<view>中功率</view>
@ -35,7 +35,7 @@
:class="[value === 3 ? 'bg-#d9e8fd' : 'bg-#ececec']"
>
<view class="w-80 h-full flex items-center justify-center">
<up-icon name="checkbox-mark" color="#2a85ec" v-if="value === 3" size="40"></up-icon>
<up-icon name="checkbox-mark" color="#2a85ec" v-if="value === 3" size="40rpx"></up-icon>
</view>
<view class="flex-1">
<view>大功率</view>

View File

@ -12,7 +12,7 @@
<up-icon
name="plus-circle-fill"
color="#002ce5"
size="50"
size="50rpx"
v-if="emailList.length < 3"
@click="addItem('email')"
></up-icon
@ -27,7 +27,7 @@
<up-icon
name="close-circle-fill"
color="#858585"
size="40"
size="40rpx"
@click="deleteItem('email', index)"
></up-icon>
<view class="ml-3">接收者</view>
@ -51,7 +51,7 @@
<up-icon
name="plus-circle-fill"
color="#002ce5"
size="50"
size="50rpx"
v-if="smsList.length < 3"
@click="addItem('sms')"
></up-icon
@ -66,7 +66,7 @@
<up-icon
name="close-circle-fill"
color="#858585"
size="40"
size="40rpx"
@click="deleteItem('sms', index)"
></up-icon>
<view class="ml-3">接收者</view>

View File

@ -49,7 +49,7 @@
@click="toJump(null)"
class="flex items-center justify-center bg-white shadow-sm rounded-md pos-fixed bottom-[calc(env(safe-area-inset-bottom)+48rpx)] w-686 mx-4 h-100"
><view class="flex items-center">
<up-icon name="plus-circle-fill" color="#002ce5" size="50"></up-icon
<up-icon name="plus-circle-fill" color="#002ce5" size="50rpx"></up-icon
><view class="text-lg text-#63b8af ml-2 font-bold">添加家人</view>
</view></view
>

View File

@ -18,7 +18,7 @@
"
name="checkbox-mark"
color="#2a85ec"
size="40"
size="40rpx"
></up-icon>
</view>
<view class="flex-1">
@ -64,7 +64,7 @@
"
name="checkbox-mark"
color="#2a85ec"
size="40"
size="40rpx"
></up-icon>
</view>
<view class="flex-1">

View File

@ -6,7 +6,7 @@
:class="[isAllDay === 1 ? 'bg-#d9e8fd' : 'bg-#ececec']"
>
<view class="w-80 h-full flex items-center justify-center">
<up-icon v-if="isAllDay === 1" name="checkbox-mark" color="#2a85ec" size="40"></up-icon>
<up-icon v-if="isAllDay === 1" name="checkbox-mark" color="#2a85ec" size="40rpx"></up-icon>
</view>
<view class="flex-1">
<view class="text-lg font-bold" :class="[isAllDay === 1 ? 'text-#2a85ec' : 'text-black']"
@ -21,7 +21,7 @@
>
<view class="flex items-center">
<view class="w-80 h-full flex items-center justify-center">
<up-icon v-if="isAllDay === 0" name="checkbox-mark" color="#2a85ec" size="40"></up-icon>
<up-icon v-if="isAllDay === 0" name="checkbox-mark" color="#2a85ec" size="40rpx"></up-icon>
</view>
<view class="flex-1">
<view class="text-lg font-bold" :class="[isAllDay === 0 ? 'text-#2a85ec' : 'text-black']">

View File

@ -52,11 +52,6 @@ const pages = [
path: '/pages/addDevice/searchDevice',
tabBar: false
},
{
name: 'selectAddress',
path: '/pages/addDevice/selectAddress',
tabBar: false
},
{
name: 'bindLock',
path: '/pages/addDevice/bindLock',
@ -415,7 +410,7 @@ const pages = [
]
export const useBasicStore = defineStore('basic', {
state() {
state () {
return {
// 设备信息
deviceInfo: null,
@ -429,7 +424,7 @@ export const useBasicStore = defineStore('basic', {
// 路由跳转
/* data name string type string params object delta number
* 具体入参查看文档 https://www.uviewui.com/js/route.html */
routeJump(data) {
routeJump (data) {
const page = pages.find(page => {
return page.name === data.name
})
@ -458,10 +453,10 @@ export const useBasicStore = defineStore('basic', {
}
},
// 获取当前网络状态
getNetworkType() {
getNetworkType () {
return new Promise(resolve => {
uni.getNetworkType({
success(res) {
success (res) {
if (res.networkType === 'none') {
uni.showToast({
title: '网络访问失败,请检查网络是否正常',
@ -472,14 +467,14 @@ export const useBasicStore = defineStore('basic', {
}
resolve(true)
},
fail() {
fail () {
resolve(false)
}
})
})
},
// 获取设备信息
getDeviceInfo() {
getDeviceInfo () {
const that = this
return new Promise(resolve => {
if (that.deviceInfo?.model) {
@ -487,18 +482,18 @@ export const useBasicStore = defineStore('basic', {
return
}
uni.getSystemInfo({
success(res) {
success (res) {
that.deviceInfo = res
resolve(that.deviceInfo)
},
fail() {
fail () {
resolve({})
}
})
})
},
// 获取胶囊信息
getButtonInfo() {
getButtonInfo () {
return new Promise(resolve => {
if (this.buttonInfo?.top) {
resolve(this.buttonInfo)
@ -509,7 +504,7 @@ export const useBasicStore = defineStore('basic', {
})
},
// 计算字符串长度
calculateStringTotalWidth(str) {
calculateStringTotalWidth (str) {
let totalWidth = 0
// 遍历字符串中的每一个字符
for (let i = 0; i < str.length; i++) {
@ -526,10 +521,10 @@ export const useBasicStore = defineStore('basic', {
return totalWidth
},
// 回退页面并弹出toast提示
backAndToast(message, delta = 1) {
backAndToast (message, delta = 1) {
uni.navigateBack({
delta,
complete() {
complete () {
setTimeout(() => {
uni.showToast({
title: message,
@ -540,7 +535,7 @@ export const useBasicStore = defineStore('basic', {
})
},
// 分享跳转
shareJump(data = this.shareConfig) {
shareJump (data = this.shareConfig) {
if (data.path) {
const target = data.path.split('/')
if (target.length > 1) {
@ -568,7 +563,7 @@ export const useBasicStore = defineStore('basic', {
}
this.shareConfig = data
function getParams(params) {
function getParams (params) {
let paramStr = ''
Object.keys(params).forEach(item => {
if (paramStr === '') {