优化小程序阅读页面,新增好友优惠展示逻辑,支持通过推荐人获取折扣。调整价格计算方式,确保用户在购买章节时能看到实际优惠。更新相关样式以提升用户体验。

This commit is contained in:
2026-02-12 17:08:46 +08:00
parent f1dad89434
commit 543a465682
20 changed files with 352 additions and 139 deletions

View File

@@ -166,7 +166,16 @@
<!-- 购买本章 - 直接调起支付 -->
<view class="purchase-btn purchase-section" bindtap="handlePurchaseSection">
<text class="btn-label">购买本章</text>
<text class="btn-price brand-color">¥{{section && section.price != null ? section.price : sectionPrice}}</text>
<view class="btn-price-row" wx:if="{{hasReferralDiscount}}">
<text class="btn-original-price">¥{{section && section.price != null ? section.price : sectionPrice}}</text>
<text class="btn-price brand-color">¥{{displaySectionPrice}}</text>
<text class="btn-discount-tag">省{{userDiscount}}%</text>
</view>
<view class="btn-price-row" wx:elif="{{showDiscountHint}}">
<text class="btn-price brand-color">¥{{section && section.price != null ? section.price : sectionPrice}}</text>
<text class="btn-discount-tag">好友链接立省{{userDiscount}}%</text>
</view>
<text wx:else class="btn-price brand-color">¥{{section && section.price != null ? section.price : sectionPrice}}</text>
</view>
<!-- 解锁全书 - 只有购买超过3章才显示 -->
@@ -176,8 +185,9 @@
<text class="btn-label">解锁全部 {{totalSections}} 章</text>
</view>
<view class="btn-right">
<text class="btn-price">¥{{fullBookPrice || 9.9}}</text>
<text class="btn-discount">省82%</text>
<text class="btn-original-price" wx:if="{{hasReferralDiscount}}">¥{{fullBookPrice || 9.9}}</text>
<text class="btn-price">¥{{hasReferralDiscount ? displayFullBookPrice : (fullBookPrice || 9.9)}}</text>
<text class="btn-discount">{{hasReferralDiscount ? '省' + userDiscount + '%' : '省82%'}}</text>
</view>
</view>
</view>