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.
 
 
 

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