From 97cdb61c25cfc82d25d9d91b38e976344a7f55ca Mon Sep 17 00:00:00 2001 From: douzhuo <17611323298@163.com> Date: Thu, 10 Mar 2022 15:33:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 51 +++- components/yz-audio/yz-audio.vue | 51 +++- pages/learning/Thefulltext/index2.vue | 353 ++++++------------------- pages/mine/details.vue | 362 ++++++++------------------ pages/mine/details2.vue | 201 ++++---------- pages/mine/equipment/index.vue | 226 ++++++++-------- 6 files changed, 451 insertions(+), 793 deletions(-) diff --git a/App.vue b/App.vue index 47bedef..c807610 100644 --- a/App.vue +++ b/App.vue @@ -21,6 +21,53 @@ CustomBar: Vue.prototype.CustomBar, windowHeight: Vue.prototype.windowHeight }; + }, + + methods: { + // 目前使用页面为录音页面 + SPEAKERSTYLE(index) { + let obj = { + color: '', + } + switch (index) { + case 1: + obj.color = '#60CBEC'; + break; + case 2: + obj.color = '#EC8B47'; + break; + case 3: + obj.color = '#4F861E'; + break; + case 5: + obj.color = '#4980C8'; + break; + case 6: + obj.color = '#60CBEC'; + break; + case 7: + obj.color = '#EC8B47'; + break; + case 8: + obj.color = '#4F861E'; + break; + default: + obj.color = '#9F61C8'; + break; + } + return obj + }, + }, + + filters: { + // ASCII码转换 大写字母A是65 演讲人是从1开始所以num+64 + toCapital(num) { + let str = '' + if (num) { + str = String.fromCharCode(num + 64) + } + return str + } } }); } @@ -126,8 +173,8 @@ obeyMuteSwitch: false }); }, - - + + onShow(options) { const token = uni.getStorageSync("weapp_session_login_data") if (typeof token.token != "string") { diff --git a/components/yz-audio/yz-audio.vue b/components/yz-audio/yz-audio.vue index f610d90..195e113 100644 --- a/components/yz-audio/yz-audio.vue +++ b/components/yz-audio/yz-audio.vue @@ -27,8 +27,9 @@ - - - + @@ -602,7 +527,7 @@ return (e) => { return this.getTime(e); } - } + }, }, onLoad: function(options) { @@ -636,13 +561,6 @@ var currPage = pages[pages.length - 1]; //当前页面 var info = currPage.data.info; } - - // this.onPause() - // this.onCanplay() - // this.onEnded() - // this.onSeeking() - // this.onSeeked() - // this.TimeUpdate() this.init(info) }, @@ -1025,64 +943,60 @@ var bgcd = this.sliderValue * 1000; this.newluyinList = []; this.dialogList = []; - uni.request({ - url: config.service.getCorpusAnal + '?corpusId=' + this.luyinList[this.csdFileindex].id + - "&bg=" + bgcd + "&speaker=" + this.roleindex, //仅为示例,并非真实接口地址。 - method: "GET", - header: { - 'content-type': 'application/json', - 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token - }, - success: (data) => { - console.log(data) - this.tablist = []; - let jsonInfo = JSON.parse(data.data.data.audioContent); - for (var i = 0; i <= data.data.data.speakerNum; i++) { - if (i === 0) { - this.tablist.push({ - name: '全部' - }) - } else { - this.tablist.push({ - name: String.fromCharCode(i + 64) - }) - } - } - - if (data.data.data.speaker == null) { - this.roleindexbiaoji = 0; - this.dshfkjsdkksodofydwfkhwdfkjh = 0; + let obj = { + corpusId: this.luyinList[this.csdFileindex].id, + bg: bgcd, + speaker: this.roleindex + } + this.$u.get(config.service.getCorpusAnal, obj).then((data) => { + console.log(data) + this.tablist = []; + let jsonInfo = JSON.parse(data.audioContent); + for (var i = 0; i <= data.speakerNum; i++) { + if (i === 0) { + this.tablist.push({ + name: '全部' + }) } else { - this.tablist[data.data.data.speaker].name = this.tablist[data.data.data.speaker] - .name + "顾问"; - this.roleindexbiaoji = data.data.data.speaker - 1; - this.dshfkjsdkksodofydwfkhwdfkjh = data.data.data.speaker - 1; + this.tablist.push({ + name: String.fromCharCode(i + 64) + }) } + } - if (this.roleindex > this.tablist.length - 1) { - this.roleindex = this.tablist.length - 1 - this.fenjiaoseunfo() - } + if (data.speaker == null) { + this.roleindexbiaoji = 0; + this.dshfkjsdkksodofydwfkhwdfkjh = 0; + } else { + this.tablist[data.speaker].name = this.tablist[data.speaker] + .name + "顾问"; + this.roleindexbiaoji = data.speaker - 1; + this.dshfkjsdkksodofydwfkhwdfkjh = data.speaker - 1; + } + if (this.roleindex > this.tablist.length - 1) { + this.roleindex = this.tablist.length - 1 + this.fenjiaoseunfo() + } - this.speaker = data.data.data.speaker; - //上拉标记点 - this.textindex = data.data.data.index; - //下拉标记点 - this.toptextindex = data.data.data.index; - jsonInfo.forEach(item => { - item.message = JSON.parse(item.onebest) - item.backindex = this.csdFileindex - }) - console.log(jsonInfo) + this.speaker = data.speaker; + //上拉标记点 + this.textindex = data.index; + //下拉标记点 + this.toptextindex = data.index; - this.newluyinList = jsonInfo; - if (this.textindex == null) { - return - } else { - this.dialogList.push(jsonInfo[this.textindex]); - } + jsonInfo.forEach(item => { + item.message = JSON.parse(item.onebest) + item.backindex = this.csdFileindex + }) + console.log(jsonInfo) + + this.newluyinList = jsonInfo; + if (this.textindex == null) { + return + } else { + this.dialogList.push(jsonInfo[this.textindex]); } }) }, @@ -1112,11 +1026,6 @@ } } } - const currTimeStr = this.formatTime(currentTime); - this.sliderValue = parseInt(currentTime); - // 变动的时间 - //进度条最大值 - this.sliderMax = this.luyinList[this.csdFileindex].recordDuration; this.$forceUpdate() }, @@ -1164,8 +1073,6 @@ }, //搜索跳转 adasdasdasd(e) { - const currTimeStr = this.formatTime(e) - this.currentTimeStr = currTimeStr this.$refs.zyAudio.seek(e) if (uni.getStorageSync('entrance') == 1) { return @@ -1642,8 +1549,6 @@ } else { this.dialogList.push(this.newluyinList[data.index]) } - const currTimeStr = this.formatTime(e.detail.value) - this.currentTimeStr = currTimeStr this.$refs.zyAudio.seek(e.detail.value); this.$refs.zyAudio.play(); }) @@ -1673,8 +1578,6 @@ this.textindex = data.data.data.index; this.toptextindex = data.data.data.index; this.dialogList.push(this.newluyinList[data.data.data.index]) - const currTimeStr = this.formatTime(newtime) - this.currentTimeStr = currTimeStr this.$refs.zyAudio.seek(newtime) this.$refs.zyAudio.play() } diff --git a/pages/mine/equipment/index.vue b/pages/mine/equipment/index.vue index 9daf6f2..3cf2565 100644 --- a/pages/mine/equipment/index.vue +++ b/pages/mine/equipment/index.vue @@ -2,9 +2,10 @@ - + + - + - + - - + + @@ -30,23 +32,29 @@ - 电量: + 电量: {{item.electricity}}% {{item.electricity}}% - + - - - - - - + + + + + + 信号:0 信号:{{item.signalDevice}} - + 设备编号 @@ -55,8 +63,8 @@ 录音状态 关闭 - 开启 - 关闭 + 开启 + 关闭 待上传 @@ -66,7 +74,7 @@ - @@ -91,8 +99,7 @@ export default { data() { return { - tablist: [ - { + tablist: [{ name: "全部(0)", }, { @@ -109,35 +116,35 @@ } ], activeClass: 0, - pageNum:1, - pageSize:20, - imei:"", - orgcode:"", - newListdata:[], - buildingID:'', - jump:'' + pageNum: 1, + pageSize: 20, + imei: "", + orgcode: "", + newListdata: [], + buildingID: '', + jump: '' }; }, onReachBottom() { - this.pageNum +=1; + this.pageNum += 1; this.init() }, - onPullDownRefresh(){ + onPullDownRefresh() { this.init() - setTimeout(function () { - uni.stopPullDownRefresh(); + setTimeout(function() { + uni.stopPullDownRefresh(); }, 1000); }, onLoad(options) { - if(options.active){ - this.activeClass=options.active - }else{ - this.activeClass=0 + if (options.active) { + this.activeClass = options.active + } else { + this.activeClass = 0 } - this.newListdata=[] - this.pageNum=1; - this.pageSize=20; - this.init() + this.newListdata = [] + this.pageNum = 1; + this.pageSize = 20; + this.init() }, filters: { formatDate: (dateTimeStamp) => { @@ -147,113 +154,114 @@ var day = hour * 24; var halfamonth = day * 15; var month = day * 30; - var now = new Date().getTime(); + var now = new Date().getTime(); var diffValue = now - newDate; - if(diffValue < 0){return;} - var monthC =diffValue/month; - var weekC =diffValue/(7*day); - var dayC =diffValue/day; - var hourC =diffValue/hour; - var minC =diffValue/minute; - var result = ''; - if(weekC>=1){ - result= "1周前"; - }else if(dayC>=1){ - result=""+ parseInt(dayC) +"天前"; - } else if(hourC>=1){ - result=""+ parseInt(hourC) +"小时前"; + if (diffValue < 0) { + return; } - else if(minC>=1){ - result=""+ parseInt(minC) +"分钟前"; - }else{ - result="刚刚"; + var monthC = diffValue / month; + var weekC = diffValue / (7 * day); + var dayC = diffValue / day; + var hourC = diffValue / hour; + var minC = diffValue / minute; + var result = ''; + if (weekC >= 1) { + result = "1周前"; + } else if (dayC >= 1) { + result = "" + parseInt(dayC) + "天前"; + } else if (hourC >= 1) { + result = "" + parseInt(hourC) + "小时前"; + } else if (minC >= 1) { + result = "" + parseInt(minC) + "分钟前"; + } else { + result = "刚刚"; } return result; } }, methods: { - shecs(){ - this.newListdata=[] - this.pageNum=1; - this.pageSize=20; - this.init() + shecs() { + this.newListdata = [] + this.pageNum = 1; + this.pageSize = 20; + this.init() }, // tab clocktab(index) { - this.activeClass=index; - this.newListdata=[] - this.pageNum=1; - this.pageSize=20; + this.activeClass = index; + this.newListdata = [] + this.pageNum = 1; + this.pageSize = 20; this.init() }, - init(){ - this.buildingID=uni.getStorageSync('buildingID').id; + init() { + this.buildingID = uni.getStorageSync('buildingID').id; const parames = { pageNum: this.pageNum, pageSize: this.pageSize, - query:{ - imei:this.imei, - onLine:this.activeClass, - propertyId:this.buildingID, - orderType:1 + query: { + imei: this.imei, + onLine: this.activeClass, + propertyId: this.buildingID, + orderType: 1 } } - - if(this.activeClass==0){ - parames.query.onLine=null + + if (this.activeClass == 0) { + parames.query.onLine = null } this.$u.post("/equipment/apiFindByPage", parames).then(res => { - this.tablist[0].name="全部("+res.allCount+")"; - this.tablist[1].name="在线("+res.eqOnLineCount+")"; - this.tablist[2].name="低电量("+res.lowElectricityCount+")"; - this.tablist[3].name="今日活跃("+res.activeCount+")"; - this.tablist[4].name="离线("+res.eqOffLineCount+")"; - if(res.obj.list.results==null){ - if (this.pageNum == 1){ + this.tablist[0].name = "全部(" + res.allCount + ")"; + this.tablist[1].name = "在线(" + res.eqOnLineCount + ")"; + this.tablist[2].name = "低电量(" + res.lowElectricityCount + ")"; + this.tablist[3].name = "今日活跃(" + res.activeCount + ")"; + this.tablist[4].name = "离线(" + res.eqOffLineCount + ")"; + if (res.obj.list.results == null) { + if (this.pageNum == 1) { return - }else{ + } else { uni.showToast({ - title: '已经到底了!', - duration: 2000 + title: '已经到底了!', + duration: 2000 }); } - }else{ - res.obj.list.results.forEach(item=>{ - if(item.onLine==0){ - item.signalDevice=0 + } else { + res.obj.list.results.forEach(item => { + if (item.onLine == 0) { + item.signalDevice = 0 } - - if(item.electricity==''){ - item.electricity=0 + + if (item.electricity == '') { + item.electricity = 0 } - if(item.electricity>100){ - item.electricity=100 + if (item.electricity > 100) { + item.electricity = 100 } - let num=this.ascformatDate(item.updateTime) - if(num>12){ - item.electricity=0 + let num = this.ascformatDate(item.updateTime) + if (num > 12) { + item.electricity = 0 } - + }) - + if (this.pageNum == 1) { - this.newListdata=res.obj.list.results + this.newListdata = res.obj.list.results } else { - this.newListdata = [...this.newListdata, ...res.obj.list.results]; + this.newListdata = [...this.newListdata, ...res.obj.list.results]; } } }) }, - ascformatDate(dateTimeStamp){ + ascformatDate(dateTimeStamp) { let newDate = new Date(dateTimeStamp.replace(/-/g, '/')).getTime(); let minute = 1000 * 60; let hour = minute * 60; let day = hour * 24; let halfamonth = day * 15; let month = day * 30; - let now = new Date().getTime(); + let now = new Date().getTime(); let diffValue = now - newDate; - let result =diffValue/hour; + let result = diffValue / hour; return result; } }, @@ -265,7 +273,7 @@ width: 100%; min-height: 100vh; background: #FFFFFF; - + .header { position: sticky; top: var(--window-top); @@ -384,6 +392,7 @@ background-color: #333333; } } + .you11 { width: 20rpx; height: 28rpx; @@ -392,7 +401,7 @@ background-size: 100% 100%; display: flex; flex-direction: column-reverse; - + .youimg { width: 100%; background-color: red; @@ -407,6 +416,7 @@ color: #333333; margin-left: 6rpx; } + .you22 { width: 114rpx; height: 30rpx; @@ -463,7 +473,7 @@ font-size: 24rpx; color: #333333; text-indent: 30rpx; - + .stayupload { color: #F41313; }