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.
 
 
 

1426 lines
37 KiB

  1. <template>
  2. <view class="details">
  3. <!-- 头部违禁信息 -->
  4. <view class="header">
  5. <view class="h-box">
  6. <view class="h-b-top">
  7. <text class="name">{{ userlistobj.agentName || '' }}</text>
  8. <view class="status">
  9. <text class="pointer"></text>
  10. <text class="item">{{ userlistobj.violatedStatus | ViolatedStatus }}</text>
  11. </view>
  12. </view>
  13. <!-- 详细信息 -->
  14. <view class="h-b-btm">
  15. <view class="item">
  16. <image class="item-imgs" src="@/static/images/img/time.png" mode=""></image>
  17. {{ userlistobj.createTime || '' }}
  18. </view>
  19. <view class="item">
  20. <image class="item-imgs" src="@/static/images/img/voice.png" mode=""></image>
  21. {{ userlistobj.mm || '' }}m
  22. </view>
  23. <view class="item hit">
  24. <image class="item-imgs" src="@/static/images/img/hit.png" mode=""></image>
  25. {{ userlistobj.violatedFrequency || '0' }}
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. <!-- tab选择框 -->
  31. <u-tabs :list="list" :is-scroll="false" bg-color="transparent" :show-bar="false" :current="current"
  32. @change="change"></u-tabs>
  33. <template v-if="current == 0">
  34. <view class="words-list">
  35. <scroll-view :scroll-top="scrollTop" lower-threshold='100px' @scrolltolower="ltolower()"
  36. upper-threshold='40px' @scrolltoupper="rolltoupper()" :scroll-into-view="scrollId" scroll-y="true"
  37. class="zhuti text scroll-Y">
  38. <!-- 聊天记录-->
  39. <view class="dialog-block" style="border-bottom: none;">
  40. <block v-for="(item,index) in findTabooWordsList" :key="index">
  41. <view class="text">
  42. <view class="avatar">
  43. <view :style="[SPEAKERSTYLE(item.speaker)]">
  44. <image v-if="item.isShow == 0" :src="Aimg" mode="widthFix"></image>
  45. <text v-else>{{ item.speaker | toCapital }}</text>
  46. </view>
  47. </view>
  48. <view class="content">
  49. <view v-html="item.onebest"></view>
  50. </view>
  51. </view>
  52. </block>
  53. </view>
  54. </scroll-view>
  55. </view>
  56. </template>
  57. <template v-if="current == 1">
  58. <!-- 音频 -->
  59. <view class="audio">
  60. <!-- 标记顾问 -->
  61. <view class="headboxbott">
  62. <view class="headovfu">
  63. <u-tabs-swiper ref="tabs" font-size="30" :bold="true" swiper-width="600" :current="roleindex"
  64. @change="tapspagek()" inactive-color="#b1b1b1" active-color="#008ef2" :list="tablist"
  65. :is-scroll="true">
  66. </u-tabs-swiper>
  67. </view>
  68. <view v-if="permissions.bjgw" class="headpade">
  69. <view class="biaoji" @tap="tagtap()">标记</view>
  70. </view>
  71. </view>
  72. </view>
  73. <scroll-view :scroll-top="scrollTop" lower-threshold='100px' @scrolltolower="ltolower()"
  74. upper-threshold='40px' @scrolltoupper="rolltoupper()" :scroll-into-view="scrollId" scroll-y="true"
  75. class="zhuti text scroll-Y">
  76. <!-- 聊天记录-->
  77. <view class="dialog-block" v-for="(dialog,i) in dialogList" :key="i">
  78. <view :id="'dialog'+i" class="fileName">录音文件</view>
  79. <block v-for="(item,index) in dialog.message" :key="index">
  80. <view class="text" :id="'dialog'+csdFileindex+'text'+item.bg"
  81. :class="{active: item.bg < playNow && item.ed > playNow, reverse: Number(item.speaker) % 2 == 0}"
  82. :data-speaker="item.speaker">
  83. <view class="avatar">
  84. <view :style="[SPEAKERSTYLE(item.speaker)]">
  85. <image v-if="item.isShow == 0" :src="Aimg" mode="widthFix"></image>
  86. <text v-else>{{ item.speaker | toCapital }}</text>
  87. </view>
  88. </view>
  89. <view class="contentInfo">
  90. <view class="info">
  91. <text class="AudioUserName">{{ item.speaker | toCapital }}</text>
  92. <text>{{conversionTiame(item.bg/1000)}}</text>
  93. </view>
  94. <view class="contentMain">
  95. <view class="content">
  96. <view v-html="item.onebest"></view>
  97. </view>
  98. <image @click="clickbofang(dialog.backindex,item)" class="play"
  99. src="@/static/images/recordingManagement/play.png"></image>
  100. </view>
  101. </view>
  102. </view>
  103. </block>
  104. </view>
  105. </scroll-view>
  106. </template>
  107. <view class="bottombox">
  108. <!-- 播放块 -->
  109. <template v-if="current == 1">
  110. <view class="bottomhead">
  111. <view class="audio-play" @tap="changePlayState">
  112. <image class="image" mode="widthFix"
  113. :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'">
  114. </image>
  115. </view>
  116. <view class="audio-slider">
  117. <view class="audio-time">
  118. <text>{{currentTimeStr}}</text>
  119. </view>
  120. <slider class="slider" min="0" :max="sliderMax" @change="sliderChangeComplate" block-size="14"
  121. :value="sliderValue" activeColor="blue"></slider>
  122. <view class="audio-time">
  123. <text>{{timeStr}}</text>
  124. </view>
  125. </view>
  126. </view>
  127. </template>
  128. <!-- 占位 -->
  129. <template v-else>
  130. <view class="bottomhead" style="border-top: none;"></view>
  131. </template>
  132. <template v-if="userlistobj.invalidViolatedCause">
  133. <view class="bottomtips">
  134. 无效原因:{{ userlistobj.invalidViolatedCause }}
  135. </view>
  136. </template>
  137. <view class="botbotmm">
  138. <view class="item" @click="preValid">上一条</view>
  139. <template v-if="userlistobj.violatedStatus == 0">
  140. <view class="item" @click="setViolated(1)">确认有效</view>
  141. <view class="item" @tap="showTagValid">确认无效</view>
  142. </template>
  143. <template v-if="userlistobj.violatedStatus == 1">
  144. <view class="item" @tap="showTagValid">无效</view>
  145. </template>
  146. <template v-if="userlistobj.violatedStatus == 2">
  147. <view class="item" @click="setViolated(1)">确认有效</view>
  148. </template>
  149. <view class="item" @click="nextValid">下一条</view>
  150. </view>
  151. </view>
  152. <!-- 标记顾问 -->
  153. <u-popup v-model="biojiisshow" mode="center">
  154. <view class="bounced">
  155. <view class="jiajinghuatit">标记为顾问</view>
  156. <view
  157. style="width: 95%;display: flex;flex-wrap: wrap;margin: 0 auto;padding-top: 30rpx;padding-bottom: 30rpx;">
  158. <view class="viewclace" :class="roleindexbiaoji == index ? 'bosdttom' : ''"
  159. @click="biaojixuanze(index)" v-for="(item,index) in tablist.slice(1,tablist.length)"
  160. :key="index">
  161. <view>{{item.name}}</view>
  162. </view>
  163. </view>
  164. <view class="bounced3" style="margin-top: 20rpx;">
  165. <view class="bounced3-1" @tap="unmarktap">取消</view>
  166. <view class="bounced3-2" @tap="Confirmthetag">确认</view>
  167. </view>
  168. </view>
  169. </u-popup>
  170. <!-- 标记无效原因 border-radius="16" -->
  171. <u-popup v-model="tagValidShow" mode="center">
  172. <view class="reason">
  173. <text class="resaon-title">无效原因</text>
  174. <view class="resaon-textbox">
  175. <textarea v-model="reasonSrc" placeholder="请输入无效原因" maxlength="60" />
  176. <text class="lastlength">{{ reasonSrc.length }}/60</text>
  177. </view>
  178. <view class="button">
  179. <text @click="inputDone">完成</text>
  180. </view>
  181. </view>
  182. </u-popup>
  183. </view>
  184. </template>
  185. <script>
  186. var util = require("@/utils/util.js");
  187. var config = require("@/config");
  188. export default {
  189. data() {
  190. return {
  191. 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",
  192. list: [{
  193. name: '违禁话术'
  194. }, {
  195. name: '音频识别'
  196. }],
  197. current: 0, // tab下表
  198. tablist: [], // 顾问标记列表
  199. roleindex: 0, // 选中顾问下标
  200. luyinList: [], // 录音文件
  201. newluyinList: [],
  202. dialogList: [], // 录音识别列表渲染数据
  203. permissions: {}, // 权限菜单
  204. biojiisshow: false, // 标记顾问弹窗
  205. textindex: 0, //下拉 转写文件下标
  206. toptextindex: 0, //上拉 转写文件下标
  207. dshfkjsdkksodofydwfkhwdfkjh: 0, // 顾问的id之类的
  208. status: 0, // 状态(不明白是什么状态)
  209. speaker: '', // 角色身份
  210. customerId: '', // 楼盘id吧(猜)
  211. infos: {}, // 音频内容
  212. stateisshow: '', //
  213. itemobj: {}, // 本地缓存的音频信息
  214. userlistobj: {}, // 获取到的顾问信息
  215. csdFileindex: 0, // 当前使用录音转写的下标
  216. // 录音信息
  217. innerAudioContext: null, // 音频对象
  218. currentTimeStr: "00:00", //当前进度的时间
  219. timeStr: "00:00", //总的时间
  220. recordPath: "", // 录音地址
  221. audioPlay: false, //当前的播放状态控制
  222. sliderValue: 0, //进度条最小值
  223. sliderMax: 0, //进度条最大值
  224. playNow: 0, // 当前播放时间
  225. scrollId: "", // 当前播放滚动到的位置
  226. tagValidShow: false, // 标记弹窗
  227. reasonSrc: '', // 标记无效的原因
  228. findTabooWordsList: [], // 违禁词列表
  229. nextPageObj: JSON.parse(uni.getStorageSync('nextPageObj')), // 当前页面筛选内容
  230. }
  231. },
  232. computed: {
  233. conversionTiame() {
  234. return (e) => {
  235. return this.getTime(e);
  236. }
  237. },
  238. },
  239. onLoad(option) {
  240. this.status = option.status;
  241. this.customerId = option.customerId;
  242. this.stateisshow = option.stateisshow;
  243. this.itemobj = uni.getStorageSync('searchobj');
  244. },
  245. onShow() {
  246. this.permissions = uni.getStorageSync('weapp_session_Menu_data') // 权限
  247. this.roleindex = 0;
  248. if (this.stateisshow == 2) {
  249. this.infos = this.itemobj;
  250. } else {
  251. var pages = getCurrentPages();
  252. var currPage = pages[pages.length - 1]; //当前页面
  253. this.infos = currPage.data.info;
  254. }
  255. this.initAudioFnc()
  256. this.gituserlist()
  257. this.findTabooWords()
  258. },
  259. onUnload() {
  260. //暂停
  261. this.innerAudioContext.pause()
  262. // 销毁
  263. this.innerAudioContext.destroy();
  264. },
  265. methods: {
  266. // 获取违禁词
  267. findTabooWords() {
  268. this.$u.get('/customer/findTabooWords', { customerId: this.customerId }).then(res => {
  269. let arr = []
  270. res.map(item => {
  271. if (item.transferContent) {
  272. item.transferContents = JSON.parse(item.transferContent)
  273. arr.push(item.transferContents)
  274. }
  275. })
  276. this.findTabooWordsList = arr
  277. console.log(this.findTabooWordsList, 'findTabooWordsList')
  278. })
  279. },
  280. // 确认无效标记 setViolatedStatus = 2
  281. inputDone() {
  282. if (!this.reasonSrc) {
  283. uni.showToast({
  284. title: '请输入标记无效的原因',
  285. icon: 'none',
  286. duration: 2000
  287. })
  288. return
  289. }
  290. this.setViolated(2)
  291. },
  292. // 下一条
  293. nextValid() {
  294. this.innerAudioContext.pause()
  295. this.nextPageObj.pageSize++
  296. this.keyWordsMatching(this.nextPageObj)
  297. },
  298. // 上一条
  299. preValid() {
  300. if (this.nextPageObj.pageSize == 0) {
  301. uni.showToast({
  302. title: '没有更早的了~'
  303. })
  304. } else {
  305. this.innerAudioContext.pause()
  306. this.nextPageObj.pageSize--
  307. this.keyWordsMatching(this.nextPageObj)
  308. }
  309. },
  310. // 获取违禁话术详情
  311. keyWordsMatching(params) {
  312. this.$u.post('/customer/findbynum', params).then(res => {
  313. this.customerId = res.results[0].id;
  314. uni.setStorageSync('nextPageObj', JSON.stringify(this.nextPageObj))
  315. this.prohibitedMatch()
  316. }).catch(e => {
  317. this.nextPageObj = JSON.parse(uni.getStorageSync('nextPageObj')), // 当前页面筛选内容
  318. uni.showToast({
  319. title: e.message,
  320. icon: 'none',
  321. duration: 2000
  322. })
  323. })
  324. },
  325. // 违禁词播放位置
  326. prohibitedMatch() {
  327. this.$u.post('/customer/prohibitedMatch', {
  328. customerId: this.customerId
  329. }).then(res => {
  330. let newweijin = res[0];
  331. newweijin.transferContent = JSON.parse(newweijin.transferContent)
  332. var item = {
  333. bg: newweijin.transferContent.bg,
  334. customerId: newweijin.corpusId,
  335. }
  336. // 获取是否有转写的音频
  337. this.$u.post("/corpus/findByPage", {
  338. pageNum: 1,
  339. pageSize: 100,
  340. query: {
  341. customerId: this.customerId,
  342. }
  343. }).then(res => {
  344. if (res == null) {
  345. uni.showToast({
  346. icon: "none",
  347. title: "暂无音频"
  348. })
  349. return
  350. } else {
  351. let newobj = res[0];
  352. if (res[0].merge == 0) {
  353. this.infos = item
  354. this.itemobj = item
  355. uni.setStorageSync("searchobj", item); //写入缓存
  356. this.roleindex = 0;
  357. this.innerAudioContext.destroy()
  358. this.initAudioFnc()
  359. this.gituserlist()
  360. this.findTabooWords()
  361. } else {
  362. uni.showToast({
  363. icon: "none",
  364. title: "暂无音频"
  365. })
  366. }
  367. }
  368. })
  369. })
  370. },
  371. // 设置违禁状态
  372. setViolated(status) {
  373. let params = {
  374. customerId: this.customerId,
  375. violatedStatus: status,
  376. invalidViolatedCause: this.reasonSrc,
  377. }
  378. this.$u.post('/customer/setViolatedStatus', params).then(res => {
  379. this.tagValidShow = false
  380. uni.showToast({
  381. title: '标记成功',
  382. duration: 2000
  383. });
  384. this.initAudioFnc()
  385. this.gituserlist()
  386. setTimeout(() => {
  387. this.reasonSrc = ''
  388. }, 2000)
  389. }).catch(e => {
  390. this.tagValidShow = false
  391. uni.showToast({
  392. title: e.message,
  393. duration: 2000
  394. });
  395. })
  396. },
  397. // 展示确认无效原因输入框
  398. showTagValid() {
  399. this.tagValidShow = true
  400. },
  401. //获取用户信息
  402. gituserlist() {
  403. this.$u.get("/matchKeywords/personalReceptionRecord", {
  404. customerId: this.customerId
  405. }).then(res => {
  406. res.endTime1 = res.endTime.substring(0, 19);
  407. this.userlistobj = res;
  408. })
  409. },
  410. //标记顾问
  411. tagtap() {
  412. this.biojiisshow = !this.biojiisshow;
  413. },
  414. //取消标记
  415. unmarktap() {
  416. this.roleindexbiaoji = this.dshfkjsdkksodofydwfkhwdfkjh;
  417. },
  418. //确认标记
  419. Confirmthetag() {
  420. var num = this.roleindexbiaoji + 1;
  421. let params = {
  422. id: this.luyinList[this.csdFileindex].id,
  423. speaker: num,
  424. customerId: this.customerId
  425. }
  426. this.$u.get(config.service.markConsultant, params).then((data) => {
  427. this.biojiisshow = false;
  428. this.biaojiyuyi()
  429. this.fenjiaoseunfo()
  430. uni.showToast({
  431. title: '标记成功',
  432. duration: 2000
  433. });
  434. })
  435. },
  436. // 切换角色展示
  437. tapspagek(index) {
  438. this.roleindex = index;
  439. this.newluyinList = [];
  440. this.fenjiaoseunfo()
  441. this.$forceUpdate()
  442. },
  443. // 初始化音频以及页面数据
  444. init(info) {
  445. this.sliderMax = 0; //进度条最大值
  446. this.timeStr = "00:00"; //总的时间
  447. const parames = {
  448. pageNum: 1,
  449. pageSize: 100,
  450. query: {
  451. customerId: this.customerId
  452. }
  453. }
  454. this.$u.post("/corpus/findByPage", parames).then(res => {
  455. if (res && res.length) {
  456. let alltime = 1 + res[0].recordDuration;
  457. this.calibration = res[0].calibration;
  458. if (this.calibration == 0) {
  459. this.kehuyixiangcenterindex = 0;
  460. } else {
  461. this.kehuyixiangcenterindex = 1;
  462. }
  463. this.alltimeStr = this.getTime(alltime)
  464. if (info.bg != 0) {
  465. this.luyinList = res;
  466. this.recordPath = res[0].recordPath
  467. this.sliderMax = this.getTime(res[0].recordDuration)
  468. this.timeStr = this.getTime(res[0].recordDuration)
  469. this.date = res[0].receptionTime;
  470. this.getCorpusAnalysis(info);
  471. this.creatAudio()
  472. } else {
  473. this.luyinList = res;
  474. this.recordPath = res[0].recordPath
  475. this.sliderMax = this.getTime(res[0].recordDuration)
  476. this.timeStr = this.getTime(res[0].recordDuration)
  477. this.date = res[0].receptionTime;
  478. this.getCorpusAnalysis(info);
  479. this.creatAudio()
  480. }
  481. }
  482. })
  483. },
  484. // 获取转义后的对话结果
  485. getCorpusAnalysis(info) {
  486. this.dialogList = [];
  487. this.newluyinList = []
  488. uni.request({
  489. url: config.service.getCorpusAnal + '?corpusId=' + this.luyinList[this.csdFileindex].id +
  490. "&bg=" + info.bg + "&speaker=" + this.roleindex, //仅为示例,并非真实接口地址。
  491. method: "GET",
  492. header: {
  493. 'content-type': 'application/json',
  494. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  495. },
  496. success: (data) => {
  497. this.tablist = [];
  498. this.roleindexbiaoji = 0;
  499. let jsonInfo = JSON.parse(data.data.data.audioContent);
  500. for (var i = 0; i <= data.data.data.speakerNum; i++) {
  501. if (i === 0) {
  502. this.tablist.push({
  503. name: '全部'
  504. })
  505. } else {
  506. this.tablist.push({
  507. name: String.fromCharCode(i + 64)
  508. })
  509. }
  510. }
  511. if (data.data.data.speaker == null) {
  512. this.dshfkjsdkksodofydwfkhwdfkjh = 0;
  513. } else {
  514. this.tablist[data.data.data.speaker].name = this.tablist[data.data.data.speaker]
  515. .name + "顾问";
  516. this.roleindexbiaoji = data.data.data.speaker - 1;
  517. this.dshfkjsdkksodofydwfkhwdfkjh = data.data.data.speaker - 1;
  518. }
  519. this.speaker = data.data.data.speaker;
  520. //上拉标记点
  521. this.textindex = data.data.data.index;
  522. //下拉标记点
  523. this.toptextindex = data.data.data.index;
  524. jsonInfo.forEach(item => {
  525. item.message = JSON.parse(item.onebest)
  526. item.backindex = this.csdFileindex;
  527. if (info.onebest) {
  528. item.message.forEach(che => {
  529. if (che.onebest == info.onebest) {
  530. che.onebest =
  531. `<font style='color: red'>${che.onebest}</font>`;
  532. }
  533. })
  534. }
  535. })
  536. this.newluyinList = jsonInfo;
  537. this.dialogList.push(jsonInfo[this.textindex]);
  538. this.adasdasdasd(info)
  539. }
  540. })
  541. },
  542. //下一页
  543. ltolower() {
  544. var lengthcz = this.newluyinList.length - 1;
  545. if (this.textindex >= lengthcz) {
  546. uni.showToast({
  547. title: '到底了',
  548. duration: 2000
  549. });
  550. return
  551. } else {
  552. this.textindex = this.textindex + 1;
  553. this.newluyinList[this.textindex].message.forEach(item => {
  554. this.dialogList[0].message.push(item)
  555. })
  556. }
  557. },
  558. //上一页
  559. rolltoupper() {
  560. if (this.toptextindex == 0) {
  561. return
  562. } else {
  563. if (this.dialogList[0] == undefined) {
  564. return
  565. } else {
  566. this.toptextindex = this.toptextindex - 1;
  567. let reverselist = this.newluyinList[this.toptextindex].message;
  568. let runlist = reverselist.reverse();
  569. runlist.forEach(item => {
  570. this.dialogList[0].message.unshift(item)
  571. })
  572. }
  573. }
  574. },
  575. //搜索跳转
  576. adasdasdasd(e) {
  577. const currTimeStr = this.formatTime(parseInt(e.bg / 1000))
  578. this.currentTimeStr = currTimeStr
  579. this.innerAudioContext.seek(parseInt(e.bg / 1000));
  580. if (uni.getStorageSync('entrance') == 1) {
  581. return
  582. } else {
  583. if (this.current == 1) {
  584. this.innerAudioContext.play();
  585. } else {
  586. this.scrollId = "dialog" + this.csdFileindex + "text" + e.bg
  587. }
  588. }
  589. },
  590. //分角色标记刷新
  591. fenjiaoseunfo() {
  592. var bgcd = this.sliderValue * 1000;
  593. this.newluyinList = [];
  594. this.dialogList = [];
  595. uni.request({
  596. url: config.service.getCorpusAnal + '?corpusId=' + this.luyinList[this.csdFileindex].id +
  597. "&bg=" + bgcd + "&speaker=" + this.roleindex, //仅为示例,并非真实接口地址。
  598. method: "GET",
  599. header: {
  600. 'content-type': 'application/json',
  601. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  602. },
  603. success: (data) => {
  604. this.tablist = [];
  605. let jsonInfo = JSON.parse(data.data.data.audioContent);
  606. for (var i = 0; i <= data.data.data.speakerNum; i++) {
  607. if (i === 0) {
  608. this.tablist.push({
  609. name: '全部'
  610. })
  611. } else {
  612. this.tablist.push({
  613. name: String.fromCharCode(i + 64)
  614. })
  615. }
  616. }
  617. if (data.data.data.speaker == null) {
  618. this.roleindexbiaoji = 0;
  619. this.dshfkjsdkksodofydwfkhwdfkjh = 0;
  620. } else {
  621. this.tablist[data.data.data.speaker].name = this.tablist[data.data.data.speaker]
  622. .name + "顾问";
  623. this.roleindexbiaoji = data.data.data.speaker - 1;
  624. this.dshfkjsdkksodofydwfkhwdfkjh = data.data.data.speaker - 1;
  625. }
  626. if (this.roleindex > this.tablist.length - 1) {
  627. this.roleindex = this.tablist.length - 1
  628. this.fenjiaoseunfo()
  629. }
  630. this.speaker = data.data.data.speaker;
  631. //上拉标记点
  632. this.textindex = data.data.data.index;
  633. //下拉标记点
  634. this.toptextindex = data.data.data.index;
  635. jsonInfo.forEach(item => {
  636. item.message = JSON.parse(item.onebest)
  637. item.backindex = this.csdFileindex
  638. })
  639. console.log(jsonInfo)
  640. this.newluyinList = jsonInfo;
  641. if (this.textindex == null) {
  642. return
  643. } else {
  644. this.dialogList.push(jsonInfo[this.textindex]);
  645. }
  646. }
  647. })
  648. },
  649. // 选中下标
  650. change(index) {
  651. console.log(index)
  652. this.current = index;
  653. },
  654. // 录音暂停播放
  655. changePlayState() {
  656. if (this.audioPlay == false) {
  657. this.innerAudioContext.play();
  658. } else {
  659. this.innerAudioContext.pause()
  660. }
  661. },
  662. // 初始化音频方法
  663. initAudioFnc() {
  664. this.innerAudioContext = uni.createInnerAudioContext();
  665. this.innerAudioContext.autoplay = false;
  666. this.innerAudioContext.title = '音频';
  667. this.onPlay()
  668. this.onPause()
  669. this.onCanplay()
  670. this.onEnded()
  671. this.onSeeking()
  672. this.onSeeked()
  673. this.TimeUpdate()
  674. this.init(this.infos)
  675. },
  676. //长按点击播放
  677. clickbofang(dialog, item) {
  678. this.innerAudioContext.pause()
  679. this.dialogList.forEach(res => {
  680. res.message.forEach(asd => {
  681. asd.isshow = false;
  682. })
  683. })
  684. this.$forceUpdate()
  685. let platetime = item.bg;
  686. let newtime = item.bg / 1000;
  687. console.log(newtime, 'newTime')
  688. this.dialogList = []
  689. uni.request({
  690. url: config.service.fastForward + '?corpusId=' + this.luyinList[this.csdFileindex].id +
  691. "&bg=" + platetime, //仅为示例,并非真实接口地址。
  692. method: "GET",
  693. header: {
  694. 'content-type': 'application/json',
  695. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  696. },
  697. success: (data) => {
  698. this.textindex = data.data.data.index;
  699. this.toptextindex = data.data.data.index;
  700. this.dialogList.push(this.newluyinList[data.data.data.index])
  701. const currTimeStr = this.formatTime(newtime)
  702. console.log(currTimeStr, 'currTimeStr')
  703. this.currentTimeStr = currTimeStr
  704. this.innerAudioContext.seek(newtime);
  705. this.innerAudioContext.play();
  706. }
  707. })
  708. },
  709. //录音实例
  710. creatAudio() {
  711. this.innerAudioContext = uni.createInnerAudioContext();
  712. this.innerAudioContext.autoplay = false;
  713. this.innerAudioContext.src = this.recordPath;
  714. this.innerAudioContext.title = '音频';
  715. this.onPlay()
  716. this.onPause()
  717. this.onCanplay()
  718. this.onEnded()
  719. this.onSeeking()
  720. this.onSeeked()
  721. this.TimeUpdate()
  722. },
  723. onPlay() {
  724. this.innerAudioContext.onPlay(() => {
  725. // 播放监听
  726. console.log('播放!');
  727. this.audioPlay = true;
  728. wx.enableAlertBeforeUnload({
  729. message: "是否确认退出详情页面?",
  730. success: function(res) {
  731. console.log("方法注册成功:", res);
  732. },
  733. fail: function(errMsg) {
  734. console.log("方法注册失败:", errMsg);
  735. },
  736. });
  737. });
  738. },
  739. onPause() {
  740. this.innerAudioContext.onPause(() => {
  741. wx.disableAlertBeforeUnload({
  742. success: function(res) {
  743. console.log(res)
  744. },
  745. fail: function(e) {
  746. console.log(e)
  747. }
  748. });
  749. // 暂停监听
  750. console.log('暂停播放!');
  751. this.audioPlay = false
  752. });
  753. },
  754. onCanplay() {
  755. this.innerAudioContext.onCanplay((callback) => {
  756. console.log("缓冲回调", this.innerAudioContext.duration);
  757. })
  758. },
  759. onEnded() {
  760. this.innerAudioContext.onEnded(() => {
  761. // 结束播放监听
  762. console.log('播放结束!');
  763. this.audioPlay = false;
  764. });
  765. },
  766. onSeeking() {
  767. this.innerAudioContext.onSeeking((res) => {
  768. console.log("进行跳转", res);
  769. })
  770. },
  771. onSeeked() {
  772. this.innerAudioContext.onSeeked((res) => {
  773. console.log("结束跳转", res);
  774. this.$forceUpdate()
  775. });
  776. },
  777. TimeUpdate() {
  778. this.innerAudioContext.onTimeUpdate(() => {
  779. const {
  780. currentTime,
  781. duration
  782. } = this.innerAudioContext;
  783. this.playNow = parseInt(currentTime * 1000)
  784. if (this.dialogList.length == 0) {
  785. return
  786. } else {
  787. const message = this.dialogList[0].message;
  788. for (let i = 0; i < message.length; i++) {
  789. if (Number(message[i].bg) < this.playNow && Number(message[i].ed) > this.playNow) {
  790. this.scrollId = "dialog" + this.csdFileindex + "text" + message[i].bg;
  791. break;
  792. }
  793. }
  794. }
  795. const currTimeStr = this.formatTime(currentTime);
  796. this.sliderValue = parseInt(currentTime);
  797. // 变动的时间
  798. this.currentTimeStr = currTimeStr;
  799. //进度条最大值
  800. this.sliderMax = this.luyinList[this.csdFileindex].recordDuration;
  801. this.$forceUpdate()
  802. });
  803. },
  804. //音频前进回退
  805. sliderChangeComplate(e) {
  806. let platetime = e.detail.value * 1000;
  807. this.dialogList = []
  808. uni.request({
  809. url: config.service.fastForward + '?corpusId=' + this.luyinList[this.csdFileindex].id +
  810. "&bg=" + platetime, //仅为示例,并非真实接口地址。
  811. method: "GET",
  812. header: {
  813. 'content-type': 'application/json',
  814. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  815. },
  816. success: (data) => {
  817. this.textindex = data.data.data.index;
  818. this.toptextindex = data.data.data.index;
  819. if (data.data.data.index > this.newluyinList.length) {
  820. this.dialogList.push(this.newluyinList[0])
  821. } else {
  822. this.dialogList.push(this.newluyinList[data.data.data.index])
  823. }
  824. const currTimeStr = this.formatTime(e.detail.value)
  825. this.currentTimeStr = currTimeStr
  826. this.innerAudioContext.seek(e.detail.value);
  827. this.innerAudioContext.play();
  828. }
  829. })
  830. },
  831. // 格式化时间
  832. getTime(time) {
  833. return util.formatSecond(time)
  834. },
  835. // 格式化时间
  836. formatTime(num) {
  837. //格式化时间格式
  838. num = num.toFixed(0);
  839. let second = num % 60;
  840. if (second < 10) second = '0' + second;
  841. let min = Math.floor(num / 60);
  842. if (min < 10) min = '0' + min;
  843. return min + ":" + second;
  844. },
  845. },
  846. filters: {
  847. // violatedStatus
  848. ViolatedStatus(status) {
  849. let str = '';
  850. switch (status) {
  851. case 0:
  852. str = '待处理'
  853. break;
  854. case 1:
  855. str = '有效违禁'
  856. break;
  857. case 2:
  858. str = '无效违禁'
  859. break;
  860. }
  861. return str
  862. },
  863. }
  864. }
  865. </script>
  866. <style lang="scss" scoped>
  867. .details {
  868. width: 100vw;
  869. height: calc(100vh - var(--window-top));
  870. display: flex;
  871. flex-direction: column;
  872. .header {
  873. padding: 20rpx;
  874. width: 100%;
  875. height: 210rpx;
  876. .h-box {
  877. padding: 0 16rpx;
  878. width: 100%;
  879. height: 100%;
  880. background: #fff;
  881. border-radius: 16rpx;
  882. .h-b-top {
  883. padding: 20rpx 0;
  884. display: flex;
  885. align-items: center;
  886. justify-content: space-between;
  887. .name {
  888. font-size: 30rpx;
  889. font-weight: bold;
  890. }
  891. .status {
  892. display: flex;
  893. align-items: center;
  894. .pointer {
  895. margin: 0 .5em;
  896. width: 12rpx;
  897. height: 12rpx;
  898. border-radius: 50%;
  899. background: #2671E2;
  900. }
  901. }
  902. }
  903. .h-b-btm {
  904. display: flex;
  905. justify-content: space-between;
  906. .item {
  907. flex-shrink: 0;
  908. display: flex;
  909. align-items: center;
  910. &.hit {
  911. color: #E7483C;
  912. font-size: bold;
  913. }
  914. .item-imgs {
  915. margin-right: .5em;
  916. width: 32rpx;
  917. height: 32rpx;
  918. }
  919. }
  920. }
  921. }
  922. }
  923. .words-list {
  924. flex-grow: 1;
  925. }
  926. .audio {
  927. .headboxbott {
  928. width: 100%;
  929. height: 88rpx;
  930. display: flex;
  931. align-items: center;
  932. .headovfu {
  933. flex: 1;
  934. height: 88rpx;
  935. overflow: hidden;
  936. }
  937. .headpade {
  938. width: 160rpx;
  939. height: 60rpx;
  940. display: flex;
  941. justify-content: center;
  942. align-items: center;
  943. border-left: 1px solid #D6D6D6;
  944. .biaoji {
  945. min-width: 120rpx;
  946. height: 48rpx;
  947. background: #E6625B;
  948. border-radius: 24rpx;
  949. text-align: center;
  950. line-height: 48rpx;
  951. color: #FFFFFF;
  952. font-size: 26rpx;
  953. }
  954. }
  955. }
  956. }
  957. .scroll-Y {
  958. flex: 1;
  959. overflow: auto;
  960. font-size: 36upx;
  961. color: #999999;
  962. background: #FFFFFF;
  963. margin-top: 30upx;
  964. flex: 1;
  965. overflow-y: scroll;
  966. width: 100%;
  967. .dialog-block {
  968. margin: 20rpx 0;
  969. border-bottom: 1px solid #ccc;
  970. .fileName {
  971. text-align: center;
  972. margin: 10rpx auto;
  973. width: 115rpx;
  974. height: 42rpx;
  975. line-height: 42rpx;
  976. background: #EFEFEF;
  977. border-radius: 4rpx;
  978. font-size: 20rpx;
  979. font-weight: 400;
  980. color: #333333;
  981. }
  982. }
  983. .text {
  984. margin: 50upx 30upx;
  985. line-height: 80upx;
  986. display: flex;
  987. align-items: center;
  988. .avatar {
  989. width: 64upx;
  990. height: 64upx;
  991. line-height: 64upx;
  992. text-align: center;
  993. font-size: 36rpx;
  994. border-radius: 50%;
  995. background: #F2F2F2;
  996. color: #008EF2;
  997. image {
  998. width: 40upx;
  999. }
  1000. }
  1001. .content {
  1002. margin-left: 30upx;
  1003. line-height: 60rpx;
  1004. text-align: left;
  1005. padding: 0 5px;
  1006. background: #2BC805;
  1007. border-radius: 8upx;
  1008. max-width: 442rpx;
  1009. color: #FFFFFF;
  1010. position: relative;
  1011. .tankuangcss {
  1012. position: absolute;
  1013. top: -140rpx;
  1014. left: -120rpx;
  1015. width: 308rpx;
  1016. height: 130rpx;
  1017. background-color: #333333;
  1018. font-size: 24rpx;
  1019. color: #FFFFFF;
  1020. padding-top: 4rpx;
  1021. padding-bottom: 4rpx;
  1022. display: flex;
  1023. flex-wrap: wrap;
  1024. border-radius: 15rpx;
  1025. z-index: 1000;
  1026. }
  1027. .bottoms {
  1028. top: unset;
  1029. bottom: -140rpx;
  1030. }
  1031. }
  1032. .contentInfo {
  1033. .info {
  1034. color: #ccc;
  1035. font-size: 18rpx;
  1036. font-size: 30rpx;
  1037. padding: 0 28rpx;
  1038. }
  1039. }
  1040. .contentMain {
  1041. display: flex;
  1042. .content {
  1043. margin-left: 0;
  1044. margin-right: 30upx;
  1045. }
  1046. .play {
  1047. width: 50rpx;
  1048. height: 50rpx;
  1049. margin-right: 20rpx;
  1050. }
  1051. }
  1052. &.active {
  1053. .content {
  1054. color: #FF7538 !important;
  1055. position: relative;
  1056. }
  1057. }
  1058. &.reverse {
  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. .contentInfo {
  1068. .info {
  1069. color: #ccc;
  1070. font-size: 18rpx;
  1071. font-size: 30rpx;
  1072. padding: 0 28rpx;
  1073. display: flex;
  1074. flex-direction: row-reverse;
  1075. .AudioUserName {
  1076. margin-left: 10rpx;
  1077. }
  1078. }
  1079. .contentMain {
  1080. display: flex;
  1081. flex-direction: row-reverse;
  1082. align-items: center;
  1083. .content {
  1084. margin-left: 0;
  1085. margin-right: 30upx;
  1086. }
  1087. .play {
  1088. width: 50rpx;
  1089. height: 50rpx;
  1090. margin-right: 20rpx;
  1091. }
  1092. }
  1093. }
  1094. }
  1095. }
  1096. }
  1097. .bottombox {
  1098. width: 100%;
  1099. min-height: 170rpx;
  1100. .bottomhead {
  1101. width: 100%;
  1102. height: 81rpx;
  1103. border-top: 1px solid #E0E0E0;
  1104. border-bottom: 1px solid #E0E0E0;
  1105. display: flex;
  1106. justify-content: space-between;
  1107. align-items: center;
  1108. .audio-slider {
  1109. width: 87%;
  1110. display: flex;
  1111. justify-content: space-between;
  1112. align-items: center;
  1113. padding-right: 30rpx;
  1114. }
  1115. .audio-slider .slider {
  1116. width: 100%;
  1117. padding: 0px 15rpx;
  1118. box-sizing: border-box;
  1119. }
  1120. .audio-time {
  1121. width: 110rpx;
  1122. text-align: right;
  1123. font-size: 26rpx;
  1124. line-height: 28rpx;
  1125. color: #70798D;
  1126. display: flex;
  1127. justify-content: space-between;
  1128. }
  1129. .audio-play {
  1130. width: 48rpx;
  1131. height: 48rpx;
  1132. flex-shrink: 0;
  1133. }
  1134. .audio-play .image {
  1135. width: 100%;
  1136. height: 100%;
  1137. margin-left: 30rpx;
  1138. }
  1139. }
  1140. .bottomtips {
  1141. padding: 0 32rpx;
  1142. min-height: 70rpx;
  1143. display: flex;
  1144. align-items: center;
  1145. background: #FDEBC6;
  1146. }
  1147. .botbotmm {
  1148. width: 100%;
  1149. height: 88rpx;
  1150. display: flex;
  1151. align-items: center;
  1152. .item {
  1153. flex: 1;
  1154. height: 100%;
  1155. display: flex;
  1156. align-items: center;
  1157. justify-content: center;
  1158. border: 1rpx solid #E0E0E0;
  1159. border-top: none;
  1160. }
  1161. }
  1162. }
  1163. .bounced {
  1164. width: 570rpx;
  1165. background: #FFFFFF;
  1166. z-index: 1000;
  1167. border-radius: 10rpx;
  1168. position: fixed;
  1169. left: 50%;
  1170. top: 50%;
  1171. transform: translate(-50%, -50%);
  1172. .headpade {
  1173. margin-top: 10rpx;
  1174. padding: 8rpx 8rpx 8rpx 8rpx;
  1175. background: #108ee9;
  1176. color: #fff;
  1177. border-radius: 16rpx;
  1178. }
  1179. /* 50%为自身尺寸的一半 */
  1180. .jiajinghuatit {
  1181. width: 100%;
  1182. height: 68rpx;
  1183. font-size: 30rpx;
  1184. text-align: center;
  1185. line-height: 68rpx;
  1186. }
  1187. .jiajinghuaview {
  1188. padding: 18rpx 18rpx 18rpx 18rpx;
  1189. display: flex;
  1190. flex-wrap: wrap;
  1191. .jiajinghuaview1 {
  1192. padding: 8rpx 8rpx 8rpx 8rpx;
  1193. font-size: 26rpx;
  1194. border-radius: 12rpx;
  1195. border: 1px solid #979797;
  1196. margin-left: 8rpx;
  1197. }
  1198. .jighuaview2 {
  1199. padding: 8rpx 18rpx 8rpx 18rpx;
  1200. font-size: 26rpx;
  1201. border-radius: 12rpx;
  1202. border: 1px solid #979797;
  1203. margin-left: 20rpx;
  1204. margin-top: 10rpx;
  1205. display: flex;
  1206. .view1-text {
  1207. text-align: center;
  1208. }
  1209. .view1-img {
  1210. width: 50rpx;
  1211. }
  1212. }
  1213. }
  1214. .bounced3 {
  1215. height: 100rpx;
  1216. width: 100%;
  1217. margin-top: 40rpx;
  1218. border-top: 1px solid #dddddd;
  1219. display: flex;
  1220. }
  1221. .bounced3-1 {
  1222. width: 50%;
  1223. height: 100%;
  1224. text-align: center;
  1225. line-height: 100rpx;
  1226. border-right: 1px solid #dddddd;
  1227. font-size: 36rpx;
  1228. color: #999999;
  1229. }
  1230. .bounced3-2 {
  1231. width: 50%;
  1232. height: 100%;
  1233. text-align: center;
  1234. line-height: 100rpx;
  1235. font-size: 36rpx;
  1236. color: #108ee9;
  1237. }
  1238. }
  1239. .reason {
  1240. padding: 0 32rpx 32rpx;
  1241. width: 686rpx;
  1242. min-height: 350rpx;
  1243. display: flex;
  1244. flex-direction: column;
  1245. box-sizing: border-box;
  1246. .resaon-title {
  1247. padding: 24rpx 0;
  1248. flex-shrink: 0;
  1249. line-height: 32rpx;
  1250. font-size: 32rpx;
  1251. box-sizing: border-box;
  1252. }
  1253. .resaon-textbox {
  1254. padding: 12rpx 16rpx 36rpx;
  1255. position: relative;
  1256. flex-grow: 1;
  1257. box-sizing: border-box;
  1258. border: 1rpx solid #979797;
  1259. // border-radius: 16rpx;
  1260. display: flex;
  1261. textarea {
  1262. flex-grow: 1;
  1263. box-sizing: border-box;
  1264. }
  1265. .lastlength {
  1266. position: absolute;
  1267. right: 32rpx;
  1268. bottom: 12rpx;
  1269. font-size: 24rpx;
  1270. box-sizing: border-box;
  1271. }
  1272. }
  1273. .button {
  1274. margin-top: 24rpx;
  1275. width: 100%;
  1276. display: flex;
  1277. justify-content: flex-end;
  1278. text {
  1279. padding: 10rpx 35rpx;
  1280. color: #fff;
  1281. background: #008EF2;
  1282. border-radius: 16rpx;
  1283. }
  1284. }
  1285. }
  1286. }
  1287. /deep/.u-tab-item {
  1288. border: 1rpx solid #dedede;
  1289. }
  1290. </style>