feat: 完整重构小程序匹配功能 + 修复UI对齐 + 文章数据API
主要更新: 1. 按H5网页端完全重构匹配功能(match页面) - 4种匹配类型: 创业合伙/资源对接/导师顾问/团队招募 - 资源对接等类型弹出手机号/微信号输入框 - 去掉重新匹配按钮,改为返回按钮 2. 修复所有卡片对齐和宽度问题 - 目录页附录卡片居中 - 首页阅读进度卡片满宽度 - 我的页面菜单卡片对齐 - 推广中心分享卡片统一宽度 3. 修复目录页图标和文字对齐 - section-icon固定40rpx宽高 - section-title与图标垂直居中 4. 更新真实完整文章标题(62篇) - 从book目录读取真实markdown文件名 - 替换之前的简化标题 5. 新增文章数据API - /api/db/chapters - 获取完整书籍结构 - 支持按ID获取单篇文章内容
This commit is contained in:
51
miniprogram/custom-tab-bar/index.js
Normal file
51
miniprogram/custom-tab-bar/index.js
Normal file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* Soul创业实验 - 自定义TabBar组件
|
||||
* 实现中间突出的"找伙伴"按钮
|
||||
*/
|
||||
|
||||
Component({
|
||||
data: {
|
||||
selected: 0,
|
||||
color: '#8e8e93',
|
||||
selectedColor: '#00CED1',
|
||||
list: [
|
||||
{
|
||||
pagePath: '/pages/index/index',
|
||||
text: '首页',
|
||||
iconType: 'home'
|
||||
},
|
||||
{
|
||||
pagePath: '/pages/chapters/chapters',
|
||||
text: '目录',
|
||||
iconType: 'list'
|
||||
},
|
||||
{
|
||||
pagePath: '/pages/match/match',
|
||||
text: '找伙伴',
|
||||
iconType: 'match',
|
||||
isSpecial: true
|
||||
},
|
||||
{
|
||||
pagePath: '/pages/my/my',
|
||||
text: '我的',
|
||||
iconType: 'user'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
attached() {
|
||||
// 初始化时获取当前页面
|
||||
},
|
||||
|
||||
methods: {
|
||||
switchTab(e) {
|
||||
const data = e.currentTarget.dataset
|
||||
const url = data.path
|
||||
const index = data.index
|
||||
|
||||
if (this.data.selected === index) return
|
||||
|
||||
wx.switchTab({ url })
|
||||
}
|
||||
}
|
||||
})
|
||||
3
miniprogram/custom-tab-bar/index.json
Normal file
3
miniprogram/custom-tab-bar/index.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"component": true
|
||||
}
|
||||
56
miniprogram/custom-tab-bar/index.wxml
Normal file
56
miniprogram/custom-tab-bar/index.wxml
Normal file
@@ -0,0 +1,56 @@
|
||||
<!--custom-tab-bar/index.wxml-->
|
||||
<view class="tab-bar">
|
||||
<view class="tab-bar-border"></view>
|
||||
|
||||
<!-- 首页 -->
|
||||
<view class="tab-bar-item" data-path="{{list[0].pagePath}}" data-index="0" bindtap="switchTab">
|
||||
<view class="icon-wrapper">
|
||||
<!-- 首页图标 -->
|
||||
<view class="icon {{selected === 0 ? 'icon-active' : ''}}">
|
||||
<view class="icon-home">
|
||||
<view class="home-roof"></view>
|
||||
<view class="home-body"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tab-bar-text" style="color: {{selected === 0 ? selectedColor : color}}">{{list[0].text}}</view>
|
||||
</view>
|
||||
|
||||
<!-- 目录 -->
|
||||
<view class="tab-bar-item" data-path="{{list[1].pagePath}}" data-index="1" bindtap="switchTab">
|
||||
<view class="icon-wrapper">
|
||||
<view class="icon {{selected === 1 ? 'icon-active' : ''}}">
|
||||
<view class="icon-list">
|
||||
<view class="list-line"></view>
|
||||
<view class="list-line"></view>
|
||||
<view class="list-line"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tab-bar-text" style="color: {{selected === 1 ? selectedColor : color}}">{{list[1].text}}</view>
|
||||
</view>
|
||||
|
||||
<!-- 找伙伴 - 中间突出按钮 -->
|
||||
<view class="tab-bar-item special-item" data-path="{{list[2].pagePath}}" data-index="2" bindtap="switchTab">
|
||||
<view class="special-button {{selected === 2 ? 'special-active' : ''}}">
|
||||
<view class="icon-users">
|
||||
<view class="user-circle user-1"></view>
|
||||
<view class="user-circle user-2"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tab-bar-text special-text" style="color: {{selected === 2 ? selectedColor : color}}">{{list[2].text}}</view>
|
||||
</view>
|
||||
|
||||
<!-- 我的 -->
|
||||
<view class="tab-bar-item" data-path="{{list[3].pagePath}}" data-index="3" bindtap="switchTab">
|
||||
<view class="icon-wrapper">
|
||||
<view class="icon {{selected === 3 ? 'icon-active' : ''}}">
|
||||
<view class="icon-user">
|
||||
<view class="user-head"></view>
|
||||
<view class="user-body"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tab-bar-text" style="color: {{selected === 3 ? selectedColor : color}}">{{list[3].text}}</view>
|
||||
</view>
|
||||
</view>
|
||||
227
miniprogram/custom-tab-bar/index.wxss
Normal file
227
miniprogram/custom-tab-bar/index.wxss
Normal file
@@ -0,0 +1,227 @@
|
||||
/**
|
||||
* Soul创业实验 - 自定义TabBar样式
|
||||
* 实现中间突出的"找伙伴"按钮
|
||||
*/
|
||||
|
||||
.tab-bar {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 100rpx;
|
||||
background: rgba(28, 28, 30, 0.95);
|
||||
backdrop-filter: blur(40rpx);
|
||||
-webkit-backdrop-filter: blur(40rpx);
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.tab-bar-border {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 1rpx;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
}
|
||||
|
||||
.tab-bar-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 10rpx 0 16rpx;
|
||||
}
|
||||
|
||||
.icon-wrapper {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 4rpx;
|
||||
}
|
||||
|
||||
.icon {
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.tab-bar-text {
|
||||
font-size: 22rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
/* ===== 首页图标 ===== */
|
||||
.icon-home {
|
||||
position: relative;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
.home-roof {
|
||||
position: absolute;
|
||||
top: 4rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 18rpx solid transparent;
|
||||
border-right: 18rpx solid transparent;
|
||||
border-bottom: 14rpx solid #8e8e93;
|
||||
}
|
||||
|
||||
.home-body {
|
||||
position: absolute;
|
||||
bottom: 4rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 28rpx;
|
||||
height: 18rpx;
|
||||
background: #8e8e93;
|
||||
border-radius: 0 0 4rpx 4rpx;
|
||||
}
|
||||
|
||||
.icon-active .home-roof {
|
||||
border-bottom-color: #00CED1;
|
||||
}
|
||||
|
||||
.icon-active .home-body {
|
||||
background: #00CED1;
|
||||
}
|
||||
|
||||
/* ===== 目录图标 ===== */
|
||||
.icon-list {
|
||||
width: 36rpx;
|
||||
height: 32rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.list-line {
|
||||
width: 100%;
|
||||
height: 6rpx;
|
||||
background: #8e8e93;
|
||||
border-radius: 3rpx;
|
||||
}
|
||||
|
||||
.list-line:nth-child(2) {
|
||||
width: 75%;
|
||||
}
|
||||
|
||||
.list-line:nth-child(3) {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.icon-active .list-line {
|
||||
background: #00CED1;
|
||||
}
|
||||
|
||||
/* ===== 我的图标 ===== */
|
||||
.icon-user {
|
||||
position: relative;
|
||||
width: 36rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
.user-head {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 16rpx;
|
||||
height: 16rpx;
|
||||
background: #8e8e93;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.user-body {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 28rpx;
|
||||
height: 18rpx;
|
||||
background: #8e8e93;
|
||||
border-radius: 14rpx 14rpx 0 0;
|
||||
}
|
||||
|
||||
.icon-active .user-head,
|
||||
.icon-active .user-body {
|
||||
background: #00CED1;
|
||||
}
|
||||
|
||||
/* ===== 找伙伴 - 中间特殊按钮 ===== */
|
||||
.special-item {
|
||||
position: relative;
|
||||
margin-top: -32rpx;
|
||||
}
|
||||
|
||||
.special-button {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
border-radius: 50%;
|
||||
background: linear-gradient(135deg, #00CED1 0%, #20B2AA 100%);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 8rpx 32rpx rgba(0, 206, 209, 0.4);
|
||||
margin-bottom: 4rpx;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.special-button:active {
|
||||
transform: scale(0.95);
|
||||
}
|
||||
|
||||
.special-active {
|
||||
box-shadow: 0 8rpx 40rpx rgba(0, 206, 209, 0.6);
|
||||
}
|
||||
|
||||
.special-text {
|
||||
margin-top: 4rpx;
|
||||
}
|
||||
|
||||
/* ===== 找伙伴图标 (双人) ===== */
|
||||
.icon-users {
|
||||
position: relative;
|
||||
width: 56rpx;
|
||||
height: 44rpx;
|
||||
}
|
||||
|
||||
.user-circle {
|
||||
position: absolute;
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
border-radius: 50%;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.user-circle::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: -12rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 22rpx;
|
||||
height: 14rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 11rpx 11rpx 0 0;
|
||||
}
|
||||
|
||||
.user-1 {
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.user-2 {
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
Reference in New Issue
Block a user