This commit is contained in:
Alex-larget
2026-03-18 17:54:32 +08:00
parent f8d7858825
commit 0f3933fabd
27 changed files with 50 additions and 31 deletions

View File

@@ -13,9 +13,9 @@ const DEFAULT_WITHDRAW_TMPL_ID = 'u3MbZGPRkrZIk-I7QdpwzFxnO_CeQPaCWF2FkiIablE'
App({
globalData: {
// API 基础地址:开发时修改下面一行切换环境
// baseUrl: "https://soulapi.quwanzhi.com",
baseUrl: "https://soulapi.quwanzhi.com",
// baseUrl: 'http://localhost:8080', // 开发
baseUrl: 'https://souldev.quwanzhi.com', // 测试
// baseUrl: 'https://souldev.quwanzhi.com', // 测试
// 小程序配置 - 真实AppID
appId: DEFAULT_APP_ID,
@@ -60,6 +60,7 @@ App({
systemInfo: null,
statusBarHeight: 44,
navBarHeight: 88,
capsuleRightPadding: 96, // 胶囊右侧留白(px)getSystemInfo 会按 menuButton 计算
// TabBar相关
currentTab: 0,
@@ -282,10 +283,12 @@ App({
this.globalData.isSinglePageMode = true
}
// 计算导航栏高度
// 计算导航栏高度与胶囊避让
const menuButton = wx.getMenuButtonBoundingClientRect()
if (menuButton) {
this.globalData.navBarHeight = (menuButton.top - systemInfo.statusBarHeight) * 2 + menuButton.height + systemInfo.statusBarHeight
// 胶囊右侧留白px供自定义导航栏避开胶囊
this.globalData.capsuleRightPadding = (systemInfo.windowWidth || 375) - menuButton.left + 8
}
} catch (e) {
console.error('获取系统信息失败:', e)

View File

@@ -122,6 +122,7 @@ Component({
'image': s + '<rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>',
'gift': s + '<polyline points="20 12 20 22 4 22 4 12"/><rect x="2" y="7" width="20" height="5"/><line x1="12" y1="22" x2="12" y2="7"/><path d="M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z"/><path d="M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z"/></svg>',
'lock': s + '<rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>',
'lock-open': s + '<rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 9.9-1"/></svg>',
'sparkles': s + '<path d="m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z"/></svg>',
'save': s + '<path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"/><polyline points="17 21 17 13 7 13 7 21"/><polyline points="7 3 7 8 15 8"/></svg>',
'globe': s + '<circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>',

View File

@@ -1,7 +1,7 @@
<!--关于作者-->
<view class="page">
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
<view class="nav-back" bindtap="goBack"></view>
<view class="nav-back" bindtap="goBack"><icon name="chevron-left" size="44" color="rgba(255,255,255,0.8)" customClass="back-icon"></icon></view>
<text class="nav-title">关于作者</text>
<view class="nav-placeholder"></view>
</view>

View File

@@ -3,7 +3,7 @@
<!-- 导航栏 -->
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
<view class="nav-back" bindtap="goBack">
<text class="back-icon"></text>
<icon name="chevron-left" size="44" color="rgba(255,255,255,0.8)" customClass="back-icon"></icon>
</view>
<text class="nav-title">收货地址</text>
<view class="nav-placeholder"></view>

View File

@@ -3,7 +3,7 @@
<!-- 导航栏 -->
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
<view class="nav-back" bindtap="goBack">
<text class="back-icon"></text>
<icon name="chevron-left" size="44" color="rgba(255,255,255,0.8)" customClass="back-icon"></icon>
</view>
<text class="nav-title">{{isEdit ? '编辑地址' : '新增地址'}}</text>
<view class="nav-placeholder"></view>

View File

@@ -1,7 +1,7 @@
<!--用户协议页 - 审核要求可点击查看-->
<view class="page">
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
<view class="nav-back" bindtap="goBack"></view>
<view class="nav-back" bindtap="goBack"><icon name="chevron-left" size="44" color="rgba(255,255,255,0.8)" customClass="back-icon"></icon></view>
<text class="nav-title">用户协议</text>
<view class="nav-placeholder"></view>
</view>

View File

@@ -1,7 +1,7 @@
<!--Soul创业派对 - 头像昵称引导页,仅头像+昵称-->
<view class="page">
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
<view class="nav-back" bindtap="goBack"><text class="back-icon"></text></view>
<view class="nav-back" bindtap="goBack"><icon name="chevron-left" size="44" color="rgba(255,255,255,0.8)" customClass="back-icon"></icon></view>
<text class="nav-title">完善资料</text>
<view class="nav-placeholder"></view>
</view>

View File

@@ -91,7 +91,10 @@
<block wx:for="{{chapter.sections}}" wx:key="id" wx:for-item="section">
<view class="section-item" bindtap="goToRead" data-id="{{section.id}}" data-mid="{{section.mid}}">
<view class="section-left">
<text class="section-lock {{section.isFree || isVip || (!section.isPremium && hasFullBook) || purchasedSections.indexOf(section.id) > -1 ? 'lock-open' : 'lock-closed'}}">{{section.isFree || isVip || (!section.isPremium && hasFullBook) || purchasedSections.indexOf(section.id) > -1 ? '○' : '●'}}</text>
<view class="section-lock-wrap">
<icon wx:if="{{section.isFree || isVip || (!section.isPremium && hasFullBook) || purchasedSections.indexOf(section.id) > -1}}" name="lock-open" size="24" color="#00CED1" customClass="section-lock lock-open"></icon>
<icon wx:else name="lock" size="24" color="rgba(255,255,255,0.3)" customClass="section-lock lock-closed"></icon>
</view>
<text class="section-title {{section.isFree || isVip || (!section.isPremium && hasFullBook) || purchasedSections.indexOf(section.id) > -1 ? '' : 'text-muted'}}">{{section.id}} {{section.title}}</text>
<text wx:if="{{section.isNew}}" class="tag tag-new">NEW</text>
</view>

View File

@@ -471,6 +471,14 @@
flex-shrink: 0;
}
.section-lock-wrap {
min-width: 32rpx;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
}
.lock-open {
color: #00CED1;
}

View File

@@ -3,7 +3,7 @@
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
<view class="nav-content">
<view class="nav-back" bindtap="goBack">
<text class="back-arrow"></text>
<icon name="chevron-left" size="44" color="#ffffff" customClass="back-arrow"></icon>
</view>
<view class="nav-info">
<text class="nav-title">{{isInitiator ? '代付分享' : (detail.action === 'redeem' ? '免费领取' : '代付详情')}}</text>

View File

@@ -3,7 +3,7 @@
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
<view class="nav-content">
<view class="nav-back" bindtap="goBack">
<text class="back-arrow"></text>
<icon name="chevron-left" size="44" color="#ffffff" customClass="back-arrow"></icon>
</view>
<view class="nav-info">
<text class="nav-title">我发起的代付</text>

View File

@@ -3,7 +3,7 @@
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
<view class="nav-content">
<view class="nav-back" bindtap="goBack">
<text class="back-arrow"></text>
<icon name="chevron-left" size="44" color="#ffffff" customClass="back-arrow"></icon>
</view>
<view class="nav-info">
<text class="nav-title">领取详情</text>

View File

@@ -3,7 +3,7 @@
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
<view class="nav-content" style="height: {{navBarHeight - statusBarHeight}}px;">
<view class="nav-back" bindtap="goBack">
<text class="back-arrow"></text>
<icon name="chevron-left" size="44" color="#ffffff" customClass="back-arrow"></icon>
</view>
<view class="nav-title">
<text class="nav-title-text">{{title}}</text>

View File

@@ -3,7 +3,7 @@
<!-- 导航栏 -->
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
<view class="nav-back" bindtap="goBack">
<text class="nav-icon"></text>
<icon name="chevron-left" size="44" color="#5EEAD4" customClass="nav-icon"></icon>
</view>
<text class="nav-title">个人资料</text>
<view class="nav-placeholder"></view>

View File

@@ -1,7 +1,7 @@
<!-- 导师详情 -->
<view class="page">
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
<view class="nav-back" bindtap="goBack"><text class="back-icon"></text></view>
<view class="nav-back" bindtap="goBack"><icon name="chevron-left" size="44" color="rgba(255,255,255,0.8)" customClass="back-icon"></icon></view>
<text class="nav-title">导师详情</text>
<view class="nav-placeholder-r"></view>
</view>

View File

@@ -1,7 +1,7 @@
<!-- 选择导师 -->
<view class="page">
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
<view class="nav-back" bindtap="goBack"><text class="back-icon"></text></view>
<view class="nav-back" bindtap="goBack"><icon name="chevron-left" size="44" color="rgba(255,255,255,0.8)" customClass="back-icon"></icon></view>
<text class="nav-title">选择导师</text>
<view class="nav-placeholder-r"></view>
</view>

View File

@@ -1,7 +1,7 @@
<!--隐私政策页 - 审核要求可点击查看-->
<view class="page">
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
<view class="nav-back" bindtap="goBack"></view>
<view class="nav-back" bindtap="goBack"><icon name="chevron-left" size="44" color="rgba(255,255,255,0.8)" customClass="back-icon"></icon></view>
<text class="nav-title">隐私政策</text>
<view class="nav-placeholder"></view>
</view>

View File

@@ -1,7 +1,7 @@
<!-- 个人资料展示页 - enhanced_professional_profile 1:1 重构 -->
<view class="page">
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
<view class="nav-back" bindtap="goBack"><text class="back-icon"></text></view>
<view class="nav-back" bindtap="goBack"><icon name="chevron-left" size="44" color="#5EEAD4" customClass="back-icon"></icon></view>
<text class="nav-title">个人资料</text>
<view class="nav-right" bindtap="goToEdit"><text class="nav-more">⋯</text></view>
</view>

View File

@@ -1,7 +1,7 @@
<!--订单页-->
<view class="page">
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
<view class="nav-back" bindtap="goBack"></view>
<view class="nav-back" bindtap="goBack"><icon name="chevron-left" size="44" color="rgba(255,255,255,0.8)" customClass="back-icon"></icon></view>
<text class="nav-title">我的订单</text>
<view class="nav-placeholder"></view>
</view>

View File

@@ -10,7 +10,7 @@
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
<view class="nav-content">
<view class="nav-back" bindtap="goBack">
<text class="back-arrow"></text>
<icon name="chevron-left" size="44" color="#ffffff" customClass="back-arrow"></icon>
</view>
<view class="nav-info">
<text class="nav-chapter" wx:if="{{section.title || chapterTitle}}">{{section.title || chapterTitle}}</text>

View File

@@ -8,6 +8,8 @@ const { trackClick } = require('../../utils/trackClick')
Page({
data: {
statusBarHeight: 44,
navBarHeight: 88,
capsuleRightPadding: 96,
keyword: '',
results: [],
loading: false,
@@ -28,7 +30,9 @@ Page({
onLoad() {
wx.showShareMenu({ withShareTimeline: true })
this.setData({
statusBarHeight: app.globalData.statusBarHeight || 44
statusBarHeight: app.globalData.statusBarHeight || 44,
navBarHeight: app.globalData.navBarHeight || 88,
capsuleRightPadding: app.globalData.capsuleRightPadding || 96
})
// 加载热门章节
this.loadHotChapters()

View File

@@ -1,11 +1,11 @@
<!--pages/search/search.wxml-->
<!--章节搜索页-->
<view class="page">
<!-- 自定义导航栏 -->
<!-- 自定义导航栏(避开胶囊) -->
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
<view class="nav-content">
<view class="nav-content" style="height: {{navBarHeight - statusBarHeight}}px; padding-right: {{capsuleRightPadding}}px;">
<view class="back-btn" bindtap="goBack">
<text class="back-icon"></text>
<icon name="chevron-left" size="40" color="#8e8e93" customClass="back-icon"></icon>
</view>
<view class="search-input-wrap">
<view class="search-icon-small"><icon name="search" size="36" color="#8e8e93"></icon></view>
@@ -18,14 +18,14 @@
confirm-type="search"
focus="{{true}}"
/>
<view class="clear-btn" wx:if="{{keyword}}" bindtap="clearSearch">×</view>
<view class="clear-btn" wx:if="{{keyword}}" bindtap="clearSearch"><icon name="x" size="32" color="#8e8e93"></icon></view>
</view>
<view class="search-btn" bindtap="doSearch">搜索</view>
</view>
</view>
<!-- 主内容区 -->
<view class="main-content" style="padding-top: {{statusBarHeight + 56}}px;">
<view class="main-content" style="padding-top: {{navBarHeight}}px;">
<!-- 热门搜索(未搜索时显示) -->
<view class="hot-section" wx:if="{{!searched}}">

View File

@@ -20,7 +20,7 @@
display: flex;
align-items: center;
padding: 8rpx 24rpx;
height: 88rpx;
/* height、padding-right 由 wxml 内联传入,以避开胶囊 */
}
.back-btn {

View File

@@ -2,7 +2,7 @@
<view class="page">
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
<view class="nav-back" bindtap="goBack">
<text class="back-icon"></text>
<icon name="chevron-left" size="44" color="rgba(255,255,255,0.6)" customClass="back-icon"></icon>
</view>
<text class="nav-title">设置</text>
<view class="nav-placeholder"></view>

View File

@@ -2,7 +2,7 @@
<view class="page">
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
<view class="nav-back" bindtap="goBack">
<text class="back-icon"></text>
<icon name="chevron-left" size="44" color="#ffffff" customClass="back-icon"></icon>
</view>
<text class="nav-title">卡若创业派对</text>
<view class="nav-placeholder-r"></view>

View File

@@ -2,7 +2,7 @@
<view class="page">
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
<view class="nav-back" bindtap="goBack">
<text class="back-icon"></text>
<icon name="chevron-left" size="44" color="rgba(255,255,255,0.8)" customClass="back-icon"></icon>
</view>
<text class="nav-title">我的余额</text>
<view class="nav-placeholder"></view>

View File

@@ -1,6 +1,6 @@
<view class="page">
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
<view class="nav-back" bindtap="goBack"></view>
<view class="nav-back" bindtap="goBack"><icon name="chevron-left" size="44" color="rgba(255,255,255,0.8)" customClass="back-icon"></icon></view>
<text class="nav-title">提现记录</text>
<view class="nav-placeholder"></view>
</view>