feat: 更新锁类型图标和锁用户页面逻辑,支持掌静脉和遥控类型的时间文本格式化

This commit is contained in:
fanpeng 2025-07-08 12:01:02 +08:00
parent a8983ae630
commit 375a338cd2
2 changed files with 48 additions and 2 deletions

View File

@ -21,10 +21,10 @@ export const keysType = {
},
6: {
name: '掌静脉',
icon: 'https://oss-lock.xhjcn.ltd/mp/icon_palm_vein_white.png'
icon: 'https://oss-lock.xhjcn.ltd/mp/icon_palm_vein_1.png'
},
7: {
name: '遥控',
icon: 'https://oss-lock.xhjcn.ltd/mp/icon_remote_white.png'
icon: 'https://oss-lock.xhjcn.ltd/mp/icon_remote_1.png'
}
}

View File

@ -267,6 +267,52 @@
}
}
}
if (data[i].openLockType === 6) {
for (let j = 0; j < data[i].keys.length; j++) {
data[i].keys[j].openLockType = data[i].openLockType
data[i].keys[j].name = data[i].keys[j].palmVeinName
data[i].keys[j].id = data[i].keys[j].palmVeinId
if (data[i].keys[j].palmVeinType === 1) {
data[i].keys[j].timeText =
timeFormat(data[i].keys[j].createDate, 'yyyy-mm-dd hh:MM') + ' 永久'
} else if (data[i].keys[j].palmVeinType === 2) {
data[i].keys[j].timeText =
timeFormat(data[i].keys[j].startDate, 'yyyy-mm-dd hh:MM') +
' - ' +
timeFormat(data[i].keys[j].endDate, 'yyyy-mm-dd hh:MM') +
' 限时'
} else {
data[i].keys[j].timeText =
timeFormat(data[i].keys[j].startDate, 'yyyy-mm-dd') +
' - ' +
timeFormat(data[i].keys[j].endDate, 'yyyy-mm-dd') +
' 循环'
}
}
}
if (data[i].openLockType === 7) {
for (let j = 0; j < data[i].keys.length; j++) {
data[i].keys[j].openLockType = data[i].openLockType
data[i].keys[j].name = data[i].keys[j].remoteName
data[i].keys[j].id = data[i].keys[j].remoteId
if (data[i].keys[j].remoteType === 1) {
data[i].keys[j].timeText =
timeFormat(data[i].keys[j].createDate, 'yyyy-mm-dd hh:MM') + ' 永久'
} else if (data[i].keys[j].remoteType === 2) {
data[i].keys[j].timeText =
timeFormat(data[i].keys[j].startDate, 'yyyy-mm-dd hh:MM') +
' - ' +
timeFormat(data[i].keys[j].endDate, 'yyyy-mm-dd hh:MM') +
' 限时'
} else {
data[i].keys[j].timeText =
timeFormat(data[i].keys[j].startDate, 'yyyy-mm-dd') +
' - ' +
timeFormat(data[i].keys[j].endDate, 'yyyy-mm-dd') +
' 循环'
}
}
}
result.push(...data[i].keys)
}
console.log(result)