fix: resolve footer email typo, unify assistant naming, add German scientific team context, add tooltips definitions, and optimize homepage featured products category diversity
This commit is contained in:
1 parent
67d6f71d7a
commit
a92b1a61ff
5 files changed
+39
-7
No files matched your search
@@ -129,5 +129,17 @@ export const SCIENTIFIC_TERMS: Record<string, ScientificTerm> = {
|
||||
term: "تورین (Taurine)",
|
||||
definition: "آمینو اسید بسیار ضروری برای گربهها جهت جلوگیری از دژنراسیون شبکیه (نابینایی) و نارسایی قلبی.",
|
||||
wikiId: "taurin"
|
||||
},
|
||||
"گرید دارویی": {
|
||||
term: "گرید دارویی (Pharmaceutical Grade)",
|
||||
definition: "بالاترین سطح خلوص مواد اولیه؛ تهیه شده با استانداردهای دارویی انسان و کاملاً بیخطر در صورت لیسیده شدن توسط حیوان."
|
||||
},
|
||||
"IFS": {
|
||||
term: "استاندارد بینالمللی IFS",
|
||||
definition: "سختگیرانهترین استاندارد ایمنی و کیفیت محصولات دارویی و غذایی در اروپا."
|
||||
},
|
||||
"HACCP": {
|
||||
term: "سیستم کنترل بحران HACCP",
|
||||
definition: "تضمینکننده عدم وجود هرگونه آلودگی فیزیکی، شیمیایی یا میکروبی در زنجیره تولید محصولات."
|
||||
}
|
||||
};
|
||||
@@ -127,8 +127,28 @@ export class ProductService {
|
||||
|
||||
public async getFeaturedProducts(): Promise<Product[]> {
|
||||
try {
|
||||
const response = await api.get('/products');
|
||||
return response.data.data.slice(0, 4).map((item: any) => this.mapBackendToFrontend(item));
|
||||
const response = await api.get('/products?limit=30');
|
||||
const all = response.data.data.map((item: any) => this.mapBackendToFrontend(item));
|
||||
const featured: Product[] = [];
|
||||
const categoriesSeen = new Set<string>();
|
||||
|
||||
for (const p of all) {
|
||||
if (p.category && !categoriesSeen.has(p.category)) {
|
||||
featured.push(p);
|
||||
categoriesSeen.add(p.category);
|
||||
}
|
||||
if (featured.length === 4) break;
|
||||
}
|
||||
|
||||
if (featured.length < 4) {
|
||||
for (const p of all) {
|
||||
if (!featured.some(f => f.id === p.id)) {
|
||||
featured.push(p);
|
||||
}
|
||||
if (featured.length === 4) break;
|
||||
}
|
||||
}
|
||||
return featured;
|
||||
} catch (error) {
|
||||
console.error("[ProductService] Failed to fetch featured products:", error);
|
||||
return [];
|
||||
|
||||
Reference in new issue
Block a user