AI销管
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1495 lines
35 KiB

  1. <template>
  2. <view class="translation">
  3. <!-- 暂时注释,暂缓使用 -->
  4. <!-- <view style="width: 690rpx;height: 64rpx;margin: 0 auto;margin-top: 30rpx;background: #F2F2F2;border-radius: 32rpx;
  5. display: flex;align-items: center;" @tap="toKeywordsearch()">
  6. <image style="width: 28rpx;height: 28rpx;margin-left: 30rpx;" src="/static/images/search.png" mode=""></image>
  7. <text style="margin-left: 10rpx;color: #999999;font-size: 24rpx;">请输入关键字</text>
  8. </view> -->
  9. <view class="top" style="margin-top: 30rpx;">
  10. <view class="title">
  11. <view class="call_record_time">{{date}}</view>
  12. </view>
  13. <view class="call_record_time_one">接待时长 {{alltimeStr}}
  14. <u-icon name="list-dot" color="#333" size="48" @click="showFile"></u-icon>
  15. <view class="audoioyouxiao" @click="alllogo()" v-if="permissions.commonly2">
  16. {{userlistobj.validInvalidName||''}}
  17. </view>
  18. <view class="file-change" v-if="isshowFile">
  19. <view class="file-item" @click="filechange(item,index)"
  20. :class="csdFileindex == index ? 'fileactive' : ''" v-for="(item,index) in luyinList"
  21. :key="index">录音文件{{index+1}}</view>
  22. </view>
  23. <view class="diangweitupian" v-if="jiaoseshow">
  24. <image v-if="status==1" @click="tappick()" style="width: 100%;height: 100%;"
  25. src="../../static/images/pike.png" mode=""></image>
  26. <image v-if="status==0" @click="notappick()" style="width: 100%;height: 100%;"
  27. src="../../static/images/nopike.png" mode=""></image>
  28. </view>
  29. </view>
  30. <yz-audio :nowFileTime="nowTime" class="audio-container" ref="zyAudio" @ended="qeihuanwenjian" @timeUpdate="TimeUpdate"
  31. @sliderChangeComplate="sliderChangeComplate"></yz-audio>
  32. </view>
  33. <scroll-view :scroll-top="scrollTop" lower-threshold='20px' @scrolltolower="ltolower()"
  34. :scroll-into-view="scrollId" scroll-y="true" class="text scroll-Y">
  35. <!-- tab 栏切换 -->
  36. <view class="tab-box" id="top">
  37. <view class="yinpinshibie" @click="changeTab(0)" :class="{active: tab==0}">
  38. 音频识别
  39. </view>
  40. <view class="rate" @click="changeTab(1)" :class="{active: tab==1}">
  41. 评分
  42. </view>
  43. </view>
  44. <!-- 音频识别模块 -->
  45. <view v-if="tab==0">
  46. <!-- 聊天记录-->
  47. <view class="dialog-block" v-for="(dialog,i) in dialogList" :key="i">
  48. <view :id="'dialog'+i" class="fileName">录音文件
  49. <!-- {{i+1}} -->
  50. </view>
  51. <view class="text" :id="'dialog'+csdFileindex+'text'+item.bg"
  52. :class="{active: item.bg < playNow && item.ed > playNow && i==0}"
  53. v-for="(item,index) in dialog.message" :key="index" :data-speaker="item.speaker">
  54. <view class="avatar">
  55. <text :style="[SPEAKERSTYLE(item.speaker)]">{{ item.speaker | toCapital }}</text>
  56. </view>
  57. <view class="content">
  58. <view @longpress="changanxiaoguo(item,index,i)" v-html="item.onebest"></view>
  59. <view class="tankuangcss" v-if="item.isshow">
  60. <view @click="clickcopy()"
  61. style="width: 60rpx;font-size: 24rpx;text-align: center;margin-left: 24rpx;">复制
  62. </view>
  63. <view @click="Oftenthewrongword()" v-if="permissions.commonly4"
  64. style="width: 80rpx;font-size: 24rpx;text-align: center;margin-left: 22rpx;">常错词
  65. </view>
  66. <view @click="Addtheessence()" v-if="permissions.commonly3"
  67. style="width: 80rpx;font-size: 24rpx;text-align: center;margin-left: 22rpx;">加精华
  68. </view>
  69. <view @click="clickbofang(dialog.backindex,item)"
  70. style="width: 80rpx;font-size: 24rpx;text-align: center;margin-left: 14rpx;">播放
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. <!-- 评分模块 -->
  78. <view v-if="tab==1" class="rate-box">
  79. <view class="title">总执行率 {{totalRate}}%</view>
  80. <view v-for="(item,index) in ratelist" :key="index" class="u-m-b-14">
  81. <view class="level1">
  82. <view class="level-name u-line-1">
  83. {{item.name}}
  84. </view>
  85. <view class="level-progress">
  86. <view class="color" :style="{width: item.ratepercent/item.rate*100+'%'}"></view>
  87. </view>
  88. <view class="level-rate">{{((item.ratepercent/item.rate).toFixed(2)*100).toFixed()}}%</view>
  89. <image v-if="!item.show" class="arrow rotatearrow" @click="changeshow(item,1)"
  90. src="/static/images/down.png" mode="" />
  91. <image v-else class="arrow" @click="changeshow(item,0)" src="/static/images/up.png" mode="" />
  92. </view>
  93. <view class="level1-subbox" v-if="item.show">
  94. <view class="sub-name" v-for="(subitem,i) in item.children" :key="i">
  95. <view class="subitem-name u-line-1">{{subitem.name}}</view>
  96. <image class="checkimg" v-if="!subitem.selected" src="/static/images/rate-checked.png"
  97. mode="" />
  98. <image class="checkimg" v-else src="/static/images/rate-nocheck.png" mode="" />
  99. </view>
  100. </view>
  101. </view>
  102. </view>
  103. </scroll-view>
  104. <!-- 回到顶部 -->
  105. <view class="backTop" @click="gotoTop">
  106. <image src="/static/images/backTop.png" mode=""></image>
  107. </view>
  108. <!-- 加入常错词 -->
  109. <view class="zhezhoa" v-if="isshow2" @tap="Cancelout"></view>
  110. <view class="bounced" v-if="isshow2">
  111. <view class="tian-view">
  112. <viwe class="tian-view-t1"></viwe>
  113. <viwe class="tian-view-t2">常错词:</viwe>
  114. <viwe class="tian-view-t3">
  115. <input type="text" v-model="thewrongword" class="tian-input" placeholder="请输入" />
  116. </viwe>
  117. </view>
  118. <view class="tian-view">
  119. <viwe class="tian-view-t1"></viwe>
  120. <viwe class="tian-view-t2">正确词:</viwe>
  121. <viwe class="tian-view-t3">
  122. <input class="tian-input" v-model="reswrongword" type="text" placeholder="请输入" />
  123. </viwe>
  124. </view>
  125. <view class="bounced3">
  126. <view class="bounced3-1" @tap="Cancelout">取消</view>
  127. <view class="bounced3-2" @tap="Confirmtheexit">确认</view>
  128. </view>
  129. </view>
  130. <!-- 加精华 -->
  131. <view class="zhezhoa" v-if="isshow3" @tap="Cancelout2"></view>
  132. <view class="bounced" v-if="isshow3">
  133. <view class="jiajinghuatit">加精华</view>
  134. <view style="width: 100%;text-indent: 20rpx;font-size: 28rpx;">选择标签</view>
  135. <view class="jiajinghuaview">
  136. <view class="jighuaview2" v-for="(item,index) in biaoqianlist" :key="index"
  137. :class="biaoqianindex == index ? 'biaoqiantom' : ''">
  138. <view class="view1-text" @click="tapbiaoqianclisck(index)">{{item.name}}</view>
  139. </view>
  140. </view>
  141. <view class="bounced3">
  142. <view class="bounced3-1" @tap="Cancelout2">取消</view>
  143. <view class="bounced3-2" @tap="Confirmtheexit2">确认</view>
  144. </view>
  145. </view>
  146. <view class="zhezhoa" v-if="effective"></view>
  147. <view class="bounced" v-if="effective">
  148. <view class="jiajinghuatit">选择</view>
  149. <view>
  150. <view class="uni-list">
  151. <radio-group @change="radioChange">
  152. <label style="display: flex;align-items: center;font-size: 30rpx;
  153. width: 94%;height: 80rpx;margin: 0 auto;" v-for="(item, index) in effectiveitems" :key="item.value">
  154. <view style="margin-top: 2rpx;flex: 1; text-indent: 20rpx;">{{item.name}}</view>
  155. <view style="width: 80rpx;">
  156. <radio :value="item.value" :checked="index == effectiveindex" />
  157. </view>
  158. </label>
  159. </radio-group>
  160. </view>
  161. <view v-if="effectiveindex==4">
  162. <textarea class="ffectivetext" v-model="effectiveitext" placeholder="备注" />
  163. </view>
  164. </view>
  165. <view class="bounced3">
  166. <view class="bounced3-1" @click="effective=false">取消</view>
  167. <view class="bounced3-2" @click="effectiveAdd()">确认</view>
  168. </view>
  169. </view>
  170. </view>
  171. </template>
  172. <script>
  173. var util = require("../../utils/util.js");
  174. var config = require("../../config");
  175. export default {
  176. data() {
  177. return {
  178. recordPath: "",
  179. customerId: "",
  180. luyinList: [], //录音文件
  181. dialogList: [], //录音识别列表
  182. csdFileindex: 0,
  183. isshowFile: false, //录音列表隐藏
  184. date: "", //年月日
  185. tab: 0, // 默认是音频识别
  186. scrollTop: 0,
  187. scrollId: "",
  188. playNow: 0,
  189. alltimeStr: "00:00:00",
  190. ratelist: [], //评分列表
  191. totalRate: "",
  192. thewrongword: "", //错误词
  193. reswrongword: "", //正确词
  194. isshow2: false,
  195. messagelisy: [],
  196. isshow3: false,
  197. biaoqianlist: [],
  198. biaoqianindex: 0,
  199. changanitem: {},
  200. duihuawenjianid: "",
  201. biaoqianid: "",
  202. status: 0,
  203. num: 0, //上拉 转写文件下标
  204. Bnum: 0, //下拉 转写文件下标
  205. itemobj: {},
  206. buildingID: '',
  207. userlistobj: {},
  208. effective: false,
  209. effectiveindex: '0',
  210. effectiveitems: [{
  211. value: '1',
  212. name: '没电指派无录音',
  213. checked: true
  214. },
  215. {
  216. value: '2',
  217. name: '离线指派无录音',
  218. },
  219. {
  220. value: '3',
  221. name: '系统测试误操作'
  222. },
  223. {
  224. value: '4',
  225. name: '非接访场景录音'
  226. },
  227. {
  228. value: '5',
  229. name: '其他'
  230. }
  231. ],
  232. effectiveitext: '',
  233. textItself: '',
  234. argtextindex1: 0,
  235. argtextindex2: 0,
  236. permissions: {
  237. commonly2: false,
  238. commonly3: false,
  239. commonly4: false,
  240. }
  241. };
  242. },
  243. computed: {
  244. nowTime() {
  245. return this.getTime(this.luyinList[this.csdFileindex].recordDuration)
  246. },
  247. },
  248. onLoad(options) {
  249. this.status = options.status;
  250. this.customerId = options.customerId;
  251. this.itemobj = uni.getStorageSync('searchobj');
  252. this.stateisshow = options.stateisshow;
  253. },
  254. onShow() {
  255. let newmenulist = uni.getStorageSync('weapp_session_Menu_data');
  256. this.permissions.commonly2 = newmenulist.jdwxbj;//1 接待无效标记 jdwxbj
  257. this.permissions.commonly3 = newmenulist.swyxal;//1 设为优秀案例 swyxal
  258. this.permissions.commonly4 = newmenulist.ccc;// 常错词 ccc
  259. this.buildingID = uni.getStorageSync('buildingID').id;
  260. if (this.stateisshow == 2) {
  261. var info = this.itemobj;
  262. } else {
  263. var pages = getCurrentPages();
  264. var currPage = pages[pages.length - 1]; //当前页面
  265. var info = currPage.data.info;
  266. }
  267. this.gituserlist()
  268. this.init(info)
  269. },
  270. methods: {
  271. effectiveAdd() {
  272. if (this.effectiveindex == 4) {
  273. if (this.effectiveitext.length == 0) {
  274. uni.showToast({
  275. title: '备注不能为空',
  276. icon: "none",
  277. duration: 2000
  278. });
  279. return
  280. }
  281. }
  282. this.effective = false;
  283. let parames = {
  284. id: this.customerId,
  285. validInvalid: '',
  286. validInvalid: 1,
  287. invalidReason: Number(this.effectiveindex) + 1,
  288. invalidNote: this.effectiveitext
  289. }
  290. this.$u.post("/customer/updateValidInvalid", parames).then(res => {
  291. console.log(res)
  292. this.gituserlist()
  293. })
  294. },
  295. radioChange(evt) {
  296. this.effectiveitext = "";
  297. for (let i = 0; i < this.effectiveitems.length; i++) {
  298. if (this.effectiveitems[i].value === evt.detail.value) {
  299. this.effectiveindex = i;
  300. break;
  301. }
  302. }
  303. },
  304. //标记
  305. alllogo() {
  306. let msg = '';
  307. if (this.userlistobj.validInvalid != 0) {
  308. msg = '是否标记为"有效录音"?';
  309. uni.showModal({
  310. title: '提示',
  311. content: msg,
  312. success: (res) => {
  313. if (res.confirm) {
  314. let parames = {
  315. id: this.customerId,
  316. validInvalid: '',
  317. invalidReason: 0
  318. }
  319. if (this.userlistobj.validInvalid == 0) {
  320. parames.validInvalid = 1;
  321. } else {
  322. parames.validInvalid = 0;
  323. }
  324. this.$u.post("/customer/updateValidInvalid", parames).then(res => {
  325. console.log(res)
  326. this.gituserlist()
  327. })
  328. }
  329. }
  330. });
  331. } else {
  332. this.effective = true;
  333. }
  334. },
  335. //获取用户信息
  336. gituserlist() {
  337. this.$u.get("/matchKeywords/personalReceptionRecord", {
  338. customerId: this.customerId
  339. }).then(res => {
  340. res.endTime1 = res.endTime.substring(0, 19);
  341. this.userlistobj = res;
  342. })
  343. },
  344. toKeywordsearch() {
  345. this.stateisshow = 1;
  346. uni.navigateTo({
  347. url: '/pages/learning/Keywordsearch?customerId=' + this.customerId + "&status=" + this.status +
  348. "&skpl=" + "1"
  349. })
  350. },
  351. TimeUpdate(e) {
  352. const {
  353. currentTime,
  354. duration
  355. } = e;
  356. this.playNow = parseInt(currentTime * 1000)
  357. if (this.dialogList.length == 0) {
  358. return
  359. } else {
  360. const message = this.dialogList[0].message
  361. for (let i = 0; i < message.length; i++) {
  362. if (Number(message[i].bg) < this.playNow && Number(message[i].ed) > this.playNow) {
  363. this.scrollId = "dialog" + this.csdFileindex + "text" + message[i].bg;
  364. break;
  365. }
  366. }
  367. }
  368. this.$forceUpdate()
  369. },
  370. init(info) {
  371. const parames = {
  372. pageNum: 1,
  373. pageSize: 100,
  374. query: {
  375. customerId: this.customerId
  376. }
  377. }
  378. this.$u.post("/corpus/findByPage", parames).then(res => {
  379. if (res && res.length) {
  380. let alltime = 1;
  381. res.forEach(item => {
  382. item.recordDuration = item.recordDuration / 1
  383. alltime += item.recordDuration
  384. })
  385. this.alltimeStr = this.getTime(alltime)
  386. if (info) {
  387. res.forEach((item, index) => {
  388. console.log(item, '打印音频列表内容')
  389. if (item.id == info.id) {
  390. this.luyinList = res;
  391. this.csdFileindex = index;
  392. this.recordPath = res[index].recordPath
  393. this.date = res[index].receptionTime;
  394. this.isshowFile = false;
  395. this.getCorpusAnalysis(info);
  396. var itc = parseInt(info.bg / 1000)
  397. this.adasdasdasd(itc)
  398. }
  399. })
  400. } else {
  401. this.recordPath = res[0].recordPath
  402. this.date = res[0].receptionTime
  403. this.luyinList = res;
  404. this.getCorpusAnalysis()
  405. }
  406. console.log(res, '打印音频列表内容')
  407. this.zyAudio()
  408. }
  409. })
  410. },
  411. //录音实例
  412. zyAudio() {
  413. console.log('this.recordPath', this.recordPath)
  414. this.$refs.zyAudio.setSrc(this.recordPath)
  415. },
  416. //搜索跳转
  417. adasdasdasd(e) {
  418. this.$refs.zyAudio.seek(e)
  419. this.$refs.zyAudio.play();
  420. },
  421. //下一页
  422. ltolower() {
  423. var lengthcz = this.luyinList.length - 1;
  424. if (this.num >= lengthcz) {
  425. uni.showToast({
  426. title: '到底了',
  427. duration: 2000
  428. });
  429. return
  430. } else {
  431. this.num = this.num + 1;
  432. let obj = {
  433. corpusId: this.luyinList[this.num].id,
  434. customerId: this.customerId,
  435. }
  436. this.$u.get(config.service.getCorpusAnalysis, obj).then(data => {
  437. console.log(data)
  438. if (!data.audioContent) {
  439. setTimeout(function() {}, 2000);
  440. } else {
  441. const jsonInfo = JSON.parse(data.audioContent);
  442. this.dialogList.push({
  443. message: jsonInfo,
  444. backindex: this.num
  445. });
  446. this.dialogList.forEach((asd, idx) => {
  447. asd.message.forEach((qwe, inde) => {
  448. qwe.isshow = false;
  449. })
  450. })
  451. }
  452. uni.hideLoading();
  453. }).catch(e => {
  454. uni.hideLoading();
  455. })
  456. }
  457. },
  458. // 取消全部加精
  459. notappick() {
  460. uni.showModal({
  461. title: '提示',
  462. content: '确认取消加精?',
  463. success: (res) => {
  464. if (res.confirm) {
  465. console.log('用户点击确定');
  466. let params = {
  467. carId: this.customerId,
  468. }
  469. this.$u.get(config.service.delATD, params).then(data => {
  470. console.log(data)
  471. this.status = 1
  472. uni.showToast({
  473. title: data.message,
  474. duration: 2000
  475. });
  476. })
  477. } else if (res.cancel) {
  478. console.log('用户点击取消');
  479. }
  480. }
  481. });
  482. },
  483. //全部加精
  484. tappick(i) {
  485. uni.showModal({
  486. title: '提示',
  487. content: '确认加精?',
  488. success: (res) => {
  489. if (res.confirm) {
  490. console.log('用户点击确定');
  491. let objdata = {
  492. "carId": that.customerId, //客户id
  493. "status": 0,
  494. "itemId": that.buildingID,
  495. }
  496. this.$u.post(config.service.addATD, objdata).then(data => {
  497. this.status = 0
  498. uni.showToast({
  499. title: data.message,
  500. duration: 2000
  501. });
  502. })
  503. } else if (res.cancel) {
  504. console.log('用户点击取消');
  505. }
  506. }
  507. });
  508. },
  509. //标签选择
  510. tapbiaoqianclisck(index) {
  511. this.biaoqianindex = index;
  512. this.biaoqianid = this.biaoqianlist[index].id
  513. },
  514. //复制
  515. clickcopy() {
  516. var that = this;
  517. uni.setClipboardData({
  518. data: that.thewrongword,
  519. success: function() {
  520. that.dialogList.forEach(res => {
  521. res.message.forEach(asd => {
  522. asd.isshow = false;
  523. })
  524. })
  525. that.$forceUpdate();
  526. console.log('success');
  527. }
  528. });
  529. },
  530. //确认加入常错词
  531. Confirmtheexit() {
  532. if (this.thewrongword) {
  533. if (this.reswrongword) {
  534. let parames = {
  535. customerId: this.customerId,
  536. cupid: this.luyinList[this.csdFileindex].id,
  537. wrongWord: this.thewrongword, //错误词
  538. correctWord: this.reswrongword, //正确词
  539. translateHtmlContent: this.messagelisy,
  540. }
  541. this.isshow2 = false;
  542. let sas = this.textItself.replace(this.thewrongword, this.reswrongword)
  543. this.dialogList[this.argtextindex1].message[this.argtextindex2].onebest = sas
  544. this.dialogList.forEach(res => {
  545. res.message.forEach(asd => {
  546. asd.isshow = false;
  547. })
  548. })
  549. this.$u.post("/corpus/addCorrectWord", parames).then(data => {
  550. this.thewrongword = "";
  551. this.reswrongword = "";
  552. })
  553. } else {
  554. uni.showToast({
  555. title: '正确值不能为空',
  556. duration: 2000
  557. });
  558. return
  559. }
  560. } else {
  561. uni.showToast({
  562. title: '错误词不能为空',
  563. duration: 2000
  564. });
  565. return
  566. }
  567. },
  568. //取消加入常错词
  569. Cancelout() {
  570. this.isshow2 = false;
  571. this.dialogList.forEach(res => {
  572. res.message.forEach(asd => {
  573. asd.isshow = false;
  574. })
  575. })
  576. },
  577. //加入长错词
  578. Oftenthewrongword() {
  579. this.reswrongword = "";
  580. this.isshow2 = true;
  581. },
  582. //加精华
  583. Addtheessence() {
  584. this.isshow3 = true;
  585. this.biaoqianlist = []
  586. this.$u.post('/addtodigest/findAllYi', {}).then(data => {
  587. this.biaoqianlist = data
  588. this.biaoqianlist.unshift({
  589. name: "逼单话术",
  590. id: 0
  591. })
  592. })
  593. // util.getRequestPromise('/addtodigest/findAllYi', {}, false).then(data => {
  594. // });
  595. },
  596. // 取消加精
  597. Cancelout2() {
  598. this.isshow3 = false;
  599. this.dialogList.forEach(res => {
  600. res.message.forEach(asd => {
  601. asd.isshow = false;
  602. })
  603. })
  604. },
  605. // 确认加精
  606. Confirmtheexit2() {
  607. if (this.biaoqianid) {
  608. this.biaoqianid = this.biaoqianid
  609. } else {
  610. this.biaoqianid = 0
  611. }
  612. this.isshow3 = false;
  613. this.dialogList.forEach(res => {
  614. res.message.forEach(asd => {
  615. asd.isshow = false;
  616. })
  617. })
  618. let objdata = {
  619. "carId": this.customerId, //客户id
  620. "startTime": this.changanitem.bg, //开始时间
  621. "startFile": this.duihuawenjianid, //对话所在录音文件id
  622. "endTime": this.changanitem.ed, //结束时间
  623. "marketingId": this.biaoqianid, //对应一级父id
  624. "jjTransfer": this.changanitem.onebest, //选中对话
  625. "status": 1
  626. }
  627. this.$u.post(config.service.addATD, objdata).then(data => {
  628. uni.showToast({
  629. title: '加精成功',
  630. duration: 2000
  631. });
  632. }).catch(e => {
  633. uni.showToast({
  634. title: e.message,
  635. icon: 'none',
  636. duration: 2000
  637. });
  638. })
  639. },
  640. //长按对话
  641. changanxiaoguo(item, index, i) {
  642. this.messagelisy = [];
  643. this.changanitem = {};
  644. this.duihuawenjianid = "",
  645. this.dialogList.forEach(res => {
  646. res.message.forEach(asd => {
  647. asd.isshow = false;
  648. })
  649. })
  650. this.changanitem = item;
  651. this.duihuawenjianid = this.luyinList[this.csdFileindex].id;
  652. this.dialogList[i].message[index].isshow = !this.dialogList[i].message[index].isshow;
  653. this.textItself = item.onebest;
  654. let onebest = item.onebest;
  655. this.thewrongword = onebest.replace(/<.*?>/ig, "");
  656. this.thewrongword = item.onebest;
  657. this.messagelisy = this.dialogList[i].message
  658. this.argtextindex1 = i;
  659. this.argtextindex2 = index;
  660. },
  661. //回到顶部
  662. gotoTop() {
  663. this.scrollId = null;
  664. this.$nextTick(() => {
  665. this.scrollId = "top";
  666. })
  667. },
  668. //切换tab
  669. changeTab(type) {
  670. if (type == 0) {
  671. this.tab = 0
  672. } else {
  673. this.tab = 1;
  674. this.getRatelist();
  675. }
  676. },
  677. //录音列表显示隐藏
  678. showFile() {
  679. console.log("111111111111111111111111")
  680. this.isshowFile = !this.isshowFile;
  681. console.log("222222222222222222222")
  682. },
  683. //评分上下显隐
  684. changeshow(item, type) {
  685. if (type == 1) {
  686. item.show = true
  687. } else {
  688. item.show = false
  689. }
  690. },
  691. // 获取评分
  692. getRatelist() {
  693. if (this.ratelist.length == 0) {
  694. this.$u.get("/customer/findzkMByCusId", {
  695. cusId: this.customerId
  696. }).then(res => {
  697. if (res.length) {
  698. let level1 = []
  699. let level2rate = 0
  700. res.forEach(item => {
  701. if (item.pid == 0) {
  702. level1.push({
  703. id: item.marketingId,
  704. rate: item.fraction,
  705. name: item.name,
  706. sort: item.sort,
  707. show: false,
  708. ratepercent: 0,
  709. children: []
  710. })
  711. } else {
  712. if (item.selected == 0) {
  713. level2rate += item.fraction
  714. }
  715. }
  716. })
  717. this.totalRate = level2rate
  718. res.forEach(subitem => {
  719. let subitempid = subitem.pid
  720. level1.forEach(item => {
  721. if (subitempid == item.id) {
  722. if (subitem.selected == 0) {
  723. item.ratepercent += subitem.fraction
  724. }
  725. item.children.push({
  726. id: subitem.id,
  727. rate: subitem.fraction,
  728. selected: subitem.selected,
  729. name: subitem.name
  730. })
  731. }
  732. })
  733. })
  734. level1[0].show = true;
  735. this.ratelist = level1
  736. }
  737. setTimeout(function() {
  738. uni.hideLoading();
  739. }, 1000);
  740. })
  741. }
  742. },
  743. // 获取转义后的对话结果
  744. getCorpusAnalysis(info) {
  745. this.dialogList = [];
  746. let obj = {
  747. corpusId: this.luyinList[this.csdFileindex].id,
  748. customerId: this.customerId
  749. }
  750. this.$u.get(config.service.getCorpusAnalysis, obj).then(data => {
  751. const jsonInfo = JSON.parse(data.audioContent);
  752. console.log(jsonInfo)
  753. if (this.luyinList[this.csdFileindex].recordDuration > 360) {
  754. //拿到总条数
  755. var stusnum = jsonInfo.length;
  756. this.dialogList.push({
  757. message: jsonInfo.splice(0, 80),
  758. backindex: this.csdFileindex
  759. });
  760. var auth_timetimer = setInterval(() => {
  761. stusnum -= 100;
  762. console.log("还剩下" + stusnum)
  763. if (stusnum <= 0) {
  764. console.log("停止")
  765. clearInterval(auth_timetimer);
  766. } else {
  767. console.log("添加")
  768. var newlistwang = [];
  769. newlistwang = jsonInfo.splice(0, 100);
  770. console.log("新数组", newlistwang)
  771. newlistwang.forEach(item => {
  772. this.dialogList[0].message.push(item)
  773. })
  774. }
  775. }, 1000);
  776. } else {
  777. this.dialogList.push({
  778. message: jsonInfo,
  779. backindex: this.csdFileindex
  780. });
  781. }
  782. this.dialogList.forEach((asd, idx) => {
  783. asd.message.forEach((qwe, inde) => {
  784. qwe.isshow = false;
  785. })
  786. })
  787. uni.hideLoading();
  788. }).catch(e => {
  789. uni.hideLoading();
  790. uni.showModal({
  791. title: '提示',
  792. content: '请求数据失败,请重新尝试',
  793. showCancel: false
  794. });
  795. })
  796. },
  797. getTime(time) {
  798. return util.formatSecond(time)
  799. },
  800. //音频前进回退
  801. sliderChangeComplate(e) {
  802. this.$refs.zyAudio.seek(e.detail.value);
  803. this.$refs.zyAudio.play();
  804. },
  805. //长按点击播放
  806. clickbofang(dialog, item) {
  807. this.dialogList.forEach(res => {
  808. res.message.forEach(asd => {
  809. asd.isshow = false;
  810. })
  811. })
  812. this.$forceUpdate()
  813. if (dialog == this.csdFileindex) {
  814. let time = parseInt(item.bg / 1000)
  815. this.$refs.zyAudio.seek(time);
  816. this.$refs.zyAudio.play();
  817. return
  818. } else {
  819. let time = parseInt(item.bg / 1000)
  820. this.csdFileindex = dialog;
  821. this.recordPath = this.luyinList[dialog].recordPath;
  822. this.date = this.luyinList[dialog].receptionTime;
  823. this.getCorpusAnalysis()
  824. this.$refs.zyAudio.seek(time);
  825. this.$refs.zyAudio.play();
  826. }
  827. },
  828. // 文件切换播放
  829. filechange(item, i) {
  830. this.num = i; //下拉起始位置
  831. this.Bnum = i;
  832. this.csdFileindex = i;
  833. this.recordPath = item.recordPath;
  834. this.date = item.receptionTime;
  835. this.isshowFile = false;
  836. this.zyAudio()
  837. this.getCorpusAnalysis()
  838. this.$forceUpdate()
  839. },
  840. // 自动播放下一个文件
  841. qeihuanwenjian() {
  842. let index = this.csdFileindex + 1;
  843. if (index < this.luyinList.length) {
  844. this.csdFileindex = index;
  845. this.getCorpusAnalysis()
  846. let item = this.luyinList[this.csdFileindex];
  847. let i = this.csdFileindex;
  848. this.filechange(item, i)
  849. }
  850. },
  851. formatTime(num) {
  852. //格式化时间格式
  853. num = num.toFixed(0);
  854. let second = num % 60;
  855. if (second < 10) second = '0' + second;
  856. let min = Math.floor(num / 60);
  857. if (min < 10) min = '0' + min;
  858. return min + ":" + second;
  859. },
  860. changeEditing() {
  861. this.dialogList.forEach(res => {
  862. res.message.forEach(asd => {
  863. asd.isshow = false;
  864. })
  865. })
  866. }
  867. },
  868. }
  869. </script>
  870. <style lang="scss" scoped>
  871. .ffectivetext {
  872. width: 85%;
  873. margin: 10rpx auto;
  874. height: 100rpx;
  875. padding: 20rpx;
  876. border: 1rpx solid #E4F0FF;
  877. }
  878. .biaoqiantom {
  879. background-color: #008EF2;
  880. color: #FFFFFF;
  881. border: none;
  882. }
  883. // 表单
  884. .tian-view {
  885. width: 570upx;
  886. background-color: #FFFFFF;
  887. border-bottom: 1px solid #ededee;
  888. display: flex;
  889. min-height: 96rpx;
  890. .tian-view-t1 {
  891. width: 20rpx;
  892. font-size: 34rpx;
  893. height: 34rpx;
  894. line-height: 110rpx;
  895. letter-spacing: 0px;
  896. color: red;
  897. }
  898. .tian-view-t2 {
  899. width: 30%;
  900. min-height: 96rpx;
  901. line-height: 96rpx;
  902. font-size: 34rpx;
  903. color: #333;
  904. }
  905. .tian-view-t3 {
  906. width: 61%;
  907. padding-top: 31rpx;
  908. padding-bottom: 31rpx;
  909. display: flex;
  910. .tian-input {
  911. width: 98%;
  912. font-size: 34rpx;
  913. border: none;
  914. }
  915. }
  916. }
  917. .zhezhoa {
  918. position: fixed;
  919. top: 0;
  920. left: 0;
  921. z-index: 999;
  922. width: 100%;
  923. height: 100vh;
  924. opacity: 0.5;
  925. background-color: #666666;
  926. }
  927. .bounced {
  928. width: 570upx;
  929. background: #FFFFFF;
  930. z-index: 1000;
  931. border-radius: 10upx;
  932. position: fixed;
  933. left: 50%;
  934. top: 50%;
  935. transform: translate(-50%, -50%);
  936. /* 50%为自身尺寸的一半 */
  937. .jiajinghuatit {
  938. width: 100%;
  939. height: 68rpx;
  940. font-size: 30rpx;
  941. text-align: center;
  942. line-height: 68rpx;
  943. }
  944. .jiajinghuaview {
  945. padding: 18rpx 18rpx 18rpx 18rpx;
  946. display: flex;
  947. flex-wrap: wrap;
  948. height: 50vh;
  949. overflow-y: scroll;
  950. .jiajinghuaview1 {
  951. padding: 8rpx 8rpx 8rpx 8rpx;
  952. font-size: 26rpx;
  953. border-radius: 12rpx;
  954. border: 1px solid #979797;
  955. margin-left: 8rpx;
  956. }
  957. .jighuaview2 {
  958. padding: 8rpx 18rpx 8rpx 18rpx;
  959. font-size: 26rpx;
  960. border-radius: 12rpx;
  961. border: 1px solid #979797;
  962. margin-left: 20rpx;
  963. margin-top: 10rpx;
  964. display: flex;
  965. .view1-text {
  966. text-align: center;
  967. }
  968. .view1-img {
  969. width: 50rpx;
  970. }
  971. }
  972. }
  973. .bounced3 {
  974. height: 100upx;
  975. width: 100%;
  976. margin-top: 40upx;
  977. border-top: 1px solid #dddddd;
  978. display: flex;
  979. }
  980. .bounced3-1 {
  981. width: 50%;
  982. height: 100%;
  983. text-align: center;
  984. line-height: 100upx;
  985. border-right: 1px solid #dddddd;
  986. font-size: 36upx;
  987. color: #999999;
  988. }
  989. .bounced3-2 {
  990. width: 50%;
  991. height: 100%;
  992. text-align: center;
  993. line-height: 100upx;
  994. font-size: 36upx;
  995. color: #108ee9;
  996. }
  997. }
  998. .translation {
  999. padding-left: 30rpx;
  1000. padding-right: 30rpx;
  1001. background: #FFFFFF;
  1002. display: flex;
  1003. flex-direction: column;
  1004. height: 100vh;
  1005. }
  1006. .translation .top {
  1007. margin: 0 -30upx;
  1008. padding: 0 30upx;
  1009. background: #ffffff;
  1010. border-bottom: 1rpx solid #F2F2F2;
  1011. padding-bottom: 10rpx;
  1012. }
  1013. .translation .top .title {
  1014. display: flex;
  1015. justify-content: space-between;
  1016. .hash {
  1017. color: rgba(21, 144, 233, 1);
  1018. font-size: 24upx;
  1019. }
  1020. }
  1021. .call_record_time {
  1022. height: 44rpx;
  1023. font-size: 28rpx;
  1024. font-weight: 600;
  1025. color: #008EF2;
  1026. line-height: 44rpx;
  1027. }
  1028. .call_record_time_one {
  1029. height: 48rpx;
  1030. font-size: 24rpx;
  1031. font-weight: 500;
  1032. color: #70798d;
  1033. line-height: 48rpx;
  1034. display: flex;
  1035. justify-content: space-between;
  1036. position: relative;
  1037. .audoioyouxiao {
  1038. height: 46rpx;
  1039. position: absolute;
  1040. top: 0rpx;
  1041. right: 140rpx;
  1042. font-size: 30rpx;
  1043. }
  1044. .diangweitupian {
  1045. width: 46rpx;
  1046. height: 46rpx;
  1047. position: absolute;
  1048. top: 0rpx;
  1049. right: 75rpx;
  1050. }
  1051. .file-change {
  1052. position: absolute;
  1053. top: 50rpx;
  1054. right: 0rpx;
  1055. width: 184rpx;
  1056. background: #FFFFFF;
  1057. box-shadow: 0rpx 0rpx 6rpx 2rpx rgba(230, 230, 230, 0.5);
  1058. border-radius: 4rpx;
  1059. z-index: 99;
  1060. height: auto;
  1061. max-height: 600rpx;
  1062. overflow: auto;
  1063. }
  1064. .file-item {
  1065. width: 184rpx;
  1066. height: 60rpx;
  1067. line-height: 60rpx;
  1068. text-align: center;
  1069. font-size: 30rpx;
  1070. font-weight: 400;
  1071. color: #333333;
  1072. border-bottom: 1rpx solid #E2E2E2;
  1073. }
  1074. .file-item:last-child {
  1075. border: 0
  1076. }
  1077. .fileactive {
  1078. color: #008EF2
  1079. }
  1080. }
  1081. .audio-container {
  1082. width: 100%;
  1083. display: flex;
  1084. justify-content: space-between;
  1085. align-items: center;
  1086. .audio-head {
  1087. width: 60rpx;
  1088. height: 60rpx;
  1089. flex-shrink: 0;
  1090. }
  1091. .audio-head .image {
  1092. width: 100%;
  1093. height: 100%;
  1094. }
  1095. .audio-slider {
  1096. width: 96%;
  1097. position: relative;
  1098. padding: 2px 0rpx 0px 20px;
  1099. display: flex;
  1100. justify-content: space-between;
  1101. align-items: center;
  1102. }
  1103. .audio-slider .slider {
  1104. width: 100%;
  1105. padding: 0px 15rpx;
  1106. box-sizing: border-box;
  1107. }
  1108. .audio-time {
  1109. width: 110rpx;
  1110. text-align: right;
  1111. font-size: 24rpx;
  1112. line-height: 28rpx;
  1113. color: #70798D;
  1114. display: flex;
  1115. justify-content: space-between;
  1116. }
  1117. .audio-play {
  1118. width: 40rpx;
  1119. height: 40rpx;
  1120. flex-shrink: 0;
  1121. }
  1122. .audio-play .image {
  1123. width: 100%;
  1124. height: 100%;
  1125. }
  1126. }
  1127. .scroll-Y {
  1128. font-size: 36upx;
  1129. color: #999999;
  1130. background: #FFFFFF;
  1131. margin-top: 30upx;
  1132. flex: 1;
  1133. overflow-y: scroll;
  1134. width: 100%;
  1135. }
  1136. .scroll-Y .text {
  1137. margin: 50upx 30upx;
  1138. line-height: 80upx;
  1139. display: flex;
  1140. align-items: center;
  1141. }
  1142. .scroll-Y .text[data-speaker="2"],
  1143. .scroll-Y .text[data-speaker="4"],
  1144. .scroll-Y .text[data-speaker="6"] {
  1145. flex-direction: row-reverse;
  1146. text-align: right;
  1147. .content {
  1148. margin-left: 0;
  1149. margin-right: 30upx;
  1150. background: #F6F6F6;
  1151. color: #999999;
  1152. }
  1153. }
  1154. .scroll-Y .text .avatar {
  1155. width: 64upx;
  1156. height: 64upx;
  1157. line-height: 64upx;
  1158. text-align: center;
  1159. // border: 1rpx solid red;
  1160. font-size: 36rpx;
  1161. border-radius: 50%;
  1162. background: #F2F2F2;
  1163. color: #008EF2;
  1164. // display: flex;
  1165. // justify-content: center;
  1166. // align-items: center;
  1167. // image {
  1168. // width: 40upx;
  1169. // }
  1170. }
  1171. .scroll-Y .text .content {
  1172. margin-left: 30upx;
  1173. line-height: 60rpx;
  1174. text-align: left;
  1175. padding: 0 5px;
  1176. background: #2BC805;
  1177. border-radius: 8upx;
  1178. max-width: 442rpx;
  1179. color: #FFFFFF;
  1180. position: relative;
  1181. .tankuangcss {
  1182. position: absolute;
  1183. top: -140rpx;
  1184. left: -120rpx;
  1185. width: 308rpx;
  1186. height: 130rpx;
  1187. background-color: #333333;
  1188. font-size: 24rpx;
  1189. color: #FFFFFF;
  1190. padding-top: 4rpx;
  1191. padding-bottom: 4rpx;
  1192. display: flex;
  1193. flex-wrap: wrap;
  1194. border-radius: 15rpx;
  1195. z-index: 1000;
  1196. }
  1197. }
  1198. .scroll-Y .text.active .content {
  1199. color: #38FFF1;
  1200. position: relative;
  1201. }
  1202. .scroll-Y .text.active[data-speaker="2"] .content,
  1203. .scroll-Y .text.active[data-speaker="4"] .content,
  1204. .scroll-Y .text.active[data-speaker="6"] .content {
  1205. color: #FF7538;
  1206. position: relative;
  1207. }
  1208. .tab-box {
  1209. width: 100%;
  1210. display: flex;
  1211. justify-content: center;
  1212. align-items: center;
  1213. .yinpinshibie {
  1214. width: 156rpx;
  1215. height: 50rpx;
  1216. font-size: 36rpx;
  1217. font-weight: 400;
  1218. color: #333333;
  1219. text-align: center;
  1220. line-height: 50rpx;
  1221. letter-spacing: 2rpx;
  1222. margin-right: 188rpx;
  1223. &.active {
  1224. position: relative;
  1225. &::after {
  1226. position: absolute;
  1227. content: '';
  1228. width: 119rpx;
  1229. height: 8rpx;
  1230. background: #008EF2;
  1231. border-radius: 4rpx;
  1232. top: 50rpx;
  1233. right: 0;
  1234. left: 0;
  1235. margin: 0 auto;
  1236. }
  1237. }
  1238. }
  1239. .rate {
  1240. width: 156rpx;
  1241. height: 50rpx;
  1242. font-size: 36rpx;
  1243. font-weight: 400;
  1244. color: #333333;
  1245. line-height: 50rpx;
  1246. letter-spacing: 2rpx;
  1247. text-align: center;
  1248. &.active {
  1249. position: relative;
  1250. &::after {
  1251. position: absolute;
  1252. content: '';
  1253. width: 119rpx;
  1254. height: 8rpx;
  1255. background: #008EF2;
  1256. border-radius: 4rpx;
  1257. top: 50rpx;
  1258. right: 0;
  1259. left: 0;
  1260. margin: 0 auto;
  1261. }
  1262. }
  1263. }
  1264. }
  1265. .backTop {
  1266. width: 60upx;
  1267. height: 60upx;
  1268. background: rgba(211, 235, 253, 1);
  1269. box-shadow: 0upx 0upx 2upx 4upx rgba(38, 161, 255, 0.04);
  1270. border-radius: 50%;
  1271. position: fixed;
  1272. bottom: 200upx;
  1273. right: 8upx;
  1274. display: flex;
  1275. justify-content: center;
  1276. align-items: center;
  1277. image {
  1278. width: 26upx;
  1279. height: 34upx;
  1280. }
  1281. }
  1282. // 评分
  1283. .rate-box {
  1284. padding: 10rpx 20rpx;
  1285. .date {
  1286. width: 300rpx;
  1287. height: 33rpx;
  1288. font-size: 24rpx;
  1289. font-weight: 400;
  1290. color: #333333;
  1291. line-height: 33rpx;
  1292. letter-spacing: 1rpx;
  1293. margin-bottom: 8rpx;
  1294. }
  1295. .title {
  1296. width: 100%;
  1297. height: 42rpx;
  1298. font-size: 30rpx;
  1299. font-weight: 500;
  1300. color: #333333;
  1301. line-height: 42rpx;
  1302. letter-spacing: 2rpx;
  1303. margin-bottom: 20rpx;
  1304. }
  1305. .level1 {
  1306. display: flex;
  1307. align-items: center;
  1308. .level-name {
  1309. width: 104rpx;
  1310. height: 33rpx;
  1311. font-size: 24rpx;
  1312. font-weight: 500;
  1313. color: #333333;
  1314. line-height: 33rpx;
  1315. letter-spacing: 1rpx;
  1316. margin-right: 10rpx;
  1317. }
  1318. .level-progress {
  1319. flex: 1;
  1320. border-radius: 11rpx;
  1321. height: 21rpx;
  1322. background-color: #BEE4FF;
  1323. position: relative;
  1324. .color {
  1325. width: 0;
  1326. position: absolute;
  1327. top: 0;
  1328. left: 0;
  1329. height: 21rpx;
  1330. border-radius: 11rpx 0 0 11rpx;
  1331. background-color: #008EF2;
  1332. }
  1333. }
  1334. .level-rate {
  1335. width: 65rpx;
  1336. height: 33rpx;
  1337. font-size: 24rpx;
  1338. font-weight: 500;
  1339. color: #333333;
  1340. line-height: 33rpx;
  1341. letter-spacing: 1rpx;
  1342. margin: 0 20rpx 0 15rpx;
  1343. }
  1344. .arrow {
  1345. width: 37rpx;
  1346. height: 21rpx;
  1347. padding: 5rpx 20rpx;
  1348. }
  1349. .rotatearrow {
  1350. transform: rotate(270deg);
  1351. }
  1352. }
  1353. .level1-subbox {
  1354. display: flex;
  1355. margin-top: 20rpx;
  1356. flex-wrap: wrap;
  1357. .sub-name {
  1358. width: 50%;
  1359. display: flex;
  1360. margin-bottom: 18rpx;
  1361. .subitem-name {
  1362. width: 104rpx;
  1363. height: 33rpx;
  1364. font-size: 24rpx;
  1365. font-weight: 400;
  1366. color: #999999;
  1367. line-height: 33rpx;
  1368. letter-spacing: 1rpx;
  1369. margin-right: 12rpx;
  1370. }
  1371. .checkimg {
  1372. width: 27rpx;
  1373. height: 27rpx;
  1374. }
  1375. }
  1376. }
  1377. }
  1378. .dialog-block {
  1379. margin: 20rpx 0;
  1380. border-bottom: 1px solid #ccc;
  1381. .fileName {
  1382. text-align: center;
  1383. margin: 10rpx auto;
  1384. width: 115rpx;
  1385. height: 42rpx;
  1386. line-height: 42rpx;
  1387. background: #EFEFEF;
  1388. border-radius: 4rpx;
  1389. font-size: 20rpx;
  1390. font-weight: 400;
  1391. color: #333333;
  1392. }
  1393. }
  1394. </style>