| | |
| | | speed: 1.0, |
| | | |
| | | }, |
| | | // 时间格式化 |
| | | format(t) { |
| | | let time = Math.floor(t / 60) >= 10 ? Math.floor(t / 60) : '0' + Math.floor(t / 60); |
| | | t = time + ':' + ((t % 60) / 100).toFixed(2).slice(-2); |
| | | return t; |
| | | }, |
| | | audio: null, |
| | | // 格式化笔记时间 |
| | | convertTimestamp(timestamp) { |
| | |
| | | return formattedDate |
| | | }, |
| | | |
| | | // 时间格式化 |
| | | format(t) { |
| | | let time = Math.floor(t / 60) >= 10 ? Math.floor(t / 60) : '0' + Math.floor(t / 60); |
| | | t = time + ':' + ((t % 60) / 100).toFixed(2).slice(-2); |
| | | return t; |
| | | }, |
| | | |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | |
| | | */ |
| | | onShow() { |
| | | |
| | | this.pubulicPlayFun() |
| | | }, |
| | | |
| | | /** |
| | |
| | | } |
| | | this.setData({ |
| | | selectedId: e.currentTarget.dataset.index, |
| | | |
| | | }) |
| | | |
| | | |
| | |
| | | await app.MG.ugc.getTopicMessageList(query).then((res) => { |
| | | // notePage.value.total = res.totalSize |
| | | res.datas.forEach((item) => { |
| | | // item.compliceHover = false |
| | | // item.deleteHover = false |
| | | |
| | | item.createDate = this.convertTimestamp(item.createDate) |
| | | console.log(item, 'item789'); |
| | | }) |
| | | this.setData({ |
| | | "pageCount.total": res.totalSize, |
| | |
| | | myAudio.duration; //必须写,不然获取不到。。。 |
| | | setTimeout(() => { |
| | | console.log(myAudio.duration, 'myAudio.duration'); |
| | | // debugger |
| | | this.setData({ |
| | | myAudioDuration: this.format(myAudio.duration), |
| | | myAudioCurrent: this.format(myAudio.currentTime) |
| | |
| | | }); |
| | | }, |
| | | adsfhaewlf() { |
| | | |
| | | myAudio.pause(); |
| | | this.setData({ |
| | | isplay: false |
| | |
| | | } |
| | | }, |
| | | |
| | | |
| | | // 左右切换 |
| | | changeItem(item) { |
| | | console.log(item); |
| | | |
| | |
| | | } |
| | | |
| | | setTimeout(() => { |
| | | console.log(this.data.speed, 'this.data.speed'); |
| | | myAudio.startTime = this.data.myAudioDuration //开始时间 |
| | | myAudio.playbackRate = this.data.speed; // 播放速率 |
| | | }, 200); |
| | |
| | | this.setData({ |
| | | showDropdown: !this.data.showDropdown |
| | | }); |
| | | |
| | | }, |
| | | smallSpeed() { |
| | | this.setData({ |
| | | speed: 0.5, |
| | | showDropdown: !this.data.showDropdown |
| | | }) |
| | | setTimeout(() => { |
| | | myAudio.startTime = this.data.myAudioDuration //开始时间 |
| | | myAudio.playbackRate = this.data.speed; // 播放速率 |
| | | }, 200); |
| | | }, |
| | | centreSpeed() { |
| | | this.setData({ |
| | | speed: 1.5, |
| | | showDropdown: !this.data.showDropdown |
| | | }) |
| | | setTimeout(() => { |
| | | myAudio.startTime = this.data.myAudioDuration //开始时间 |
| | | myAudio.playbackRate = this.data.speed; // 播放速率 |
| | | }, 200); |
| | | }, |
| | | bigSpeed() { |
| | | this.setData({ |
| | | speed: 2, |
| | | showDropdown: !this.data.showDropdown |
| | | }) |
| | | setTimeout(() => { |
| | | myAudio.startTime = this.data.myAudioDuration //开始时间 |
| | | myAudio.playbackRate = this.data.speed; // 播放速率 |
| | | }, 200); |
| | | }, |
| | | smallSpeeDmultiple() { |
| | | this.setData({ |
| | | speed: 1, |
| | | showDropdown: !this.data.showDropdown |
| | | }) |
| | | setTimeout(() => { |
| | | myAudio.startTime = this.data.myAudioDuration //开始时间 |
| | | myAudio.playbackRate = this.data.speed; // 播放速率 |
| | | }, 200); |
| | | } |
| | | }) |