You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

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