Browse Source

提交

test
douzhuo 2 years ago
parent
commit
97cdb61c25
6 changed files with 451 additions and 793 deletions
  1. +49
    -2
      App.vue
  2. +40
    -11
      components/yz-audio/yz-audio.vue
  3. +78
    -275
      pages/learning/Thefulltext/index2.vue
  4. +114
    -248
      pages/mine/details.vue
  5. +52
    -149
      pages/mine/details2.vue
  6. +118
    -108
      pages/mine/equipment/index.vue

+ 49
- 2
App.vue View File

@@ -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") {


+ 40
- 11
components/yz-audio/yz-audio.vue View File

@@ -27,8 +27,9 @@

<view class="slidebox">
<slot name="extraCtrls">
<image @click="backAudio" class="slide-img" :src="require('./static/backimg.png')" mode=""></image>
<!-- <text class="hItem extrButton" @click="$emit('Button1Click')"
<image @click="backAudio" class="slide-img" :src="require('./static/backimg.png')" mode="">
</image>
<!-- <text class="hItem extrButton" @click="$emit('Button1Click')"
v-show="isButton1Visible">{{button1Text}}</text>
<text class="hItem extrButton" @click="$emit('Button2Click')"
v-show="isButton2Visible">{{button2Text}}</text>
@@ -54,7 +55,11 @@
*/

import Vue from 'vue';
import { mapState, mapActions, mapMutations } from 'vuex'
import {
mapState,
mapActions,
mapMutations
} from 'vuex'
export default {
props: {
isButton1Visible: {
@@ -97,24 +102,42 @@
playState: "pause", //"loading"/"playing"/"pause"
isSliderChanging: false,
isFirst: false, // 是否阻止第一次赋值
audio: null, // 音频对象
};
},
created() {
// 自定义组件,需要传递第二个参数为this,否则后续的pause等操作不起作用
this.videoCtx = uni.createVideoContext("videoPlayer", this);
this.createPageAudio()
this.createAudio()
// 获取当前音频的总时长
let audio = uni.createAudioContext();
audio.src = this.src;
this.duration = audio.duration
},

methods: {
...mapMutations(['createAudio', 'setAudio']),

createPageAudio() {
this.audio = uni.createInnerAudioContext();
this.audio.autoplay = false;
this.audio.onCanplay(() => {
// this.duration = this.audio.duration
console.log(this.audio, 'audio')
console.log(this.audio.duration, 'audio')
})
},

resetSrc(value) {
this.resetParams()
this.videoCtx.src = value
// this.audio.src = value;
this.$forceUpdate()
},

setSrc(value) {
this.src = value;
this.playState = 'pause'
// 获取当前音频的总时长
this.audio.src = value;
this.$forceUpdate()
},
setPoster(value) {
this.poster = value;
@@ -125,6 +148,12 @@
setSinger(value) {
this.singer = value;
},

resetParams() {
this.currentTime = 0;
this.$forceUpdate()
},

playerOnPlay(e) {
this.playState = "playing";
console.log('playerOnPlay', e)
@@ -200,7 +229,7 @@
this.isSliderChanging = true;
console.log(e, '当前正在改变')
},
// 点击后台播放音频事件
backAudio() {
this.pause()
@@ -260,7 +289,7 @@
.slidebox {
flex-shrink: 0;
display: flex;
.slide-img {
width: 75rpx;
height: 75rpx;


+ 78
- 275
pages/learning/Thefulltext/index2.vue View File

@@ -14,23 +14,10 @@
</view>
</view>
<view class="call_record_time_one">接待时长 {{alltimeStr}}</view>
<view class="audio-container">
<view class="audio-play" @tap="changePlayState">
<image class="image" mode="widthFix"
:src="audioPlay ? 'https://qufang.oss-cn-beijing.aliyuncs.com/upload/icon/xcx/jjycrm/pause.png' : 'https://qufang.oss-cn-beijing.aliyuncs.com/upload/icon/xcx/jjycrm/play.png'">
</image>
</view>
<view class="audio-slider">
<view class="audio-time">
<text>{{currentTimeStr}}</text>
</view>
<slider class="slider" min="0" :max="sliderMax" @change="sliderChangeComplate" block-size="14"
:value="sliderValue" activeColor="blue"></slider>
<view class="audio-time">
<text>{{timeStr}}</text>
</view>
</view>
</view>

<yz-audio class="audio-container" ref="zyAudio" @timeUpdate="TimeUpdate"
@sliderChangeComplate="sliderChangeComplate"></yz-audio>

</view>
<scroll-view :scroll-top="scrollTop" lower-threshold='100px' @scrolltolower="ltolower()" upper-threshold='40px'
@scrolltoupper="rolltoupper()" :scroll-into-view="scrollId" scroll-y="true" class="text scroll-Y">
@@ -46,51 +33,10 @@
v-for="(item,index) in dialog.message" :key="index" :data-speaker="item.speaker">
<view class="avatar">
<view class="avatar">
<view v-if="item.speaker == 1" style="color: #60CBEC;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix">
</image>
<text v-else>A</text>
</view>
<view v-if="item.speaker == 2" style="color: #EC8B47;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix">
</image>
<text v-else>B</text>
</view>
<view v-if="item.speaker == 3" style="color: #4F861E;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix">
</image>
<text v-else>C</text>
</view>
<view v-if="item.speaker == 4" style="color: #9F61C8;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix">
</image>
<text v-else>D</text>
</view>
<view v-if="item.speaker == 5" style="color: #4980C8;">
<view :style="[SPEAKERSTYLE(item.speaker)]">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix">
</image>
<text v-else>E</text>
</view>

<view v-if="item.speaker == 6" style="color: #60CBEC;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix">
</image>
<text v-else>F</text>
</view>
<view v-if="item.speaker == 7" style="color: #EC8B47;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix">
</image>
<text v-else>G</text>
</view>
<view v-if="item.speaker == 8" style="color: #4F861E;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix">
</image>
<text v-else>H</text>
</view>
<view v-if="item.speaker == 9" style="color: #9F61C8;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix">
</image>
<text v-else>I</text>
<text v-else>{{ item.speaker | toCapital }}</text>
</view>
</view>
</view>
@@ -260,10 +206,6 @@
audioPlay: false, //当前的播放状态控制
sliderValue: 0, //进度条最小值
end: false,
sliderMax: 0, //进度条最大值
innerAudioContext: "", //播放实例
currentTimeStr: "00:00", //当前进度的时间
timeStr: "00:00", //总的时间
recordPath: "",
csdFileindex: 0,
date: "", //年月日
@@ -305,38 +247,12 @@
}

console.log(info, 656456546)
this.innerAudioContext = uni.createInnerAudioContext();
this.innerAudioContext.autoplay = false;
this.innerAudioContext.title = '音频';

this.onPlay()
this.onPause()
this.onCanplay()
this.onEnded()
this.onSeeking()
this.onSeeked()
this.TimeUpdate()

this.getluyinList(info);
},
// 在组件实例被从页面节点树移除时执行
destroyed: function() {
clearTimeout(this.timer)
//暂停
// this.innerAudioContext.pause()
// 销毁
this.innerAudioContext.destroy();
},
// 销毁实例
onUnload: function() {
//暂停
// this.innerAudioContext.pause()
// 销毁
this.innerAudioContext.destroy();
},

methods: {
toKeywordsearch() {
this.innerAudioContext.destroy();
uni.navigateTo({
url: '/pages/learning/Thefulltext/search?customerId=' + this.customerId + "&status=" + this
.status + "&skpl=" + "2"
@@ -359,69 +275,24 @@
// console.log(res)
})
},
onPlay() {
this.innerAudioContext.onPlay(() => {
// 播放监听
console.log('播放!');
this.audioPlay = true;
});
},
onPause() {
this.innerAudioContext.onPause(() => {
// 暂停监听
console.log('暂停播放!');
this.audioPlay = false
});
},
onCanplay() {
this.innerAudioContext.onCanplay((callback) => {
console.log("缓冲回调", this.innerAudioContext.duration);
})
},
onEnded() {
this.innerAudioContext.onEnded(() => {
// 结束播放监听
console.log('播放结束!');
this.audioPlay = false;
});
},
onSeeking() {
this.innerAudioContext.onSeeking((res) => {
console.log("进行跳转", res);
})
},
onSeeked() {
this.innerAudioContext.onSeeked((res) => {
console.log("结束跳转", res);
this.$forceUpdate()
});
},
TimeUpdate() {
this.innerAudioContext.onTimeUpdate(() => {
const {
currentTime,
duration
} = this.innerAudioContext;
this.playNow = parseInt(currentTime * 1000)
if (this.dialogList.length == 0) {
TimeUpdate(e) {
const {
currentTime,
duration
} = e;
this.playNow = parseInt(currentTime * 1000)
if (this.dialogList.length == 0) {

} else {
const message = this.dialogList[0].message;
for (let i = 0; i < message.length; i++) {
if (Number(message[i].bg) < this.playNow && Number(message[i].ed) > this.playNow) {
this.scrollId = "dialog" + this.csdFileindex + "text" + message[i].bg;
break;
}
} else {
const message = this.dialogList[0].message;
for (let i = 0; i < message.length; i++) {
if (Number(message[i].bg) < this.playNow && Number(message[i].ed) > this.playNow) {
this.scrollId = "dialog" + this.csdFileindex + "text" + message[i].bg;
break;
}
}
const currTimeStr = this.formatTime(currentTime);
this.sliderValue = parseInt(currentTime);
// 变动的时间
this.currentTimeStr = currTimeStr;
//进度条最大值
this.sliderMax = this.luyinList[this.csdFileindex].recordDuration;
this.$forceUpdate()
});
}
this.$forceUpdate()
},
//下一页
ltolower() {
@@ -438,7 +309,6 @@
this.dialogList[0].message.push(item)
})
}
console.log("下一页", this.textindex)
},
//上一页
rolltoupper() {
@@ -464,35 +334,13 @@
},
//获取点赞列表isLiked likegetLike
getdianzan() {
uni.request({
url: config.service.likegetLike + '?targetId=' + this.customerId, //仅为示例,并非真实接口地址。
method: "GET",
header: {
'content-type': 'application/json',
'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
},
success: (data) => {
if (data.data.code == 10000) {
this.isLiked = data.data.data.like;
} else {
uni.hideLoading();
uni.showModal({
title: '提示',
content: '请求数据失败,请重新尝试',
showCancel: false
});
}
},
fail(error) {
uni.hideLoading();
uni.showModal({
title: '提示',
content: '网络异常,请重新尝试',
showCancel: false
});
return false;
}
});
this.$u.get(config.service.likegetLike, {
targetId: this.customerId
}).then(data => {
this.isLiked = data.like;
}).catch(e => {
uni.hideLoading();
})
},
// 获取评论列表
getCommentList() {
@@ -506,8 +354,6 @@
},
// 获取录音记录列表
getluyinList(info) {
this.sliderMax = 0; //进度条最大值
this.timeStr = "00:00"; //总的时间
const parames = {
pageNum: 1,
pageSize: 100,
@@ -522,118 +368,83 @@
if (info.bg != 0) {
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.creatAudio()
this.zyAudio()
} 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.creatAudio()
this.zyAudio()
}
}
})
},
//搜索跳转
adasdasdasd(e) {
const currTimeStr = this.formatTime(e)
this.currentTimeStr = currTimeStr
this.innerAudioContext.seek(e);
this.innerAudioContext.play();
this.$refs.zyAudio.seek(e);
this.$refs.zyAudio.play();
},

// 获取转义后的对话结果
getCorpusAnalysis(info) {
this.dialogList = [];
uni.request({
url: config.service.getCorpusAnal + '?corpusId=' + this.luyinList[this.csdFileindex].id +
"&bg=" + info.bg + "&speaker=" + this.roleindex, //仅为示例,并非真实接口地址。
method: "GET",
header: {
'content-type': 'application/json',
'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
},
success: (data) => {
let jsonInfo = JSON.parse(data.data.data.audioContent);
//上拉标记点
this.textindex = data.data.data.index;
//下拉标记点
this.toptextindex = data.data.data.index;

console.log(info.onebest + ":66666666666666666666666666666")
jsonInfo.forEach(item => {
item.message = JSON.parse(item.onebest)
item.backindex = this.csdFileindex;
if (info.onebest) {
item.message.forEach(che => {
if (che.onebest == info.onebest) {
che.onebest =
`<font style='color: red'>${che.onebest}</font>`;
}
})
}
})
this.newluyinList = jsonInfo;
this.dialogList.push(jsonInfo[this.textindex]);
var itc = parseInt(info.bg / 1000)
this.adasdasdasd(itc)
}
let obj = {
corpusId: this.luyinList[this.csdFileindex].id,
bg: info.bg,
speaker: this.roleindex,
}
this.$u.get(config.service.getCorpusAnal, obj).then((data) => {
let jsonInfo = JSON.parse(data.audioContent);
//上拉标记点
this.textindex = data.index;
//下拉标记点
this.toptextindex = data.index;

jsonInfo.forEach(item => {
item.message = JSON.parse(item.onebest)
item.backindex = this.csdFileindex;
if (info.onebest) {
item.message.forEach(che => {
if (che.onebest == info.onebest) {
che.onebest =
`<font style='color: red'>${che.onebest}</font>`;
}
})
}
})
this.newluyinList = jsonInfo;
this.dialogList.push(jsonInfo[this.textindex]);
this.adasdasdasd(parseInt(info.bg / 1000))
})
},
getTime(time) {
return util.formatSecond(time)
},
//录音实例
creatAudio() {
this.innerAudioContext = uni.createInnerAudioContext();
this.innerAudioContext.autoplay = true;
this.innerAudioContext.src = this.recordPath;
this.innerAudioContext.title = '音频';
this.onPlay()
this.onPause()
this.onCanplay()
this.onEnded()
this.onSeeking()
this.onSeeked()
this.TimeUpdate()

//录音实例
zyAudio() {
console.log('this.recordPath', this.recordPath)
this.$refs.zyAudio.setSrc(this.recordPath)
},
// 录音暂停播放
changePlayState() {
if (this.audioPlay == false) {
this.innerAudioContext.play();
} else {
this.innerAudioContext.pause()
}
},

//音频前进回退
sliderChangeComplate(e) {
this.$refs.zyAudio.pause()
let platetime = e.detail.value * 1000;
this.dialogList = []
uni.request({
url: config.service.fastForward + '?corpusId=' + this.luyinList[this.csdFileindex].id +
"&bg=" + platetime, //仅为示例,并非真实接口地址。
method: "GET",
header: {
'content-type': 'application/json',
'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
},
success: (data) => {
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(e.detail.value)
this.currentTimeStr = currTimeStr
this.innerAudioContext.seek(e.detail.value);
this.innerAudioContext.play();
}
this.$u.get(config.service.fastForward, {
corpusId: this.luyinList[this.csdFileindex].id,
bg: platetime
}).then(data => {
this.textindex = data.index;
this.toptextindex = data.index;
this.dialogList.push(this.newluyinList[data.index])
this.$refs.zyAudio.seek(e.detail.value);
this.$refs.zyAudio.play();
})
},

@@ -651,12 +462,13 @@
changeVoiceShow() {
this.voiceShow = !this.voiceShow;
},
voiceStart: function() {

voiceStart() {
manager.start({
lang: "zh_CN"
});
},
voiceEnd: function() {
voiceEnd() {
// uni.showToast();
if (this.isRecording) {
uni.showLoading({
@@ -815,10 +627,6 @@
// 查看全部评论
gotoChat() {
this.watchAllCommit = true
// this.scrollId = null;
// this.$nextTick(() => {
// this.scrollId = "hash";
// })
},
gotoTop() {
console.log("asdasdasd")
@@ -832,11 +640,6 @@
this.answerId = null;
this.answerUserId = null;
this.textareaFocus = false;
// this.dialogList.forEach(res=>{
// res.message.forEach(asd=>{
// asd.isshow=false;
// })
// })
}
}
};


+ 114
- 248
pages/mine/details.vue View File

@@ -1,5 +1,6 @@
<template>
<view class="translation">
<!-- 暂时注释,暂缓使用 -->
<!-- <view style="width: 690rpx;height: 64rpx;margin: 0 auto;margin-top: 30rpx;background: #F2F2F2;border-radius: 32rpx;
display: flex;align-items: center;" @tap="toKeywordsearch()">
<image style="width: 28rpx;height: 28rpx;margin-left: 30rpx;" src="/static/images/search.png" mode=""></image>
@@ -66,16 +67,7 @@
:class="{active: item.bg < playNow && item.ed > playNow && i==0}"
v-for="(item,index) in dialog.message" :key="index" :data-speaker="item.speaker">
<view class="avatar">
<text v-if="item.speaker == 1" style="color: #60CBEC;">A</text>
<text v-if="item.speaker == 2" style="color: #EC8B47;">B</text>
<text v-if="item.speaker == 3" style="color: #4F861E;">C</text>
<text v-if="item.speaker == 4" style="color: #9F61C8;">D</text>
<text v-if="item.speaker == 5" style="color: #4980C8;">E</text>

<text v-if="item.speaker == 6" style="color: #60CBEC;">F</text>
<text v-if="item.speaker == 7" style="color: #EC8B47;">G</text>
<text v-if="item.speaker == 8" style="color: #4F861E;">H</text>
<text v-if="item.speaker == 9" style="color: #9F61C8;">I</text>
<text :style="[SPEAKERSTYLE(item.speaker)]">{{ item.speaker | toCapital }}</text>
</view>
<view class="content">
<view @longpress="changanxiaoguo(item,index,i)" v-html="item.onebest"></view>
@@ -366,28 +358,27 @@
},
//标记
alllogo() {
var that = this;
let msg = '';
if (this.userlistobj.validInvalid != 0) {
msg = '是否标记为"有效录音"?';
uni.showModal({
title: '提示',
content: msg,
success: function(res) {
success: (res) => {
if (res.confirm) {
let parames = {
id: that.customerId,
id: this.customerId,
validInvalid: '',
invalidReason: 0
}
if (that.userlistobj.validInvalid == 0) {
if (this.userlistobj.validInvalid == 0) {
parames.validInvalid = 1;
} else {
parames.validInvalid = 0;
}
that.$u.post("/customer/updateValidInvalid", parames).then(res => {
this.$u.post("/customer/updateValidInvalid", parames).then(res => {
console.log(res)
that.gituserlist()
this.gituserlist()
})
}
}
@@ -556,130 +547,52 @@
return
} else {
this.num = this.num + 1;
setTimeout(function() {
uni.hideLoading();
}, 2000);
uni.request({
url: config.service.getCorpusAnalysis + '?corpusId=' + this.luyinList[this.num].id +
"&customerId=" + this.customerId, //仅为示例,并非真实接口地址。
method: "GET",
header: {
'content-type': 'application/json',
'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
},
success: (data) => {
if (data.data.code == 10000) {
if (data.data.data.audioContent.length == 0) {
setTimeout(function() {
uni.hideLoading();
}, 2000);
} else {
const jsonInfo = JSON.parse(data.data.data.audioContent);
this.dialogList.push({
message: jsonInfo,
backindex: this.num
});
this.dialogList.forEach((asd, idx) => {
asd.message.forEach((qwe, inde) => {
qwe.isshow = false;
})
})
uni.hideLoading();
}
}
},

fail: () => {
uni.hideLoading();
let obj = {
corpusId: this.luyinList[this.num].id,
customerId: this.customerId,
}
this.$u.get(config.service.getCorpusAnalysis, obj).then(data => {
console.log(data)
if (!data.audioContent) {
setTimeout(function() {
}, 2000);
} else {
const jsonInfo = JSON.parse(data.audioContent);
this.dialogList.push({
message: jsonInfo,
backindex: this.num
});
this.dialogList.forEach((asd, idx) => {
asd.message.forEach((qwe, inde) => {
qwe.isshow = false;
})
})
}
})
}
},
//上一页
rolltoupper() {
if (this.csdFileindex == 0) {
uni.showToast({
title: '到头了',
duration: 2000
});
return
} else if (this.Bnum == 0) {
uni.showToast({
title: '到头了',
duration: 2000
});
return
} else {
this.Bnum = this.Bnum - 1;
setTimeout(function() {
uni.hideLoading();
}, 2000);
uni.request({
url: config.service.getCorpusAnalysis + '?corpusId=' + this.luyinList[this.Bnum].id +
"&customerId=" + this.customerId, //仅为示例,并非真实接口地址。
method: "GET",
header: {
'content-type': 'application/json',
'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
},
success: (data) => {
if (data.data.code == 10000) {
if (data.data.data.audioContent.length == 0) {
setTimeout(function() {
uni.hideLoading();
}, 2000);
} else {
const jsonInfo = JSON.parse(data.data.data.audioContent);
this.dialogList.unshift({
message: jsonInfo
});
this.dialogList.forEach((asd, idx) => {
asd.message.forEach((qwe, inde) => {
qwe.isshow = false;
})
})
uni.hideLoading();
}
}

},
fail: () => {
uni.hideLoading();
}
}).catch(e => {
uni.hideLoading();
})
}
},
// 取消全部加精
notappick() {
var that = this;
uni.showModal({
title: '提示',
content: '确认取消加精?',
success: function(res) {
success: (res) => {
if (res.confirm) {
console.log('用户点击确定');
uni.request({
url: config.service.delATD + "?carId=" + that.customerId,
method: "GET",
header: {
'content-type': 'application/json',
'Authorization': 'Bearer ' + uni.getStorageSync(
'weapp_session_login_data').token
},
success: (data) => {
if (data.data.code == 10000) {
that.status = 1
uni.showToast({
title: '取消成功',
duration: 2000
});
} else {
uni.showToast({
title: data.data.message,
duration: 2000
});
}
}
let params = {
carId: this.customerId,
}
this.$u.get(config.service.delATD, params).then(data => {
console.log(data)
this.status = 1
uni.showToast({
title: data.message,
duration: 2000
});
})
} else if (res.cancel) {
console.log('用户点击取消');
@@ -689,11 +602,10 @@
},
//全部加精
tappick(i) {
var that = this;
uni.showModal({
title: '提示',
content: '确认加精?',
success: function(res) {
success: (res) => {
if (res.confirm) {
console.log('用户点击确定');
let objdata = {
@@ -701,29 +613,13 @@
"status": 0,
"itemId": that.buildingID,
}
uni.request({
url: config.service.addATD,
method: "POST",
header: {
'content-type': 'application/json',
'Authorization': 'Bearer ' + uni.getStorageSync(
'weapp_session_login_data').token
},
data: objdata,
success: (data) => {
if (data.data.code == 10000) {
that.status = 0
uni.showToast({
title: '加精成功',
duration: 2000
});
} else {
uni.showToast({
title: data.data.message,
duration: 2000
});
}
}
this.$u.post(config.service.addATD, objdata).then(data => {
this.status = 0
uni.showToast({
title: data.message,
duration: 2000
});
})
} else if (res.cancel) {
console.log('用户点击取消');
@@ -809,13 +705,16 @@
Addtheessence() {
this.isshow3 = true;
this.biaoqianlist = []
util.getRequestPromise(config.service.findAllYi, {}, false).then(data => {
this.$u.post('/addtodigest/findAllYi', {}).then(data => {
this.biaoqianlist = data
this.biaoqianlist.unshift({
name: "逼单话术",
id: 0
})
});
})
// util.getRequestPromise('/addtodigest/findAllYi', {}, false).then(data => {

// });
},
// 取消加精
Cancelout2() {
@@ -848,27 +747,17 @@
"jjTransfer": this.changanitem.onebest, //选中对话
"status": 1
}
uni.request({
url: config.service.addATD,
method: "POST",
header: {
'content-type': 'application/json',
'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
},
data: objdata,
success: (data) => {
if (data.data.code == 10000) {
uni.showToast({
title: '加精成功',
duration: 2000
});
} else {
uni.showToast({
title: data.data.message,
duration: 2000
});
}
}
this.$u.post(config.service.addATD, objdata).then(data => {
uni.showToast({
title: '加精成功',
duration: 2000
});
}).catch(e => {
uni.showToast({
title: e.message,
icon: 'none',
duration: 2000
});
})
},
//长按对话
@@ -981,83 +870,58 @@
// 获取转义后的对话结果
getCorpusAnalysis(info) {
this.dialogList = [];
uni.request({
url: config.service.getCorpusAnalysis + '?corpusId=' + this.luyinList[this.csdFileindex].id +
"&customerId=" + this.customerId, //仅为示例,并非真实接口地址。
method: "GET",
header: {
'content-type': 'application/json',
'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
},
success: (data) => {
if (data.data.code == 10000) {
if (data.data.data.audioContent.length == 0) {
setTimeout(function() {
uni.hideLoading();
}, 2000);
let obj = {
corpusId: this.luyinList[this.csdFileindex].id,
customerId: this.customerId
}
this.$u.get(config.service.getCorpusAnalysis, obj).then(data => {
const jsonInfo = JSON.parse(data.audioContent);
console.log(jsonInfo)
if (this.luyinList[this.csdFileindex].recordDuration > 360) {
//拿到总条数
var stusnum = jsonInfo.length;
this.dialogList.push({
message: jsonInfo.splice(0, 80),
backindex: this.csdFileindex
});
var auth_timetimer = setInterval(() => {
stusnum -= 100;
console.log("还剩下" + stusnum)
if (stusnum <= 0) {
console.log("停止")
clearInterval(auth_timetimer);
} else {
const jsonInfo = JSON.parse(data.data.data.audioContent);
console.log(jsonInfo)
if (this.luyinList[this.csdFileindex].recordDuration > 360) {
//拿到总条数
var stusnum = jsonInfo.length;
this.dialogList.push({
message: jsonInfo.splice(0, 80),
backindex: this.csdFileindex
});

var auth_timetimer = setInterval(() => {
stusnum -= 100;
console.log("还剩下" + stusnum)
if (stusnum <= 0) {
console.log("停止")
clearInterval(auth_timetimer);
} else {
console.log("添加")

var newlistwang = [];
newlistwang = jsonInfo.splice(0, 100);
console.log("新数组", newlistwang)
newlistwang.forEach(item => {
this.dialogList[0].message.push(item)
})
}
}, 1000);
} else {
this.dialogList.push({
message: jsonInfo,
backindex: this.csdFileindex
});
}
this.dialogList.forEach((asd, idx) => {
asd.message.forEach((qwe, inde) => {
qwe.isshow = false;
})
console.log("添加")
var newlistwang = [];
newlistwang = jsonInfo.splice(0, 100);
console.log("新数组", newlistwang)
newlistwang.forEach(item => {
this.dialogList[0].message.push(item)
})
setTimeout(function() {
uni.hideLoading();
}, 2000);
}

} else {
uni.hideLoading();
uni.showModal({
title: '提示',
content: '请求数据失败,请重新尝试',
showCancel: false
});
}
},
fail(error) {
uni.hideLoading();
uni.showModal({
title: '提示',
content: '网络异常,请重新尝试',
showCancel: false
}, 1000);
} else {
this.dialogList.push({
message: jsonInfo,
backindex: this.csdFileindex
});
return false;
}
});
this.dialogList.forEach((asd, idx) => {
asd.message.forEach((qwe, inde) => {
qwe.isshow = false;
})
})
uni.hideLoading();
}).catch(e => {
uni.hideLoading();
uni.showModal({
title: '提示',
content: '请求数据失败,请重新尝试',
showCancel: false
});
})
},
getTime(time) {
return util.formatSecond(time)
@@ -1261,6 +1125,8 @@
padding: 18rpx 18rpx 18rpx 18rpx;
display: flex;
flex-wrap: wrap;
height: 50vh;
overflow-y: scroll;

.jiajinghuaview1 {
padding: 8rpx 8rpx 8rpx 8rpx;


+ 52
- 149
pages/mine/details2.vue View File

@@ -36,89 +36,14 @@
:class="{active: item.bg < playNow && item.ed > playNow && i==0}"
v-for="(item,index) in dialog.message" :key="index" :data-speaker="item.speaker">
<view class="avatar">
<view v-if="item.speaker == 1" style="color: #60CBEC;">
<view :style="[SPEAKERSTYLE(item.speaker)]">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>A</text>
</view>
<view v-if="item.speaker == 2" style="color: #EC8B47;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>B</text>
</view>
<view v-if="item.speaker == 3" style="color: #4F861E;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>C</text>
</view>
<view v-if="item.speaker == 4" style="color: #9F61C8;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>D</text>
</view>
<view v-if="item.speaker == 5" style="color: #4980C8;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>E</text>
</view>
<view v-if="item.speaker == 6" style="color: #60CBEC;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>F</text>
</view>
<view v-if="item.speaker == 7" style="color: #EC8B47;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>G</text>
</view>
<view v-if="item.speaker == 8" style="color: #4F861E;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>H</text>
</view>
<view v-if="item.speaker == 9" style="color: #9F61C8;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>I</text>
</view>
<view v-if="item.speaker == 10" style="color: #9F61C8;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>J</text>
</view>
<view v-if="item.speaker == 11" style="color: #9F61C8;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>K</text>
</view>
<view v-if="item.speaker == 12" style="color: #9F61C8;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>L</text>
</view>
<view v-if="item.speaker == 13" style="color: #9F61C8;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>M</text>
</view>
<view v-if="item.speaker == 14" style="color: #9F61C8;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>N</text>
</view>
<view v-if="item.speaker == 15" style="color: #9F61C8;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>O</text>
</view>
<view v-if="item.speaker == 16" style="color: #9F61C8;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>P</text>
<text v-else>{{ item.speaker | toCapital }}</text>
</view>
</view>
<view class="contentInfo">
<view class="info">
<text v-if="item.speaker == 1" class="AudioUserName">A</text>
<text v-if="item.speaker == 2" class="AudioUserName">B</text>
<text v-if="item.speaker == 3" class="AudioUserName">C</text>
<text v-if="item.speaker == 4" class="AudioUserName">D</text>
<text v-if="item.speaker == 5" class="AudioUserName">E</text>
<text v-if="item.speaker == 6" class="AudioUserName">F</text>
<text v-if="item.speaker == 7" class="AudioUserName">G</text>
<text v-if="item.speaker == 8" class="AudioUserName">H</text>
<text v-if="item.speaker == 9" class="AudioUserName">I</text>
<text v-if="item.speaker == 10" class="AudioUserName">J</text>
<text v-if="item.speaker == 11" class="AudioUserName">K</text>
<text v-if="item.speaker == 12" class="AudioUserName">L</text>
<text v-if="item.speaker == 13" class="AudioUserName">M</text>
<text v-if="item.speaker == 14" class="AudioUserName">N</text>
<text v-if="item.speaker == 15" class="AudioUserName">O</text>
<text v-if="item.speaker == 16" class="AudioUserName">P</text>
<text class="AudioUserName">{{ item.speaker | toCapital }}</text>
<text>{{conversionTiame(item.bg/1000)}}</text>
</view>
<view class="contentMain">
@@ -154,7 +79,7 @@
<view class="bottombox">
<!-- 播放块 :src="recordPath" -->
<yz-audio ref="zyAudio" @timeUpdate="TimeUpdate" @sliderChangeComplate="sliderChangeComplate"></yz-audio>
<!-- 底部弹框 -->
<view class="botbotmm">
<view class="tmmchen" @click="guanjiancishifo()">
@@ -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()
}


+ 118
- 108
pages/mine/equipment/index.vue View File

@@ -2,9 +2,10 @@
<view class="cented">
<view class="header">
<view style="width: 690rpx;margin: 0 auto;margin-top: 20rpx;">
<u-search @search='shecs()' :show-action='false' placeholder="请输入设备编号或领用人进行搜索" v-model="imei"></u-search>
<u-search @search='shecs()' :show-action='false' placeholder="请输入设备编号或领用人进行搜索" v-model="imei">
</u-search>
</view>
<view class="tab-box">
<!-- <view class="tab-item-wrap">
<view v-for="(item, index) in tablist" :key="index" :class="activeClass == index ? 'bottom' : ''" @tap="clocktab(index)">
@@ -12,13 +13,14 @@
<view class="bottomLine" v-if="activeClass == index"></view>
</view>
</view> -->
<u-tabs-swiper ref="tabs" font-size="30" :bold="true" swiper-width="700" :current="activeClass" @change="clocktab()"
inactive-color="#b1b1b1" active-color="#008ef2" :list="tablist" :is-scroll="true">
<u-tabs-swiper ref="tabs" font-size="30" :bold="true" swiper-width="700" :current="activeClass"
@change="clocktab()" inactive-color="#b1b1b1" active-color="#008ef2" :list="tablist"
:is-scroll="true">
</u-tabs-swiper>
</view>
</view>
<view class="infoet">
<view class="infoviewbox" v-for="(item,index) in newListdata" :key="index">
<view class="infobox1">
@@ -30,23 +32,29 @@
<view class="you11" v-if="item.electricity<20">
<view class="youimg" :style="{ height: item.electricity + '%' }"></view>
</view>
<view class="you2">电量:
<view class="you2">电量:
<text v-if="item.electricity>20">{{item.electricity}}%</text>
<text v-if="item.electricity<20" style="color: red;">{{item.electricity}}%</text>
</view>
<view class="you3">
<image v-if="item.signalDevice==''" class="youimg" src="../../../static/images/newimg/xinhao0.png" mode=""></image>
<image v-if="item.signalDevice<20 && item.signalDevice>0" class="youimg" src="../../../static/images/newimg/xinhao1.png" mode=""></image>
<image v-if="item.signalDevice<50 && item.signalDevice>20" class="youimg" src="../../../static/images/newimg/xinhao2.png" mode=""></image>
<image v-if="item.signalDevice<70 && item.signalDevice>50" class="youimg" src="../../../static/images/newimg/xinhao3.png" mode=""></image>
<image v-if="item.signalDevice<90 && item.signalDevice>70" class="youimg" src="../../../static/images/newimg/xinhao4.png" mode=""></image>
<image v-if="item.signalDevice<=100 && item.signalDevice>90" class="youimg" src="../../../static/images/newimg/xinhao5.png" mode=""></image>
<image v-if="item.signalDevice==''" class="youimg"
src="../../../static/images/newimg/xinhao0.png" mode=""></image>
<image v-if="item.signalDevice<20 && item.signalDevice>0" class="youimg"
src="../../../static/images/newimg/xinhao1.png" mode=""></image>
<image v-if="item.signalDevice<50 && item.signalDevice>20" class="youimg"
src="../../../static/images/newimg/xinhao2.png" mode=""></image>
<image v-if="item.signalDevice<70 && item.signalDevice>50" class="youimg"
src="../../../static/images/newimg/xinhao3.png" mode=""></image>
<image v-if="item.signalDevice<90 && item.signalDevice>70" class="youimg"
src="../../../static/images/newimg/xinhao4.png" mode=""></image>
<image v-if="item.signalDevice<=100 && item.signalDevice>90" class="youimg"
src="../../../static/images/newimg/xinhao5.png" mode=""></image>
</view>
<view class="you4" v-if="item.signalDevice=='' ">信号:0</view>
<view class="you4" v-else>信号:{{item.signalDevice}}</view>
</view>
</view>
<view class="infobox2">
<view class="box2-zuo">设备编号</view>
@@ -55,8 +63,8 @@
<view class="infobox2">
<view class="box2-zuo">录音状态</view>
<view class="box2-you" v-if="item.audioStatus=='false'">关闭</view>
<view class="box2-you" v-if="item.audioStatus=='true'">开启</view>
<view class="box2-you" v-if="item.audioStatus=='' ">关闭</view>
<view class="box2-you" v-if="item.audioStatus=='true'">开启</view>
<view class="box2-you" v-if="!item.audioStatus">关闭</view>
</view>
<view class="infobox2">
<view class="box2-zuo">待上传</view>
@@ -66,7 +74,7 @@
<template v-else>
<text class="box2-you">0</text>
</template>
<!-- <view class="box2-you" v-if="item.audioUploadStatus=='false'">无上传</view>
<!-- <view class="box2-you" v-if="item.audioUploadStatus=='false'">无上传</view>
<view class="box2-you" v-if="item.audioUploadStatus=='true'">上传中</view>
<view class="box2-you" v-if="item.audioUploadStatus=='' ">无上传</view> -->
</view>
@@ -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;
}


Loading…
Cancel
Save