|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575 |
- <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>
- <text style="margin-left: 10rpx;color: #999999;font-size: 24rpx;">请输入关键字</text>
- </view>
- <view class="top" style="margin-top: 30rpx;">
- <view class="title">
- <view class="call_record_time">{{date}}</view>
- </view>
- <view class="call_record_time_one">接待时长 {{alltimeStr}}
- <u-icon name="list-dot" color="#333" size="48" @click="showFile"></u-icon>
- <view class="audoioyouxiao" @click="alllogo()">
- {{userlistobj.validInvalidName||''}}
- </view>
- <view class="file-change" v-if="isshowFile">
- <view class="file-item" @click="filechange(item,index)"
- :class="csdFileindex == index ? 'fileactive' : ''" v-for="(item,index) in luyinList"
- :key="index">录音文件{{index+1}}</view>
- </view>
- <view class="diangweitupian" v-if="jiaoseshow">
- <image v-if="status==1" @click="tappick()" style="width: 100%;height: 100%;"
- src="../../static/images/pike.png" mode=""></image>
- <image v-if="status==0" @click="notappick()" style="width: 100%;height: 100%;"
- src="../../static/images/nopike.png" mode=""></image>
- </view>
- </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>
- </view>
- <scroll-view :scroll-top="scrollTop"
- lower-threshold='20px' @scrolltolower="ltolower()" :scroll-into-view="scrollId" scroll-y="true"
- class="text scroll-Y">
- <!-- tab 栏切换 -->
- <view class="tab-box" id="top">
- <view class="yinpinshibie" @click="changeTab(0)" :class="{active: tab==0}">
- 音频识别
- </view>
- <view class="rate" @click="changeTab(1)" :class="{active: tab==1}">
- 评分
- </view>
- </view>
- <!-- 音频识别模块 -->
- <view v-if="tab==0">
- <!-- 聊天记录-->
- <view class="dialog-block" v-for="(dialog,i) in dialogList" :key="i">
- <view :id="'dialog'+i" class="fileName">录音文件
- <!-- {{i+1}} -->
- </view>
- <view class="text" :id="'dialog'+csdFileindex+'text'+item.bg"
- :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>
- </view>
- <view class="content">
- <view @longpress="changanxiaoguo(item,index,i)" v-html="item.onebest"></view>
- <view class="tankuangcss" v-if="item.isshow">
- <view @click="clickcopy()"
- style="width: 60rpx;font-size: 24rpx;text-align: center;margin-left: 24rpx;">复制
- </view>
- <view @click="Oftenthewrongword()"
- style="width: 80rpx;font-size: 24rpx;text-align: center;margin-left: 22rpx;">常错词
- </view>
- <view v-if="jiaoseshow" @click="Addtheessence()"
- style="width: 80rpx;font-size: 24rpx;text-align: center;margin-left: 22rpx;">加精华
- </view>
- <view @click="clickbofang(dialog.backindex,item)"
- style="width: 80rpx;font-size: 24rpx;text-align: center;margin-left: 14rpx;">播放
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 评分模块 -->
- <view v-if="tab==1" class="rate-box">
- <view class="title">总执行率 {{totalRate}}%</view>
- <view v-for="(item,index) in ratelist" :key="index" class="u-m-b-14">
- <view class="level1">
- <view class="level-name u-line-1">
- {{item.name}}
- </view>
- <view class="level-progress">
- <view class="color" :style="{width: item.ratepercent/item.rate*100+'%'}"></view>
- </view>
- <view class="level-rate">{{((item.ratepercent/item.rate).toFixed(2)*100).toFixed()}}%</view>
- <image v-if="!item.show" class="arrow rotatearrow" @click="changeshow(item,1)"
- src="/static/images/down.png" mode="" />
- <image v-else class="arrow" @click="changeshow(item,0)" src="/static/images/up.png"
- mode="" />
- </view>
- <view class="level1-subbox" v-if="item.show">
- <view class="sub-name" v-for="(subitem,i) in item.children" :key="i">
- <view class="subitem-name u-line-1">{{subitem.name}}</view>
- <image class="checkimg" v-if="!subitem.selected"
- src="/static/images/rate-checked.png" mode="" />
- <image class="checkimg" v-else src="/static/images/rate-nocheck.png" mode="" />
- </view>
- </view>
- </view>
- </view>
- </scroll-view>
-
- <!-- 回到顶部 -->
- <view class="backTop" @click="gotoTop">
- <image src="/static/images/backTop.png" mode=""></image>
- </view>
- <!-- 加入常错词 -->
- <view class="zhezhoa" v-if="isshow2" @tap="Cancelout"></view>
- <view class="bounced" v-if="isshow2">
- <view class="tian-view">
- <viwe class="tian-view-t1"></viwe>
- <viwe class="tian-view-t2">常错词:</viwe>
- <viwe class="tian-view-t3">
- <input type="text" v-model="thewrongword" class="tian-input" placeholder="请输入" />
- </viwe>
- </view>
- <view class="tian-view">
- <viwe class="tian-view-t1"></viwe>
- <viwe class="tian-view-t2">正确词:</viwe>
- <viwe class="tian-view-t3">
- <input class="tian-input" v-model="reswrongword" type="text" placeholder="请输入" />
- </viwe>
- </view>
- <view class="bounced3">
- <view class="bounced3-1" @tap="Cancelout">取消</view>
- <view class="bounced3-2" @tap="Confirmtheexit">确认</view>
- </view>
- </view>
- <!-- 加精华 -->
- <view class="zhezhoa" v-if="isshow3" @tap="Cancelout2"></view>
- <view class="bounced" v-if="isshow3">
- <view class="jiajinghuatit">加精华</view>
- <view style="width: 100%;text-indent: 20rpx;font-size: 28rpx;">选择标签</view>
- <view class="jiajinghuaview">
- <view class="jighuaview2" v-for="(item,index) in biaoqianlist" :key="index"
- :class="biaoqianindex == index ? 'biaoqiantom' : ''">
- <view class="view1-text" @click="tapbiaoqianclisck(index)">{{item.name}}</view>
- </view>
- </view>
- <view class="bounced3">
- <view class="bounced3-1" @tap="Cancelout2">取消</view>
- <view class="bounced3-2" @tap="Confirmtheexit2">确认</view>
- </view>
- </view>
- </view>
- </template>
-
- <script>
- var util = require("../../utils/util.js");
- var config = require("../../config");
- export default {
- data() {
- return {
- audioPlay: false, //当前的播放状态控制
- sliderValue: 0, //进度条最小值
- sliderMax: 0, //进度条最大值
- innerAudioContext: "", //播放实例
- currentTimeStr: "00:00", //当前进度的时间
- timeStr: "00:00", //总的时间
- recordPath: "",
- customerId: "",
- luyinList: [], //录音文件
- dialogList: [], //录音识别列表
- csdFileindex: 0,
- isshowFile: false, //录音列表隐藏
- date: "", //年月日
- tab: 0, // 默认是音频识别
- scrollTop: 0,
- scrollId: "",
- playNow: 0,
- alltimeStr: "00:00:00",
- ratelist: [], //评分列表
- totalRate: "",
- thewrongword: "", //错误词
- reswrongword: "", //正确词
- isshow2: false,
- messagelisy: [],
- isshow3: false,
- biaoqianlist: [],
- biaoqianindex: 0,
- changanitem: {},
- duihuawenjianid: "",
- biaoqianid: "",
- status: 0,
- userInfo: {},
- jiaoseshow: true,
- num: 0, //上拉 转写文件下标
- Bnum: 0, //下拉 转写文件下标
- itemobj:{},
- buildingID:'',
- userlistobj:{}
- };
- },
- onLoad: function(options) {
- this.status = options.status;
- this.customerId = options.customerId;
- this.itemobj = uni.getStorageSync('searchobj');
- this.stateisshow=options.stateisshow;
- },
- onShow() {
- this.buildingID = uni.getStorageSync('buildingID').id;
-
- this.userInfo = uni.getStorageSync('weapp_session_userInfo_data');
- if (this.userInfo.dataCode == 6) {
- this.jiaoseshow = false
- }
-
-
-
- if(this.stateisshow==2){
- var info =this.itemobj;
- }else{
- var pages = getCurrentPages();
- var currPage = pages[pages.length - 1]; //当前页面
- var info = currPage.data.info;
- }
-
- this.gituserlist()
-
- 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.init(info)
- },
- // 在组件实例被从页面节点树移除时执行
- destroyed: function() {
- if (this.innerAudioContext) {
- this.innerAudioContext.destroy();
- }
- },
- // 销毁实例
- onUnload: function() {
- this.innerAudioContext.destroy();
- },
- methods: {
- //标记
- alllogo(){
- var that=this;
- let msg='';
- if(this.userlistobj.validInvalid==0){
- msg='是否标记为"无效录音"?'
- }else{
- msg='是否标记为"有效录音"?'
- }
- uni.showModal({
- title: '提示',
- content: msg,
- success: function (res) {
- if (res.confirm) {
- let parames={
- id:that.customerId,
- validInvalid:''
- }
- if(that.userlistobj.validInvalid==0){
- parames.validInvalid=1;
- }else{
- parames.validInvalid=0;
- }
- that.$u.post("/customer/updateValidInvalid", parames).then(res => {
- console.log(res)
- that.gituserlist()
- })
- }
- }
- });
- },
-
- //获取用户信息
- gituserlist(){
- this.$u.get("/matchKeywords/personalReceptionRecord", {
- customerId: this.customerId
- }).then(res => {
- res.endTime1=res.endTime.substring(0, 19);
- this.userlistobj=res;
- })
- },
- toKeywordsearch(){
- this.innerAudioContext.destroy();
- this.stateisshow=1;
- uni.navigateTo({
- url: '/pages/learning/Keywordsearch?customerId='+this.customerId +"&status="+this.status +"&skpl="+"1"
- })
- },
- 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;
- this.qeihuanwenjian()
- });
- },
- 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) {
-
- } 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;
- console.log(duration)
- this.$forceUpdate()
- });
- },
-
-
- init(info) {
- this.sliderMax = 0; //进度条最大值
- this.timeStr = "00:00"; //总的时间
- const parames = {
- pageNum: 1,
- pageSize: 100,
- query: {
- customerId: this.customerId
- }
- }
- this.$u.post("/corpus/findByPage", parames).then(res => {
- if (res && res.length) {
- let alltime = 1;
- res.forEach(item => {
- alltime += item.recordDuration
- })
- this.alltimeStr = this.getTime(alltime)
- if(info){
- res.forEach((item,index) => {
- if(item.id==info.id){
- this.luyinList = res;
- this.csdFileindex=index;
- this.recordPath = res[index].recordPath
- this.sliderMax = this.getTime(res[index].recordDuration)
- this.timeStr = this.getTime(res[index].recordDuration)
- this.date = res[index].receptionTime;
-
- this.isshowFile = false;
- this.getCorpusAnalysis(info);
- this.creatAudio()
- var itc=parseInt(info.bg/1000)
- this.adasdasdasd(itc)
- }
- })
- }else{
- 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.innerAudioContext.src = this.recordPath;
- this.changePlayState()
- this.luyinList = res;
- this.getCorpusAnalysis()
- }
- }
- })
- },
- //搜索跳转
- adasdasdasd(e) {
- const currTimeStr = this.formatTime(e)
- this.currentTimeStr = currTimeStr
- this.innerAudioContext.seek(e);
- this.innerAudioContext.play();
- },
- //下一页
- ltolower() {
- var lengthcz=this.luyinList.length-1;
- if (this.num >= lengthcz) {
- uni.showToast({
- title: '到底了',
- duration: 2000
- });
- return
- }else {
- this.num=this.num+1;
- uni.showLoading({
- title: '加载中'
- });
- 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',
- 'Access-Token': 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;
- })
- })
- }
- }
- },
- })
- }
- },
- //上一页
- 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;
- uni.showLoading({
- title: '加载中'
- });
- 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',
- 'Access-Token': 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;
- })
- })
- }
- }
- },
- })
- }
- },
- // 取消全部加精
- notappick() {
- var that = this;
- uni.showModal({
- title: '提示',
- content: '确认取消加精?',
- success: function(res) {
- if (res.confirm) {
- console.log('用户点击确定');
- uni.request({
- url: config.service.delATD + "?carId=" + that.customerId,
- method: "GET",
- header: {
- 'content-type': 'application/json',
- 'Access-Token': 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
- });
- }
- }
- })
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- });
- },
- //全部加精
- tappick(i) {
- var that = this;
- uni.showModal({
- title: '提示',
- content: '确认加精?',
- success: function(res) {
- if (res.confirm) {
- console.log('用户点击确定');
- let objdata = {
- "carId": that.customerId, //客户id
- "status": 0,
- "itemId":that.buildingID,
- }
- uni.request({
- url: config.service.addATD,
- method: "POST",
- header: {
- 'content-type': 'application/json',
- 'Access-Token': 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
- });
- }
- }
- })
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- });
- },
- //标签选择
- tapbiaoqianclisck(index) {
- this.biaoqianindex = index;
- this.biaoqianid = this.biaoqianlist[index].id
- },
- //复制
- clickcopy() {
- var that = this;
- uni.setClipboardData({
- data: that.thewrongword,
- success: function() {
- that.dialogList.forEach(res => {
- res.message.forEach(asd => {
- asd.isshow = false;
- })
- })
- that.$forceUpdate();
- console.log('success');
- }
- });
- },
- //确认加入常错词
- Confirmtheexit() {
- if (this.thewrongword) {
- if (this.reswrongword) {
- let parames = {
- customerId:this.customerId,
- cupid: this.luyinList[this.csdFileindex].id,
- wrongWord: this.thewrongword, //错误词
- correctWord: this.reswrongword, //正确词
- translateHtmlContent: this.messagelisy,
-
- }
- this.$u.post("/corpus/addCorrectWord", parames).then(data => {
- this.isshow2 = false;
- this.dialogList.forEach(res => {
- res.message.forEach(asd => {
- asd.isshow = false;
- })
- })
- this.thewrongword = "";
- this.reswrongword = "";
- })
- } else {
- uni.showToast({
- title: '正确值不能为空',
- duration: 2000
- });
- return
- }
- } else {
- uni.showToast({
- title: '错误词不能为空',
- duration: 2000
- });
- return
- }
- },
- //取消加入常错词
- Cancelout() {
- this.isshow2 = false;
- this.dialogList.forEach(res => {
- res.message.forEach(asd => {
- asd.isshow = false;
- })
- })
- },
- //加入长错词
- Oftenthewrongword() {
- this.reswrongword = "";
- this.isshow2 = true;
- },
- //加精华
- Addtheessence() {
- this.isshow3 = true;
- this.biaoqianlist = []
- util.getRequestPromise(config.service.findAllYi, {}, false).then(data => {
- this.biaoqianlist = data
- this.biaoqianlist.unshift({
- name: "逼单话术",
- id: 0
- })
- });
- },
- // 取消加精
- Cancelout2() {
- this.isshow3 = false;
- this.dialogList.forEach(res => {
- res.message.forEach(asd => {
- asd.isshow = false;
- })
- })
- },
- // 确认加精
- Confirmtheexit2() {
- if (this.biaoqianid) {
- this.biaoqianid = this.biaoqianid
- } else {
- this.biaoqianid = 0
- }
- this.isshow3 = false;
- this.dialogList.forEach(res => {
- res.message.forEach(asd => {
- asd.isshow = false;
- })
- })
- let objdata = {
- "carId": this.customerId, //客户id
- "startTime": this.changanitem.bg, //开始时间
- "startFile": this.duihuawenjianid, //对话所在录音文件id
- "endTime": this.changanitem.ed, //结束时间
- "marketingId": this.biaoqianid, //对应一级父id
- "jjTransfer": this.changanitem.onebest, //选中对话
- "status": 1
- }
- uni.request({
- url: config.service.addATD,
- method: "POST",
- header: {
- 'content-type': 'application/json',
- 'Access-Token': 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
- });
- }
- }
- })
- },
- //长按对话
- changanxiaoguo(item, index, i) {
- this.messagelisy = [];
- this.changanitem = {};
- this.duihuawenjianid = "",
- this.dialogList.forEach(res => {
- res.message.forEach(asd => {
- asd.isshow = false;
- })
- })
- this.changanitem = item;
- this.duihuawenjianid = this.luyinList[this.csdFileindex].id;
- this.dialogList[i].message[index].isshow = !this.dialogList[i].message[index].isshow
- this.thewrongword = item.onebest;
- this.messagelisy = this.dialogList[i].message
- console.log(this.dialogList[i], "长按触发")
- },
- //回到顶部
- gotoTop() {
- this.scrollId = null;
- this.$nextTick(() => {
- this.scrollId = "top";
- })
- },
- //切换tab
- changeTab(type) {
- if (type == 0) {
- this.tab = 0
- } else {
- this.tab = 1;
- this.getRatelist();
- }
- },
- //录音列表显示隐藏
- showFile() {
- console.log("111111111111111111111111")
- this.isshowFile = !this.isshowFile;
- console.log("222222222222222222222")
- },
-
- //评分上下显隐
- changeshow(item, type) {
- if (type == 1) {
- item.show = true
- } else {
- item.show = false
- }
- },
- // 获取评分
- getRatelist() {
- if (this.ratelist.length == 0) {
- uni.showLoading({
- title: '加载中'
- });
- this.$u.get("/customer/findzkMByCusId", {
- cusId: this.customerId
- }).then(res => {
- if (res.length) {
- let level1 = []
- let level2rate = 0
- res.forEach(item => {
- if (item.pid == 0) {
- level1.push({
- id: item.marketingId,
- rate: item.fraction,
- name: item.name,
- sort: item.sort,
- show: false,
- ratepercent: 0,
- children: []
- })
- } else {
- if (item.selected == 0) {
- level2rate += item.fraction
- }
- }
- })
- this.totalRate = level2rate
- res.forEach(subitem => {
- let subitempid = subitem.pid
- level1.forEach(item => {
- if (subitempid == item.id) {
- if (subitem.selected == 0) {
- item.ratepercent += subitem.fraction
- }
- item.children.push({
- id: subitem.id,
- rate: subitem.fraction,
- selected: subitem.selected,
- name: subitem.name
- })
- }
- })
- })
- level1[0].show = true;
- this.ratelist = level1
- }
- setTimeout(function() {
- uni.hideLoading();
- }, 1000);
- })
- }
-
-
- },
-
- // 获取转义后的对话结果
- getCorpusAnalysis(info) {
- this.dialogList = [];
- uni.showLoading({
- title: '加载中'
- });
- uni.request({
- url: config.service.getCorpusAnalysis + '?corpusId=' + this.luyinList[this.csdFileindex].id+"&customerId="+this.customerId, //仅为示例,并非真实接口地址。
- method: "GET",
- header: {
- 'content-type': 'application/json',
- 'Access-Token': 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);
- 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;
- })
- })
- setTimeout(function() {
- uni.hideLoading();
- }, 2000);
- }
-
- } else {
- uni.hideLoading();
- uni.showModal({
- title: '提示',
- content: '请求数据失败,请重新尝试',
- showCancel: false
- });
- }
- },
- fail(error) {
- uni.hideLoading();
- uni.showModal({
- title: '提示',
- content: '网络异常,请重新尝试',
- showCancel: false
- });
- return false;
- }
- });
- },
- getTime(time) {
- return util.formatSecond(time)
- },
- // 录音暂停播放
- changePlayState() {
- if (this.audioPlay == false) {
- this.innerAudioContext.play();
- } else {
- this.innerAudioContext.pause()
- }
- },
- //音频前进回退
- sliderChangeComplate(e) {
- const currTimeStr = this.formatTime(e.detail.value)
- this.currentTimeStr = currTimeStr
- this.innerAudioContext.seek(e.detail.value);
- this.innerAudioContext.play();
- },
- //长按点击播放
- clickbofang(dialog,item) {
- this.innerAudioContext.pause()
- this.dialogList.forEach(res => {
- res.message.forEach(asd => {
- asd.isshow = false;
- })
- })
- this.$forceUpdate()
- if(dialog==this.csdFileindex){
- let time = parseInt(item.bg / 1000)
- const currTimeStr = this.formatTime(time)
- this.currentTimeStr = currTimeStr
- this.innerAudioContext.seek(time);
- this.innerAudioContext.play();
- return
- }else{
- let time = parseInt(item.bg / 1000)
- this.innerAudioContext.destroy()
-
- this.csdFileindex = dialog;
- this.recordPath = this.luyinList[dialog].recordPath;
- this.sliderMax = this.getTime(this.luyinList[dialog].recordDuration);
- this.timeStr = this.getTime(this.luyinList[dialog].recordDuration);
- this.date = this.luyinList[dialog].receptionTime;
- this.creatAudio()
- this.getCorpusAnalysis()
-
- const currTimeStr = this.formatTime(time)
- this.currentTimeStr = currTimeStr
- this.innerAudioContext.seek(time);
- this.innerAudioContext.play();
- }
- },
- // 文件切换播放
- filechange(item, i) {
- this.num=i;//下拉起始位置
- this.Bnum=i;
- this.innerAudioContext.destroy();
- this.csdFileindex = i;
- this.recordPath = item.recordPath;
- this.sliderMax = this.getTime(item.recordDuration);
- this.timeStr = this.getTime(item.recordDuration);
- this.date = item.receptionTime;
- this.isshowFile = false;
- this.creatAudio()
- this.getCorpusAnalysis()
- },
- //录音实例
- 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()
- },
- // 自动播放下一个文件
- qeihuanwenjian() {
- let index = this.csdFileindex + 1;
- if (index < this.luyinList.length) {
- this.csdFileindex = index;
- this.getCorpusAnalysis()
- let item = this.luyinList[this.csdFileindex];
- let i = this.csdFileindex;
- this.filechange(item, i)
- }
- },
- formatTime(num) {
- //格式化时间格式
- num = num.toFixed(0);
- let second = num % 60;
- if (second < 10) second = '0' + second;
- let min = Math.floor(num / 60);
- if (min < 10) min = '0' + min;
- return min + ":" + second;
- },
- changeEditing() {
- this.dialogList.forEach(res => {
- res.message.forEach(asd => {
- asd.isshow = false;
- })
- })
- }
- },
- }
- </script>
- <style lang="scss" scoped>
- .biaoqiantom {
- background-color: #008EF2;
- color: #FFFFFF;
- border: none;
- }
- // 表单
- .tian-view {
- width: 570upx;
- background-color: #FFFFFF;
- border-bottom: 1px solid #ededee;
- display: flex;
- min-height: 96rpx;
- .tian-view-t1 {
- width: 20rpx;
- font-size: 34rpx;
- height: 34rpx;
- line-height: 110rpx;
- letter-spacing: 0px;
- color: red;
- }
- .tian-view-t2 {
- width: 30%;
- min-height: 96rpx;
- line-height: 96rpx;
- font-size: 34rpx;
- color: #333;
- }
- .tian-view-t3 {
- width: 61%;
- padding-top: 31rpx;
- padding-bottom: 31rpx;
- display: flex;
- .tian-input {
- width: 98%;
- font-size: 34rpx;
- border: none;
- }
- }
- }
- .zhezhoa {
- position: fixed;
- top: 0;
- left: 0;
- z-index: 999;
- width: 100%;
- height: 100vh;
- opacity: 0.5;
- background-color: #666666;
- }
- .bounced {
- width: 570upx;
- background: #FFFFFF;
- z-index: 1000;
- border-radius: 10upx;
- position: fixed;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- /* 50%为自身尺寸的一半 */
- .jiajinghuatit {
- width: 100%;
- height: 68rpx;
- font-size: 30rpx;
- text-align: center;
- line-height: 68rpx;
- }
- .jiajinghuaview {
- padding: 18rpx 18rpx 18rpx 18rpx;
- display: flex;
- flex-wrap: wrap;
- .jiajinghuaview1 {
- padding: 8rpx 8rpx 8rpx 8rpx;
- font-size: 26rpx;
- border-radius: 12rpx;
- border: 1px solid #979797;
- margin-left: 8rpx;
- }
- .jighuaview2 {
- padding: 8rpx 18rpx 8rpx 18rpx;
- font-size: 26rpx;
- border-radius: 12rpx;
- border: 1px solid #979797;
- margin-left: 20rpx;
- margin-top: 10rpx;
- display: flex;
- .view1-text {
- text-align: center;
- }
- .view1-img {
- width: 50rpx;
- }
- }
- }
- .bounced3 {
- height: 100upx;
- width: 100%;
- margin-top: 40upx;
- border-top: 1px solid #dddddd;
- display: flex;
- }
- .bounced3-1 {
- width: 50%;
- height: 100%;
- text-align: center;
- line-height: 100upx;
- border-right: 1px solid #dddddd;
- font-size: 36upx;
- color: #999999;
- }
- .bounced3-2 {
- width: 50%;
- height: 100%;
- text-align: center;
- line-height: 100upx;
- font-size: 36upx;
- color: #108ee9;
- }
- }
- .translation {
- padding-left: 30rpx;
- padding-right: 30rpx;
- background: #FFFFFF;
- display: flex;
- flex-direction: column;
- height: 100vh;
- }
- .translation .top {
- margin: 0 -30upx;
- padding: 0 30upx;
- background: #ffffff;
- border-bottom: 1rpx solid #F2F2F2;
- padding-bottom: 10rpx;
- }
- .translation .top .title {
- display: flex;
- justify-content: space-between;
- .hash {
- color: rgba(21, 144, 233, 1);
- font-size: 24upx;
- }
- }
- .call_record_time {
- height: 44rpx;
- font-size: 28rpx;
- font-weight: 600;
- color: #008EF2;
- line-height: 44rpx;
- }
- .call_record_time_one {
- height: 48rpx;
- font-size: 24rpx;
- font-weight: 500;
- color: #70798d;
- line-height: 48rpx;
- display: flex;
- justify-content: space-between;
- position: relative;
- .audoioyouxiao{
- height: 46rpx;
- position: absolute;
- top: 0rpx;
- right: 140rpx;
- font-size: 30rpx;
- }
-
- .diangweitupian {
- width: 46rpx;
- height: 46rpx;
- position: absolute;
- top: 0rpx;
- right: 75rpx;
- }
- .file-change {
- position: absolute;
- top: 50rpx;
- right: 0rpx;
- width: 184rpx;
- background: #FFFFFF;
- box-shadow: 0rpx 0rpx 6rpx 2rpx rgba(230, 230, 230, 0.5);
- border-radius: 4rpx;
- z-index: 99;
- height: auto;
- max-height: 600rpx;
- overflow: auto;
- }
- .file-item {
- width: 184rpx;
- height: 60rpx;
- line-height: 60rpx;
- text-align: center;
- font-size: 30rpx;
- font-weight: 400;
- color: #333333;
- border-bottom: 1rpx solid #E2E2E2;
- }
- .file-item:last-child {
- border: 0
- }
- .fileactive {
- color: #008EF2
- }
- }
- .audio-container {
- width: 100%;
- display: flex;
- justify-content: space-between;
- align-items: center;
- .audio-head {
- width: 60rpx;
- height: 60rpx;
- flex-shrink: 0;
- }
- .audio-head .image {
- width: 100%;
- height: 100%;
- }
- .audio-slider {
- width: 96%;
- position: relative;
- padding: 2px 0rpx 0px 20px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .audio-slider .slider {
- width: 100%;
- padding: 0px 15rpx;
- box-sizing: border-box;
- }
- .audio-time {
- width: 110rpx;
- text-align: right;
- font-size: 24rpx;
- line-height: 28rpx;
- color: #70798D;
- display: flex;
- justify-content: space-between;
- }
- .audio-play {
- width: 40rpx;
- height: 40rpx;
- flex-shrink: 0;
- }
- .audio-play .image {
- width: 100%;
- height: 100%;
- }
- }
- .scroll-Y {
- font-size: 36upx;
- color: #999999;
- background: #FFFFFF;
- margin-top: 30upx;
- flex: 1;
- overflow-y: scroll;
- width: 100%;
- }
- .scroll-Y .text {
- margin: 50upx 30upx;
- line-height: 80upx;
- display: flex;
- align-items: center;
- }
- .scroll-Y .text[data-speaker="2"],
- .scroll-Y .text[data-speaker="4"],
- .scroll-Y .text[data-speaker="6"] {
- flex-direction: row-reverse;
- text-align: right;
- .content {
- margin-left: 0;
- margin-right: 30upx;
- background: #F6F6F6;
- color: #999999;
- }
- }
- .scroll-Y .text .avatar {
- width: 64upx;
- height: 64upx;
- line-height: 64upx;
- text-align: center;
- // border: 1rpx solid red;
- font-size: 36rpx;
- border-radius: 50%;
- background: #F2F2F2;
- color: #008EF2;
- // display: flex;
- // justify-content: center;
- // align-items: center;
- // image {
- // width: 40upx;
- // }
- }
- .scroll-Y .text .content {
- margin-left: 30upx;
- line-height: 60rpx;
- text-align: left;
- padding: 0 5px;
- background: #2BC805;
- border-radius: 8upx;
- max-width: 442rpx;
- color: #FFFFFF;
- position: relative;
- .tankuangcss {
- position: absolute;
- top: -140rpx;
- left: -120rpx;
- width: 308rpx;
- height: 130rpx;
- background-color: #333333;
- font-size: 24rpx;
- color: #FFFFFF;
- padding-top: 4rpx;
- padding-bottom: 4rpx;
- display: flex;
- flex-wrap: wrap;
- border-radius: 15rpx;
- z-index: 1000;
- }
- }
- .scroll-Y .text.active .content {
- color: #38FFF1;
- position: relative;
- }
- .scroll-Y .text.active[data-speaker="2"] .content,
- .scroll-Y .text.active[data-speaker="4"] .content,
- .scroll-Y .text.active[data-speaker="6"] .content {
- color: #FF7538;
- position: relative;
- }
- .tab-box {
- width: 100%;
- display: flex;
- justify-content: center;
- align-items: center;
- .yinpinshibie {
- width: 156rpx;
- height: 50rpx;
- font-size: 36rpx;
- font-weight: 400;
- color: #333333;
- text-align: center;
- line-height: 50rpx;
- letter-spacing: 2rpx;
- margin-right: 188rpx;
- &.active {
- position: relative;
- &::after {
- position: absolute;
- content: '';
- width: 119rpx;
- height: 8rpx;
- background: #008EF2;
- border-radius: 4rpx;
- top: 50rpx;
- right: 0;
- left: 0;
- margin: 0 auto;
- }
- }
- }
- .rate {
- width: 156rpx;
- height: 50rpx;
- font-size: 36rpx;
- font-weight: 400;
- color: #333333;
- line-height: 50rpx;
- letter-spacing: 2rpx;
- text-align: center;
- &.active {
- position: relative;
- &::after {
- position: absolute;
- content: '';
- width: 119rpx;
- height: 8rpx;
- background: #008EF2;
- border-radius: 4rpx;
- top: 50rpx;
- right: 0;
- left: 0;
- margin: 0 auto;
- }
- }
- }
- }
- .backTop {
- width: 60upx;
- height: 60upx;
- background: rgba(211, 235, 253, 1);
- box-shadow: 0upx 0upx 2upx 4upx rgba(38, 161, 255, 0.04);
- border-radius: 50%;
- position: fixed;
- bottom: 200upx;
- right: 8upx;
- display: flex;
- justify-content: center;
- align-items: center;
- image {
- width: 26upx;
- height: 34upx;
- }
- }
- // 评分
- .rate-box {
- padding: 10rpx 20rpx;
- .date {
- width: 300rpx;
- height: 33rpx;
- font-size: 24rpx;
- font-weight: 400;
- color: #333333;
- line-height: 33rpx;
- letter-spacing: 1rpx;
- margin-bottom: 8rpx;
- }
- .title {
- width: 100%;
- height: 42rpx;
- font-size: 30rpx;
- font-weight: 500;
- color: #333333;
- line-height: 42rpx;
- letter-spacing: 2rpx;
- margin-bottom: 20rpx;
- }
- .level1 {
- display: flex;
- align-items: center;
- .level-name {
- width: 104rpx;
- height: 33rpx;
- font-size: 24rpx;
- font-weight: 500;
- color: #333333;
- line-height: 33rpx;
- letter-spacing: 1rpx;
- margin-right: 10rpx;
- }
- .level-progress {
- flex: 1;
- border-radius: 11rpx;
- height: 21rpx;
- background-color: #BEE4FF;
- position: relative;
- .color {
- width: 0;
- position: absolute;
- top: 0;
- left: 0;
- height: 21rpx;
- border-radius: 11rpx 0 0 11rpx;
- background-color: #008EF2;
- }
- }
- .level-rate {
- width: 65rpx;
- height: 33rpx;
- font-size: 24rpx;
- font-weight: 500;
- color: #333333;
- line-height: 33rpx;
- letter-spacing: 1rpx;
- margin: 0 20rpx 0 15rpx;
- }
- .arrow {
- width: 37rpx;
- height: 21rpx;
- padding: 5rpx 20rpx;
- }
- .rotatearrow {
- transform: rotate(270deg);
- }
- }
- .level1-subbox {
- display: flex;
- margin-top: 20rpx;
- flex-wrap: wrap;
-
- .sub-name {
- width: 50%;
- display: flex;
- margin-bottom: 18rpx;
- .subitem-name {
- width: 104rpx;
- height: 33rpx;
- font-size: 24rpx;
- font-weight: 400;
- color: #999999;
- line-height: 33rpx;
- letter-spacing: 1rpx;
- margin-right: 12rpx;
- }
- .checkimg {
- width: 27rpx;
- height: 27rpx;
- }
- }
- }
- }
- .dialog-block {
- margin: 20rpx 0;
- border-bottom: 1px solid #ccc;
- .fileName {
- text-align: center;
- margin: 10rpx auto;
- width: 115rpx;
- height: 42rpx;
- line-height: 42rpx;
- background: #EFEFEF;
- border-radius: 4rpx;
- font-size: 20rpx;
- font-weight: 400;
- color: #333333;
- }
- }
- </style>
|