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:
29
miniprogram/components/level-tag/index.js
Normal file
29
miniprogram/components/level-tag/index.js
Normal file
@@ -0,0 +1,29 @@
|
||||
// 难度等级标签:beginner / intermediate / advanced / all
|
||||
const MAP = {
|
||||
beginner: { text: '新手入门', color: '#3FBF7F', bg: 'rgba(63,191,127,0.14)' },
|
||||
intermediate: { text: '进阶提升', color: '#5B9DF9', bg: 'rgba(91,157,249,0.14)' },
|
||||
advanced: { text: '高级挑战', color: '#F08A5D', bg: 'rgba(240,138,93,0.14)' },
|
||||
all: { text: '全阶段', color: '#58C9B9', bg: 'rgba(88,201,185,0.14)' }
|
||||
};
|
||||
|
||||
Component({
|
||||
properties: {
|
||||
level: { type: String, value: 'all' },
|
||||
label: { type: String, value: '' }
|
||||
},
|
||||
data: {
|
||||
text: '全阶段',
|
||||
color: '#58C9B9',
|
||||
bg: 'rgba(88,201,185,0.14)'
|
||||
},
|
||||
observers: {
|
||||
'level, label': function (level, label) {
|
||||
const m = MAP[level] || MAP.all;
|
||||
this.setData({
|
||||
text: label || m.text,
|
||||
color: m.color,
|
||||
bg: m.bg
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
4
miniprogram/components/level-tag/index.json
Normal file
4
miniprogram/components/level-tag/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
miniprogram/components/level-tag/index.wxml
Normal file
1
miniprogram/components/level-tag/index.wxml
Normal file
@@ -0,0 +1 @@
|
||||
<view class="lvl" style="color: {{color}}; background: {{bg}};">{{text}}</view>
|
||||
9
miniprogram/components/level-tag/index.wxss
Normal file
9
miniprogram/components/level-tag/index.wxss
Normal file
@@ -0,0 +1,9 @@
|
||||
.lvl {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
font-size: 20rpx;
|
||||
font-weight: 600;
|
||||
padding: 6rpx 16rpx;
|
||||
border-radius: 999rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
Reference in New Issue
Block a user