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:
2026-07-22 14:05:30 +08:00
parent b3b58e66fb
commit 70ff806042
79 changed files with 2397 additions and 146070 deletions

View File

@@ -3,23 +3,40 @@ const app = getApp();
Component({
properties: {
title: { type: String, value: '' },
showBack: { type: Boolean, value: false }
showBack: { type: Boolean, value: false },
// 拦截返回:为 true 时点击返回仅触发 bind:back 事件,由页面自行处理(如未保存草稿确认)
interceptBack: { type: Boolean, value: false }
},
data: {
statusBarHeight: 20
statusBarHeight: 20,
// 运行期根据页面栈动态决定:只有确实存在上一页时才显示返回键,
// 避免在底部 tab 根页(页面栈深度 = 1误显示返回键
canBack: false
},
lifetimes: {
attached() {
const h = (app.globalData && app.globalData.statusBarHeight) || 20;
this.setData({ statusBarHeight: h });
const pages = getCurrentPages();
this.setData({
statusBarHeight: h,
canBack: pages.length > 1
});
}
},
methods: {
onBack() {
const pages = getCurrentPages();
// 页面要求自行处理返回逻辑(典型场景:编辑页有未保存内容需确认)
if (this.data.interceptBack) {
this.triggerEvent('back');
return;
}
if (pages.length > 1) {
wx.navigateBack();
wx.navigateBack({ delta: 1 });
} else {
// 兜底:确实没有上一页时回到首页(正常 tab 根页不会显示返回键,此为保险)
wx.reLaunch({ url: '/pages/index/index' });
}
}

View File

@@ -1,7 +1,14 @@
<view class="navbar">
<view class="navbar__status" style="height: {{statusBarHeight}}px;"></view>
<view class="navbar__bar">
<view wx:if="{{showBack}}" class="navbar__back" bindtap="onBack"></view>
<view
wx:if="{{showBack && canBack}}"
class="navbar__back"
hover-class="navbar__back--hover"
hover-stay-time="80"
bindtap="onBack">
<view class="navbar__arrow"></view>
</view>
<view wx:if="{{title}}" class="navbar__title">{{title}}</view>
</view>
</view>

View File

@@ -10,20 +10,51 @@
display: flex;
align-items: center;
position: relative;
padding: 0 28rpx;
padding: 0 24rpx;
}
/* 返回键:整块左侧区域可点,热区远大于图标本身 */
.navbar__back {
font-size: 56rpx;
color: var(--gold);
line-height: 1;
width: 60rpx;
position: relative;
width: 72rpx;
height: 88rpx;
display: flex;
align-items: center;
justify-content: flex-start;
margin-left: -10rpx; /* 让箭头更贴近系统返回键位置 */
z-index: 2;
}
/* 扩展可点热区,提升命中率(左右留白也算可点) */
.navbar__back::after {
content: '';
position: absolute;
left: 0;
right: -24rpx;
top: 0;
bottom: 0;
}
.navbar__back--hover { opacity: 0.5; }
/* 用 CSS 绘制清晰、较粗的左箭头,避免依赖字体渲染 字符 */
.navbar__arrow {
width: 20rpx;
height: 20rpx;
border-left: 5rpx solid var(--gold);
border-bottom: 5rpx solid var(--gold);
transform: rotate(45deg);
margin-left: 14rpx;
box-sizing: border-box;
}
.navbar__title {
position: absolute;
left: 0; right: 0;
left: 0;
right: 0;
text-align: center;
font-size: 34rpx;
font-weight: 700;
letter-spacing: 2rpx;
color: var(--text);
z-index: 1;
pointer-events: none; /* 不拦截返回键的点击 */
}