diff --git a/config/env.js b/config/env.js index c74463b..9d8c3cf 100644 --- a/config/env.js +++ b/config/env.js @@ -1,56 +1,72 @@ let version = '-' let buildNumber = '-' uni.getSystemInfo({ - success(res) { - version = res.appVersion - buildNumber = res.appVersionCode - } + success(res) { + version = res.appVersion + buildNumber = res.appVersionCode + } }) const DEV = { - name: 'dev', - appName: '星星锁Lite', - baseUrl: 'https://lock.dev.star-lock.cn/api', - webviewBaseUrl: 'https://lock.dev.star-lock.cn', - version, - buildNumber + name: 'dev', + appName: '星星锁Lite', + baseUrl: 'https://lock.dev.star-lock.cn/api', + webviewBaseUrl: 'https://lock.dev.star-lock.cn', + officialEmail: '', + officialWebsite: '', + version, + buildNumber } const PRE = { - name: 'pre', - appName: '星星锁Lite', - baseUrl: 'https://lock.pre.star-lock.cn/api', - webviewBaseUrl: 'https://lock.xhjcn.ltd', - version, - buildNumber + name: 'pre', + appName: '星星锁Lite', + baseUrl: 'https://lock.pre.star-lock.cn/api', + webviewBaseUrl: 'https://lock.xhjcn.ltd', + officialEmail: '', + officialWebsite: '', + version, + buildNumber } const XHJ = { - name: 'xhj', - appName: '星星锁Lite', - baseUrl: 'https://lock.xhjcn.ltd/api', - webviewBaseUrl: 'https://lock.xhjcn.ltd', - version, - buildNumber + name: 'xhj', + appName: '星星锁Lite', + baseUrl: 'https://lock.xhjcn.ltd/api', + webviewBaseUrl: 'https://lock.xhjcn.ltd', + officialEmail: '', + officialWebsite: '', + version, + buildNumber } const SKY = { - name: 'sky', - appName: '锁通通', - baseUrl: 'https://lock.skychip.top/api', - webviewBaseUrl: 'https://lock.skychip.top', - version, - buildNumber + name: 'sky', + appName: '锁通通', + baseUrl: 'https://lock.skychip.top/api', + webviewBaseUrl: 'https://lock.skychip.top', + officialEmail: 'contact@skychip.top', + officialWebsite: 'www.skychip.top', + version, + buildNumber } const GE = { - name: 'ge', - appName: '星星锁Lite', - baseUrl: 'http://lock.ge.star-lock.cn/api', - webviewBaseUrl: 'http://lock.ge.star-lock.cn', - version, - buildNumber + name: 'ge', + appName: '星星锁Lite', + baseUrl: 'http://lock.ge.star-lock.cn/api', + webviewBaseUrl: 'http://lock.ge.star-lock.cn', + officialEmail: '', + officialWebsite: '', + version, + buildNumber } // 更换环境的时候 切换导出就行 -export default { DEV, PRE, XHJ, SKY, GE } +export default { + DEV, + PRE, + XHJ, + SKY, + GE +} \ No newline at end of file diff --git a/manifest.json b/manifest.json index 2753183..ec70fbc 100644 --- a/manifest.json +++ b/manifest.json @@ -20,9 +20,7 @@ "optimization" : { "subPackages" : true }, - "plugins" : { - - } + "plugins" : {} }, "vueVersion" : "3", "app-plus" : { diff --git a/pages.json b/pages.json index d74cad4..3d744be 100644 --- a/pages.json +++ b/pages.json @@ -1,669 +1,661 @@ { - "easycom": { - "autoscan": true, - "custom": { - "^u--(.*)": "uview-plus/components/u-$1/u-$1.vue", - "^up-(.*)": "uview-plus/components/u-$1/u-$1.vue", - "^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue" - } - }, - "subPackages": [ - { - "root": "pages/p2p", - "pages": [ - { - "path": "p2pPlayer", - "style": { - "navigationStyle": "custom", - "navigationBarTitleText": "监控", - "disableScroll": true - } - }, - { - "path": "authorizeWechat", - "style": { - "navigationBarTitleText": "微信授权", - "disableScroll": true - } - }, - { - "path": "videoLog", - "style": { - "navigationBarTitleText": "门锁记录", - "disableScroll": true - } - } - ], - "plugins": { - - } - }, - { - "root": "pages/addDevice", - "pages": [ - { - "path": "addLockGuid", - "style": { - "navigationBarTitleText": "添加锁", - "disableScroll": true - } - }, - { - "path": "bindLock", - "style": { - "navigationBarTitleText": "添加锁" - } - }, - { - "path": "searchDevice", - "style": { - "disableScroll": true, - "navigationBarTitleText": "附近设备" - } - }, - { - "path": "distributionNetwork", - "style": { - "navigationBarTitleText": "WiFi配网", - "disableScroll": true - } - } - ] - }, - { - "root": "pages/user", - "pages": [ - { - "path": "userInfo", - "style": { - "navigationBarTitleText": "个人信息" - } - }, - { - "path": "updateName", - "style": { - "navigationBarTitleText": "修改昵称" - } - }, - { - "path": "updatePassword", - "style": { - "navigationBarTitleText": "重置密码" - } - }, - { - "path": "updateAccount", - "style": { - "navigationBarTitleText": "修改邮箱" - } - }, - { - "path": "verifyAccount", - "style": { - "navigationBarTitleText": "验证邮箱" - } - }, - { - "path": "login", - "style": { - "navigationBarTitleText": "登录", - "disableScroll": true - } - }, - { - "path": "register", - "style": { - "navigationBarTitleText": "注册", - "disableScroll": true - } - }, - { - "path": "forgotPassword", - "style": { - "navigationBarTitleText": "忘记密码", - "disableScroll": true - } - }, - { - "path": "countryList", - "style": { - "navigationBarTitleText": "你所在的国家/地区" - } - }, - { - "path": "safeVerify", - "style": { - "navigationBarTitleText": "安全验证" - } - }, - { - "path": "deleteAccount", - "style": { - "navigationBarTitleText": "删除账号", - "disableScroll": true - } - } - ] - }, - { - "root": "pages/others", - "pages": [ - { - "path": "notificationDetail", - "style": { - "navigationBarTitleText": "消息详情" - } - }, - { - "path": "temporaryDate", - "style": { - "navigationBarTitleText": "修改有效期", - "disableScroll": true - } - }, - { - "path": "webview", - "style": { - "navigationBarTitleText": "介绍" - } - }, - { - "path": "cycleDate", - "style": { - "navigationBarTitleText": "有效期", - "disableScroll": true - } - } - ] - }, - { - "root": "pages/feature", - "pages": [ - { - "path": "createPassword", - "style": { - "disableScroll": true, - "navigationBarTitleText": "获取密码" - } - }, - { - "path": "createPalmVein", - "style": { - "navigationBarTitleText": "添加掌静脉", - "disableScroll": true - } - }, - { - "path": "createFace", - "style": { - "navigationBarTitleText": "添加人脸", - "disableScroll": true - } - }, - { - "path": "createRemote", - "style": { - "navigationBarTitleText": "添加遥控", - "disableScroll": true - } - }, - { - "path": "createFingerprint", - "style": { - "navigationBarTitleText": "添加指纹", - "disableScroll": true - } - }, - { - "path": "createCard", - "style": { - "navigationBarTitleText": "添加卡", - "disableScroll": true - } - }, - { - "path": "typeRecordList", - "style": { - "navigationBarTitleText": "操作记录", - "disableScroll": true - } - }, - { - "path": "recordList", - "style": { - "navigationBarTitleText": "操作记录", - "disableScroll": true - } - }, - { - "path": "cardDetail", - "style": { - "navigationBarTitleText": "卡详情", - "disableScroll": true - } - }, - { - "path": "passwordDetail", - "style": { - "disableScroll": true, - "navigationBarTitleText": "密码详情" - } - }, - { - "path": "palmVeinDetail", - "style": { - "navigationBarTitleText": "掌静脉详情", - "disableScroll": true - } - }, - { - "path": "faceDetail", - "style": { - "navigationBarTitleText": "人脸详情", - "disableScroll": true - } - }, - { - "path": "remoteDetail", - "style": { - "navigationBarTitleText": "遥控详情", - "disableScroll": true - } - }, - { - "path": "fingerprintDetail", - "style": { - "navigationBarTitleText": "指纹详情", - "disableScroll": true - } - }, - { - "path": "palmVeinList", - "style": { - "navigationBarTitleText": "掌静脉", - "disableScroll": true - } - }, - { - "path": "faceList", - "style": { - "navigationBarTitleText": "人脸", - "disableScroll": true - } - }, - { - "path": "remoteList", - "style": { - "navigationBarTitleText": "遥控", - "disableScroll": true - } - }, - { - "path": "fingerprintList", - "style": { - "navigationBarTitleText": "指纹", - "disableScroll": true - } - }, - { - "path": "cardList", - "style": { - "navigationBarTitleText": "卡", - "disableScroll": true - } - }, - { - "path": "bindFace", - "style": { - "navigationBarTitleText": "添加人脸", - "disableScroll": true - } - }, - { - "path": "bindFingerprint", - "style": { - "navigationBarTitleText": "添加指纹", - "disableScroll": true - } - }, - { - "path": "bindCard", - "style": { - "navigationBarTitleText": "添加卡", - "disableScroll": true - } - }, - { - "path": "bindPalmVein", - "style": { - "navigationBarTitleText": "添加掌静脉", - "disableScroll": true - } - }, - { - "path": "bindRemote", - "style": { - "navigationBarTitleText": "添加遥控", - "disableScroll": true - } - }, - { - "path": "passwordList", - "style": { - "disableScroll": true, - "navigationBarTitleText": "密码" - } - }, - { - "path": "recordDetail", - "style": { - "navigationBarTitleText": "操作记录详情", - "disableScroll": true - } - }, - { - "path": "createAdmin", - "style": { - "navigationBarTitleText": "创建授权管理员", - "disableScroll": true - } - }, - { - "path": "keyDetail", - "style": { - "disableScroll": true, - "navigationBarTitleText": "钥匙详情" - } - }, - { - "path": "adminDetail", - "style": { - "navigationBarTitleText": "授权管理员详情", - "disableScroll": true - } - }, - { - "path": "adminList", - "style": { - "navigationBarTitleText": "授权管理员", - "disableScroll": true - } - }, - { - "path": "createKey", - "style": { - "navigationBarTitleText": "发送钥匙" - } - }, - { - "path": "keyList", - "style": { - "disableScroll": true, - "navigationBarTitleText": "电子钥匙" - } - } - ] - }, - { - "root": "pages/setting", - "pages": [ - { - "path": "videoSlot", - "style": { - "navigationBarTitleText": "录像时段", - "disableScroll": true - } - }, - { - "path": "setting", - "style": { - "navigationBarTitleText": "设置" - } - }, - { - "path": "uploadLockData", - "style": { - "navigationBarTitleText": "上传数据", - "disableScroll": true - } - }, - { - "path": "passageMode", - "style": { - "navigationBarTitleText": "常开模式", - "disableScroll": true - } - }, - { - "path": "realTimePicture", - "style": { - "navigationBarTitleText": "实时画面", - "disableScroll": true - } - }, - { - "path": "customCatEye", - "style": { - "navigationBarTitleText": "自定义模式", - "disableScroll": true - } - }, - { - "path": "openDirection", - "style": { - "navigationBarTitleText": "开门方向设置", - "disableScroll": true - } - }, - { - "path": "catEyeMode", - "style": { - "navigationBarTitleText": "猫眼工作模式", - "disableScroll": true - } - }, - { - "path": "catEye", - "style": { - "navigationBarTitleText": "猫眼设置", - "disableScroll": true - } - }, - { - "path": "noticeDetail", - "style": { - "navigationBarTitleText": "家人详情", - "disableScroll": true - } - }, - { - "path": "noticeWay", - "style": { - "navigationBarTitleText": "提醒方式", - "disableScroll": true - } - }, - { - "path": "autoLock", - "style": { - "navigationBarTitleText": "自动闭锁", - "disableScroll": true - } - }, - { - "path": "lockUser", - "style": { - "navigationBarTitleText": "锁用户", - "disableScroll": true - } - }, - { - "path": "lockDate", - "style": { - "navigationBarTitleText": "锁时间", - "disableScroll": true - } - }, - { - "path": "faceSetting", - "style": { - "navigationBarTitleText": "面容开锁设置", - "disableScroll": true - } - }, - { - "path": "lockSound", - "style": { - "navigationBarTitleText": "锁声音", - "disableScroll": true - } - }, - { - "path": "lockInfo", - "style": { - "navigationBarTitleText": "基本信息", - "disableScroll": true - } - }, - { - "path": "notOpenDoor", - "style": { - "navigationBarTitleText": "N天未开门", - "disableScroll": true - } - }, - { - "path": "messageReminder", - "style": { - "navigationBarTitleText": "消息提醒", - "disableScroll": true - } - }, - { - "path": "coercionFingerprint", - "style": { - "navigationBarTitleText": "指纹列表", - "disableScroll": true - } - }, - { - "path": "coercionOpenDoor", - "style": { - "navigationBarTitleText": "胁迫开门", - "disableScroll": true - } - }, - { - "path": "openDoorNotice", - "style": { - "navigationBarTitleText": "家人到家", - "disableScroll": true - } - }, - { - "path": "lowElecNotice", - "style": { - "navigationBarTitleText": "低电量提醒", - "disableScroll": true - } - }, - { - "path": "motorTorsion", - "style": { - "navigationBarTitleText": "电机功率设置", - "disableScroll": true - } - }, - { - "path": "updateSetting", - "style": { - "navigationBarTitleText": "设置", - "disableScroll": true - } - }, - { - "path": "syncElec", - "style": { - "navigationBarTitleText": "电量", - "disableScroll": true - } - }, - { - "path": "selectGroup", - "style": { - "navigationBarTitleText": "选择分组", - "disableScroll": true - } - } - ] - } - ], - "pages": [ - { - "path": "pages/main/home" - }, - { - "path": "pages/main/mine" - }, - { - "path": "pages/main/customBox" - }, - { - "path": "pages/main/notificationList", - "style": { - "navigationBarTitleText": "通知列表" - } - }, - { - "path": "pages/main/lockDetail", - "style": { - "navigationBarTitleText": "锁通通" - } - } - ], - "preloadRule": { - "pages/main/home": { - "packages": ["pages/others", "pages/addDevice", "pages/p2p"] - }, - "pages/main/lockDetail": { - "packages": ["pages/feature", "pages/setting"] - }, - "pages/main/mine": { - "packages": ["pages/user"] - } - }, - "globalStyle": { - "navigationBarTextStyle": "white", - "navigationBarTitleText": "锁通通", - "navigationBarBackgroundColor": "#4777ee", - "backgroundColor": "#F3F3F3", - "navigationStyle": "default" - }, - "tabBar": { - "color": "#a3a3a3", - "selectedColor": "#4777ee", - "borderStyle": "white", - "backgroundColor": "#FFFFFF", - "position": "bottom", - "list": [ - { - "pagePath": "pages/main/home", - "iconPath": "static/images/tabbar_key_no_select.png", - "selectedIconPath": "static/images/tabbar_key_select.png", - "text": "设备" - }, - { - "pagePath": "pages/main/notificationList", - "iconPath": "static/images/tabbar_notification_no_select.png", - "selectedIconPath": "static/images/tabbar_notification_select.png", - "text": "消息" - }, - { - "pagePath": "pages/main/mine", - "iconPath": "static/images/tabbar_mine_no_select.png", - "selectedIconPath": "static/images/tabbar_mine_select.png", - "text": "我的" - } - ] - } -} + "easycom": { + "autoscan": true, + "custom": { + "^u--(.*)": "uview-plus/components/u-$1/u-$1.vue", + "^up-(.*)": "uview-plus/components/u-$1/u-$1.vue", + "^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue" + } + }, + "subPackages": [{ + "root": "pages/p2p", + "pages": [{ + "path": "p2pPlayer", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "监控", + "disableScroll": true + } + }, + { + "path": "authorizeWechat", + "style": { + "navigationBarTitleText": "微信授权", + "disableScroll": true + } + }, + { + "path": "videoLog", + "style": { + "navigationBarTitleText": "门锁记录", + "disableScroll": true + } + } + ], + "plugins": { + + } + }, + { + "root": "pages/addDevice", + "pages": [{ + "path": "addLockGuid", + "style": { + "navigationBarTitleText": "添加锁", + "disableScroll": true + } + }, + { + "path": "bindLock", + "style": { + "navigationBarTitleText": "添加锁" + } + }, + { + "path": "searchDevice", + "style": { + "disableScroll": true, + "navigationBarTitleText": "附近设备" + } + }, + { + "path": "distributionNetwork", + "style": { + "navigationBarTitleText": "WiFi配网", + "disableScroll": true + } + } + ] + }, + { + "root": "pages/user", + "pages": [{ + "path": "userInfo", + "style": { + "navigationBarTitleText": "个人信息" + } + }, + { + "path": "updateName", + "style": { + "navigationBarTitleText": "修改昵称" + } + }, + { + "path": "updatePassword", + "style": { + "navigationBarTitleText": "重置密码" + } + }, + { + "path": "updateAccount", + "style": { + "navigationBarTitleText": "修改邮箱" + } + }, + { + "path": "verifyAccount", + "style": { + "navigationBarTitleText": "验证邮箱" + } + }, + { + "path": "login", + "style": { + "navigationBarTitleText": "登录", + "disableScroll": true + } + }, + { + "path": "register", + "style": { + "navigationBarTitleText": "注册", + "disableScroll": true + } + }, + { + "path": "forgotPassword", + "style": { + "navigationBarTitleText": "忘记密码", + "disableScroll": true + } + }, + { + "path": "countryList", + "style": { + "navigationBarTitleText": "你所在的国家/地区" + } + }, + { + "path": "safeVerify", + "style": { + "navigationBarTitleText": "安全验证" + } + }, + { + "path": "deleteAccount", + "style": { + "navigationBarTitleText": "删除账号", + "disableScroll": true + } + } + ] + }, + { + "root": "pages/others", + "pages": [{ + "path": "notificationDetail", + "style": { + "navigationBarTitleText": "消息详情" + } + }, + { + "path": "temporaryDate", + "style": { + "navigationBarTitleText": "修改有效期", + "disableScroll": true + } + }, + { + "path": "webview", + "style": { + "navigationBarTitleText": "介绍" + } + }, + { + "path": "cycleDate", + "style": { + "navigationBarTitleText": "有效期", + "disableScroll": true + } + } + ] + }, + { + "root": "pages/feature", + "pages": [{ + "path": "createPassword", + "style": { + "disableScroll": true, + "navigationBarTitleText": "获取密码" + } + }, + { + "path": "createPalmVein", + "style": { + "navigationBarTitleText": "添加掌静脉", + "disableScroll": true + } + }, + { + "path": "createFace", + "style": { + "navigationBarTitleText": "添加人脸", + "disableScroll": true + } + }, + { + "path": "createRemote", + "style": { + "navigationBarTitleText": "添加遥控", + "disableScroll": true + } + }, + { + "path": "createFingerprint", + "style": { + "navigationBarTitleText": "添加指纹", + "disableScroll": true + } + }, + { + "path": "createCard", + "style": { + "navigationBarTitleText": "添加卡", + "disableScroll": true + } + }, + { + "path": "typeRecordList", + "style": { + "navigationBarTitleText": "操作记录", + "disableScroll": true + } + }, + { + "path": "recordList", + "style": { + "navigationBarTitleText": "操作记录", + "disableScroll": true + } + }, + { + "path": "cardDetail", + "style": { + "navigationBarTitleText": "卡详情", + "disableScroll": true + } + }, + { + "path": "passwordDetail", + "style": { + "disableScroll": true, + "navigationBarTitleText": "密码详情" + } + }, + { + "path": "palmVeinDetail", + "style": { + "navigationBarTitleText": "掌静脉详情", + "disableScroll": true + } + }, + { + "path": "faceDetail", + "style": { + "navigationBarTitleText": "人脸详情", + "disableScroll": true + } + }, + { + "path": "remoteDetail", + "style": { + "navigationBarTitleText": "遥控详情", + "disableScroll": true + } + }, + { + "path": "fingerprintDetail", + "style": { + "navigationBarTitleText": "指纹详情", + "disableScroll": true + } + }, + { + "path": "palmVeinList", + "style": { + "navigationBarTitleText": "掌静脉", + "disableScroll": true + } + }, + { + "path": "faceList", + "style": { + "navigationBarTitleText": "人脸", + "disableScroll": true + } + }, + { + "path": "remoteList", + "style": { + "navigationBarTitleText": "遥控", + "disableScroll": true + } + }, + { + "path": "fingerprintList", + "style": { + "navigationBarTitleText": "指纹", + "disableScroll": true + } + }, + { + "path": "cardList", + "style": { + "navigationBarTitleText": "卡", + "disableScroll": true + } + }, + { + "path": "bindFace", + "style": { + "navigationBarTitleText": "添加人脸", + "disableScroll": true + } + }, + { + "path": "bindFingerprint", + "style": { + "navigationBarTitleText": "添加指纹", + "disableScroll": true + } + }, + { + "path": "bindCard", + "style": { + "navigationBarTitleText": "添加卡", + "disableScroll": true + } + }, + { + "path": "bindPalmVein", + "style": { + "navigationBarTitleText": "添加掌静脉", + "disableScroll": true + } + }, + { + "path": "bindRemote", + "style": { + "navigationBarTitleText": "添加遥控", + "disableScroll": true + } + }, + { + "path": "passwordList", + "style": { + "disableScroll": true, + "navigationBarTitleText": "密码" + } + }, + { + "path": "recordDetail", + "style": { + "navigationBarTitleText": "操作记录详情", + "disableScroll": true + } + }, + { + "path": "createAdmin", + "style": { + "navigationBarTitleText": "创建授权管理员", + "disableScroll": true + } + }, + { + "path": "keyDetail", + "style": { + "disableScroll": true, + "navigationBarTitleText": "钥匙详情" + } + }, + { + "path": "adminDetail", + "style": { + "navigationBarTitleText": "授权管理员详情", + "disableScroll": true + } + }, + { + "path": "adminList", + "style": { + "navigationBarTitleText": "授权管理员", + "disableScroll": true + } + }, + { + "path": "createKey", + "style": { + "navigationBarTitleText": "发送钥匙" + } + }, + { + "path": "keyList", + "style": { + "disableScroll": true, + "navigationBarTitleText": "电子钥匙" + } + } + ] + }, + { + "root": "pages/setting", + "pages": [{ + "path": "videoSlot", + "style": { + "navigationBarTitleText": "录像时段", + "disableScroll": true + } + }, + { + "path": "setting", + "style": { + "navigationBarTitleText": "设置" + } + }, + { + "path": "uploadLockData", + "style": { + "navigationBarTitleText": "上传数据", + "disableScroll": true + } + }, + { + "path": "passageMode", + "style": { + "navigationBarTitleText": "常开模式", + "disableScroll": true + } + }, + { + "path": "realTimePicture", + "style": { + "navigationBarTitleText": "实时画面", + "disableScroll": true + } + }, + { + "path": "customCatEye", + "style": { + "navigationBarTitleText": "自定义模式", + "disableScroll": true + } + }, + { + "path": "openDirection", + "style": { + "navigationBarTitleText": "开门方向设置", + "disableScroll": true + } + }, + { + "path": "catEyeMode", + "style": { + "navigationBarTitleText": "猫眼工作模式", + "disableScroll": true + } + }, + { + "path": "catEye", + "style": { + "navigationBarTitleText": "猫眼设置", + "disableScroll": true + } + }, + { + "path": "noticeDetail", + "style": { + "navigationBarTitleText": "家人详情", + "disableScroll": true + } + }, + { + "path": "noticeWay", + "style": { + "navigationBarTitleText": "提醒方式", + "disableScroll": true + } + }, + { + "path": "autoLock", + "style": { + "navigationBarTitleText": "自动闭锁", + "disableScroll": true + } + }, + { + "path": "lockUser", + "style": { + "navigationBarTitleText": "锁用户", + "disableScroll": true + } + }, + { + "path": "lockDate", + "style": { + "navigationBarTitleText": "锁时间", + "disableScroll": true + } + }, + { + "path": "faceSetting", + "style": { + "navigationBarTitleText": "面容开锁设置", + "disableScroll": true + } + }, + { + "path": "lockSound", + "style": { + "navigationBarTitleText": "锁声音", + "disableScroll": true + } + }, + { + "path": "lockInfo", + "style": { + "navigationBarTitleText": "基本信息", + "disableScroll": true + } + }, + { + "path": "notOpenDoor", + "style": { + "navigationBarTitleText": "N天未开门", + "disableScroll": true + } + }, + { + "path": "messageReminder", + "style": { + "navigationBarTitleText": "消息提醒", + "disableScroll": true + } + }, + { + "path": "coercionFingerprint", + "style": { + "navigationBarTitleText": "指纹列表", + "disableScroll": true + } + }, + { + "path": "coercionOpenDoor", + "style": { + "navigationBarTitleText": "胁迫开门", + "disableScroll": true + } + }, + { + "path": "openDoorNotice", + "style": { + "navigationBarTitleText": "家人到家", + "disableScroll": true + } + }, + { + "path": "lowElecNotice", + "style": { + "navigationBarTitleText": "低电量提醒", + "disableScroll": true + } + }, + { + "path": "motorTorsion", + "style": { + "navigationBarTitleText": "电机功率设置", + "disableScroll": true + } + }, + { + "path": "updateSetting", + "style": { + "navigationBarTitleText": "设置", + "disableScroll": true + } + }, + { + "path": "syncElec", + "style": { + "navigationBarTitleText": "电量", + "disableScroll": true + } + }, + { + "path": "selectGroup", + "style": { + "navigationBarTitleText": "选择分组", + "disableScroll": true + } + } + ] + } + ], + "pages": [{ + "path": "pages/main/lockDetail", + "style": { + "navigationBarTitleText": "锁通通" + } + }, + { + "path": "pages/main/home" + }, + { + "path": "pages/main/mine" + }, + { + "path": "pages/main/customBox" + }, + { + "path": "pages/main/notificationList", + "style": { + "navigationBarTitleText": "通知列表" + } + } + + ], + "preloadRule": { + "pages/main/home": { + "packages": ["pages/others", "pages/addDevice", "pages/p2p"] + }, + "pages/main/lockDetail": { + "packages": ["pages/feature", "pages/setting"] + }, + "pages/main/mine": { + "packages": ["pages/user"] + } + }, + "globalStyle": { + "navigationBarTextStyle": "white", + "navigationBarTitleText": "锁通通", + "navigationBarBackgroundColor": "#4777ee", + "backgroundColor": "#F3F3F3", + "navigationStyle": "default" + }, + "tabBar": { + "color": "#a3a3a3", + "selectedColor": "#4777ee", + "borderStyle": "white", + "backgroundColor": "#FFFFFF", + "position": "bottom", + "list": [{ + "pagePath": "pages/main/lockDetail", + "iconPath": "static/images/tabbar_key_no_select.png", + "selectedIconPath": "static/images/tabbar_key_select.png", + "text": "设备" + }, + { + "pagePath": "pages/main/notificationList", + "iconPath": "static/images/tabbar_notification_no_select.png", + "selectedIconPath": "static/images/tabbar_notification_select.png", + "text": "消息" + }, + { + "pagePath": "pages/main/mine", + "iconPath": "static/images/tabbar_mine_no_select.png", + "selectedIconPath": "static/images/tabbar_mine_select.png", + "text": "我的" + } + ] + } +} \ No newline at end of file diff --git a/pages/addDevice/bindLock.vue b/pages/addDevice/bindLock.vue index d0edbe3..96e0aa6 100644 --- a/pages/addDevice/bindLock.vue +++ b/pages/addDevice/bindLock.vue @@ -142,11 +142,11 @@ const { code, message } = await bindLockAdmin(params) console.log('添加锁返回', code, message) if (code === 0) { - this.updateLockSearch({ + await this.updateLockSearch({ ...this.lockSearch, pageNo: 1 }) - this.getLockList(this.lockSearch) + await this.getLockList(this.lockSearch) setTimeout(() => { uni.hideLoading() this.backAndToast('添加成功', 2) @@ -204,7 +204,7 @@ line-height: 96rpx; color: #ffffff; text-align: center; - background: #4777ee; + background: #4777ee; border-radius: 16rpx; } diff --git a/pages/main/lockDetail.vue b/pages/main/lockDetail.vue index 0bcae1a..00a099d 100644 --- a/pages/main/lockDetail.vue +++ b/pages/main/lockDetail.vue @@ -3,79 +3,104 @@ - 钥匙将在{{ $bluetooth.currentLockInfo.days }}天后失效 - {{ $bluetooth.currentLockInfo.lockAlias }} - + - - + + + + + {{ $bluetooth.currentLockInfo.lockAlias }} + - {{ $bluetooth.currentLockInfo.electricQuantity }}% - - - - - - - 点击开锁,长按闭锁 - - - - {{ - $lock.getRole( - $bluetooth.currentLockInfo.userType, - $bluetooth.currentLockInfo.keyRight - ) - }} - - - - 手机需联网 + + + + + + {{ $bluetooth.currentLockInfo.electricQuantity }}% + + + + + + + + + + 钥匙将在{{ $bluetooth.currentLockInfo.days }}天后失效 + + + 点击开锁,长按闭锁 + + + + {{ + $lock.getRole($bluetooth.currentLockInfo.userType, $bluetooth.currentLockInfo.keyRight) + }} + + + + 手机需联网 - - - 功能 - 电子钥匙 @@ -102,8 +127,9 @@ > + src="https://cos-lock.skychip.top/mp/icon_main_password.png" + > + 密码 @@ -132,8 +158,9 @@ > + src="https://cos-lock.skychip.top/mp/icon_main_fingerprint.png" + > + 指纹 遥控 @@ -177,7 +204,7 @@ > 掌静脉 @@ -188,7 +215,7 @@ > 监控 @@ -202,7 +229,7 @@ > 授权管理员 @@ -213,7 +240,7 @@ > 操作记录 @@ -224,57 +251,31 @@ > 门锁记录 - + - 消息提醒 - - - - 微信呼叫 + 设置 - - - 设置 - - - 删除 - + + + 暂无智能锁 + + + import { timeFormat } from 'uview-plus' - import { onMounted, ref } from 'vue' + import { onMounted, onUnmounted, ref } from 'vue' import { useBluetoothStore } from '@/stores/bluetooth' import { useBasicStore } from '@/stores/basic' import SwitchLoading from '@/components/SwitchLoading/SwitchLoading.vue' @@ -312,6 +313,9 @@ import { getLockDetailRequest, getLockNetTokenRequest, deleteLockRequest } from '@/api/lock' import { deleteKeyRequest } from '@/api/key' 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 import { requestPermission } from '@/uni_modules/xhj-record' @@ -322,7 +326,7 @@ const $lock = useLockStore() const $user = useUserStore() - const sLoading = ref(null) + // const sLoading = ref(null) const time = ref(0) const onlineToken = ref('0') @@ -333,9 +337,133 @@ const deviceInfo = ref(null) + // 控制是否应用旋转动画 + const isRotating = ref(false) + + // 选择器数据源(比如一个字符串数组) + const pickerOptions = ref([]) + + // 当前选中项的索引(picker 内部使用) + const selectedIndex = ref(0) + + // 选中后展示的文本 + const selectedText = ref(pickerOptions.value[0]) + onMounted(async () => { - deviceInfo.value = await $basic.getDeviceInfo() - await getServeTime() + try { + // #ifdef MP-WEIXIN + 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 () => { @@ -350,10 +478,27 @@ return } // #endif - $basic.routeJump({ name: 'p2pPlayer' }) + $basic.routeJump({ + name: 'p2pPlayer' + }) } 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() if ( $bluetooth.currentLockInfo.faceAuthentication === 1 && @@ -365,20 +510,23 @@ content: '开门前需进行实名认证,小程序暂不支持,请使用APP认证开门', showCancel: false }) + isRotating.value = false return } if (pending.value) { + isRotating.value = false return } if ($bluetooth.currentLockInfo.appUnlockOnline && type !== 'close') { const netWork = await $basic.getNetworkType() if (!netWork) { + isRotating.value = false return } } uni.vibrateLong() pending.value = true - sLoading.value.open() + if (type === 'close') { uni.showToast({ title: `正在尝试闭锁……`, @@ -388,9 +536,11 @@ // if ($bluetooth.currentLockInfo.appUnlockOnline && type !== 'close') { if ($bluetooth.currentLockInfo.appUnlockOnline) { const result = await getNetToken() + if (!result) { - sLoading.value.close() + // sLoading.value.close() pending.value = false + isRotating.value = false return } } @@ -400,6 +550,7 @@ } else { openMode = $bluetooth.currentLockInfo.appUnlockOnline ? 1 : 0 } + const { code } = await $bluetooth.openDoor({ name: $bluetooth.currentLockInfo.name, uid: $user.userInfo.uid.toString(), @@ -465,8 +616,9 @@ icon: 'none' }) } - sLoading.value.close() + pending.value = false + isRotating.value = false } const closePopup = () => { @@ -510,7 +662,10 @@ lockId: $bluetooth.currentLockInfo.lockId }) if (code === 0) { - $bluetooth.updateCurrentLockInfo({ ...$bluetooth.currentLockInfo, ...data }) + $bluetooth.updateCurrentLockInfo({ + ...$bluetooth.currentLockInfo, + ...data + }) uni.showToast({ title: '刷新成功', icon: 'none' @@ -524,6 +679,12 @@ refresherTriggered.value = false } + const toSearchDevice = async () => { + $basic.routeJump({ + name: 'addLockGuid' + }) + } + const deleteLock = async () => { const netWork = await $basic.getNetworkType() if (!netWork) { @@ -575,6 +736,27 @@ } }) } + + // 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) + } + } diff --git a/pages/main/mine.vue b/pages/main/mine.vue index a45efac..adfb65b 100644 --- a/pages/main/mine.vue +++ b/pages/main/mine.vue @@ -1,448 +1,543 @@ + .icon-arrow { + width: 40rpx; + height: 40rpx; + } + + .view-line { + width: 100%; + height: 3rpx; + 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; + } + } + \ No newline at end of file diff --git a/pages/others/cycleDate.vue b/pages/others/cycleDate.vue index ce10c8d..dc8c2b7 100644 --- a/pages/others/cycleDate.vue +++ b/pages/others/cycleDate.vue @@ -71,7 +71,7 @@