feat: 小程序连接服务器IP + 同步未提交开发
- miniprogram/config.js: BASE_URL 指向 http://192.227.237.8:3001 - 动作标题中文化(nameZh),搜索匹配 name/nameZh/nameEn - 新增计划/收藏/我的 等页面与组件 - 后端 Docker 化(Dockerfile/.dockerignore)与翻译脚本 - .gitignore 补充 .DS_Store
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -8,6 +8,7 @@
|
||||
export interface RawExercise {
|
||||
id: string;
|
||||
name: string;
|
||||
nameZh?: string;
|
||||
category?: string;
|
||||
body_part: string;
|
||||
equipment: string;
|
||||
@@ -30,6 +31,8 @@ export type ExerciseType = 'strength' | 'cardio' | 'flexibility';
|
||||
export interface Exercise {
|
||||
id: string;
|
||||
name: string;
|
||||
nameZh: string;
|
||||
nameEn: string;
|
||||
bodyPart: string;
|
||||
bodyPartLabel: string;
|
||||
equipment: string;
|
||||
@@ -55,6 +58,8 @@ export interface Exercise {
|
||||
export interface ExerciseSummary {
|
||||
id: string;
|
||||
name: string;
|
||||
nameZh: string;
|
||||
nameEn: string;
|
||||
bodyPart: string;
|
||||
bodyPartLabel: string;
|
||||
equipment: string;
|
||||
|
||||
@@ -59,6 +59,8 @@ export class ExercisesService implements OnModuleInit {
|
||||
list = list.filter(
|
||||
(e) =>
|
||||
e.name.toLowerCase().includes(q) ||
|
||||
e.nameZh.toLowerCase().includes(q) ||
|
||||
e.nameEn.toLowerCase().includes(q) ||
|
||||
e.targetLabel.toLowerCase().includes(q) ||
|
||||
e.equipmentLabel.toLowerCase().includes(q) ||
|
||||
e.bodyPartLabel.toLowerCase().includes(q),
|
||||
|
||||
@@ -44,7 +44,9 @@ export function normalize(raw: RawExercise): Exercise {
|
||||
|
||||
return {
|
||||
id: raw.id,
|
||||
name: raw.name,
|
||||
name: raw.nameZh && raw.nameZh.trim() ? raw.nameZh : raw.name,
|
||||
nameZh: raw.nameZh && raw.nameZh.trim() ? raw.nameZh : raw.name,
|
||||
nameEn: raw.name,
|
||||
bodyPart: raw.body_part,
|
||||
bodyPartLabel: labelOf(BODY_PART_LABELS, raw.body_part),
|
||||
equipment: raw.equipment,
|
||||
@@ -72,6 +74,8 @@ export function toSummary(ex: Exercise): ExerciseSummary {
|
||||
return {
|
||||
id: ex.id,
|
||||
name: ex.name,
|
||||
nameZh: ex.nameZh,
|
||||
nameEn: ex.nameEn,
|
||||
bodyPart: ex.bodyPart,
|
||||
bodyPartLabel: ex.bodyPartLabel,
|
||||
equipment: ex.equipment,
|
||||
|
||||
Reference in New Issue
Block a user