From 32378c2aef305b5d73dd38161a7fd91e3e075848 Mon Sep 17 00:00:00 2001 From: liyi Date: Thu, 17 Jul 2025 10:15:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=B0=83=E6=95=B4demo=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/lockDetail/lockDetail.js | 37 ++++++++++--------- miniprogram/project.config.json | 23 ++++++++---- package-lock.json | 8 ++-- package.json | 2 +- 4 files changed, 39 insertions(+), 31 deletions(-) diff --git a/miniprogram/miniprogram/pages/lockDetail/lockDetail.js b/miniprogram/miniprogram/pages/lockDetail/lockDetail.js index 10f62a9..a6dafd9 100644 --- a/miniprogram/miniprogram/pages/lockDetail/lockDetail.js +++ b/miniprogram/miniprogram/pages/lockDetail/lockDetail.js @@ -27,12 +27,12 @@ Page({ onLoad(options) { const app = getApp(); - + // 尝试获取全局数据 const lock = app.globalData.lock; const accountInfo = app.globalData.accountInfo; - - console.log('lockDetail onLoad:', { lock, accountInfo }); + + console.log('lockDetail onLoad:', {lock, accountInfo}); if (!lock || !accountInfo) { wx.showToast({ @@ -158,13 +158,14 @@ Page({ accountInfo: this.data.accountInfo, lockId: app.globalData.lock.lockId }); - + const result = await openDoor({ accountInfo: this.data.accountInfo, disconnect: true, type: 'open' }); - + console.log('openDoor result', result); + if (result.code === Result.Success.code) { wx.showToast({ title: '开门成功', @@ -196,8 +197,8 @@ Page({ }, onPassageModeInput(e) { - const { field } = e.currentTarget.dataset; - const { value } = e.detail; + const {field} = e.currentTarget.dataset; + const {value} = e.detail; this.setData({ [`passageModeForm.${field}`]: value }); @@ -236,7 +237,7 @@ Page({ default: throw new Error('请选择循环类型'); } - + await this._updatePassageModeSetting({ passageMode: parseInt(form.passageMode), startDate: startTime, @@ -245,7 +246,7 @@ Page({ weekDay, autoUnlock: parseInt(form.autoUnlock) }); - + this.hidePassageMode(); } catch (error) { wx.showToast({ @@ -261,7 +262,7 @@ Page({ accountInfo: this.data.accountInfo, lockId: this.data.lock.lockId }); - + const result = await updateSupportFunctionsWithParams({ accountInfo: this.data.accountInfo, featureBit: 50, @@ -292,20 +293,20 @@ Page({ accountInfo: this.data.accountInfo, lockId: this.data.lock.lockId }); - + const result = await deleteLock({ accountInfo: this.data.accountInfo }); - + if (result.code === Result.Success.code) { wx.showToast({ title: '删除成功', icon: 'success' }); - + const app = getApp(); app.globalData.lock = null; - + setTimeout(() => { wx.navigateBack(); }, 1500); @@ -321,9 +322,9 @@ Page({ // 通用的API调用方法 async handleApiCall(apiFunc, loadingText = '处理中...') { const app = getApp(); - this.setData({ loading: true }); - wx.showLoading({ title: loadingText, mask: true }); - + this.setData({loading: true}); + wx.showLoading({title: loadingText, mask: true}); + try { // 检查锁信息是否存在 if (!app.globalData.lock || !app.globalData.lock.lockId) { @@ -336,7 +337,7 @@ Page({ icon: 'none' }); } finally { - this.setData({ loading: false }); + this.setData({loading: false}); wx.hideLoading(); } }, diff --git a/miniprogram/project.config.json b/miniprogram/project.config.json index d02ff03..fcb5ebf 100644 --- a/miniprogram/project.config.json +++ b/miniprogram/project.config.json @@ -4,23 +4,30 @@ "compileType": "plugin", "libVersion": "latest", "srcMiniprogramRoot": "miniprogram/", - "appid": "wxf2c491f734bbf82f", - "pluginAppid": "wxf2c491f734bbf82f", - "packOptions": { - "ignore": [], - "include": [] - }, "setting": { "babelSetting": { "ignore": [], "disablePlugins": [], "outputPath": "" - } + }, + "coverView": false, + "postcss": false, + "minified": false, + "enhance": false, + "showShadowRootInWxmlPanel": false, + "packNpmRelationList": [], + "ignoreUploadUnusedFiles": true }, "condition": {}, "editorSetting": { "tabIndent": "insertSpaces", "tabSize": 2 }, - "simulatorPluginLibVersion": {} + "simulatorPluginLibVersion": {}, + "packOptions": { + "ignore": [], + "include": [] + }, + "appid": "wxf2c491f734bbf82f", + "pluginAppid": "wxf2c491f734bbf82f" } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 215bf44..0b15942 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "@dcloudio/uni-mp-xhs": "3.0.0-4030620241128001", "@dcloudio/uni-quickapp-webview": "3.0.0-4030620241128001", "pinia": "^2.2.8", - "star-cloud-uni": "^1.0.18", + "star-cloud-uni": "^1.0.22", "vue": "^3.5.13", "vue-i18n": "^9.1.9" }, @@ -10046,9 +10046,9 @@ } }, "node_modules/star-cloud-uni": { - "version": "1.0.18", - "resolved": "https://registry.npmjs.org/star-cloud-uni/-/star-cloud-uni-1.0.18.tgz", - "integrity": "sha512-KvJTm1ilJrHHqYz7Ha/0wACNPQmkvq4bIf1m4wTvvzIvL4aCubeI5UnAlCn938Xgm0L8bg4D+rIAYFvYrcd0Ew==", + "version": "1.0.22", + "resolved": "https://registry.npmjs.org/star-cloud-uni/-/star-cloud-uni-1.0.22.tgz", + "integrity": "sha512-9iJMxGfbe1m6lyLksU7mS4NI7VcUWu4SCu/TRXgJBLbfGrHnSK9Iil1Ym6KApZLR5rQICVYOoqLH+liBrX6z1w==", "dependencies": { "buffer": "^6.0.3", "crc": "^4.3.2", diff --git a/package.json b/package.json index b938fea..9f8c1df 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "@dcloudio/uni-mp-xhs": "3.0.0-4030620241128001", "@dcloudio/uni-quickapp-webview": "3.0.0-4030620241128001", "pinia": "^2.2.8", - "star-cloud-uni": "^1.0.18", + "star-cloud-uni": "^1.0.22", "vue": "^3.5.13", "vue-i18n": "^9.1.9" },