feat: 调整样式

This commit is contained in:
Blizzard
2026-02-14 11:31:44 +08:00
parent cbbe82ef63
commit d6f781a666
42 changed files with 827 additions and 293 deletions
+4 -7
View File
@@ -1,5 +1,6 @@
// pages/plant-detail/index.js
import request from '../../utils/request';
import { calculateDaysSince, getPlantAgeBadge } from '../../utils/dateUtil';
Page({
data: {
@@ -53,14 +54,9 @@ Page({
// Calculate days planted and format date
let adoptionDate = '未知';
let daysPlanted = 0;
const daysPlanted = calculateDaysSince(plant.plantTime);
const ageBadge = getPlantAgeBadge(daysPlanted);
if (plant.plantTime) {
const start = new Date(plant.plantTime);
const now = new Date();
const diffTime = now - start;
if (diffTime > 0) {
daysPlanted = Math.floor(diffTime / (1000 * 60 * 60 * 24));
}
adoptionDate = plant.plantTime.split('T')[0];
}
@@ -70,6 +66,7 @@ Page({
location: plant.placement || '',
adoptionDate: adoptionDate,
daysPlanted: daysPlanted,
ageBadge: ageBadge,
careSchedule: carePlans
},
swiperImages: swiperImages,