Enhance mini program environment configuration and chapter loading logic

- Introduced a debugging environment configuration in app.js, allowing for dynamic API endpoint selection based on the environment.
- Implemented lazy loading for chapter parts in chapters.js, improving performance by only fetching necessary data.
- Updated UI elements in chapters.wxml to reflect changes in chapter loading and added loading indicators.
- Enhanced error handling and data management for chapter retrieval, ensuring a smoother user experience.
- Added functionality for switching API environments in settings.js, visible only in development mode.
This commit is contained in:
Alex-larget
2026-03-14 18:04:05 +08:00
parent 1edceda4db
commit d82ef6d8e4
22 changed files with 1184 additions and 899 deletions

View File

@@ -109,6 +109,15 @@
<text class="tip-text">提示:绑定微信号才能使用提现功能</text>
</view>
<!-- 开发专用:切换 API 环境(仅开发版显示) -->
<view class="dev-switch-card" wx:if="{{isDevMode}}" bindtap="switchApiEnv">
<view class="dev-switch-inner">
<text class="dev-switch-icon">🌐</text>
<text class="dev-switch-text">切换环境</text>
<text class="dev-switch-desc">当前:{{apiEnvLabel}}(点击循环:自动→本地→测试→正式)</text>
</view>
</view>
<!-- 开发专用:切换账号(仅开发版显示) -->
<view class="dev-switch-card" wx:if="{{isDevMode}}" bindtap="openSwitchAccountModal">
<view class="dev-switch-inner">