- miniprogram/config.js: BASE_URL 指向 http://192.227.237.8:3001 - 动作标题中文化(nameZh),搜索匹配 name/nameZh/nameEn - 新增计划/收藏/我的 等页面与组件 - 后端 Docker 化(Dockerfile/.dockerignore)与翻译脚本 - .gitignore 补充 .DS_Store
28 lines
658 B
JavaScript
28 lines
658 B
JavaScript
Component({
|
||
properties: {
|
||
exercise: { type: Object, value: {} },
|
||
score: { type: Number, value: 0 },
|
||
reason: { type: String, value: '' },
|
||
compact: { type: Boolean, value: false }
|
||
},
|
||
data: {
|
||
imgSrc: '',
|
||
imgError: false
|
||
},
|
||
observers: {
|
||
// 卡片用轻量静态图(~6KB),避免 91KB 的 GIF 拖慢列表
|
||
exercise(ex) {
|
||
this.setData({ imgSrc: (ex && ex.image) || '', imgError: false });
|
||
}
|
||
},
|
||
methods: {
|
||
onImgError() {
|
||
this.setData({ imgError: true });
|
||
},
|
||
onTap() {
|
||
const ex = this.data.exercise || {};
|
||
this.triggerEvent('tap', { id: ex.id, exercise: ex });
|
||
}
|
||
}
|
||
});
|