Browse Source

bug处理

master
kola-web 3 months ago
parent
commit
399ec490b5
  1. 2
      project.private.config.json
  2. 2
      src/components/global-toast/index.wxml
  3. BIN
      src/images/my-list-icon4.png
  4. BIN
      src/images/relove.png
  5. 5
      src/pages/article/index.scss
  6. 33
      src/pages/article/index.ts
  7. 24
      src/pages/article/index.wxml
  8. 4
      src/pages/classify/index.wxml
  9. 2
      src/pages/collection/index.wxml
  10. 2
      src/pages/home/index.wxml
  11. 7
      src/pages/my/index.ts
  12. 4
      src/pages/my/index.wxml
  13. 6
      src/pages/search/index.scss
  14. 2
      src/pages/search/index.wxml
  15. 4
      src/pages/topic/index.json
  16. 32
      src/pages/topic/index.scss
  17. 31
      src/pages/topic/index.ts
  18. 17
      src/pages/topic/index.wxml
  19. 3
      src/pages/userInfo/index.wxml
  20. 8
      src/utils/page.ts

2
project.private.config.json

@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
{
"name": "文章详情",
"pathName": "pages/article/index",
"query": "id=1",
"query": "id=3",
"launchMode": "default",
"scene": null
},

2
src/components/global-toast/index.wxml

@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
src="{{imageUrl}}{{params.qwPicture}}"
show-menu-by-longpress
></image>
<view class="tip">长按识别二维码关注</view>
<view class="tip">长按识别二维码添加</view>
</view>
</van-popup>

BIN
src/images/my-list-icon4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
src/images/relove.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

5
src/pages/article/index.scss

@ -51,6 +51,11 @@ @@ -51,6 +51,11 @@
.progress {
display: block;
margin-top: 30rpx;
.custom-button {
width: 64rpx;
height: 64rpx;
background-color: transparent;
}
}
}

33
src/pages/article/index.ts

@ -15,10 +15,11 @@ Page({ @@ -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({ @@ -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({ @@ -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({ @@ -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);

24
src/pages/article/index.wxml

@ -7,20 +7,29 @@ @@ -7,20 +7,29 @@
<view class="name">概要解读</view>
<view class="date">{{time}}</view>
</view>
<image bind:tap="handlePause" wx:if="{{play}}" class="icon" src="{{imageUrl}}icon-stop.png?t={{Timestamp}}"></image>
<image
bind:tap="handlePause"
wx:if="{{play}}"
class="icon"
src="{{imageUrl}}icon-stop.png?t={{Timestamp}}"
></image>
<image bind:tap="handlePlay" wx:else class="icon" src="{{imageUrl}}icon-play.png?t={{Timestamp}}"></image>
</view>
<van-slider
class="progress"
custom-class="progress"
disabled
step="0.001"
value="{{progress}}"
model:value="{{progress}}"
bar-height="12rpx"
active-color="#3795F7"
inactive-color="#FFFFFF"
use-button-slot
/>
bind:drag-start="handleDragStart"
bind:drag-end="handleDragEnd"
bind:drag="handleDrag"
>
<view class="custom-button" slot="button"></view>
</van-slider>
</view>
<view class="rich">
<mp-html content="{{chapter.Content}}" scroll-table="{{true}}"></mp-html>
@ -91,4 +100,9 @@ @@ -91,4 +100,9 @@
</view>
</van-popup>
<global-toast show="{{toastShow}}" type="{{toastType}}" bind:close="handleAuthClose" bind:conform="handleAuthConform"></global-toast>
<global-toast
show="{{toastShow}}"
type="{{toastType}}"
bind:close="handleAuthClose"
bind:conform="handleAuthConform"
></global-toast>

4
src/pages/classify/index.wxml

@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
<view class="stat">
<view class="s-item">
<image class="icon" src="{{imageUrl}}icon-eye.png?t={{Timestamp}}"></image>
{{item.BrowseNum}}
{{~~item.OperateNum + ~~item.BrowseNum}}
</view>
<view
class="s-item active"
@ -62,7 +62,7 @@ @@ -62,7 +62,7 @@
<view class="stat">
<view class="s-item">
<image class="icon" src="{{imageUrl}}icon-eye.png?t={{Timestamp}}"></image>
{{item.BrowseNum}}
{{~~item.OperateNum + ~~item.BrowseNum}}
</view>
<view
class="s-item active"

2
src/pages/collection/index.wxml

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
<view class="stat">
<view class="s-item">
<image class="icon" src="{{imageUrl}}icon-eye.png?t={{Timestamp}}"></image>
{{item.BrowseNum}}
{{~~item.OperateNum + ~~item.BrowseNum}}
</view>
<view
class="s-item active"

2
src/pages/home/index.wxml

@ -48,8 +48,6 @@ @@ -48,8 +48,6 @@
model:value="{{remark}}"
placeholder-class="textarea-placeholder"
placeholder="欢迎反馈您的问题"
confirm-type="send"
bindconfirm="handleRemark"
></textarea>
<view wx:if="{{feedbackCount>0}}" class="submit" bind:tap="handleRemark">提交</view>
<view wx:else class="submit not-submit" bind:tap="handleNotRemark">提交</view>

7
src/pages/my/index.ts

@ -7,7 +7,7 @@ Page({ @@ -7,7 +7,7 @@ Page({
userInfo: {} as any,
},
onLoad() {
onShow() {
app.waitLogin().then(() => {
app.getUserInfo(this);
});
@ -75,4 +75,9 @@ Page({ @@ -75,4 +75,9 @@ Page({
toastShow: false,
});
},
handleTopic() {
wx.navigateTo({
url: '/pages/topic/index?back=1',
});
},
});

4
src/pages/my/index.wxml

@ -27,6 +27,10 @@ @@ -27,6 +27,10 @@
<image class="icon" src="{{imageUrl}}my-list-icon1.png?t={{Timestamp}}"></image>
我的收藏
</view>
<view class="nav-item" bind:tap="handleTopic" wx:if="{{userInfo.isAnswer!==1}}">
<image class="icon" src="{{imageUrl}}my-list-icon4.png?t={{Timestamp}}"></image>
问卷调查
</view>
<view class="nav-item" bind:tap="handleOffice">
<image class="icon" src="{{imageUrl}}my-list-icon2.png?t={{Timestamp}}"></image>
关注公众号

6
src/pages/search/index.scss

@ -65,17 +65,15 @@ page { @@ -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;

2
src/pages/search/index.wxml

@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
<view class="stat">
<view class="s-item">
<image class="icon" src="{{imageUrl}}icon-eye.png?t={{Timestamp}}"></image>
{{item.BrowseNum}}
{{~~item.OperateNum + ~~item.BrowseNum}}
</view>
</view>
</view>

4
src/pages/topic/index.json

@ -1,5 +1,7 @@ @@ -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"
}
}

32
src/pages/topic/index.scss

@ -59,11 +59,11 @@ page { @@ -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 { @@ -83,7 +83,7 @@ page {
}
.submit {
flex: 1;
width: 290rpx;
height: 88rpx;
font-size: 36rpx;
color: #ffffff;
@ -96,3 +96,29 @@ page { @@ -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;
}
}

31
src/pages/topic/index.ts

@ -5,8 +5,15 @@ Page({ @@ -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({ @@ -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({ @@ -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 {};

17
src/pages/topic/index.wxml

@ -2,6 +2,9 @@ @@ -2,6 +2,9 @@
class="page"
style="background: url('{{imageUrl}}topic-bg.png?t={{Timestamp}}') no-repeat {{menuButtonInfo.bottom+62}}rpx center/100% 1284rpx;"
>
<van-nav-bar title="" border="{{false}}" custom-style="background:transparent" bind:click-left="handleBack" fixed>
<van-icon name="arrow-left" slot="left" color="#000" size="46rpx" />
</van-nav-bar>
<swiper
class="swiper"
current="{{nav}}"
@ -9,7 +12,10 @@ @@ -9,7 +12,10 @@
style="margin-top:{{menuButtonInfo.bottom+73}}px;"
>
<swiper-item wx:for="{{question}}" wx:key="index" wx:for-item="questionItem">
<view class="topic" style="background: url('{{imageUrl}}topic-card-bg.png?t={{Timestamp}}') no-repeat top center/100% 1232rpx">
<view
class="topic"
style="background: url('{{imageUrl}}topic-card-bg.png?t={{Timestamp}}') no-repeat top center/100% 1232rpx"
>
<view class="order">
{{index + 1}}/
<text class="all">{{question.length}}</text>
@ -65,3 +71,12 @@ @@ -65,3 +71,12 @@
</swiper-item>
</swiper>
</view>
<view class="relove" wx:if="{{relove}}">
<image class="icon" src="{{imageUrl}}relove.png?t={{Timestamp}}"></image>
<view class="content">
提交成功
<view></view>
感谢您的参与
</view>
</view>

3
src/pages/userInfo/index.wxml

@ -7,9 +7,8 @@ @@ -7,9 +7,8 @@
<uploadFile
class="avatar"
chooseAvatar
bind:file="handleFile"
data-key="Img"
bind:file="handleAvatar"
bind:file="handleFile"
>
<image
wx:if="{{userInfo.avatar}}"

8
src/utils/page.ts

@ -30,18 +30,16 @@ function page(config: WechatMiniprogram.Page.Instance<WechatMiniprogram.IAnyObje @@ -30,18 +30,16 @@ function page(config: WechatMiniprogram.Page.Instance<WechatMiniprogram.IAnyObje
// const url = currentPage.route;
return {
title: "武田",
path: "/pages/start/index",
// imageUrl: `${getApp().globalData.imageUrl}1/1.png?t=${Timestamp}`,
};
}
};
config.onPageScroll = function (e) {
config.onPageScroll = function (e: any) {
const { scrollTop } = e;
let background = "transparent";
let background = 'transparent';
if (scrollTop > 20) {
background = "#fff";
background = '#fff';
}
this.setData({
background,

Loading…
Cancel
Save