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 @@ + + + + + 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 @@ @@ -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 @@ @@ -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 @@ - - - - - - \ 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 @@ @@ -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: {