feat: 整体页面优化,删除无用svg

This commit is contained in:
Blizzard
2026-02-14 08:32:47 +08:00
parent daea00ca60
commit cbbe82ef63
59 changed files with 1265 additions and 342 deletions
+3 -2
View File
@@ -1,5 +1,5 @@
// pages/garden/add/index.js
import { CARE_TASK_ICONS } from '../../../utils/mockData';
import { CARE_TASK_ICONS } from '../../../utils/constant';
import request from '../../../utils/request';
import { requestSubscription, checkSubscriptionSettings } from '../../../utils/subscribe';
@@ -253,7 +253,8 @@ Page({
const carePlans = newCareTasks.map(task => ({
name: task.taskName || '未命名事项',
period: parseInt(task.frequencyValue) || 1,
icon: JSON.stringify(task.taskIcon || {}) // Serialize icon details
icon: JSON.stringify(task.taskIcon || {}), // Serialize icon details
targetAction: (task.taskIcon && task.taskIcon.targetAction) ? task.taskIcon.targetAction : ''
}));
// Construct Payload
+24 -3
View File
@@ -12,7 +12,8 @@ Page({
pageSize: 6,
total: 0,
isLastPage: false,
isLoading: false
isLoading: false,
scrollTop: 0
},
onLoad(options) {
@@ -66,9 +67,23 @@ Page({
const mappedList = list.map(item => {
let imageUrl = '';
if (item.imgList && item.imgList.length > 0) {
imageUrl = item.imgList[0].url;
imageUrl = item.imgList[0].url || '';
}
return { ...item, images: [imageUrl] };
// Calculate days
let days = 1;
if (item.plantTime) {
try {
const start = new Date(item.plantTime).getTime();
const now = Date.now();
const diff = now - start;
if (diff > 0) {
days = Math.ceil(diff / (1000 * 60 * 60 * 24));
}
} catch (e) { }
}
return { ...item, images: [imageUrl], daysPlanted: days };
});
this.setData({
@@ -139,5 +154,11 @@ Page({
return {
title: '我的植物花园 - Sundynix Plant'
};
},
onTabItemTap() {
// Reset scroll when switching to this tab
// Use random small value to force data change detection
this.setData({ scrollTop: Math.random() * 0.01 });
}
})
+1 -1
View File
@@ -45,7 +45,7 @@
</view>
</view>
<scroll-view wx:else scroll-y class="garden-list-container" enhanced show-scrollbar="{{false}}" bindscrolltolower="onScrollLower">
<scroll-view wx:else scroll-y class="garden-list-container" enhanced show-scrollbar="{{false}}" bindscrolltolower="onScrollLower" scroll-top="{{scrollTop}}">
<view class="plant-grid">
<view wx:for="{{plants}}" wx:key="id" class="plant-card" bindtap="navigateToDetail" data-id="{{item.id}}">
<view class="plant-image-container">