同步小程序与管理端更新,完善抽烟记录和解绑冷静期

This commit is contained in:
2026-10-09 22:15:51 +08:00
parent a68a4ef411
commit b10fc3c4ac
149 changed files with 3794 additions and 589 deletions
+12
View File
@@ -0,0 +1,12 @@
function photoForm(photo) {
return { taken_at: String(photo.taken_at || '').slice(0, 10), location: photo.location || '', activity: photo.activity || '' };
}
function metadataRows(photos) {
const rows = photos.map((photo, index) => ({ ...photoForm(photo), id: photo.id, photoIndex: index, label: photos.length > 1 ? '第 ' + (index + 1) + ' 张' : '' }));
if (!rows.length) return [];
const same = rows.every(row => row.taken_at === rows[0].taken_at && row.location === rows[0].location && row.activity === rows[0].activity);
if (same) rows.splice(1);
if (same) rows[0].label = '';
return rows.filter(row => row.taken_at || row.location || row.activity);
}
module.exports = { photoForm, metadataRows };