AI销管
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.
 
 
 
 

1539 line
36 KiB

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