From 529626818bb3ca3daa49c5d3cc4f0a425b399a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Fri, 13 Sep 2024 09:49:41 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8DUI=E4=B8=8A=E8=8B=B1?= =?UTF-8?q?=E6=96=87=E4=B8=8D=E6=8D=A2=E8=A1=8Cbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.json | 2 +- pages/lockDetail/lockDetail.vue | 1 + pages/setting/setting.vue | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 49f5a2f..6d45a9d 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "appid" : "__UNI__933D519", "description" : "", "versionName" : "1.0.0", - "versionCode" : "12", + "versionCode" : "13", "transformPx" : false, /* 小程序特有相关 */ "mp-weixin" : { diff --git a/pages/lockDetail/lockDetail.vue b/pages/lockDetail/lockDetail.vue index 42802ec..506699e 100644 --- a/pages/lockDetail/lockDetail.vue +++ b/pages/lockDetail/lockDetail.vue @@ -279,6 +279,7 @@ export default { font-size: 32rpx; padding: 32rpx 32rpx 0 32rpx; font-weight: bold; + word-break: break-all; } .top { diff --git a/pages/setting/setting.vue b/pages/setting/setting.vue index 94c784e..9149230 100644 --- a/pages/setting/setting.vue +++ b/pages/setting/setting.vue @@ -4,7 +4,7 @@ 名称 - {{currentLockInfo.lockAlias}} + {{currentLockInfo.lockAlias}} From b6620dd4ad9254d422c26491991fa7efbd0dc605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Fri, 13 Sep 2024 13:37:57 +0800 Subject: [PATCH 2/6] =?UTF-8?q?1.=20=E9=A6=96=E9=A1=B5=E5=88=86=E7=BB=84?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E4=BF=AE=E6=94=B9=E8=8B=B1=E6=96=87=E6=98=B5?= =?UTF-8?q?=E7=A7=B0=E8=BF=87=E9=95=BF=E6=97=B6=E7=9A=84=E6=98=BE=E7=A4=BA?= =?UTF-8?q?bug=202.=20=E6=9B=B4=E6=96=B0=E5=AE=89=E5=85=A8=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E6=B7=BB=E5=8A=A0=E6=9C=AA=E8=8E=B7=E5=8F=96=E5=88=B0?= =?UTF-8?q?=E5=AE=89=E5=85=A8=E9=97=AE=E9=A2=98=E7=9A=84=E5=BC=95=E5=AF=BC?= =?UTF-8?q?=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/home/home.vue | 1 + pages/updateSafeQuestion/updateSafeQuestion.vue | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/pages/home/home.vue b/pages/home/home.vue index 3900ae7..c5eef4d 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -605,6 +605,7 @@ page { .group-name-text { padding: 0 32rpx; + word-break: break-all; } .group-name-line { diff --git a/pages/updateSafeQuestion/updateSafeQuestion.vue b/pages/updateSafeQuestion/updateSafeQuestion.vue index 598b6f1..c4fb2a0 100644 --- a/pages/updateSafeQuestion/updateSafeQuestion.vue +++ b/pages/updateSafeQuestion/updateSafeQuestion.vue @@ -151,6 +151,18 @@ export default { this.show = true }, async getQuestionList() { + const netWork = await this.getNetworkType() + if(!netWork) { + uni.showModal({ + title: '提示', + content: '未获取到问题列表,请退出重试', + showCancel: false, + success: () => { + uni.navigateBack() + } + }) + return + } const { code, data, message } = await getQuestionListRequest() if(code === 0) { this.questionList = data From 8ee2fc8dc1816dbbfc7962649f1131c33562b560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Fri, 13 Sep 2024 14:45:49 +0800 Subject: [PATCH 3/6] =?UTF-8?q?1.=20=E4=BF=AE=E6=94=B9=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E6=9C=80=E5=A4=A7=E8=BE=93=E5=85=A5=E9=95=BF?= =?UTF-8?q?=E5=BA=A6=202.=20=E4=BF=AE=E6=94=B9=E5=AE=89=E5=85=A8=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E6=97=B6=E6=98=BE=E7=A4=BA=E5=8E=9F=E6=9D=A5=E7=9A=84?= =?UTF-8?q?=E7=AD=94=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 2 +- pages/safeQuestion/safeQuestion.vue | 8 +++--- .../updateSafeQuestion/updateSafeQuestion.vue | 26 ++++++++++++++----- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/pages.json b/pages.json index c8331f0..c6faf86 100644 --- a/pages.json +++ b/pages.json @@ -60,7 +60,7 @@ { "path": "pages/updateSafeQuestion/updateSafeQuestion", "style": { - "navigationBarTitleText": "修改安全问题" + "navigationBarTitleText": "安全问题" } }, { diff --git a/pages/safeQuestion/safeQuestion.vue b/pages/safeQuestion/safeQuestion.vue index fc67494..6d4d2ae 100644 --- a/pages/safeQuestion/safeQuestion.vue +++ b/pages/safeQuestion/safeQuestion.vue @@ -7,7 +7,7 @@ - 修改 @@ -51,8 +51,10 @@ export default { return } this.routeJump({ - type: 'redirectTo', - name: 'updateSafeQuestion' + name: 'updateSafeQuestion', + params: { + questionAnswer: JSON.stringify(this.questionAnswer) + } }) } } diff --git a/pages/updateSafeQuestion/updateSafeQuestion.vue b/pages/updateSafeQuestion/updateSafeQuestion.vue index c4fb2a0..c7b88f9 100644 --- a/pages/updateSafeQuestion/updateSafeQuestion.vue +++ b/pages/updateSafeQuestion/updateSafeQuestion.vue @@ -7,7 +7,7 @@ - @@ -16,7 +16,7 @@ - @@ -25,7 +25,7 @@ - 保存 @@ -65,14 +65,26 @@ export default { answer: '' }], show: false, - pending: false + pending: false, + questionAnswer: null } }, computed: { ...mapState(useUserStore, ['userInfo']) }, - onLoad() { - this.getQuestionList() + async onLoad (data) { + await this.getQuestionList() + const questionAnswer = JSON.parse(data.questionAnswer) + if (questionAnswer) { + this.questionAnswer = questionAnswer + this.answer = questionAnswer.map(item => { + return { + question: item.question, + answer: item.answer, + questionId: item.questionId + } + }) + } }, methods: { ...mapActions(useUserStore, ['updateUserInfo']), @@ -113,7 +125,7 @@ export default { ...this.userInfo, haveSafeAnswer: 1 }) - this.backAndToast('设置成功') + this.backAndToast('设置成功', 2) } else { uni.showToast({ title: message, From d3364ecec56c7a04e94ff1490e4ddfaee78cb12d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Sat, 14 Sep 2024 09:49:50 +0800 Subject: [PATCH 4/6] =?UTF-8?q?1.=20=E4=BF=AE=E5=A4=8D=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E7=9A=84=E6=96=87=E6=A1=88=E6=98=BE=E7=A4=BA?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/safeQuestion/safeQuestion.vue | 16 ++++------------ pages/updateSafeQuestion/updateSafeQuestion.vue | 5 ++++- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/pages/safeQuestion/safeQuestion.vue b/pages/safeQuestion/safeQuestion.vue index 6d4d2ae..ef5b978 100644 --- a/pages/safeQuestion/safeQuestion.vue +++ b/pages/safeQuestion/safeQuestion.vue @@ -7,8 +7,7 @@ - + {{item.answer}} 修改 @@ -97,17 +96,10 @@ page { .input { border-radius: 0 0 32rpx 32rpx; - height: 100rpx; - line-height: 100rpx; + line-height: 40rpx; background: #FFFFFF; - padding: 0 32rpx; -} - -.input-placeholder { - height: 100rpx; - font-size: 36rpx; - font-weight: bold; - line-height: 100rpx; + padding: 20rpx 32rpx; + word-break: break-all; } .line { diff --git a/pages/updateSafeQuestion/updateSafeQuestion.vue b/pages/updateSafeQuestion/updateSafeQuestion.vue index c7b88f9..c6d1d50 100644 --- a/pages/updateSafeQuestion/updateSafeQuestion.vue +++ b/pages/updateSafeQuestion/updateSafeQuestion.vue @@ -73,9 +73,12 @@ export default { ...mapState(useUserStore, ['userInfo']) }, async onLoad (data) { - await this.getQuestionList() + this.getQuestionList() const questionAnswer = JSON.parse(data.questionAnswer) if (questionAnswer) { + uni.setNavigationBarTitle({ + title: '安全问题设置' + }) this.questionAnswer = questionAnswer this.answer = questionAnswer.map(item => { return { From 0de95780e6c479eb14af8278e70bec23771f1dd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Sat, 14 Sep 2024 10:26:06 +0800 Subject: [PATCH 5/6] =?UTF-8?q?1.=20=E4=BF=AE=E5=A4=8D=E8=93=9D=E7=89=99?= =?UTF-8?q?=E5=BC=80=E5=85=B3=E7=9B=91=E5=90=ACbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 2 ++ stores/bluetooth.js | 43 +++++++++++++++++++++---------------------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/App.vue b/App.vue index a6c7d0f..cf7897b 100644 --- a/App.vue +++ b/App.vue @@ -37,6 +37,8 @@ onLaunch: async function() { // 检查强制升级 this.updateMiniProgram() + // 监听蓝牙开关状态 + this.onBluetoothState() // 检查蓝牙权限 const checkResult = await this.checkSetting() console.log(checkResult) diff --git a/stores/bluetooth.js b/stores/bluetooth.js index e28f2de..69e57d9 100644 --- a/stores/bluetooth.js +++ b/stores/bluetooth.js @@ -121,8 +121,6 @@ export const useBluetoothStore = defineStore('ble', { if (initResult) { // 更新蓝牙初始化状态 this.updateInitBluetooth(true) - // 监听蓝牙开关状态 - this.onBluetoothState() // 监听蓝牙连接状态 this.onBluetoothConnectStatus() // 监听设备特征值变化 @@ -542,30 +540,33 @@ export const useBluetoothStore = defineStore('ble', { uni.stopBluetoothDevicesDiscovery() }, // 蓝牙状态提示 - getBluetoothStatus() { - if(this.bluetoothStatus === 1) { - uni.showModal({ - title: '提示', - content: '蓝牙尚未打开,请先打开蓝牙', - showCancel: false, - success(res) { - if (res.confirm) { - wx.openSystemBluetoothSetting({ - success (res) { - console.log(res) - } - }) + async getBluetoothStatus () { + if (this.bluetoothStatus === 1) { + const initResult = await this.initBluetooth() + if (!initResult) { + uni.showModal({ + title: '提示', + content: '蓝牙尚未打开,请先打开蓝牙', + showCancel: false, + success (res) { + if (res.confirm) { + wx.openSystemBluetoothSetting({ + success (res) { + console.log(res) + } + }) + } } - } - }) - } else if(this.bluetoothStatus === 2 || this.bluetoothStatus === 3) { + }) + } + } else if (this.bluetoothStatus === 2 || this.bluetoothStatus === 3) { uni.showModal({ title: '提示', content: '小程序蓝牙功能被禁用,请打开小程序蓝牙权限', showCancel: false, confirmText: '去设置', - success(res) { - if(res.confirm) { + success (res) { + if (res.confirm) { uni.openSetting() } } @@ -594,8 +595,6 @@ export const useBluetoothStore = defineStore('ble', { await that.initBluetooth() } else if(that.bluetoothStatus === 3 && bluetooth !== false) { that.bluetoothStatus = 1 - await that.initBluetooth() - that.onBluetoothState() } console.log('蓝牙权限', bluetooth, that.bluetoothStatus) resolve(bluetooth) From f0fc91295df2f02470d42dd2616d13cdb538ecc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Sat, 14 Sep 2024 10:28:42 +0800 Subject: [PATCH 6/6] v1.0.0.14 --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 6d45a9d..6396c8d 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "appid" : "__UNI__933D519", "description" : "", "versionName" : "1.0.0", - "versionCode" : "13", + "versionCode" : "14", "transformPx" : false, /* 小程序特有相关 */ "mp-weixin" : {