AI销管
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

1621 righe
35 KiB

  1. <template>
  2. <view class="translation" @click="changeEditing(false)">
  3. <view class="top" style="margin-top: 30rpx;">
  4. <view class="title">
  5. <view class="call_record_time">{{date}}</view>
  6. <view class="hash" @click="gotoChat" v-if="commentList.length != 0">
  7. 查看全部评论
  8. </view>
  9. </view>
  10. <view class="call_record_time_one">接待时长 {{alltimeStr}}
  11. <u-icon name="list-dot" color="#333" size="48" @click="showFile"></u-icon>
  12. <view class="file-change" v-if="isshowFile">
  13. <view class="file-item" v-for="(item,index) in luyinList" :key="index"
  14. @click="filechange(item,index)" :class="{fileactive: csdFileindex == index}">录音文件{{index+1}}
  15. </view>
  16. </view>
  17. </view>
  18. <zaudio :duration="duration" theme="theme4"></zaudio>
  19. </view>
  20. <scroll-view :scroll-top="scrollTop" lower-threshold='20px' @scrolltolower="ltolower()"
  21. :scroll-into-view="scrollId" scroll-y="true" class="text scroll-Y">
  22. <!-- 音频识别模块 -->
  23. <view>
  24. <!-- 聊天记录-->
  25. <view class="dialog-block" v-for="(dialog,i) in dialogList" :key="i">
  26. <view :id="'dialog'+i" class="fileName">录音文件</view>
  27. <view class="text dingweishiy" :id="'dialog'+csdFileindex+'text'+item.bg"
  28. :class="{active: Math.floor(item.bg/1000) <= playNow && Math.floor(item.ed/1000) > playNow}"
  29. v-for="(item,index) in dialog.message" :key="index" :data-speaker="item.speaker">
  30. <view class="avatar">
  31. <text :style="[SPEAKERSTYLE(item.speaker)]">{{ item.speaker | toCapital }}</text>
  32. </view>
  33. <view class="content">
  34. <view v-html="item.onebest"></view>
  35. </view>
  36. <view class="tankuangcss" v-if="startTime==item.bg">
  37. <view style="max-width: 85rpx; height: 38rpx;font-size: 24rpx;color: #333333;text-align: center;line-height: 38rpx;
  38. border-radius: 2rpx;border: 1px solid #979797;">标签</view>
  39. <view style="max-width: 171rpx;height: 38rpx;background: #008EF2;border-radius: 2rpx;display: flex;
  40. align-items: center;margin-left: 10rpx;" @click="dianjibiaoqian()">
  41. <view style="width: 126rpx;height: 38rpx;line-height: 38rpx;font-size: 24rpx;color: #FFFFFF;
  42. text-align: center; overflow: hidden;">{{biaoqian}}</view>
  43. <view v-if="biaoqian.length>4" style="width: 37rpx;height: 37rpx;line-height: 37rpx;">
  44. <u-icon name="chat-fill" color="#ffffff" size="32rpx"></u-icon>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="biaoqianya" v-if="startTime==item.bg">
  49. <view class="biaoqianyaisshow" v-if="biaoqianyaisshow">
  50. {{biaoqian}}
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. <!-- 点赞 -->
  56. <view class="likeArea" :class="{'liked':isLiked}">
  57. <image
  58. :src="isLiked?'/static/images/recordingManagement/likeActive.png':'/static/images/recordingManagement/like_gray.png'"
  59. mode=""></image>
  60. </view>
  61. <view class="hash" id="hash">
  62. </view>
  63. </view>
  64. </scroll-view>
  65. <!-- 评语列表 -->
  66. <u-popup v-model="watchAllCommit" mode="bottom">
  67. <scroll-view scroll-y style="height: 70vh;">
  68. <view class="boxs">
  69. <!-- 评语列表 -->
  70. <view class="chat">
  71. <view class="total">
  72. 全部评论(共{{commentList.length}}条)
  73. </view>
  74. <view class="list">
  75. <view class="message" v-for="(item,index) in commentList" :key="index">
  76. <u-avatar class="avator" size="72"
  77. :src="item.commentPic ||'https://qufang.oss-cn-beijing.aliyuncs.com/upload/icon/xcx/jjycrm/my/headPicture.png'">
  78. </u-avatar>
  79. <view class="right">
  80. <view class="name">
  81. {{item.commentName||"未知昵称"}}
  82. </view>
  83. <view class="subtitle" v-if="item.commentAutoGraph">
  84. {{item.commentAutoGraph}}
  85. </view>
  86. <view class="answer" v-if="item.replyName">
  87. 回复@{{item.replyName}}
  88. </view>
  89. <view class="content" v-if="item.content">
  90. {{item.content}}
  91. </view>
  92. <view class="pic" v-if="item.picUrl">
  93. <image style="width: 100%;max-width: 240px;" :src="item.picUrl" mode="widthFix">
  94. </image>
  95. </view>
  96. <view class="bottom">
  97. <view class="time">
  98. {{item.createTime}}
  99. </view>
  100. <view class="button" v-if="myId != item.commentUser"
  101. @click.stop="answer(item.commentUser,item.id)">
  102. 回复
  103. </view>
  104. </view>
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. <!-- 写评价 -->
  110. <view class="bottomArea">
  111. <image class="voice" @click.stop="changeVoiceShow"
  112. src="/static/images/recordingManagement/voice.png" mode=""></image>
  113. <view class="inputArea">
  114. <textarea :value="content" :focus="textareaFocus" type="text" @input="changeContent"
  115. :auto-height="true" class="editor" :class="{'active':editing}"
  116. @click.stop="changeEditing(true)" @confirm="sendComment">
  117. </textarea>
  118. <view class="placeholder" :class="{'editing':editing}" v-if="!content && !editing">写评价
  119. </view>
  120. <image class="edit" v-if="!editing && content == ''"
  121. src="/static/images/recordingManagement/edit.png" mode=""></image>
  122. </view>
  123. <image class="like" v-if="myId != createUser && !editing" @click="changeLike"
  124. src="/static/images/recordingManagement/like.png" mode=""></image>
  125. <image class="add" @click.stop="uploadImage" v-if="!editing && content == ''"
  126. src="/static/images/recordingManagement/add.png" mode=""></image>
  127. <view class="send" @click="sendComment" v-if="content!=''">
  128. 发送
  129. </view>
  130. </view>
  131. </view>
  132. </scroll-view>
  133. </u-popup>
  134. <!-- 语音输入 -->
  135. <cover-view class="voiceContent" v-if="voiceShow" @click="changeVoiceShow">
  136. <cover-view class="box" @click.stop="" @touchstart="voiceStart" @touchend="voiceEnd">
  137. <cover-view class="center">
  138. <cover-image class="voice" src="/static/images/voice.png" mode="widthFix"></cover-image>
  139. <cover-view class="text">
  140. {{isRecording?'正在输入':'长按语音输入'}}
  141. </cover-view>
  142. </cover-view>
  143. </cover-view>
  144. </cover-view>
  145. </view>
  146. </template>
  147. <script>
  148. var app = getApp();
  149. var util = require("../../../utils/util.js");
  150. var config = require("../../../config");
  151. var plugin = requirePlugin("WechatSI")
  152. let manager = plugin.getRecordRecognitionManager();
  153. import zaudio from '@/components/uniapp-zaudio/zaudio';
  154. export default {
  155. components: {
  156. zaudio
  157. },
  158. data() {
  159. return {
  160. dialogList: [], // 录音对话转移列表
  161. isshowFile: false, // 录音文件默认隐藏
  162. luyinList: [], //录音文件列表
  163. fileIndex: 0, //文件索引
  164. fileId: '', //选中的录音ID
  165. id: "",
  166. audioStop: false,
  167. customerId: '',
  168. date: "",
  169. time: "",
  170. message: "", //聊天记录表
  171. durationTimeStr: "",
  172. autoLoad: true,
  173. playNow: 0,
  174. scrollTop: 0,
  175. scrollId: "",
  176. editing: false,
  177. isLiked: null,
  178. createUser: null,
  179. commentList: [], //评论列表
  180. content: "",
  181. voiceShow: false,
  182. isRecording: false,
  183. answerUserId: null,
  184. answerId: null,
  185. textareaFocus: false,
  186. myId: uni.getStorageSync("weapp_session_userInfo_data").accountId,
  187. startTime: "",
  188. alltimeStr: "00:00",
  189. end: false,
  190. recordPath: "",
  191. csdFileindex: 0,
  192. biaoqian: "",
  193. biaoqianyaisshow: false,
  194. startFile: '',
  195. num: 0, //上拉 转写文件下标
  196. timer: null,
  197. Bnum: 0, //下拉 转写文件下标
  198. watchAllCommit: false, // 查看全部评论
  199. ACTION: Symbol('zaudio'), // 唯一值区分每个页面的方法
  200. isPageHide: false, // 是否息屏
  201. duration: '', // 播放时长
  202. };
  203. },
  204. onLoad(options) {
  205. this.startTime = options.startTime
  206. this.customerId = options.customerId,
  207. this.biaoqian = options.biaoqian;
  208. this.startFile = options.startFile;
  209. this.getdianzan()
  210. this.getCommentList();
  211. this.getView()
  212. let that = this
  213. this.timer = setTimeout(function() {
  214. that.addHot()
  215. }, 30000)
  216. //注意: 不同的回调方法, 相同的业务函数方法名, 不会相互影响;
  217. this.$zaudio.on('stop', this.ACTION, () => {
  218. console.log('我是强制暂停或关闭小程序音频浮窗触发的')
  219. })
  220. this.$zaudio.on('seek', this.ACTION, (time) => {
  221. this.sliderChangeComplate(this.TIMEEVENT(time))
  222. })
  223. this.$zaudio.on('playing', this.ACTION, (obj) => {
  224. this.duration = obj.duration
  225. this.TimeUpdate(this.TIMEEVENT(obj.current))
  226. })
  227. this.$zaudio.on('ended', this.ACTION, e => {
  228. // this.qeihuanwenjian()
  229. this.$zaudio.operate();
  230. })
  231. },
  232. onShow() {
  233. this.initRecord();
  234. !this.isPageHide && this.getluyinList();
  235. },
  236. onHide() {
  237. this.isPageHide = true
  238. },
  239. onUnload() {
  240. //卸载不需要的业务和获取播放状态的业务,提高页面性能
  241. this.$zaudio.off('seek', this.ACTION);
  242. this.$zaudio.off('stop', this.ACTION);
  243. this.$zaudio.off('playing', this.ACTION);
  244. this.$zaudio.off('ended', this.ACTION);
  245. },
  246. methods: {
  247. addHot() {
  248. // console.log('30')
  249. this.$u.post('/zkstudyrecord', {
  250. targetId: this.customerId
  251. })
  252. .then(res => {
  253. // console.log(res)
  254. })
  255. },
  256. getView() {
  257. this.$u.get('/addtodigest/addPageviews', {
  258. id: this.customerId
  259. })
  260. .then(res => {
  261. // console.log(res)
  262. })
  263. // uni.request({
  264. // url: config.service.getView,
  265. // method: "POST",
  266. // data: {id:this.customerId},
  267. // header: {
  268. // 'content-type': 'application/json',
  269. // 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
  270. // },
  271. // success: (data) => {
  272. // console.log(data)
  273. // }
  274. // })
  275. },
  276. TimeUpdate(currentTime) {
  277. this.playNow = Number(currentTime)
  278. if (this.dialogList.length == 0) {
  279. return
  280. } else {
  281. const message = this.dialogList[0].message;
  282. if (!message) return
  283. for (let i = 0; i < message.length; i++) {
  284. if ((Math.floor(message[i].bg / 1000) <= this.playNow && this.playNow < Math.floor(message[i].ed /
  285. 1000))) {
  286. this.scrollId = "dialog" + this.csdFileindex + "text" + message[i].bg;
  287. break;
  288. }
  289. if (i < message.length - 1 && Math.floor(message[i].ed / 1000) < this.playNow && this.playNow <
  290. Math.floor(message[i + 1].bg / 1000)) {
  291. this.scrollId = "dialog" + this.csdFileindex + "text" + message[i].bg;
  292. break;
  293. }
  294. }
  295. }
  296. this.$forceUpdate()
  297. },
  298. //下一页
  299. ltolower() {
  300. var lengthcz = this.luyinList.length - 1;
  301. if (this.num >= lengthcz) {
  302. uni.showToast({
  303. title: '到底了',
  304. duration: 2000
  305. });
  306. return
  307. } else {
  308. this.num = this.num + 1;
  309. uni.showLoading({
  310. title: '加载中'
  311. });
  312. setTimeout(function() {
  313. uni.hideLoading();
  314. }, 2000);
  315. uni.request({
  316. url: config.service.getCorpusAnalysis + '?corpusId=' + this.luyinList[this.num].id +
  317. "&customerId=" + this.customerId, //仅为示例,并非真实接口地址。
  318. method: "GET",
  319. header: {
  320. 'content-type': 'application/json',
  321. 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
  322. },
  323. success: (data) => {
  324. if (data.data.code == 10000) {
  325. if (data.data.data.audioContent.length == 0) {
  326. setTimeout(function() {
  327. uni.hideLoading();
  328. }, 2000);
  329. } else {
  330. const jsonInfo = JSON.parse(data.data.data.audioContent);
  331. this.dialogList.push({
  332. message: jsonInfo
  333. });
  334. this.dialogList.forEach((asd, idx) => {
  335. asd.message.forEach((qwe, inde) => {
  336. qwe.isshow = false;
  337. })
  338. })
  339. }
  340. }
  341. },
  342. })
  343. }
  344. },
  345. //点击标签
  346. dianjibiaoqian() {
  347. if (this.biaoqian.length > 4) {
  348. this.biaoqianyaisshow = !this.biaoqianyaisshow;
  349. }
  350. },
  351. //获取点赞列表isLiked likegetLike
  352. getdianzan() {
  353. uni.request({
  354. url: config.service.likegetLike + '?targetId=' + this.customerId, //仅为示例,并非真实接口地址。
  355. method: "GET",
  356. header: {
  357. 'content-type': 'application/json',
  358. 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
  359. },
  360. success: (data) => {
  361. if (data.data.code == 10000) {
  362. this.isLiked = data.data.data.like;
  363. } else {
  364. uni.hideLoading();
  365. uni.showModal({
  366. title: '提示',
  367. content: '请求数据失败,请重新尝试',
  368. showCancel: false
  369. });
  370. }
  371. },
  372. fail(error) {
  373. uni.hideLoading();
  374. uni.showModal({
  375. title: '提示',
  376. content: '网络异常,请重新尝试',
  377. showCancel: false
  378. });
  379. return false;
  380. }
  381. });
  382. },
  383. // 获取评论列表
  384. getCommentList() {
  385. const that = this;
  386. util.getRequestPromise(config.service.cmmentList + '?targetId=' + this.customerId, {}, false, "GET").then(
  387. data => {
  388. let tmp = data;
  389. tmp.reverse();
  390. that.commentList = tmp;
  391. });
  392. },
  393. // 获取录音记录列表
  394. getluyinList() {
  395. const parames = {
  396. pageNum: 1,
  397. pageSize: 100,
  398. query: {
  399. whetherFinish: 1,
  400. customerId: this.customerId,
  401. id: this.startFile
  402. }
  403. }
  404. this.$u.post("/corpus/fendianFindByPage", parames).then(res => {
  405. try {
  406. let alltime = 1;
  407. res.forEach(item => {
  408. alltime = item.recordDuration
  409. })
  410. this.alltimeStr = this.getTime(alltime)
  411. res.forEach((cet, index) => {
  412. if (cet.id == this.startFile) {
  413. this.csdFileindex = index;
  414. this.recordPath = res[index].recordPath
  415. this.date = res[index].receptionTime
  416. this.num = index; //下拉起始位置
  417. this.Bnum = index;
  418. this.luyinList = res;
  419. this.zyAudio();
  420. this.getCorpusAnalysis()
  421. var itc = parseInt(this.startTime / 1000)
  422. this.adasdasdasd(itc)
  423. } else {
  424. console.log("my")
  425. }
  426. })
  427. } catch (e) {
  428. console.log(e)
  429. }
  430. })
  431. },
  432. //首次跳转
  433. adasdasdasd(e) {
  434. this.stepPlay(e)
  435. },
  436. //录音文件切换隐藏
  437. showFile() {
  438. this.isshowFile = !this.isshowFile
  439. },
  440. changeVoiceShow() {
  441. this.voiceShow = !this.voiceShow;
  442. },
  443. voiceStart: function() {
  444. manager.start({
  445. lang: "zh_CN"
  446. });
  447. },
  448. voiceEnd: function() {
  449. // uni.showToast();
  450. if (this.isRecording) {
  451. uni.showLoading({
  452. title: "识别中"
  453. })
  454. }
  455. this.voiceShow = false;
  456. this.isRecording = false;
  457. manager.stop();
  458. },
  459. // 语音初始化
  460. initRecord() {
  461. const that = this;
  462. manager.onStart = function(res) {
  463. that.isRecording = true;
  464. // this.voiceState = "onStart:" + res.msg + "正在录音"
  465. };
  466. //有新的识别内容返回,则会调用此事件
  467. manager.onRecognize = (res) => {
  468. console.log('ing' + res.result);
  469. }
  470. // 识别结束事件
  471. manager.onStop = (res) => {
  472. uni.hideLoading();
  473. let newText = that.content + res.result;
  474. if (newText.length > 140) {
  475. newText = newText.substring(0, 140)
  476. }
  477. that.content = newText;
  478. that.textareaFocus = true;
  479. }
  480. // 识别错误事件
  481. manager.onError = (res) => {
  482. uni.hideLoading();
  483. }
  484. },
  485. //音频前进回退
  486. sliderChangeComplate(currentTime) {},
  487. // 获取转义后的对话结果
  488. getCorpusAnalysis() {
  489. this.dialogList = [];
  490. uni.showLoading({
  491. title: '加载中'
  492. });
  493. uni.request({
  494. url: config.service.getCorpusAnalysis + '?corpusId=' + this.luyinList[this.csdFileindex].id +
  495. "&customerId=" + this.customerId, //仅为示例,并非真实接口地址。
  496. method: "GET",
  497. header: {
  498. 'content-type': 'application/json',
  499. 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
  500. },
  501. success: (data) => {
  502. if (data.data.code == 10000) {
  503. const jsonInfo = JSON.parse(data.data.data.audioContent);
  504. this.dialogList.push({
  505. message: jsonInfo
  506. });
  507. setTimeout(function() {
  508. uni.hideLoading();
  509. }, 2000);
  510. } else {
  511. uni.hideLoading();
  512. uni.showModal({
  513. title: '提示',
  514. content: '请求数据失败,请重新尝试',
  515. showCancel: false
  516. });
  517. }
  518. },
  519. fail(error) {
  520. uni.hideLoading();
  521. uni.showModal({
  522. title: '提示',
  523. content: '网络异常,请重新尝试',
  524. showCancel: false
  525. });
  526. return false;
  527. }
  528. });
  529. },
  530. getTime(time) {
  531. return util.formatSecond(time)
  532. },
  533. // 文件切换播放
  534. filechange(item, i) {
  535. this.num = i; //下拉起始位置
  536. this.Bnum = i;
  537. this.csdFileindex = i;
  538. this.recordPath = item.recordPath;
  539. this.date = item.receptionTime;
  540. this.isshowFile = false;
  541. setTimeout(() => {
  542. this.$zaudio.operate(i)
  543. }, 50)
  544. this.getCorpusAnalysis()
  545. },
  546. // 自动播放下一个文件
  547. qeihuanwenjian() {
  548. let index = this.csdFileindex + 1;
  549. if (index < this.luyinList.length) {
  550. this.csdFileindex = index;
  551. this.getCorpusAnalysis()
  552. let item = this.luyinList[this.csdFileindex];
  553. let i = this.csdFileindex;
  554. this.filechange(item, i)
  555. }
  556. },
  557. formatTime(num) {
  558. //格式化时间格式
  559. num = num.toFixed(0);
  560. let second = num % 60;
  561. if (second < 10) second = '0' + second;
  562. let min = Math.floor(num / 60);
  563. if (min < 10) min = '0' + min;
  564. return min + ":" + second;
  565. },
  566. changeContent(e) {
  567. this.content = e.detail.value;
  568. },
  569. answer(userId, tid) {
  570. this.answerId = tid;
  571. this.answerUserId = userId;
  572. this.editing = true;
  573. this.textareaFocus = true;
  574. },
  575. // 保存评论
  576. sendComment() {
  577. if (this.content == "") {
  578. uni.showToast({
  579. icon: "none",
  580. title: "请输入标题"
  581. })
  582. return;
  583. }
  584. let parames = {
  585. targetId: this.customerId,
  586. content: this.content,
  587. commentType: 1
  588. };
  589. if (this.answerUserId) {
  590. parames.replyCommentId = this.answerId;
  591. parames.replyUser = this.answerUserId;
  592. }
  593. const that = this;
  594. util.getRequestPromise(config.service.saveCmment, parames, false).then(data => {
  595. that.getCommentList();
  596. uni.showToast({
  597. title: "评论成功",
  598. icon: "none"
  599. })
  600. that.textareaFocus = false;
  601. that.content = "";
  602. });
  603. },
  604. uploadImage() {
  605. const that = this;
  606. var parames = {
  607. targetId: that.id,
  608. commentType: 1
  609. };
  610. if (this.answerUserId) {
  611. parames.replyCommentId = this.answerId;
  612. parames.replyUser = this.answerUserId;
  613. }
  614. uni.chooseImage({
  615. count: 1, //默认9
  616. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  617. sourceType: ['album', 'camera'],
  618. success: function(res) {
  619. uni.showLoading({
  620. title: "上传中"
  621. })
  622. uni.uploadFile({
  623. url: config.service.saveCmmentUpload,
  624. filePath: res.tempFilePaths[0],
  625. name: 'file',
  626. header: {
  627. 'Authorization': 'Bearer ' + uni.getStorageSync(
  628. 'weapp_session_login_data').token
  629. },
  630. formData: parames,
  631. success: (uploadFileRes) => {
  632. that.getCommentList();
  633. uni.hideLoading();
  634. uni.showToast({
  635. icon: "none",
  636. title: "上传成功"
  637. })
  638. console.log(uploadFileRes.data);
  639. }
  640. });
  641. }
  642. });
  643. },
  644. uploadAudio() {
  645. },
  646. changeLike() {
  647. uni.showLoading({
  648. title: "请求中",
  649. mask: true
  650. })
  651. if (this.isLiked) {
  652. this.cancelLike();
  653. } else {
  654. this.saveLike();
  655. }
  656. },
  657. // 点赞
  658. saveLike() {
  659. const that = this;
  660. util.getRequestPromise(config.service.saveLike, {
  661. targetId: this.customerId
  662. }, false).then(data => {
  663. that.isLiked = true;
  664. uni.hideLoading();
  665. uni.showToast({
  666. icon: "none",
  667. title: "点赞成功"
  668. })
  669. });
  670. },
  671. // 取消点赞
  672. cancelLike() {
  673. const that = this;
  674. util.getRequestPromise(config.service.cancelLike, {
  675. targetId: this.customerId
  676. }, false).then(data => {
  677. that.isLiked = false;
  678. uni.hideLoading();
  679. uni.showToast({
  680. icon: "none",
  681. title: "取消点赞成功"
  682. })
  683. });
  684. },
  685. gotoChat() {
  686. this.watchAllCommit = true
  687. console.log('dsakldjklasjdklas')
  688. },
  689. gotoTop() {
  690. this.scrollId = null;
  691. this.$nextTick(() => {
  692. this.scrollId = "top";
  693. })
  694. },
  695. changeEditing(type) {
  696. this.editing = type;
  697. this.answerId = null;
  698. this.answerUserId = null;
  699. this.textareaFocus = false;
  700. this.dialogList.forEach(res => {
  701. res.message.forEach(asd => {
  702. asd.isshow = false;
  703. })
  704. })
  705. },
  706. //录音实例
  707. zyAudio() {
  708. let data = this.luyinList.map((item, index) => {
  709. return {
  710. src: item.recordPath,
  711. title: `录音文件${index + 1}`,
  712. singer: '',
  713. coverImgUrl: ''
  714. }
  715. })
  716. this.$zaudio.setAudio(data)
  717. //渲染第一首音频
  718. this.$zaudio.setRender(0)
  719. },
  720. // 跳转指定位置播放
  721. stepPlay(t) {
  722. this.$zaudio.seek(t)
  723. if (this.$zaudio.paused) {
  724. this.$zaudio.operate()
  725. }
  726. },
  727. }
  728. };
  729. </script>
  730. <style lang="scss" scoped>
  731. .audio-container {
  732. width: 100%;
  733. display: flex;
  734. justify-content: space-between;
  735. align-items: center;
  736. .audio-head {
  737. width: 60rpx;
  738. height: 60rpx;
  739. flex-shrink: 0;
  740. }
  741. .audio-head .image {
  742. width: 100%;
  743. height: 100%;
  744. }
  745. .audio-slider {
  746. width: 96%;
  747. position: relative;
  748. padding: 2px 0rpx 0px 20px;
  749. display: flex;
  750. justify-content: space-between;
  751. align-items: center;
  752. }
  753. .audio-slider .slider {
  754. width: 100%;
  755. padding: 0px 15rpx;
  756. box-sizing: border-box;
  757. }
  758. .audio-time {
  759. width: 110rpx;
  760. text-align: right;
  761. font-size: 24rpx;
  762. line-height: 28rpx;
  763. color: #70798D;
  764. display: flex;
  765. justify-content: space-between;
  766. }
  767. .audio-play {
  768. width: 40rpx;
  769. height: 40rpx;
  770. flex-shrink: 0;
  771. }
  772. .audio-play .image {
  773. width: 100%;
  774. height: 100%;
  775. }
  776. }
  777. .biaoqiantom {
  778. background-color: #008EF2;
  779. color: #FFFFFF;
  780. border: none;
  781. }
  782. // 表单
  783. .tian-view {
  784. width: 570upx;
  785. background-color: #FFFFFF;
  786. border-bottom: 1px solid #ededee;
  787. display: flex;
  788. min-height: 96rpx;
  789. .tian-view-t1 {
  790. width: 20rpx;
  791. font-size: 34rpx;
  792. height: 34rpx;
  793. line-height: 110rpx;
  794. letter-spacing: 0px;
  795. color: red;
  796. }
  797. .tian-view-t2 {
  798. width: 30%;
  799. min-height: 96rpx;
  800. line-height: 96rpx;
  801. font-size: 34rpx;
  802. color: #333;
  803. }
  804. .tian-view-t3 {
  805. width: 61%;
  806. padding-top: 31rpx;
  807. padding-bottom: 31rpx;
  808. display: flex;
  809. .tian-input {
  810. width: 98%;
  811. font-size: 34rpx;
  812. border: none;
  813. }
  814. }
  815. }
  816. .zhezhoa {
  817. position: fixed;
  818. top: 0;
  819. left: 0;
  820. z-index: 999;
  821. width: 100%;
  822. height: 100vh;
  823. opacity: 0.5;
  824. background-color: #666666;
  825. }
  826. .bounced {
  827. width: 570upx;
  828. background: #FFFFFF;
  829. z-index: 1000;
  830. border-radius: 10upx;
  831. position: fixed;
  832. left: 50%;
  833. top: 50%;
  834. transform: translate(-50%, -50%);
  835. /* 50%为自身尺寸的一半 */
  836. .jiajinghuatit {
  837. width: 100%;
  838. height: 68rpx;
  839. font-size: 30rpx;
  840. text-align: center;
  841. line-height: 68rpx;
  842. }
  843. .jiajinghuaview {
  844. padding: 18rpx 18rpx 18rpx 18rpx;
  845. display: flex;
  846. flex-wrap: wrap;
  847. .jiajinghuaview1 {
  848. padding: 8rpx 8rpx 8rpx 8rpx;
  849. font-size: 26rpx;
  850. border-radius: 12rpx;
  851. border: 1px solid #979797;
  852. margin-left: 8rpx;
  853. }
  854. .jighuaview2 {
  855. padding: 8rpx 8rpx 8rpx 8rpx;
  856. font-size: 26rpx;
  857. border-radius: 12rpx;
  858. border: 1px solid #979797;
  859. margin-left: 8rpx;
  860. display: flex;
  861. .view1-text {
  862. text-align: center;
  863. // border-right: 1rpx solid red;
  864. }
  865. .view1-img {
  866. width: 50rpx;
  867. }
  868. }
  869. }
  870. .bounced3 {
  871. height: 100upx;
  872. width: 100%;
  873. margin-top: 40upx;
  874. border-top: 1px solid #dddddd;
  875. display: flex;
  876. }
  877. .bounced3-1 {
  878. width: 50%;
  879. height: 100%;
  880. text-align: center;
  881. line-height: 100upx;
  882. border-right: 1px solid #dddddd;
  883. font-size: 36upx;
  884. color: #999999;
  885. }
  886. .bounced3-2 {
  887. width: 50%;
  888. height: 100%;
  889. text-align: center;
  890. line-height: 100upx;
  891. font-size: 36upx;
  892. color: #108ee9;
  893. }
  894. }
  895. .bosdttom {
  896. color: #008EF2;
  897. }
  898. .tab-box {
  899. width: 100%;
  900. display: flex;
  901. justify-content: center;
  902. align-items: center;
  903. .yinpinshibie {
  904. width: 156rpx;
  905. height: 50rpx;
  906. font-size: 36rpx;
  907. font-weight: 400;
  908. color: #333333;
  909. text-align: center;
  910. line-height: 50rpx;
  911. letter-spacing: 2rpx;
  912. margin-right: 188rpx;
  913. &.active {
  914. position: relative;
  915. &::after {
  916. position: absolute;
  917. content: '';
  918. width: 119rpx;
  919. height: 8rpx;
  920. background: #008EF2;
  921. border-radius: 4rpx;
  922. top: 50rpx;
  923. right: 0;
  924. left: 0;
  925. margin: 0 auto;
  926. }
  927. }
  928. }
  929. .rate {
  930. width: 156rpx;
  931. height: 50rpx;
  932. font-size: 36rpx;
  933. font-weight: 400;
  934. color: #333333;
  935. line-height: 50rpx;
  936. letter-spacing: 2rpx;
  937. text-align: center;
  938. &.active {
  939. position: relative;
  940. &::after {
  941. position: absolute;
  942. content: '';
  943. width: 119rpx;
  944. height: 8rpx;
  945. background: #008EF2;
  946. border-radius: 4rpx;
  947. top: 50rpx;
  948. right: 0;
  949. left: 0;
  950. margin: 0 auto;
  951. }
  952. }
  953. }
  954. }
  955. .dialog-block {
  956. margin: 20rpx 0;
  957. border-bottom: 1px solid #ccc;
  958. .fileName {
  959. text-align: center;
  960. margin: 10rpx auto;
  961. width: 115rpx;
  962. height: 42rpx;
  963. line-height: 42rpx;
  964. background: #EFEFEF;
  965. border-radius: 4rpx;
  966. font-size: 20rpx;
  967. font-weight: 400;
  968. color: #333333;
  969. }
  970. }
  971. // 评分
  972. .rate-box {
  973. padding: 10rpx 20rpx;
  974. .date {
  975. width: 300rpx;
  976. height: 33rpx;
  977. font-size: 24rpx;
  978. font-weight: 400;
  979. color: #333333;
  980. line-height: 33rpx;
  981. letter-spacing: 1rpx;
  982. margin-bottom: 8rpx;
  983. }
  984. .title {
  985. width: 100%;
  986. height: 42rpx;
  987. font-size: 30rpx;
  988. font-weight: 500;
  989. color: #333333;
  990. line-height: 42rpx;
  991. letter-spacing: 2rpx;
  992. margin-bottom: 20rpx;
  993. }
  994. .level1 {
  995. display: flex;
  996. align-items: center;
  997. .level-name {
  998. width: 104rpx;
  999. height: 33rpx;
  1000. font-size: 24rpx;
  1001. font-weight: 500;
  1002. color: #333333;
  1003. line-height: 33rpx;
  1004. letter-spacing: 1rpx;
  1005. margin-right: 10rpx;
  1006. }
  1007. .level-progress {
  1008. flex: 1;
  1009. border-radius: 11rpx;
  1010. height: 21rpx;
  1011. background-color: #BEE4FF;
  1012. position: relative;
  1013. .color {
  1014. width: 0;
  1015. position: absolute;
  1016. top: 0;
  1017. left: 0;
  1018. height: 21rpx;
  1019. border-radius: 11rpx 0 0 11rpx;
  1020. background-color: #008EF2;
  1021. }
  1022. }
  1023. .level-rate {
  1024. width: 65rpx;
  1025. height: 33rpx;
  1026. font-size: 24rpx;
  1027. font-weight: 500;
  1028. color: #333333;
  1029. line-height: 33rpx;
  1030. letter-spacing: 1rpx;
  1031. margin: 0 20rpx 0 15rpx;
  1032. }
  1033. .arrow {
  1034. width: 37rpx;
  1035. height: 21rpx;
  1036. padding: 5rpx 20rpx;
  1037. }
  1038. .rotatearrow {
  1039. transform: rotate(270deg);
  1040. }
  1041. }
  1042. .level1-subbox {
  1043. display: flex;
  1044. margin-top: 20rpx;
  1045. flex-wrap: wrap;
  1046. .sub-name {
  1047. width: 50%;
  1048. display: flex;
  1049. margin-bottom: 18rpx;
  1050. .subitem-name {
  1051. width: 104rpx;
  1052. height: 33rpx;
  1053. font-size: 24rpx;
  1054. font-weight: 400;
  1055. color: #999999;
  1056. line-height: 33rpx;
  1057. letter-spacing: 1rpx;
  1058. margin-right: 12rpx;
  1059. }
  1060. .checkimg {
  1061. width: 27rpx;
  1062. height: 27rpx;
  1063. }
  1064. }
  1065. }
  1066. }
  1067. .luyin {
  1068. height: 100rpx;
  1069. width: 100%;
  1070. }
  1071. .translation {
  1072. padding-left: 30rpx;
  1073. padding-right: 30rpx;
  1074. background: #FFFFFF;
  1075. display: flex;
  1076. flex-direction: column;
  1077. height: 100vh;
  1078. }
  1079. .translation .top {
  1080. margin: 0 -30upx;
  1081. padding: 0 30upx;
  1082. background: #ffffff;
  1083. border-bottom: 1rpx solid #F2F2F2;
  1084. padding-bottom: 10rpx;
  1085. }
  1086. .translation .top .title {
  1087. display: flex;
  1088. justify-content: space-between;
  1089. .hash {
  1090. color: rgba(21, 144, 233, 1);
  1091. font-size: 24upx;
  1092. }
  1093. }
  1094. .call_record_time {
  1095. height: 44rpx;
  1096. font-size: 28rpx;
  1097. font-weight: 600;
  1098. color: #008EF2;
  1099. line-height: 44rpx;
  1100. }
  1101. .call_record_time_one {
  1102. height: 48rpx;
  1103. font-size: 24rpx;
  1104. font-weight: 500;
  1105. color: #70798d;
  1106. line-height: 48rpx;
  1107. display: flex;
  1108. justify-content: space-between;
  1109. position: relative;
  1110. .diangweitupian {
  1111. width: 46rpx;
  1112. height: 46rpx;
  1113. // border: 1px solid red;
  1114. position: absolute;
  1115. top: 0rpx;
  1116. right: 75rpx;
  1117. }
  1118. .file-change {
  1119. position: absolute;
  1120. top: 50rpx;
  1121. right: 0rpx;
  1122. width: 184rpx;
  1123. background: #FFFFFF;
  1124. box-shadow: 0rpx 0rpx 6rpx 2rpx rgba(230, 230, 230, 0.5);
  1125. border-radius: 4rpx;
  1126. z-index: 99;
  1127. height: auto;
  1128. max-height: 600rpx;
  1129. overflow: auto;
  1130. }
  1131. .file-item {
  1132. width: 184rpx;
  1133. height: 60rpx;
  1134. line-height: 60rpx;
  1135. text-align: center;
  1136. font-size: 30rpx;
  1137. font-weight: 400;
  1138. color: #333333;
  1139. border-bottom: 1rpx solid #E2E2E2;
  1140. }
  1141. .file-item:last-child {
  1142. border: 0
  1143. }
  1144. .fileactive {
  1145. color: #008EF2
  1146. }
  1147. }
  1148. .dingweishiy {
  1149. position: relative;
  1150. .tankuangcss {
  1151. position: absolute;
  1152. bottom: -50rpx;
  1153. left: 0rpx;
  1154. width: 100%;
  1155. // border: 1rpx solid red;
  1156. font-size: 24rpx;
  1157. color: #FFFFFF;
  1158. padding-top: 4rpx;
  1159. padding-bottom: 4rpx;
  1160. display: flex;
  1161. justify-content: center;
  1162. border-radius: 15rpx;
  1163. z-index: 1000;
  1164. }
  1165. .biaoqianya {
  1166. width: 631rpx;
  1167. margin: 0 auto;
  1168. position: absolute;
  1169. bottom: -120rpx;
  1170. left: 0rpx;
  1171. z-index: 2000;
  1172. color: #FFFFFF;
  1173. .biaoqianyaisshow {
  1174. background-image: url(../../../static/images/biaoqianya.png);
  1175. background-size: 100% 100%;
  1176. text-align: left;
  1177. text-indent: 20rpx;
  1178. }
  1179. }
  1180. }
  1181. .scroll-Y {
  1182. font-size: 36upx;
  1183. color: #999999;
  1184. background: #FFFFFF;
  1185. margin-top: 30upx;
  1186. flex: 1;
  1187. overflow-y: scroll;
  1188. width: 100%;
  1189. }
  1190. .scroll-Y .text {
  1191. margin: 80upx 30upx;
  1192. line-height: 80upx;
  1193. display: flex;
  1194. align-items: center;
  1195. }
  1196. .scroll-Y .text[data-speaker="2"],
  1197. .scroll-Y .text[data-speaker="4"],
  1198. .scroll-Y .text[data-speaker="6"] {
  1199. flex-direction: row-reverse;
  1200. text-align: right;
  1201. .content {
  1202. margin-left: 0;
  1203. margin-right: 30upx;
  1204. background: #F6F6F6;
  1205. color: #999999;
  1206. }
  1207. }
  1208. .scroll-Y .text .avatar {
  1209. width: 64upx;
  1210. height: 64upx;
  1211. line-height: 64upx;
  1212. text-align: center;
  1213. // border: 1rpx solid red;
  1214. font-size: 36rpx;
  1215. border-radius: 50%;
  1216. background: #F2F2F2;
  1217. color: #008EF2;
  1218. // display: flex;
  1219. // justify-content: center;
  1220. // align-items: center;
  1221. // image {
  1222. // width: 40upx;
  1223. // }
  1224. }
  1225. .scroll-Y .text .content {
  1226. margin-left: 30upx;
  1227. line-height: 60rpx;
  1228. text-align: left;
  1229. padding: 0 5px;
  1230. background: #2BC805;
  1231. border-radius: 8upx;
  1232. max-width: 442rpx;
  1233. color: #FFFFFF;
  1234. }
  1235. .scroll-Y .text.active .content {
  1236. color: #FF7538 !important;
  1237. position: relative;
  1238. }
  1239. .scroll-Y .text.active[data-speaker="2"] .content,
  1240. .scroll-Y .text.active[data-speaker="4"] .content,
  1241. .scroll-Y .text.active[data-speaker="6"] .content {
  1242. color: #FF7538 !important;
  1243. position: relative;
  1244. }
  1245. .likeArea {
  1246. width: 86upx;
  1247. height: 84upx;
  1248. margin: 20upx auto 38upx auto;
  1249. border-radius: 50%;
  1250. display: flex;
  1251. justify-content: center;
  1252. align-items: center;
  1253. border: 1upx solid #C1C2C1;
  1254. &.liked {
  1255. border: 1upx solid rgba(21, 144, 233, 1);
  1256. }
  1257. image {
  1258. width: 38upx;
  1259. height: 39upx;
  1260. }
  1261. }
  1262. .chat {
  1263. display: flex;
  1264. flex-direction: column;
  1265. border-top: 1upx solid rgba(151, 151, 151, 0.4);
  1266. padding: 20rpx 20rpx 0;
  1267. .total {
  1268. color: rgba(21, 144, 233, 1);
  1269. font-size: 24upx;
  1270. }
  1271. .list {
  1272. display: flex;
  1273. flex-direction: column;
  1274. .message {
  1275. display: flex;
  1276. margin-top: 20upx;
  1277. border-bottom: 1upx solid rgba(151, 151, 151, 0.4);
  1278. padding-bottom: 20upx;
  1279. &:last-child {
  1280. border-bottom: 0;
  1281. }
  1282. .avator {
  1283. margin-left: 120upx;
  1284. }
  1285. &:first-child {
  1286. .avator {
  1287. margin-left: 0;
  1288. }
  1289. }
  1290. .right {
  1291. display: flex;
  1292. flex-direction: column;
  1293. margin-left: 20upx;
  1294. flex: 1;
  1295. .name {
  1296. color: rgba(16, 16, 16, 1);
  1297. font-size: 30upx;
  1298. }
  1299. .subtitle {
  1300. color: rgba(120, 120, 120, 1);
  1301. font-size: 24upx;
  1302. margin-top: 16upx;
  1303. }
  1304. .answer {
  1305. font-size: 24upx;
  1306. color: #787878;
  1307. }
  1308. .content {
  1309. color: rgba(49, 48, 48, 1);
  1310. font-size: 30upx;
  1311. margin-top: 20upx;
  1312. position: relative;
  1313. }
  1314. .bottom {
  1315. margin-top: 16upx;
  1316. display: flex;
  1317. justify-content: space-between;
  1318. .time {
  1319. color: rgba(185, 185, 185, 1);
  1320. font-size: 20upx;
  1321. }
  1322. .button {
  1323. color: rgba(144, 144, 144, 1);
  1324. font-size: 30upx;
  1325. width: 111upx;
  1326. height: 44upx;
  1327. border-radius: 22upx;
  1328. border: 1upx solid rgba(151, 151, 151, 1);
  1329. text-align: center;
  1330. }
  1331. }
  1332. }
  1333. }
  1334. }
  1335. }
  1336. .bottomArea {
  1337. min-height: 90upx;
  1338. background: #F0F2F5;
  1339. width: 100%;
  1340. display: flex;
  1341. align-items: center;
  1342. border-top: 1upx solid rgba(151, 151, 151, 0.25);
  1343. .voice {
  1344. width: 44upx;
  1345. height: 44upx;
  1346. margin-left: 38upx;
  1347. }
  1348. .inputArea {
  1349. margin-left: 38upx;
  1350. margin-right: 38upx;
  1351. flex: 1;
  1352. display: flex;
  1353. position: relative;
  1354. .edit {
  1355. width: 30upx;
  1356. height: 28upx;
  1357. position: absolute;
  1358. top: 31upx;
  1359. left: 27upx;
  1360. }
  1361. .editor {
  1362. background: rgba(0, 139, 245, 0.17);
  1363. border-radius: 29upx;
  1364. flex: 1;
  1365. min-height: 58upx;
  1366. width: unset;
  1367. padding: 0 32upx;
  1368. font-size: 30upx;
  1369. margin: 16rpx 0;
  1370. line-height: 29px;
  1371. }
  1372. .placeholder {
  1373. position: absolute;
  1374. left: 70rpx;
  1375. top: 22rpx;
  1376. color: #26A2FF;
  1377. &.editing {
  1378. left: 36rpx;
  1379. }
  1380. }
  1381. }
  1382. .download {
  1383. width: 41upx;
  1384. height: 35upx;
  1385. margin-right: 36upx;
  1386. }
  1387. .like {
  1388. width: 38upx;
  1389. height: 39upx;
  1390. margin-right: 38upx;
  1391. }
  1392. .add {
  1393. width: 50upx;
  1394. height: 50upx;
  1395. margin-right: 38upx;
  1396. }
  1397. .send {
  1398. background: #1590e9;
  1399. color: white;
  1400. padding: 10rpx 20rpx;
  1401. margin: 5px;
  1402. border-radius: 8rpx;
  1403. }
  1404. }
  1405. .backTop {
  1406. width: 60upx;
  1407. height: 60upx;
  1408. background: rgba(211, 235, 253, 1);
  1409. box-shadow: 0upx 0upx 2upx 4upx rgba(38, 161, 255, 0.04);
  1410. border-radius: 50%;
  1411. position: fixed;
  1412. bottom: 200upx;
  1413. right: 8upx;
  1414. display: flex;
  1415. justify-content: center;
  1416. align-items: center;
  1417. image {
  1418. width: 26upx;
  1419. height: 34upx;
  1420. }
  1421. }
  1422. .voiceContent {
  1423. position: fixed;
  1424. top: 0;
  1425. bottom: 0;
  1426. left: 0;
  1427. right: 0;
  1428. width: 100vw;
  1429. height: 100vh;
  1430. display: flex;
  1431. justify-content: center;
  1432. align-items: center;
  1433. background: rgba(30, 30, 30, 0.4592);
  1434. z-index: 10001;
  1435. }
  1436. .box {
  1437. background: rgba(21, 144, 233, 0.299);
  1438. width: 524upx;
  1439. height: 524upx;
  1440. border-radius: 50%;
  1441. display: flex;
  1442. align-items: center;
  1443. justify-content: center;
  1444. .center {
  1445. width: 412upx;
  1446. height: 412upx;
  1447. background: #1590E9;
  1448. border-radius: 50%;
  1449. display: flex;
  1450. align-items: center;
  1451. justify-content: center;
  1452. flex-direction: column;
  1453. .voice {
  1454. width: 110upx;
  1455. height: 133upx;
  1456. }
  1457. .text {
  1458. color: #FFFFFF;
  1459. font-size: 36upx;
  1460. margin-top: 24upx;
  1461. }
  1462. }
  1463. }
  1464. .boxs {
  1465. min-height: 100%;
  1466. display: flex;
  1467. flex-direction: column;
  1468. .chat {
  1469. flex-grow: 1;
  1470. }
  1471. .bottomArea {
  1472. flex-shrink: 0;
  1473. position: sticky;
  1474. bottom: 0;
  1475. }
  1476. }
  1477. </style>