diff --git a/src/images/icon-collection-active.png b/src/images/icon-collection-active.png index 5ea867a..5d90bde 100644 Binary files a/src/images/icon-collection-active.png and b/src/images/icon-collection-active.png differ diff --git a/src/images/icon-collection.png b/src/images/icon-collection.png index 66a27bd..e3c680b 100644 Binary files a/src/images/icon-collection.png and b/src/images/icon-collection.png differ diff --git a/src/images/icon-collection1.png b/src/images/icon-collection1.png index 6e5c7b1..5c049c0 100644 Binary files a/src/images/icon-collection1.png and b/src/images/icon-collection1.png differ diff --git a/src/pages/article/index.ts b/src/pages/article/index.ts index 2059651..aca20cd 100644 --- a/src/pages/article/index.ts +++ b/src/pages/article/index.ts @@ -18,6 +18,7 @@ Page({ toastShow: false, toastType: 3, + currentTime: 0, }, innerAudioContext: null as WechatMiniprogram.InnerAudioContext | null, onLoad(options) { @@ -25,6 +26,11 @@ Page({ this.setData({ BookId: options.id, }); + if (options.cid) { + this.setData({ + ChapterId: options.cid, + }); + } app.waitLogin(false, true).then(() => { this.getChapterList(); this.getDetail(); @@ -78,6 +84,7 @@ Page({ time, }); } + this.handleView(); }) .catch(() => { this.setData({ @@ -86,6 +93,16 @@ Page({ }); }); }, + handleView() { + wx.ajax({ + method: 'POST', + url: '?r=shizhong/book/add-browse-record', + data: { + BookId: this.data.BookId, + ChapterId: this.data.ChapterId, + }, + }); + }, handleDirectory() { this.setData({ show: true, @@ -140,7 +157,7 @@ Page({ }, handlePlay() { - const { chapter, play } = this.data; + const { chapter, play, currentTime } = this.data; if (this.innerAudioContext) { if (play) { this.innerAudioContext.stop(); @@ -148,10 +165,8 @@ Page({ } this.innerAudioContext.stop(); this.innerAudioContext.src = chapter.AudioUrl.url; + this.innerAudioContext.seek(currentTime); this.innerAudioContext.play(); - this.setData({ - play: true, - }); const listener = () => { if (this.innerAudioContext) { const { currentTime, duration } = this.innerAudioContext; @@ -160,6 +175,8 @@ Page({ this.setData({ time, progress, + currentTime, + play: true, }); } }; @@ -169,7 +186,12 @@ Page({ play: false, }); }); - this.innerAudioContext.onStop(() => { + this.innerAudioContext.onPlay(() => { + this.setData({ + play: true, + }); + }); + this.innerAudioContext.onPause(() => { this.setData({ play: false, }); @@ -179,9 +201,10 @@ Page({ handlePause() { if (this.innerAudioContext) { this.innerAudioContext.pause(); - this.setData({ - play: false, - }); + this.innerAudioContext.offTimeUpdate() + this.innerAudioContext.offEnded() + this.innerAudioContext.offPlay() + this.innerAudioContext.offPause() } }, formatTime(time: number) { @@ -199,8 +222,8 @@ Page({ this.setData({ toastShow: false, }); - wx.reLaunch({ - url: '/pages/login/index', + wx.navigateTo({ + url: '/pages/login/index?back=1', }); }, }); diff --git a/src/pages/article/index.wxml b/src/pages/article/index.wxml index 8907e2f..18d4144 100644 --- a/src/pages/article/index.wxml +++ b/src/pages/article/index.wxml @@ -23,7 +23,7 @@ /> - + - {{item.ChapterName}} + {{index+1}}.{{item.ChapterName}} diff --git a/src/pages/collection/index.ts b/src/pages/collection/index.ts index 2b496a5..1c5d259 100644 --- a/src/pages/collection/index.ts +++ b/src/pages/collection/index.ts @@ -81,6 +81,14 @@ Page({ handleBack() { wx.navigateBack(); }, + handleDetail(e) { + const { id } = e.currentTarget.dataset; + app.waitLogin(false, true).then(() => { + wx.navigateTo({ + url: `/pages/article/index?id=${id}`, + }); + }); + }, }); export {}; diff --git a/src/pages/collection/index.wxml b/src/pages/collection/index.wxml index cfea2a4..34445d6 100644 --- a/src/pages/collection/index.wxml +++ b/src/pages/collection/index.wxml @@ -9,8 +9,8 @@ - - + + {{item.BookName}} {{item.CateName}}{{item.CateSecondName ? '/'+item.CateSecondName : ''}} diff --git a/src/pages/home/index.ts b/src/pages/home/index.ts index b53509b..1d92814 100644 --- a/src/pages/home/index.ts +++ b/src/pages/home/index.ts @@ -35,7 +35,7 @@ Page({ }); } else if (bannerItem.configType === '2') { wx.navigateTo({ - url: `/pages/article/index?id=${bannerItem.configContent}`, + url: `/pages/article/index?id=${bannerItem.configContentBookId}&cid=${bannerItem.configContent}`, }); } else if (bannerItem.configType === '3') { wx.navigateTo({ @@ -76,10 +76,6 @@ Page({ this.setData({ feedbackCount: res, }); - wx.showToast({ - icon: 'none', - title: '留言成功', - }); }); }, handleRemark() { @@ -94,7 +90,7 @@ Page({ }).then(() => { wx.showToast({ title: '提交成功', - icon: 'success', + icon: 'none', }); this.setData({ remark: '', diff --git a/src/pages/login/index.json b/src/pages/login/index.json index 0d4a6d0..b3238b0 100644 --- a/src/pages/login/index.json +++ b/src/pages/login/index.json @@ -1,6 +1,7 @@ { "usingComponents": { "van-icon": "@vant/weapp/icon/index", + "van-nav-bar": "@vant/weapp/nav-bar/index", "van-popup": "@vant/weapp/popup/index" } } diff --git a/src/pages/login/index.ts b/src/pages/login/index.ts index b15babf..87c2742 100644 --- a/src/pages/login/index.ts +++ b/src/pages/login/index.ts @@ -10,8 +10,14 @@ Page({ code: '', protool: false, codeText: '发送验证码', + + back: false, + }, + onLoad(options) { + this.setData({ + back: options.back === '1', + }); }, - onLoad() {}, getCode() { if (timer) return; const mobile = this.data.mobile; @@ -152,6 +158,9 @@ Page({ url: '/pages/home/index', }); }, + handleBack() { + wx.navigateBack(); + }, }); export {}; diff --git a/src/pages/login/index.wxml b/src/pages/login/index.wxml index 0fdc67e..ae7162b 100644 --- a/src/pages/login/index.wxml +++ b/src/pages/login/index.wxml @@ -1,3 +1,6 @@ + + + 手机号快捷登录 - + 游客访问 diff --git a/src/pages/my/index.scss b/src/pages/my/index.scss index c9e7c23..f2b7df5 100644 --- a/src/pages/my/index.scss +++ b/src/pages/my/index.scss @@ -3,24 +3,9 @@ page { } .page { background: linear-gradient(180deg, #d2f1fe 0%, rgba(244, 248, 249, 0) 100%) no-repeat top center / 100% 682rpx; - .no-login { - margin: 32rpx 62rpx 0; - display: flex; - align-items: center; - gap: 24rpx; - .avatar { - width: 160rpx; - height: 160rpx; - } - .name { - font-size: 40rpx; - color: #3795f7; - } - } .login { margin: 32rpx 62rpx 0; display: flex; - align-items: center; gap: 24rpx; .upload { flex-shrink: 0; @@ -61,6 +46,20 @@ page { color: #999999; } } + .no-login { + margin: 32rpx 62rpx 0; + display: flex; + align-items: center; + gap: 24rpx; + .avatar { + width: 160rpx; + height: 160rpx; + } + .name { + font-size: 40rpx; + color: #3795f7; + } + } .nav-list { margin: 70rpx 32rpx 0; padding: 0 30rpx; diff --git a/src/pages/my/index.wxml b/src/pages/my/index.wxml index 7b76a5a..74094d2 100644 --- a/src/pages/my/index.wxml +++ b/src/pages/my/index.wxml @@ -7,7 +7,7 @@ - {{userInfo.username || '---'}}health_1733302440913576 + {{userInfo.username || '---'}} {{userInfo.telephone}} diff --git a/src/pages/search/index.ts b/src/pages/search/index.ts index 551a7d0..16e0ff9 100644 --- a/src/pages/search/index.ts +++ b/src/pages/search/index.ts @@ -64,6 +64,14 @@ Page({ handleBack() { wx.navigateBack(); }, + handleDetail(e) { + const { id } = e.currentTarget.dataset; + app.waitLogin(false, true).then(() => { + wx.navigateTo({ + url: `/pages/article/index?id=${id}`, + }); + }); + }, }); export {}; diff --git a/src/pages/search/index.wxml b/src/pages/search/index.wxml index fca15b7..8e58794 100644 --- a/src/pages/search/index.wxml +++ b/src/pages/search/index.wxml @@ -23,7 +23,7 @@ /> 以下为搜到的内容 - + {{item.ChapterName}} @@ -33,7 +33,7 @@ - ??? + {{item.BrowseNum}} diff --git a/src/pages/topic/index.scss b/src/pages/topic/index.scss index f409d41..b550203 100644 --- a/src/pages/topic/index.scss +++ b/src/pages/topic/index.scss @@ -36,9 +36,9 @@ page { .content { margin-top: 34rpx; - font-size: 40rpx; + font-size: 36rpx; color: #222222; - line-height: 64rpx; + line-height: 1.4; } .btn { @@ -58,11 +58,8 @@ page { } .footer { - position: absolute; - bottom: 206rpx; - left: 0; width: 100%; - padding: 0 88rpx; + padding: 30rpx 88rpx; box-sizing: border-box; display: flex; align-items: center;