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.

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