From 0da48e246e461a3ce4fd10cf09f3b7bd7e50f977 Mon Sep 17 00:00:00 2001 From: douzhuo <17611323298@163.com> Date: Thu, 19 May 2022 18:42:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Customerportrait/Receivedetailabout.vue | 18 +++++--- pages/center/Piabodata/Userinsightinto.vue | 9 +++- pages/center/prohibited/details.vue | 45 ++++++++++++------- pages/mine/details.vue | 4 +- pages/mine/details2.vue | 1 + 5 files changed, 51 insertions(+), 26 deletions(-) diff --git a/pages/center/Piabodata/Customerportrait/Receivedetailabout.vue b/pages/center/Piabodata/Customerportrait/Receivedetailabout.vue index e7ebb2e..7d3ac4b 100644 --- a/pages/center/Piabodata/Customerportrait/Receivedetailabout.vue +++ b/pages/center/Piabodata/Customerportrait/Receivedetailabout.vue @@ -447,7 +447,8 @@ ACTION: Symbol('zaudio'), // 唯一值区分每个页面的方法 isPageHide: false, // 是否息屏 - duration: '', // 总时长 + duration: '', // 总时长 + info: {}, // 播放时间 }; }, @@ -460,6 +461,7 @@ }, onLoad(options) { + if (options.info) this.info = JSON.parse(options.info) this.customerId = options.customerId; this.$zaudio.autoPlay = true //注意: 不同的回调方法, 相同的业务函数方法名, 不会相互影响; @@ -512,15 +514,17 @@ bg: 0 } } - !this.isPageHide && this.init(info) + !this.isPageHide && this.init(Object.keys(this.info).length > 0 ? this.info : info) }, - onHide() { + onHide() { + this.info = {} this.isPageHide = true }, // 销毁实例 - onUnload() { + onUnload() { + this.info = {} //卸载不需要的业务和获取播放状态的业务,提高页面性能 this.$zaudio.off('seek', this.ACTION); this.$zaudio.off('stop', this.ACTION); @@ -775,12 +779,12 @@ const message = this.dialogList[0].message; if (!message) return for (let i = 0; i < message.length; i++) { - if ((Math.floor(message[i].bg / 1000) <= this.playNow && this.playNow < Math.floor(message[i].ed / + if ((Math.floor(message[i].bg / 1000) <= this.playNow && this.playNow <= Math.floor(message[i].ed / 1000))) { this.scrollId = "dialog" + this.csdFileindex + "text" + message[i].bg; break; } - if (i < message.length - 1 && Math.floor(message[i].ed / 1000) < this.playNow && this.playNow < + if (i < message.length - 1 && Math.floor(message[i].ed / 1000) <= this.playNow && this.playNow <= Math.floor(message[i + 1].bg / 1000)) { this.scrollId = "dialog" + this.csdFileindex + "text" + message[i].bg; break; @@ -810,8 +814,8 @@ } this.datetiem = res[0].receptionTime; this.Alladdtodigest = res[0].status; + this.zyAudio() this.getCorpusAnalysis(info) - if (info.bg == 0 || type == 'Receivedetailabout') this.zyAudio() } }) }, diff --git a/pages/center/Piabodata/Userinsightinto.vue b/pages/center/Piabodata/Userinsightinto.vue index 2fad9ce..6eacad7 100644 --- a/pages/center/Piabodata/Userinsightinto.vue +++ b/pages/center/Piabodata/Userinsightinto.vue @@ -201,8 +201,15 @@ }, //查看 Toview(item,i){ + console.log(item) + let keywordsid = 0 + if (item.matchKeywords[i].children) { + keywordsid = item.matchKeywords[i].children[0].keywordsId + } else { + keywordsid = item.matchKeywords[i].keywordsId + } uni.navigateTo({ - url: '/pages/center/Piabodata/Customerportrait/Receivingrecords?datatype='+this.activeTotal+"&keywordsId="+item.matchKeywords[i].keywordsId+"&starttime="+this.timeobj.statDateStart+"&endoftime="+this.timeobj.statDateEnd + url: '/pages/center/Piabodata/Customerportrait/Receivingrecords?datatype='+this.activeTotal+"&keywordsId="+keywordsid+"&starttime="+this.timeobj.statDateStart+"&endoftime="+this.timeobj.statDateEnd }) }, //时间切换 diff --git a/pages/center/prohibited/details.vue b/pages/center/prohibited/details.vue index 0c6da57..4e6b802 100644 --- a/pages/center/prohibited/details.vue +++ b/pages/center/prohibited/details.vue @@ -269,7 +269,7 @@ this.stateisshow = option.stateisshow; this.itemobj = uni.getStorageSync('searchobj'); if (option.isMerge) this.isMerge = option.isMerge - this.$zaudio.autoPlay = false + this.$zaudio.autoPlay = true //注意: 不同的回调方法, 相同的业务函数方法名, 不会相互影响; this.$zaudio.on('stop', this.ACTION, () => { @@ -295,8 +295,11 @@ }, onShow() { + this.scrollId = '' //实时渲染当前的播放状态 - this.$zaudio.syncRender() + if (this.current == 1) { + this.$zaudio.syncRender() + } this.permissions = uni.getStorageSync('weapp_session_Menu_data') // 权限 this.roleindex = 0; @@ -320,12 +323,8 @@ this.$zaudio.off('seek', this.ACTION); this.$zaudio.off('stop', this.ACTION); this.$zaudio.off('playing', this.ACTION); - this.$zaudio.setAudio([{ - src: '', - title: '', - singer: '', - coverImgUrl: '' - }]) + // this.$zaudio.setAudio([]) + }, methods: { @@ -395,7 +394,6 @@ this.customerId = res.results[0].id; this.current = 0 uni.setStorageSync('nextPageObj', JSON.stringify(this.nextPageObj)) - this.$zaudio.resetDatas() this.resetAudioParams() this.prohibitedMatch() }).catch(e => { @@ -445,7 +443,7 @@ this.roleindex = 0; this.gituserlist() this.findTabooWords() - this.zyAudio() + // this.zyAudio() } else { uni.showToast({ icon: "none", @@ -566,14 +564,14 @@ this.sliderMax = this.getTime(res[0].recordDuration) this.timeStr = this.getTime(res[0].recordDuration) this.date = res[0].receptionTime; - this.getCorpusAnalysis(info); + this.getCorpusAnalysis(info, type); } else { this.luyinList = res; this.recordPath = res[0].recordPath this.sliderMax = this.getTime(res[0].recordDuration) this.timeStr = this.getTime(res[0].recordDuration) this.date = res[0].receptionTime; - this.getCorpusAnalysis(info); + this.getCorpusAnalysis(info, type); } } }) @@ -585,7 +583,7 @@ }, // 获取转义后的对话结果 - getCorpusAnalysis(info) { + getCorpusAnalysis(info, type) { this.dialogList = []; this.newluyinList = [] uni.request({ @@ -659,8 +657,10 @@ this.newluyinList = jsonInfo; this.dialogList.push(jsonInfo[0]); console.log(this.dialogList, '12312321') - var itc = parseInt(info.bg / 1000) - this.adasdasdasd(itc) + if (type == 'show') { + var itc = parseInt(info.bg / 1000) + this.adasdasdasd(itc) + } this.$forceUpdate() } }) @@ -810,6 +810,7 @@ // 选中下标 change(index) { this.current = index; + this.scrollId = '' if (index == 1) { this.zyAudio() } @@ -823,6 +824,18 @@ this.infos = item this.audioType = true this.init(this.infos, type) + let data = [{ + src: this.recordPath, + title: '录音音频', + singer: '', + coverImgUrl: '' + }] + this.$zaudio.setAudio(data) + //渲染第一首音频 + this.$zaudio.setRender(0) + setTimeout(() => { + this.adasdasdasd(parseInt(item.bg / 1000)) + }, 1500) return } else { this.audioType = false @@ -870,7 +883,7 @@ this.scrollId = "dialog" + this.csdFileindex + "text" + message[i].bg; break; } - if (i < message.length - 1 && Math.floor(message[i].ed / 1000) < this.playNow && this.playNow < + if (i < message.length - 1 && Math.floor(message[i].ed / 1000) <= this.playNow && this.playNow <= Math.floor(message[i + 1].bg / 1000)) { this.scrollId = "dialog" + this.csdFileindex + "text" + message[i].bg; break; diff --git a/pages/mine/details.vue b/pages/mine/details.vue index 38daefd..57042fe 100644 --- a/pages/mine/details.vue +++ b/pages/mine/details.vue @@ -451,12 +451,12 @@ const message = this.dialogList[0].message; if (!message) return for (let i = 0; i < message.length; i++) { - if ((Math.floor(message[i].bg / 1000) <= this.playNow && this.playNow < Math.floor(message[i].ed / 1000))) { + if ((Math.floor(message[i].bg / 1000) <= this.playNow && this.playNow <= Math.floor(message[i].ed / 1000))) { console.log(message[i]) this.scrollId = "dialog" + this.csdFileindex + "text" + message[i].bg; break; } - if (i < message.length - 1 && Math.floor(message[i].ed / 1000) < this.playNow && this.playNow < Math.floor(message[i + 1].bg / 1000)) { + if (i < message.length - 1 && Math.floor(message[i].ed / 1000) <= this.playNow && this.playNow <= Math.floor(message[i + 1].bg / 1000)) { this.scrollId = "dialog" + this.csdFileindex + "text" + message[i].bg; break; } diff --git a/pages/mine/details2.vue b/pages/mine/details2.vue index fb5b5cc..2a2ab1d 100644 --- a/pages/mine/details2.vue +++ b/pages/mine/details2.vue @@ -670,6 +670,7 @@ }, //关键词点击 tapbadge(item) { + this.Pinspeak = false //进搜索页面 uni.navigateTo({ url: '/pages/learning/Keywordsearch?customerId=' + this.customerId + "&keyword=" + item +