fix:调整demo测试页面
This commit is contained in:
parent
39a70a768d
commit
32378c2aef
@ -27,12 +27,12 @@ Page({
|
|||||||
|
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
const app = getApp();
|
const app = getApp();
|
||||||
|
|
||||||
// 尝试获取全局数据
|
// 尝试获取全局数据
|
||||||
const lock = app.globalData.lock;
|
const lock = app.globalData.lock;
|
||||||
const accountInfo = app.globalData.accountInfo;
|
const accountInfo = app.globalData.accountInfo;
|
||||||
|
|
||||||
console.log('lockDetail onLoad:', { lock, accountInfo });
|
console.log('lockDetail onLoad:', {lock, accountInfo});
|
||||||
|
|
||||||
if (!lock || !accountInfo) {
|
if (!lock || !accountInfo) {
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
@ -158,13 +158,14 @@ Page({
|
|||||||
accountInfo: this.data.accountInfo,
|
accountInfo: this.data.accountInfo,
|
||||||
lockId: app.globalData.lock.lockId
|
lockId: app.globalData.lock.lockId
|
||||||
});
|
});
|
||||||
|
|
||||||
const result = await openDoor({
|
const result = await openDoor({
|
||||||
accountInfo: this.data.accountInfo,
|
accountInfo: this.data.accountInfo,
|
||||||
disconnect: true,
|
disconnect: true,
|
||||||
type: 'open'
|
type: 'open'
|
||||||
});
|
});
|
||||||
|
console.log('openDoor result', result);
|
||||||
|
|
||||||
if (result.code === Result.Success.code) {
|
if (result.code === Result.Success.code) {
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
title: '开门成功',
|
title: '开门成功',
|
||||||
@ -196,8 +197,8 @@ Page({
|
|||||||
},
|
},
|
||||||
|
|
||||||
onPassageModeInput(e) {
|
onPassageModeInput(e) {
|
||||||
const { field } = e.currentTarget.dataset;
|
const {field} = e.currentTarget.dataset;
|
||||||
const { value } = e.detail;
|
const {value} = e.detail;
|
||||||
this.setData({
|
this.setData({
|
||||||
[`passageModeForm.${field}`]: value
|
[`passageModeForm.${field}`]: value
|
||||||
});
|
});
|
||||||
@ -236,7 +237,7 @@ Page({
|
|||||||
default:
|
default:
|
||||||
throw new Error('请选择循环类型');
|
throw new Error('请选择循环类型');
|
||||||
}
|
}
|
||||||
|
|
||||||
await this._updatePassageModeSetting({
|
await this._updatePassageModeSetting({
|
||||||
passageMode: parseInt(form.passageMode),
|
passageMode: parseInt(form.passageMode),
|
||||||
startDate: startTime,
|
startDate: startTime,
|
||||||
@ -245,7 +246,7 @@ Page({
|
|||||||
weekDay,
|
weekDay,
|
||||||
autoUnlock: parseInt(form.autoUnlock)
|
autoUnlock: parseInt(form.autoUnlock)
|
||||||
});
|
});
|
||||||
|
|
||||||
this.hidePassageMode();
|
this.hidePassageMode();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
@ -261,7 +262,7 @@ Page({
|
|||||||
accountInfo: this.data.accountInfo,
|
accountInfo: this.data.accountInfo,
|
||||||
lockId: this.data.lock.lockId
|
lockId: this.data.lock.lockId
|
||||||
});
|
});
|
||||||
|
|
||||||
const result = await updateSupportFunctionsWithParams({
|
const result = await updateSupportFunctionsWithParams({
|
||||||
accountInfo: this.data.accountInfo,
|
accountInfo: this.data.accountInfo,
|
||||||
featureBit: 50,
|
featureBit: 50,
|
||||||
@ -292,20 +293,20 @@ Page({
|
|||||||
accountInfo: this.data.accountInfo,
|
accountInfo: this.data.accountInfo,
|
||||||
lockId: this.data.lock.lockId
|
lockId: this.data.lock.lockId
|
||||||
});
|
});
|
||||||
|
|
||||||
const result = await deleteLock({
|
const result = await deleteLock({
|
||||||
accountInfo: this.data.accountInfo
|
accountInfo: this.data.accountInfo
|
||||||
});
|
});
|
||||||
|
|
||||||
if (result.code === Result.Success.code) {
|
if (result.code === Result.Success.code) {
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
title: '删除成功',
|
title: '删除成功',
|
||||||
icon: 'success'
|
icon: 'success'
|
||||||
});
|
});
|
||||||
|
|
||||||
const app = getApp();
|
const app = getApp();
|
||||||
app.globalData.lock = null;
|
app.globalData.lock = null;
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
wx.navigateBack();
|
wx.navigateBack();
|
||||||
}, 1500);
|
}, 1500);
|
||||||
@ -321,9 +322,9 @@ Page({
|
|||||||
// 通用的API调用方法
|
// 通用的API调用方法
|
||||||
async handleApiCall(apiFunc, loadingText = '处理中...') {
|
async handleApiCall(apiFunc, loadingText = '处理中...') {
|
||||||
const app = getApp();
|
const app = getApp();
|
||||||
this.setData({ loading: true });
|
this.setData({loading: true});
|
||||||
wx.showLoading({ title: loadingText, mask: true });
|
wx.showLoading({title: loadingText, mask: true});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 检查锁信息是否存在
|
// 检查锁信息是否存在
|
||||||
if (!app.globalData.lock || !app.globalData.lock.lockId) {
|
if (!app.globalData.lock || !app.globalData.lock.lockId) {
|
||||||
@ -336,7 +337,7 @@ Page({
|
|||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
} finally {
|
} finally {
|
||||||
this.setData({ loading: false });
|
this.setData({loading: false});
|
||||||
wx.hideLoading();
|
wx.hideLoading();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -4,23 +4,30 @@
|
|||||||
"compileType": "plugin",
|
"compileType": "plugin",
|
||||||
"libVersion": "latest",
|
"libVersion": "latest",
|
||||||
"srcMiniprogramRoot": "miniprogram/",
|
"srcMiniprogramRoot": "miniprogram/",
|
||||||
"appid": "wxf2c491f734bbf82f",
|
|
||||||
"pluginAppid": "wxf2c491f734bbf82f",
|
|
||||||
"packOptions": {
|
|
||||||
"ignore": [],
|
|
||||||
"include": []
|
|
||||||
},
|
|
||||||
"setting": {
|
"setting": {
|
||||||
"babelSetting": {
|
"babelSetting": {
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"disablePlugins": [],
|
"disablePlugins": [],
|
||||||
"outputPath": ""
|
"outputPath": ""
|
||||||
}
|
},
|
||||||
|
"coverView": false,
|
||||||
|
"postcss": false,
|
||||||
|
"minified": false,
|
||||||
|
"enhance": false,
|
||||||
|
"showShadowRootInWxmlPanel": false,
|
||||||
|
"packNpmRelationList": [],
|
||||||
|
"ignoreUploadUnusedFiles": true
|
||||||
},
|
},
|
||||||
"condition": {},
|
"condition": {},
|
||||||
"editorSetting": {
|
"editorSetting": {
|
||||||
"tabIndent": "insertSpaces",
|
"tabIndent": "insertSpaces",
|
||||||
"tabSize": 2
|
"tabSize": 2
|
||||||
},
|
},
|
||||||
"simulatorPluginLibVersion": {}
|
"simulatorPluginLibVersion": {},
|
||||||
|
"packOptions": {
|
||||||
|
"ignore": [],
|
||||||
|
"include": []
|
||||||
|
},
|
||||||
|
"appid": "wxf2c491f734bbf82f",
|
||||||
|
"pluginAppid": "wxf2c491f734bbf82f"
|
||||||
}
|
}
|
||||||
8
package-lock.json
generated
8
package-lock.json
generated
@ -24,7 +24,7 @@
|
|||||||
"@dcloudio/uni-mp-xhs": "3.0.0-4030620241128001",
|
"@dcloudio/uni-mp-xhs": "3.0.0-4030620241128001",
|
||||||
"@dcloudio/uni-quickapp-webview": "3.0.0-4030620241128001",
|
"@dcloudio/uni-quickapp-webview": "3.0.0-4030620241128001",
|
||||||
"pinia": "^2.2.8",
|
"pinia": "^2.2.8",
|
||||||
"star-cloud-uni": "^1.0.18",
|
"star-cloud-uni": "^1.0.22",
|
||||||
"vue": "^3.5.13",
|
"vue": "^3.5.13",
|
||||||
"vue-i18n": "^9.1.9"
|
"vue-i18n": "^9.1.9"
|
||||||
},
|
},
|
||||||
@ -10046,9 +10046,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/star-cloud-uni": {
|
"node_modules/star-cloud-uni": {
|
||||||
"version": "1.0.18",
|
"version": "1.0.22",
|
||||||
"resolved": "https://registry.npmjs.org/star-cloud-uni/-/star-cloud-uni-1.0.18.tgz",
|
"resolved": "https://registry.npmjs.org/star-cloud-uni/-/star-cloud-uni-1.0.22.tgz",
|
||||||
"integrity": "sha512-KvJTm1ilJrHHqYz7Ha/0wACNPQmkvq4bIf1m4wTvvzIvL4aCubeI5UnAlCn938Xgm0L8bg4D+rIAYFvYrcd0Ew==",
|
"integrity": "sha512-9iJMxGfbe1m6lyLksU7mS4NI7VcUWu4SCu/TRXgJBLbfGrHnSK9Iil1Ym6KApZLR5rQICVYOoqLH+liBrX6z1w==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
"crc": "^4.3.2",
|
"crc": "^4.3.2",
|
||||||
|
|||||||
@ -52,7 +52,7 @@
|
|||||||
"@dcloudio/uni-mp-xhs": "3.0.0-4030620241128001",
|
"@dcloudio/uni-mp-xhs": "3.0.0-4030620241128001",
|
||||||
"@dcloudio/uni-quickapp-webview": "3.0.0-4030620241128001",
|
"@dcloudio/uni-quickapp-webview": "3.0.0-4030620241128001",
|
||||||
"pinia": "^2.2.8",
|
"pinia": "^2.2.8",
|
||||||
"star-cloud-uni": "^1.0.18",
|
"star-cloud-uni": "^1.0.22",
|
||||||
"vue": "^3.5.13",
|
"vue": "^3.5.13",
|
||||||
"vue-i18n": "^9.1.9"
|
"vue-i18n": "^9.1.9"
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user