AI销管
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

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