From e433ef1c9cd3365f204d2bca8edd0438d81f4ca2 Mon Sep 17 00:00:00 2001
From: huliyong <2783385703@qq.com>
Date: Sun, 8 Jun 2025 17:11:15 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E9=92=B1=E5=8C=85?=
=?UTF-8?q?=E6=B5=81=E6=B0=B4=E5=8A=9F=E8=83=BD=E5=B9=B6=E4=BC=98=E5=8C=96?=
=?UTF-8?q?=E5=A4=9A=E4=B8=AA=E9=A1=B5=E9=9D=A2=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 新增钱包流水功能,包括充值记录和支付记录展示
- 新增签到记录弹窗组件
- 优化小说详情页的订阅和阅读体验
- 修复修改个人信息页面签名字段不显示的问题
- 调整章节编辑页面的付费开关样式和大小
- 优化书架页面跳转逻辑,支持直接跳转到阅读记录章节
- 修复任务中心签到状态判断逻辑
- 新增书籍状态组件,统一展示连载/完结状态
- 优化评论列表和我的评论页面显示逻辑
- 调整个人中心页面布局和样式
- 新增充值功能入口页面
- 优化章节列表和章节内容的付费标识显示
- 修复成就等级设置页面数据加载问题
- 优化打赏排行榜数据显示和交互
- 调整环境配置为开发环境
---
api/api.js | 2 +-
api/model/achievement.js | 4 +-
api/model/all_money.js | 17 +
api/model/bookshelf.js | 6 +
api/model/my_book.js | 6 +
api/model/order.js | 24 +
api/model/task.js | 6 +
components/novel/bookStatus.vue | 51 ++
components/novel/novelItem.vue | 29 +-
config.js | 2 +-
pages.json | 8 +-
pages/index/bookshelf.vue | 50 +-
pages/index/center.vue | 31 +-
pages_order/auth/Modifyinformation.vue | 7 +-
pages_order/auth/wxLogin.vue | 1 +
pages_order/author/chapterList.vue | 15 +-
pages_order/author/createNovel.vue | 2 +-
pages_order/author/editor.vue | 15 +-
pages_order/comment/myComment.vue | 54 ++-
pages_order/components/comment/myCommentItem.vue | 5 +
pages_order/components/novel/RankListItem.vue | 45 +-
pages_order/components/novel/chapterPopup.vue | 2 +-
.../components/novel/interactiveGiftPopup.vue | 408 ++++++++++++++++
pages_order/components/novel/signRecordPopup.vue | 218 +++++++++
pages_order/components/novel/subscriptionPopup.vue | 26 +-
pages_order/mine/Walletflow.vue | 364 ++++++++++++++
pages_order/mine/recharge.vue | 530 +++++++++++++++++++++
pages_order/novel/ReaderAchievement.vue | 93 ++--
pages_order/novel/Tipping.vue | 63 ++-
pages_order/novel/Translation.vue | 128 ++---
pages_order/novel/Walletflow.vue | 388 ---------------
pages_order/novel/bookList.vue | 7 +-
pages_order/novel/novelDetail.vue | 56 ++-
pages_order/novel/readnovels.vue | 100 +++-
.../uv-switch/components/uv-switch/props.js | 2 +-
35 files changed, 2141 insertions(+), 624 deletions(-)
create mode 100644 api/model/all_money.js
create mode 100644 components/novel/bookStatus.vue
create mode 100644 pages_order/components/novel/interactiveGiftPopup.vue
create mode 100644 pages_order/components/novel/signRecordPopup.vue
create mode 100644 pages_order/mine/Walletflow.vue
create mode 100644 pages_order/mine/recharge.vue
delete mode 100644 pages_order/novel/Walletflow.vue
diff --git a/api/api.js b/api/api.js
index 2df6a65..cf0c384 100644
--- a/api/api.js
+++ b/api/api.js
@@ -6,7 +6,7 @@ let limit = {}
let debounce = {}
const models = ['login', 'index', 'bookshelf', 'my_book', 'comment', 'task'
-, 'order', 'writer', 'achievement']
+, 'order', 'writer', 'achievement', 'all_money']
const config = {
// 示例
diff --git a/api/model/achievement.js b/api/model/achievement.js
index 3b40e48..47fb595 100644
--- a/api/model/achievement.js
+++ b/api/model/achievement.js
@@ -3,7 +3,7 @@ const api = {
// 设置读者成就等级名称
setAchievementName: {
url: '/all_achievement/setAchievementName',
- method: 'GET',
+ method: 'POST',
auth: true,
},
// 根据用户标识和书籍标识查询该用户的成就等级
@@ -19,4 +19,4 @@ const api = {
},
}
-export default api
\ No newline at end of file
+export default api
\ No newline at end of file
diff --git a/api/model/all_money.js b/api/model/all_money.js
new file mode 100644
index 0000000..0aec45e
--- /dev/null
+++ b/api/model/all_money.js
@@ -0,0 +1,17 @@
+
+const api = {
+ // 获取我的可用积分数
+ getMyMoneyNum : {
+ url: '/all_money/getMyMoneyNum',
+ method: 'GET',
+ auth: true,
+ },
+ // 获取我的流水列表带分页
+ getMyMoneyLogPage : {
+ url: '/all_money/getMyMoneyLogPage',
+ method: 'GET',
+ auth: true,
+ },
+}
+
+export default api
\ No newline at end of file
diff --git a/api/model/bookshelf.js b/api/model/bookshelf.js
index 723240f..9981784 100644
--- a/api/model/bookshelf.js
+++ b/api/model/bookshelf.js
@@ -25,6 +25,12 @@ const api = {
method: 'POST',
auth: true,
},
+ // 修改我的书籍信息
+ saveOrUpdateReadBook: {
+ url: '/all_book/saveOrUpdateReadBook',
+ method: 'POST',
+ auth: true,
+ },
}
export default api
\ No newline at end of file
diff --git a/api/model/my_book.js b/api/model/my_book.js
index 9348b5a..c35c916 100644
--- a/api/model/my_book.js
+++ b/api/model/my_book.js
@@ -40,6 +40,12 @@ const api = {
method: 'POST',
auth: true,
},
+ // 查询我是否购买了这个章节
+ getMyShopNovel: {
+ url: '/my_book/getMyShopNovel',
+ method: 'GET',
+ auth: true,
+ },
}
export default api
\ No newline at end of file
diff --git a/api/model/order.js b/api/model/order.js
index efd3c59..e4e68fd 100644
--- a/api/model/order.js
+++ b/api/model/order.js
@@ -37,6 +37,30 @@ const api = {
method: 'POST',
auth: true,
},
+ // 创建支付套餐订单
+ createPayPackageOrder : {
+ url: '/my_order/createPayPackageOrder',
+ method: 'POST',
+ auth: true,
+ },
+ // 充值套餐列表
+ getPayPackageList : {
+ url: '/my_order/getPayPackageList',
+ method: 'GET',
+ auth: true,
+ },
+ // 根据书籍id,礼物id赠送礼物
+ giveGift : {
+ url: '/my_order/giveGift',
+ method: 'POST',
+ auth: true,
+ },
+ // 购买章节
+ buyNovel : {
+ url: '/my_order/buyNovel',
+ method: 'POST',
+ auth: true,
+ },
}
export default api
\ No newline at end of file
diff --git a/api/model/task.js b/api/model/task.js
index 36a31a7..fbfcefa 100644
--- a/api/model/task.js
+++ b/api/model/task.js
@@ -47,6 +47,12 @@ const api = {
method: 'GET',
auth: true,
},
+ // 获取我当天是否以及签到
+ getSignTaskToday: {
+ url: '/my_task/getSignTaskToday',
+ method: 'GET',
+ auth: true,
+ },
}
export default api
\ No newline at end of file
diff --git a/components/novel/bookStatus.vue b/components/novel/bookStatus.vue
new file mode 100644
index 0000000..78e01d9
--- /dev/null
+++ b/components/novel/bookStatus.vue
@@ -0,0 +1,51 @@
+
+
+ {{ statusText }}
+
+
+
+
+
+
diff --git a/components/novel/novelItem.vue b/components/novel/novelItem.vue
index 1ec5345..e07a066 100644
--- a/components/novel/novelItem.vue
+++ b/components/novel/novelItem.vue
@@ -14,10 +14,7 @@
-->
-
-
- {{ statusText }}
-
+
{{ item.service || '大家都在读' }}
@@ -27,7 +24,11 @@
diff --git a/pages_order/components/comment/myCommentItem.vue b/pages_order/components/comment/myCommentItem.vue
index 755d700..700cf2f 100644
--- a/pages_order/components/comment/myCommentItem.vue
+++ b/pages_order/components/comment/myCommentItem.vue
@@ -27,6 +27,11 @@
},
methods: {
goToReply(item) {
+
+ // this.$fetch('updateCommentRead', {
+ // commentId : item.id,
+ // })
+
uni.navigateTo({
url: '/pages_order/comment/respondComments?id=' + item.id
})
diff --git a/pages_order/components/novel/RankListItem.vue b/pages_order/components/novel/RankListItem.vue
index 3a85864..0547a57 100644
--- a/pages_order/components/novel/RankListItem.vue
+++ b/pages_order/components/novel/RankListItem.vue
@@ -1,14 +1,36 @@
-
+
+
+
+ {{ index }}
+
+
-
- 发源于
+
+ {{
+
+ item.hanHaiMember
+ && item.hanHaiMember.nickName
+
+ }}
- 200亲密值
- 护书使者 五级
+
+ {{
+ item.hanHaiMember
+ && item.num
+ }}
+
+ 亲密值
+
+ {{
+ item.commonBookAchievement
+ && (item.commonBookAchievement.oldName || item.commonBookAchievement.title)
+ }}
+
@@ -17,7 +39,12 @@
export default {
name: 'RankListItem',
props: {
- }
+ index : {
+ },
+ item : {
+ default : {}
+ }
+ },
}
@@ -41,6 +68,12 @@
width: 60rpx;
height: 60rpx;
margin-right: 10rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ font-size: 34rpx;
+ font-weight: 900;
+ color: #684427;
}
.avatar {
diff --git a/pages_order/components/novel/chapterPopup.vue b/pages_order/components/novel/chapterPopup.vue
index 1db333e..9a61bee 100644
--- a/pages_order/components/novel/chapterPopup.vue
+++ b/pages_order/components/novel/chapterPopup.vue
@@ -15,7 +15,7 @@
:class="['catalog-item theme-transition', {active: idx == currentIndex}]">
{{ item.title }}
- 付费
+ 付费
diff --git a/pages_order/components/novel/interactiveGiftPopup.vue b/pages_order/components/novel/interactiveGiftPopup.vue
new file mode 100644
index 0000000..8a400ad
--- /dev/null
+++ b/pages_order/components/novel/interactiveGiftPopup.vue
@@ -0,0 +1,408 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages_order/components/novel/signRecordPopup.vue b/pages_order/components/novel/signRecordPopup.vue
new file mode 100644
index 0000000..4522845
--- /dev/null
+++ b/pages_order/components/novel/signRecordPopup.vue
@@ -0,0 +1,218 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages_order/components/novel/subscriptionPopup.vue b/pages_order/components/novel/subscriptionPopup.vue
index cf5d280..abf874a 100644
--- a/pages_order/components/novel/subscriptionPopup.vue
+++ b/pages_order/components/novel/subscriptionPopup.vue
@@ -1,13 +1,16 @@
@@ -182,8 +217,12 @@ export default {
}
.name {
+ width: 200rpx;
+ overflow:hidden; //超出的文本隐藏
+ text-overflow:ellipsis; //溢出用省略号显示
+ white-space:nowrap; //溢出不换行
margin-top: 10rpx;
- font-size: 36rpx;
+ font-size: 30rpx;
color: #FFFFFF;
font-weight: bold;
}
diff --git a/pages_order/novel/Translation.vue b/pages_order/novel/Translation.vue
index 4a9f6e3..1ccbd4a 100644
--- a/pages_order/novel/Translation.vue
+++ b/pages_order/novel/Translation.vue
@@ -1,32 +1,28 @@
-
-
+
+
账户剩余
- {{ maxVote }} 张 推荐票
+ {{ maxVote }} 张 推荐票
+
-
-
+
+
{{ day.title }}
-
+
+ {{ day.num }}
@@ -45,23 +41,28 @@
{{ task.title }}
推荐票 +{{ task.num }}
-
+
+
+
@@ -226,7 +247,6 @@
.balance-value {
font-weight: bold;
- color: #bfa100;
.num {
font-size: 24rpx;
diff --git a/pages_order/novel/Walletflow.vue b/pages_order/novel/Walletflow.vue
deleted file mode 100644
index 48c3b45..0000000
--- a/pages_order/novel/Walletflow.vue
+++ /dev/null
@@ -1,388 +0,0 @@
-
-
-
-
-
-
-
-
- 账户
-
- {{ balance }}
- 充值
-
-
-
-
-
-
-
-
-
-
-
- {{ item.title }}
- {{ item.date }}
-
- +{{ item.amount }}
-
-
-
-
-
-
-
- {{ item.title }}
- {{ item.date }}
-
- -{{ item.amount }}
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages_order/novel/bookList.vue b/pages_order/novel/bookList.vue
index cd5f7c8..8f2e480 100644
--- a/pages_order/novel/bookList.vue
+++ b/pages_order/novel/bookList.vue
@@ -6,9 +6,10 @@
diff --git a/pages_order/novel/novelDetail.vue b/pages_order/novel/novelDetail.vue
index c8e240b..daee5b8 100644
--- a/pages_order/novel/novelDetail.vue
+++ b/pages_order/novel/novelDetail.vue
@@ -1,7 +1,7 @@
-
+
@@ -13,7 +13,7 @@
{{ novelData.name }}
作者:
- {{ novelData.author }}
+ {{ novelData.author || '暂无显示' }}
-
+
+
+
+
{{ novelData.service }}
@@ -114,7 +117,7 @@
- {{ catalog ? catalog.title : '暂无章节' }}
+ {{ catalog ? catalog.title || '暂无章节' : '暂无章节' }}
>
@@ -152,7 +155,7 @@
🎁
礼物盒
-->
-
+
@@ -167,6 +170,8 @@
+
+
@@ -175,7 +180,9 @@
import chapterPopup from '../components/novel/chapterPopup.vue'
import commentItem from '../components/comment/commentItem.vue'
import novelVotePopup from '../components/novel/novelVotePopup.vue'
+ import interactiveGiftPopup from '../components/novel/interactiveGiftPopup.vue'
import mixinsList from '@/mixins/list.js'
+ import bookStatus from '@/components/novel/bookStatus.vue'
export default {
mixins: [mixinsList],
components: {
@@ -183,6 +190,8 @@
chapterPopup,
commentItem,
novelVotePopup,
+ interactiveGiftPopup,
+ bookStatus,
},
data() {
return {
@@ -281,6 +290,7 @@
shopId: this.id,
name: this.novelData.name,
image: this.novelData.image,
+ novelId : this.fastCatalog && this.fastCatalog.id
}).then(res => {
uni.showToast({
title: '已加入书架',
@@ -316,6 +326,22 @@
url: `/pages_order/novel/readnovels?cid=${item.id}&id=${this.id}`
})
},
+ handleGiftSent(giftData) {
+ // 处理礼物发送后的逻辑
+ console.log('礼物发送成功:', giftData);
+ uni.showToast({
+ title: `成功赠送${giftData.gift.title} x${giftData.count}`,
+ icon: 'success'
+ });
+
+ // 重新获取小说详情,更新打赏相关数据
+ this.getDateil();
+
+ // 如果用户已登录,更新成就数据
+ if(this.isLogin){
+ this.getAchievement();
+ }
+ },
}
}
@@ -324,7 +350,7 @@
.novel-detail {
min-height: 100vh;
background-color: #f5f5f5;
- padding-bottom: calc(env(safe-area-inset-bottom) + 30rpx);
+ padding-bottom: calc(env(safe-area-inset-bottom) + 100rpx);
.nav-header {
display: flex;
@@ -340,19 +366,19 @@
}
.novel-info {
- padding: 20rpx;
+ padding: 40rpx;
display: flex;
background: #fff;
.novel-cover {
- width: 200rpx;
- height: 280rpx;
+ width: 160rpx;
+ height: 200rpx;
margin-right: 20rpx;
image {
width: 100%;
height: 100%;
- border-radius: 8rpx;
+ border-radius: 20rpx;
}
}
@@ -373,7 +399,7 @@
display: flex;
align-items: center;
margin-bottom: 12rpx;
- font-size: 28rpx;
+ font-size: 26rpx;
color: #666;
}
@@ -433,11 +459,11 @@
.rec-left {
display: flex;
flex-direction: column;
- align-items: flex-start;
+ align-items: center;
margin-left: 70rpx;
.rec-count {
- font-size: 44rpx;
+ font-size: 34rpx;
font-weight: 500;
color: #333;
line-height: 1.2;
@@ -621,7 +647,7 @@
.check-text {
font-size: 22rpx;
- color: #999;
+ color: #33e;
}
}
}
diff --git a/pages_order/novel/readnovels.vue b/pages_order/novel/readnovels.vue
index 9e6890f..78d7dfe 100644
--- a/pages_order/novel/readnovels.vue
+++ b/pages_order/novel/readnovels.vue
@@ -18,10 +18,13 @@
-->
+
+
+
-
-
+
+
{{ currentChapter }}
@@ -62,7 +65,9 @@
-
+
@@ -95,6 +100,10 @@
cid: 0,
novelData: {},
chapterList: [],
+ scrollTop: 0, // 滚动位置
+
+ // 是否需要购买
+ isPay : false,
}
},
computed: {
@@ -131,12 +140,35 @@
this.novelData = res
})
},
- getBookCatalogDetail() {
+ async getBookCatalogDetail() {
+
+ this.isPay = await this.$fetch('getMyShopNovel', {
+ bookId : this.id,
+ novelId : this.cid,
+ })
+
+ this.isPay = !this.isPay
+
this.$fetch('getBookCatalogDetail', {
id: this.cid
}).then(res => {
+
this.paragraphs = res.details && res.details.split('\n')
this.currentChapter = res.title
+
+ if(res.isPay != 'Y'){
+ this.isPay = false
+ }
+
+ this.updateSub()
+
+ // 更新阅读进度到书架
+ this.updateReadProgress()
+
+ // 滚动到顶部
+ this.$nextTick(() => {
+ this.scrollTop = 0; // 设置scroll-view滚动到顶部
+ })
})
},
getBookCatalogList() {
@@ -147,8 +179,6 @@
reverse: 0,
}).then(res => {
this.chapterList = res.records
- this.catalog = res.records[res.records.length - 1]
- this.fastCatalog = res.records[0]
})
},
handleContentClick() {
@@ -157,6 +187,7 @@
handleScroll(e) {
// 获取滚动位置
const scrollTop = e.detail.scrollTop;
+ this.scrollTop = scrollTop; // 更新当前滚动位置
// 滚动时触发订阅弹窗
if (scrollTop > 50 && !this.popupShown) {
@@ -167,10 +198,14 @@
toggleFullScreen() {
this.isFullScreen = !this.isFullScreen
},
- goToSubscription() {
- uni.navigateTo({
- url: '/pages_order/novel/SubscriptionInformation'
+ async goToSubscription() {
+ await this.$fetch('buyNovel', {
+ bookId : this.id,
+ novelId : this.cid,
})
+
+ this.isPay = false
+ this.updateSub()
},
selectChapter({
item,
@@ -193,6 +228,29 @@
this.isFullScreen = true
this.getBookCatalogDetail()
},
+
+ // 更新阅读进度到书架
+ updateReadProgress() {
+ if (!this.id || !this.cid) return;
+
+ this.$fetch('saveOrUpdateReadBook', {
+ shopId: this.id, // 书籍id
+ novelId: this.cid, // 章节id
+ name: this.novelData.name,
+ image: this.novelData.image
+ }).then(res => {
+ console.log('阅读进度已更新');
+ }).catch(err => {
+ console.error('更新阅读进度失败:', err);
+ });
+ },
+ updateSub(){
+ if(this.isPay){
+ this.$refs.subscriptionPopup.open()
+ }else{
+ this.$refs.subscriptionPopup.close()
+ }
+ },
},
}
@@ -265,12 +323,12 @@
.bottom-right {
.outline-btn {
background: #222;
- color: #4a90e2;
- border: 2rpx solid #4a90e2;
+ color: #999;
+ border: 2rpx solid #999;
.btn-text {
- color: #4a90e2;
- border-bottom: 2rpx solid #4a90e2;
+ color: #999;
+ border-bottom: 2rpx solid #999;
}
}
}
@@ -284,7 +342,7 @@
right: 0;
background: rgba(255, 255, 255, 0.98);
padding-top: calc(var(--status-bar-height) + 10rpx);
- z-index: 100;
+ z-index: 100000;
transform: translateY(0);
transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out, background-color 0.3s ease;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
@@ -418,7 +476,7 @@
align-items: center;
height: 180rpx;
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
- z-index: 10;
+ z-index: 100000;
padding: 0 40rpx 10rpx 40rpx;
transform: translateY(0);
transition: transform 0.3s ease-in-out, background-color 0.3s ease;
@@ -460,19 +518,21 @@
.bottom-right {
display: flex;
align-items: flex-end;
- gap: 32rpx;
+ gap: 22rpx;
margin-left: 40rpx;
+ text-overflow: ellipsis;
.outline-btn {
+ flex-shrink: 0;
min-width: 110rpx;
- padding: 0 28rpx;
+ padding: 0 26rpx;
height: 60rpx;
line-height: 60rpx;
background: #fff;
color: #223a7a;
border: 2rpx solid #223a7a;
border-radius: 32rpx;
- font-size: 28rpx;
+ font-size: 26rpx;
font-weight: bold;
margin: 0;
display: flex;
@@ -483,7 +543,7 @@
.btn-text {
font-weight: bold;
color: #223a7a;
- font-size: 28rpx;
+ font-size: 26rpx;
border-bottom: 2rpx solid #223a7a;
padding-bottom: 2rpx;
transition: color 0.3s ease, border-color 0.3s ease;
diff --git a/uni_modules/uv-switch/components/uv-switch/props.js b/uni_modules/uv-switch/components/uv-switch/props.js
index b3737dd..d215199 100644
--- a/uni_modules/uv-switch/components/uv-switch/props.js
+++ b/uni_modules/uv-switch/components/uv-switch/props.js
@@ -21,7 +21,7 @@ export default {
// 开关尺寸,单位px
size: {
type: [String, Number],
- default: 25
+ default: 50
},
// 打开时的背景颜色
activeColor: {