From 6a24461bdc6392f772f357d59ec78486485731cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Thu, 26 Sep 2024 15:58:20 +0800 Subject: [PATCH 1/6] v1.0.2+19 --- manifest.json | 4 ++-- pages/createPassword/createPassword.vue | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 8d2ba3d..f3f27e4 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name" : "wx-starlock", "appid" : "__UNI__933D519", "description" : "", - "versionName" : "1.0.1", - "versionCode" : "18", + "versionName" : "1.0.2", + "versionCode" : "19", "transformPx" : false, /* 小程序特有相关 */ "mp-weixin" : { diff --git a/pages/createPassword/createPassword.vue b/pages/createPassword/createPassword.vue index 4710779..2a87160 100644 --- a/pages/createPassword/createPassword.vue +++ b/pages/createPassword/createPassword.vue @@ -68,10 +68,22 @@ export default { async onLoad() { this.deviceInfo = await this.getDeviceInfo() this.temporaryTime = this.setTime() + this.minDate = Number(this.getNextFullHour()) }, methods: { ...mapActions(useBasicStore, ['getDeviceInfo', 'backAndToast', 'getNetworkType']), ...mapActions(useLockStore, ['getPasswordList', 'updatePasswordSearch']), + // 获取下一个整点时间 + getNextFullHour() { + const now = new Date() + const currentHour = now.getHours() + now.setHours(currentHour + 1); + now.setMinutes(0); + now.setSeconds(0); + now.setMilliseconds(0); + + return now; + }, setTime() { const now = new Date() now.setMinutes(0, 0, 0) From 4e23c6f99a6330278cc82c25c5f9dff974de231b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Thu, 26 Sep 2024 17:40:44 +0800 Subject: [PATCH 2/6] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=94=B9=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E5=92=8C=E7=94=B5=E5=AD=90=E9=92=A5=E5=8C=99=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.json | 2 +- pages/createKey/createKey.vue | 14 +++++++------- pages/createPassword/createPassword.vue | 9 ++++----- pages/keyDetail/keyDetail.vue | 4 ++-- pages/passwordDetail/passwordDetail.vue | 4 ++-- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/manifest.json b/manifest.json index f3f27e4..b428330 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "appid" : "__UNI__933D519", "description" : "", "versionName" : "1.0.2", - "versionCode" : "19", + "versionCode" : "20", "transformPx" : false, /* 小程序特有相关 */ "mp-weixin" : { diff --git a/pages/createKey/createKey.vue b/pages/createKey/createKey.vue index 3faf3b0..4065e2c 100644 --- a/pages/createKey/createKey.vue +++ b/pages/createKey/createKey.vue @@ -10,17 +10,17 @@ :list="tabs" :autoplay="false" :circular="true" :current="currnetIndex" @change="changeSwiper"> - - 接收者可使用此小程序开关锁 - 发送钥匙 + 发送 - - 接收者在有效期内可以不限次数使用 - 发送钥匙 + 发送 @@ -77,7 +77,7 @@ export default { }, async onLoad () { this.deviceInfo = await this.getDeviceInfo() - this.temporaryInvalidTime = this.setTime() + // this.temporaryInvalidTime = this.setTime() }, methods: { ...mapActions(useBasicStore, ['getDeviceInfo', 'backAndToast', 'getNetworkType']), diff --git a/pages/createPassword/createPassword.vue b/pages/createPassword/createPassword.vue index 2a87160..0327349 100644 --- a/pages/createPassword/createPassword.vue +++ b/pages/createPassword/createPassword.vue @@ -10,13 +10,13 @@ :list="tabs" :autoplay="false" :circular="true" :current="currnetIndex" @change="changeSwiper"> - {{ text }} 获取密码 - - 名称 + 姓名 {{ currentKeyInfo.keyName }} @@ -39,7 +39,7 @@ 发送时间 {{ timeFormat(currentKeyInfo.sendDate, 'yyyy-mm-dd h:M') }} - 删除钥匙 + 删除 diff --git a/pages/passwordDetail/passwordDetail.vue b/pages/passwordDetail/passwordDetail.vue index f2d4002..8656593 100644 --- a/pages/passwordDetail/passwordDetail.vue +++ b/pages/passwordDetail/passwordDetail.vue @@ -5,7 +5,7 @@ {{ currentPasswordInfo.keyboardPwd }} - 名称 + 姓名 {{ currentPasswordInfo.keyboardPwdName }} @@ -28,7 +28,7 @@ {{ timeFormat(currentPasswordInfo.sendDate, 'yyyy-mm-dd h:M') }} 密码生成后,请在当日23:59前使用一次进行激活,否则过0点后未激活则失效。 - 删除密码 + 删除 From ac769296e84fe5795c3f6d5836c47a1bc9dfdae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Thu, 26 Sep 2024 17:45:20 +0800 Subject: [PATCH 3/6] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=94=B9=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E5=92=8C=E7=94=B5=E5=AD=90=E9=92=A5=E5=8C=99=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stores/bluetooth.js | 1 + 1 file changed, 1 insertion(+) diff --git a/stores/bluetooth.js b/stores/bluetooth.js index 69e57d9..e11d0f7 100644 --- a/stores/bluetooth.js +++ b/stores/bluetooth.js @@ -764,6 +764,7 @@ export const useBluetoothStore = defineStore('ble', { timer1 = setInterval(() => { uni.getBluetoothDevices({ success(res) { + console.log('设备列表', res) const deviceList = res.devices for(let i = 0; i < deviceList.length; i++) { if(deviceList[i]?.name === that.currentLockInfo.name) { From 87ee56869cc3b83cbfb4d0ae8aa05b694040489d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Fri, 27 Sep 2024 10:29:15 +0800 Subject: [PATCH 4/6] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E9=B8=BF?= =?UTF-8?q?=E8=92=99=E7=B3=BB=E7=BB=9F=E6=9D=83=E9=99=90bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.json | 2 +- stores/bluetooth.js | 31 ++++++++++++++++++++++++------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/manifest.json b/manifest.json index b428330..b06c90d 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "appid" : "__UNI__933D519", "description" : "", "versionName" : "1.0.2", - "versionCode" : "20", + "versionCode" : "21", "transformPx" : false, /* 小程序特有相关 */ "mp-weixin" : { diff --git a/stores/bluetooth.js b/stores/bluetooth.js index e11d0f7..79e479d 100644 --- a/stores/bluetooth.js +++ b/stores/bluetooth.js @@ -495,7 +495,7 @@ export const useBluetoothStore = defineStore('ble', { if(searchNumber === 0 && searchTipFlag) { uni.showModal({ title: '提示', - content: '长时间未搜索到任何设备,请确认微信的附近设备权限开启后再试', + content: '长时间未搜索到任何设备,请确认微信的附近设备权限开启后再试(鸿蒙系统在设置-隐私-定位服务中开启位置信息权限)', showCancel: false, success() { uni.openAppAuthorizeSetting({ @@ -756,16 +756,33 @@ export const useBluetoothStore = defineStore('ble', { return new Promise((resolve) => { uni.startBluetoothDevicesDiscovery({ success: function () { - timer2 = setTimeout(() => { - uni.stopBluetoothDevicesDiscovery() - clearInterval(timer1) - resolve({ code: -1 }) - }, 10500) + let searchFlag = false + timer2 = setTimeout(async () => { + uni.stopBluetoothDevicesDiscovery() + clearInterval(timer1) + if (!searchFlag) { + uni.showModal({ + title: '提示', + content: '长时间未搜索到任何设备,请确认微信的附近设备权限开启后再试(鸿蒙系统在设置-隐私-定位服务中开启位置信息权限)', + showCancel: false, + success () { + uni.openAppAuthorizeSetting({ + success (res) { + console.log(res) + } + }) + } + }) + } + resolve({ code: -1 }) + }, 10500) timer1 = setInterval(() => { uni.getBluetoothDevices({ success(res) { - console.log('设备列表', res) const deviceList = res.devices + if(searchFlag === false && res.devices.length > 0) { + searchFlag = true + } for(let i = 0; i < deviceList.length; i++) { if(deviceList[i]?.name === that.currentLockInfo.name) { const uuid = deviceList[i]?.advertisServiceUUIDs[0] From b309a532812dfc61e46238b89eaf915ae631846f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Fri, 27 Sep 2024 11:26:36 +0800 Subject: [PATCH 5/6] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E5=92=8C=E7=94=B5=E5=AD=90=E9=92=A5=E5=8C=99=E6=96=87?= =?UTF-8?q?=E6=A1=88=E4=B8=8E=E6=97=B6=E9=97=B4=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LockDatetimePicker/LockDatetimePicker.vue | 26 ++++++++++++++++--- pages/createKey/createKey.vue | 13 +++++----- pages/createPassword/createPassword.vue | 19 +++++++++++--- pages/passwordDetail/passwordDetail.vue | 1 - stores/lock.js | 2 +- 5 files changed, 46 insertions(+), 15 deletions(-) diff --git a/components/LockDatetimePicker/LockDatetimePicker.vue b/components/LockDatetimePicker/LockDatetimePicker.vue index 911b896..0f3dcf6 100644 --- a/components/LockDatetimePicker/LockDatetimePicker.vue +++ b/components/LockDatetimePicker/LockDatetimePicker.vue @@ -6,10 +6,10 @@ {{ timeFormat(time, 'yyyy-mm-dd h:M') }} - + @close="close" @cancel="close"> @@ -22,7 +22,7 @@ export default { title: String, value: Number, minDate: Number, - placeholder: String, + maxDate: Number, type: { type: String, default: 'datetime' @@ -39,6 +39,24 @@ export default { }, methods: { timeFormat, + formatter(type, value) { + if (type === 'year') { + return `${value}年`; + } + if (type === 'month') { + return `${value}月`; + } + if (type === 'day') { + return `${value}日`; + } + if (type === 'hour') { + return `${value}时`; + } + if (type === 'minute') { + return `${value}分`; + } + return value; + }, filter(mode, options) { if (mode === 'minute' && this.type === 'datehour') { return options.filter((option) => option === '00') diff --git a/pages/createKey/createKey.vue b/pages/createKey/createKey.vue index 4065e2c..5bcfba2 100644 --- a/pages/createKey/createKey.vue +++ b/pages/createKey/createKey.vue @@ -14,7 +14,8 @@ @changeInput="changePermanentAccountInput"> - 接收者可使用此小程序开关锁 + 接收者可使用此小程序开关锁 + 小程序暂不支持邮箱登录,若接收者账号为邮箱可先使用星星锁APP登录,绑定手机号后可使用小程序登录 发送 @@ -24,11 +25,12 @@ @changeInput="changeTemporaryNameInput"> + @changeTime="changeTemporaryValidTime" :maxDate="maxDate"> + @changeTime="changeTemporaryInvalidTime" :maxDate="maxDate"> - 接收者在有效期内可以不限次数使用 + 接收者在有效期内可以不限次数使用 + 小程序暂不支持邮箱登录,若接收者账号为邮箱可先使用星星锁APP登录,绑定手机号后可使用小程序登录 发送 @@ -62,6 +64,7 @@ export default { temporaryValidTime: Number(new Date()), temporaryInvalidTime: Number(new Date()), minDate: Number(new Date()), + maxDate: Number(4133951940000), currnetIndex: 0, deviceInfo: null, pending: false @@ -212,8 +215,6 @@ page { } .text { - margin-top: 40rpx; - margin-bottom: 50rpx; color: #262626; font-size: 26rpx; padding: 0 32rpx; diff --git a/pages/createPassword/createPassword.vue b/pages/createPassword/createPassword.vue index 0327349..2843629 100644 --- a/pages/createPassword/createPassword.vue +++ b/pages/createPassword/createPassword.vue @@ -16,11 +16,11 @@ 获取密码 - - + {{ text }} 获取密码 @@ -51,6 +51,7 @@ export default { temporaryName: '', temporaryTime: Number(new Date()), minDate: Number(new Date()), + maxDate: Number(4133951940000), currnetIndex: 0, deviceInfo: null, pending: false, @@ -69,6 +70,7 @@ export default { this.deviceInfo = await this.getDeviceInfo() this.temporaryTime = this.setTime() this.minDate = Number(this.getNextFullHour()) + this.maxDate = Number(this.getFutureTimestamp()) }, methods: { ...mapActions(useBasicStore, ['getDeviceInfo', 'backAndToast', 'getNetworkType']), @@ -84,6 +86,17 @@ export default { return now; }, + getFutureTimestamp() { + const currentDate = new Date(); + + const year = currentDate.getFullYear(); + const month = currentDate.getMonth(); + const day = currentDate.getDate(); + + const futureDate = new Date(year + 3, month, day, 23, 0, 0); + + return futureDate.getTime(); + }, setTime() { const now = new Date() now.setMinutes(0, 0, 0) diff --git a/pages/passwordDetail/passwordDetail.vue b/pages/passwordDetail/passwordDetail.vue index 8656593..86f80ee 100644 --- a/pages/passwordDetail/passwordDetail.vue +++ b/pages/passwordDetail/passwordDetail.vue @@ -27,7 +27,6 @@ 发送时间 {{ timeFormat(currentPasswordInfo.sendDate, 'yyyy-mm-dd h:M') }} - 密码生成后,请在当日23:59前使用一次进行激活,否则过0点后未激活则失效。 删除 diff --git a/stores/lock.js b/stores/lock.js index bd0a5dd..c123a45 100644 --- a/stores/lock.js +++ b/stores/lock.js @@ -213,7 +213,7 @@ export const useLockStore = defineStore('lock', { } else if(data.list[i].keyboardPwdType === 14) { text = '周日' } - data.list[i].timeText = `${text} ${data.list[i].hoursStart}:00-${data.list[i].hoursEnd}:00 循环` + data.list[i].timeText = `${text} ${data.list[i].hoursStart}:00-${data.list[i].hoursEnd}:00` } if(data.list[i].isCustom === 1) { data.list[i].timeText += ' 自定义' From 6c19cbc0e01fa3ca8979a9bc6f2619b610c6aa73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Fri, 27 Sep 2024 14:24:03 +0800 Subject: [PATCH 6/6] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E5=BE=AA?= =?UTF-8?q?=E7=8E=AF=E5=AF=86=E7=A0=81=E6=96=87=E6=A1=88=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.json | 2 +- pages/passwordDetail/passwordDetail.vue | 2 +- stores/lock.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index b06c90d..bca47ef 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "appid" : "__UNI__933D519", "description" : "", "versionName" : "1.0.2", - "versionCode" : "21", + "versionCode" : "22", "transformPx" : false, /* 小程序特有相关 */ "mp-weixin" : { diff --git a/pages/passwordDetail/passwordDetail.vue b/pages/passwordDetail/passwordDetail.vue index 86f80ee..2f96906 100644 --- a/pages/passwordDetail/passwordDetail.vue +++ b/pages/passwordDetail/passwordDetail.vue @@ -16,7 +16,7 @@ {{ timeFormat(currentPasswordInfo.endDate, 'yyyy-mm-dd h:M') }} - {{ currentPasswordInfo.timeText }} + {{ currentPasswordInfo.timeText.slice(0, -3) }} diff --git a/stores/lock.js b/stores/lock.js index c123a45..bd0a5dd 100644 --- a/stores/lock.js +++ b/stores/lock.js @@ -213,7 +213,7 @@ export const useLockStore = defineStore('lock', { } else if(data.list[i].keyboardPwdType === 14) { text = '周日' } - data.list[i].timeText = `${text} ${data.list[i].hoursStart}:00-${data.list[i].hoursEnd}:00` + data.list[i].timeText = `${text} ${data.list[i].hoursStart}:00-${data.list[i].hoursEnd}:00 循环` } if(data.list[i].isCustom === 1) { data.list[i].timeText += ' 自定义'