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

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