feat: ai问答
This commit is contained in:
@@ -79,13 +79,32 @@ Page({
|
||||
imageUrl = item.imgList[0].url;
|
||||
}
|
||||
|
||||
// Type → icon/color mapping
|
||||
const typeConfig = {
|
||||
growth: { icon: 'thumb-up', color: '#4CAF50', accent: '#E8F5E9' },
|
||||
flower: { icon: 'heart', color: '#E91E63', accent: '#FCE4EC' },
|
||||
repot: { icon: 'swap', color: '#FF9800', accent: '#FFF3E0' },
|
||||
prune: { icon: 'cut', color: '#9C27B0', accent: '#F3E5F5' },
|
||||
fertilize: { icon: 'edit-1', color: '#FF9800', accent: '#FFF8E1' },
|
||||
soil: { icon: 'layers', color: '#795548', accent: '#EFEBE9' },
|
||||
pest: { icon: 'error-circle', color: '#F44336', accent: '#FFEBEE' },
|
||||
medicine: { icon: 'heart-filled', color: '#E91E63', accent: '#FCE4EC' },
|
||||
move: { icon: 'map-navigation', color: '#00BCD4', accent: '#E0F7FA' },
|
||||
other: { icon: 'file', color: '#2196F3', accent: '#E3F2FD' },
|
||||
};
|
||||
const tag = item.tag || 'other';
|
||||
const cfg = typeConfig[tag] || typeConfig.other;
|
||||
|
||||
return {
|
||||
id: item.id,
|
||||
date: item.createdAtStr ? item.createdAtStr.split(' ')[0] : '',
|
||||
type: item.tag || 'growth',
|
||||
type: tag,
|
||||
title: item.name || '成长记录',
|
||||
content: item.content || item.desc || '',
|
||||
image: imageUrl
|
||||
image: imageUrl,
|
||||
iconName: cfg.icon,
|
||||
iconColor: cfg.color,
|
||||
accentColor: cfg.accent,
|
||||
};
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user