diff --git a/project.private.config.json b/project.private.config.json index 7e84be8..153bcdb 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -11,7 +11,7 @@ { "name": "文章详情", "pathName": "pages/article/index", - "query": "id=1", + "query": "id=3", "launchMode": "default", "scene": null }, diff --git a/src/components/global-toast/index.wxml b/src/components/global-toast/index.wxml index ec594ed..643dbd8 100644 --- a/src/components/global-toast/index.wxml +++ b/src/components/global-toast/index.wxml @@ -28,7 +28,7 @@ src="{{imageUrl}}{{params.qwPicture}}" show-menu-by-longpress > - 长按识别二维码关注 + 长按识别二维码添加 diff --git a/src/images/my-list-icon4.png b/src/images/my-list-icon4.png new file mode 100644 index 0000000..abb7fe9 Binary files /dev/null and b/src/images/my-list-icon4.png differ diff --git a/src/images/relove.png b/src/images/relove.png new file mode 100644 index 0000000..e01d5b4 Binary files /dev/null and b/src/images/relove.png differ diff --git a/src/pages/article/index.scss b/src/pages/article/index.scss index 45f83ab..7fab90e 100644 --- a/src/pages/article/index.scss +++ b/src/pages/article/index.scss @@ -51,6 +51,11 @@ .progress { display: block; margin-top: 30rpx; + .custom-button { + width: 64rpx; + height: 64rpx; + background-color: transparent; + } } } diff --git a/src/pages/article/index.ts b/src/pages/article/index.ts index aca20cd..4f19948 100644 --- a/src/pages/article/index.ts +++ b/src/pages/article/index.ts @@ -15,10 +15,11 @@ Page({ url: 'http://m10.music.126.net/20241126110303/3f2481d2d6d50acd2009359539eadda0/ymusic/5353/0f0f/0358/d99739615f8e5153d77042092f07fd77.mp3', play: false, time: '00:00/00:00', + currentTime: 0, + drag: false, toastShow: false, toastType: 3, - currentTime: 0, }, innerAudioContext: null as WechatMiniprogram.InnerAudioContext | null, onLoad(options) { @@ -168,7 +169,7 @@ Page({ this.innerAudioContext.seek(currentTime); this.innerAudioContext.play(); const listener = () => { - if (this.innerAudioContext) { + if (this.innerAudioContext && !this.data.drag) { const { currentTime, duration } = this.innerAudioContext; const time = `${this.formatTime(currentTime)}/${this.formatTime(duration)}`; const progress = (currentTime / duration) * 100; @@ -182,6 +183,7 @@ Page({ }; this.innerAudioContext.onTimeUpdate(listener); this.innerAudioContext.onEnded(() => { + this.innerAudioContext?.seek(0); this.setData({ play: false, }); @@ -201,12 +203,31 @@ Page({ handlePause() { if (this.innerAudioContext) { this.innerAudioContext.pause(); - this.innerAudioContext.offTimeUpdate() - this.innerAudioContext.offEnded() - this.innerAudioContext.offPlay() - this.innerAudioContext.offPause() } }, + handleDragStart() { + this.setData({ + drag: true, + }); + }, + handleDragEnd() { + this.setData({ + drag: false, + }); + if (this.data.play) { + this.innerAudioContext?.seek(this.data.currentTime); + } + }, + handleDrag(e: any) { + const current = e.detail.value; + const duration = this.innerAudioContext?.duration || this.data.chapter.AudioUrl.duration; + const currentTime = (current / 100) * duration; + const time = `${this.formatTime(currentTime)}/${this.formatTime(duration)}`; + this.setData({ + time, + currentTime, + }); + }, formatTime(time: number) { const minutes = Math.floor(time / 60); const seconds = Math.floor(time % 60); diff --git a/src/pages/article/index.wxml b/src/pages/article/index.wxml index 18d4144..5e30097 100644 --- a/src/pages/article/index.wxml +++ b/src/pages/article/index.wxml @@ -7,20 +7,29 @@ 概要解读 {{time}} - + + bind:drag-start="handleDragStart" + bind:drag-end="handleDragEnd" + bind:drag="handleDrag" + > + + @@ -91,4 +100,9 @@ - + diff --git a/src/pages/classify/index.wxml b/src/pages/classify/index.wxml index 6e7a1d8..9f3bec5 100644 --- a/src/pages/classify/index.wxml +++ b/src/pages/classify/index.wxml @@ -34,7 +34,7 @@ - {{item.BrowseNum}} + {{~~item.OperateNum + ~~item.BrowseNum}} - {{item.BrowseNum}} + {{~~item.OperateNum + ~~item.BrowseNum}} - {{item.BrowseNum}} + {{~~item.OperateNum + ~~item.BrowseNum}} 提交 提交 diff --git a/src/pages/my/index.ts b/src/pages/my/index.ts index 7e3ce9c..2e035c3 100644 --- a/src/pages/my/index.ts +++ b/src/pages/my/index.ts @@ -7,7 +7,7 @@ Page({ userInfo: {} as any, }, - onLoad() { + onShow() { app.waitLogin().then(() => { app.getUserInfo(this); }); @@ -75,4 +75,9 @@ Page({ toastShow: false, }); }, + handleTopic() { + wx.navigateTo({ + url: '/pages/topic/index?back=1', + }); + }, }); diff --git a/src/pages/my/index.wxml b/src/pages/my/index.wxml index 74094d2..9a267c3 100644 --- a/src/pages/my/index.wxml +++ b/src/pages/my/index.wxml @@ -27,6 +27,10 @@ 我的收藏 + + + 问卷调查 + 关注公众号 diff --git a/src/pages/search/index.scss b/src/pages/search/index.scss index 3f0598f..9fc5c04 100644 --- a/src/pages/search/index.scss +++ b/src/pages/search/index.scss @@ -65,17 +65,15 @@ page { .c-footer { margin-top: 20px; display: flex; - align-items: center; justify-content: space-between; + gap: 20rpx; .type { font-size: 28rpx; color: #999999; line-height: 28rpx; } .stat { - display: flex; - align-items: center; - gap: 40rpx; + flex-shrink: 0; .s-item { display: flex; align-items: center; diff --git a/src/pages/search/index.wxml b/src/pages/search/index.wxml index 8e58794..ec3d820 100644 --- a/src/pages/search/index.wxml +++ b/src/pages/search/index.wxml @@ -33,7 +33,7 @@ - {{item.BrowseNum}} + {{~~item.OperateNum + ~~item.BrowseNum}} diff --git a/src/pages/topic/index.json b/src/pages/topic/index.json index 0700ef8..3a3e83a 100644 --- a/src/pages/topic/index.json +++ b/src/pages/topic/index.json @@ -1,5 +1,7 @@ { "usingComponents": { - "van-progress": "@vant/weapp/progress/index" + "van-progress": "@vant/weapp/progress/index", + "van-nav-bar": "@vant/weapp/nav-bar/index", + "van-icon": "@vant/weapp/icon/index" } } diff --git a/src/pages/topic/index.scss b/src/pages/topic/index.scss index b550203..81cbc91 100644 --- a/src/pages/topic/index.scss +++ b/src/pages/topic/index.scss @@ -59,11 +59,11 @@ page { .footer { width: 100%; - padding: 30rpx 88rpx; + padding: 80rpx 0; box-sizing: border-box; display: flex; align-items: center; - justify-content: center; + justify-content: space-between; .prev { flex: 1; @@ -83,7 +83,7 @@ page { } .submit { - flex: 1; + width: 290rpx; height: 88rpx; font-size: 36rpx; color: #ffffff; @@ -96,3 +96,29 @@ page { } } } + +.relove { + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 10; + width: 388rpx; + height: 350rpx; + background: rgba(0, 0, 0, 0.67); + border-radius: 42rpx 42rpx 42rpx 42rpx; + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + text-align: center; + .icon { + width: 84rpx; + height: 84rpx; + } + .content { + margin-top: 26rpx; + font-size: 40rpx; + color: #ffffff; + } +} diff --git a/src/pages/topic/index.ts b/src/pages/topic/index.ts index f5a26e7..ec88e34 100644 --- a/src/pages/topic/index.ts +++ b/src/pages/topic/index.ts @@ -5,8 +5,15 @@ Page({ nav: 0, percentage: 0, question: [] as { questionId: string; title: string; answer?: '1' | '2' }[], + + relove: false, + + back: false, }, - onLoad() { + onLoad(options) { + this.setData({ + back: options.back === '1', + }); app.waitLogin(true).then(() => { this.getList(); }); @@ -51,6 +58,9 @@ Page({ answer: JSON.stringify(answer), }, }).then(() => { + this.setData({ + relove: true, + }); app.waitLogin().then(() => { wx.reLaunch({ url: '/pages/home/index', @@ -63,6 +73,25 @@ Page({ nav: this.data.nav, }); }, + handleBack() { + wx.showModal({ + title: '确认退出?', + content: '还差一点就完成了,退出会清空所有答题,确认现在要退出吗?', + cancelText: '退出', + confirmText: '继续答题', + success: (res) => { + if (res.cancel) { + if (this.data.back) { + wx.navigateBack(); + } else { + wx.reLaunch({ + url: '/pages/home/index', + }); + } + } + }, + }); + }, }); export {}; diff --git a/src/pages/topic/index.wxml b/src/pages/topic/index.wxml index 599a3ee..7357140 100644 --- a/src/pages/topic/index.wxml +++ b/src/pages/topic/index.wxml @@ -2,6 +2,9 @@ class="page" style="background: url('{{imageUrl}}topic-bg.png?t={{Timestamp}}') no-repeat {{menuButtonInfo.bottom+62}}rpx center/100% 1284rpx;" > + + + - + {{index + 1}}/ {{question.length}} @@ -65,3 +71,12 @@ + + + + + 提交成功 + + 感谢您的参与 + + diff --git a/src/pages/userInfo/index.wxml b/src/pages/userInfo/index.wxml index 926646a..e51f40d 100644 --- a/src/pages/userInfo/index.wxml +++ b/src/pages/userInfo/index.wxml @@ -7,9 +7,8 @@ 20) { - background = "#fff"; + background = '#fff'; } this.setData({ background,