优化小程序阅读页面逻辑,动态更新章节价格和免费状态,确保用户体验流畅。移除硬编码价格,支持通过接口返回的值进行展示。更新用户地址管理逻辑,简化获取地址的流程,提升代码可读性。

This commit is contained in:
2026-02-13 16:36:38 +08:00
parent 76624605a5
commit 35b669c31e
13 changed files with 469 additions and 187 deletions

View File

@@ -22,6 +22,9 @@ type User struct {
IsAdmin *bool `gorm:"column:is_admin" json:"isAdmin,omitempty"`
WithdrawnEarnings *float64 `gorm:"column:withdrawn_earnings;type:decimal(10,2)" json:"withdrawnEarnings,omitempty"`
Source *string `gorm:"column:source;size:50" json:"source,omitempty"`
// 以下为接口返回时从订单/绑定表实时计算的字段,不入库
PurchasedSectionCount int `gorm:"-" json:"purchasedSectionCount,omitempty"`
}
func (User) TableName() string { return "users" }