|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628 |
- <template>
- <view class="translation" @click="changeEditing(false)">
- <view class="top" style="margin-top: 30rpx;">
- <view class="title">
- <view class="call_record_time">{{date}}</view>
- <view class="hash" @click="gotoChat" v-if="commentList.length != 0">
- 查看全部评论
- </view>
- </view>
- <view class="call_record_time_one" >接待时长 {{alltimeStr}}
- <u-icon name="list-dot" color="#333" size="48" @click="showFile"></u-icon>
- <view class="file-change" v-if="isshowFile">
- <view class="file-item" @click="filechange(item,index)"
- :class="csdFileindex == index ? 'fileactive' : ''" v-for="(item,index) in luyinList"
- :key="index">录音文件{{index+1}}</view>
- </view>
- </view>
- <view class="audio-container">
- <view class="audio-play" @tap="changePlayState">
- <image class="image" mode="widthFix" :src="audioPlay ? 'https://qufang.oss-cn-beijing.aliyuncs.com/upload/icon/xcx/jjycrm/pause.png' : 'https://qufang.oss-cn-beijing.aliyuncs.com/upload/icon/xcx/jjycrm/play.png'"></image>
- </view>
- <view class="audio-slider">
- <view class="audio-time">
- <text>{{currentTimeStr}}</text>
- </view>
- <slider class="slider" min="0" :max="sliderMax" @change="sliderChangeComplate" block-size="14"
- :value="sliderValue" activeColor="blue"></slider>
- <view class="audio-time">
- <text>{{timeStr}}</text>
- </view>
- </view>
- </view>
- </view>
- <scroll-view :scroll-top="scrollTop"
- lower-threshold='20px' @scrolltolower="ltolower()" :scroll-into-view="scrollId" scroll-y="true"
- class="text scroll-Y">
- <!-- 音频识别模块 -->
- <view >
- <!-- 聊天记录-->
- <view class="dialog-block" v-for="(dialog,i) in dialogList" :key="i">
- <view :id="'dialog'+i" class="fileName">录音文件</view>
- <view class="text dingweishiy" :id="'dialog'+csdFileindex+'text'+index"
- :class="{active: item.bg < playNow && item.ed > playNow && i==0}"
- v-for="(item,index) in dialog.message" :key="index" :data-speaker="item.speaker"
- >
- <view class="avatar">
- <text v-if="item.speaker == 1" style="color: #60CBEC;">A</text>
- <text v-if="item.speaker == 2" style="color: #EC8B47;">B</text>
- <text v-if="item.speaker == 3" style="color: #4F861E;">C</text>
- <text v-if="item.speaker == 4" style="color: #9F61C8;">D</text>
- <text v-if="item.speaker == 5" style="color: #4980C8;">E</text>
-
- <text v-if="item.speaker == 6" style="color: #60CBEC;">F</text>
- <text v-if="item.speaker == 7" style="color: #EC8B47;">G</text>
- <text v-if="item.speaker == 8" style="color: #4F861E;">H</text>
- <text v-if="item.speaker == 9" style="color: #9F61C8;">I</text>
- </view>
- <view class="content">
- <view v-html="item.onebest"></view>
- </view>
- <view class="tankuangcss" v-if="startTime==item.bg">
- <view style="max-width: 85rpx; height: 38rpx;font-size: 24rpx;color: #333333;text-align: center;line-height: 38rpx;
- border-radius: 2rpx;border: 1px solid #979797;">标签</view>
- <view style="max-width: 171rpx;height: 38rpx;background: #008EF2;border-radius: 2rpx;display: flex;
- align-items: center;margin-left: 10rpx;" @click="dianjibiaoqian()">
- <view style="width: 126rpx;height: 38rpx;line-height: 38rpx;font-size: 24rpx;color: #FFFFFF;
- text-align: center; overflow: hidden;">{{biaoqian}}</view>
- <view v-if="biaoqian.length>4" style="width: 37rpx;height: 37rpx;line-height: 37rpx;">
- <u-icon name="chat-fill" color="#ffffff" size="32rpx"></u-icon>
- </view>
- </view>
- </view>
- <view class="biaoqianya" v-if="startTime==item.bg">
- <view class="biaoqianyaisshow" v-if="biaoqianyaisshow">
- {{biaoqian}}
- </view>
- </view>
- </view>
- </view>
- <!-- 点赞 -->
- <view class="likeArea" :class="{'liked':isLiked}">
- <image :src="isLiked?'/static/images/recordingManagement/likeActive.png':'/static/images/recordingManagement/like_gray.png'"
- mode=""></image>
- </view>
- <view class="hash" id="hash">
- </view>
- <!-- 评语列表 -->
- <view class="chat" v-if="commentList.length != 0">
- <view class="total">
- 全部评论(共{{commentList.length}}条)
- </view>
- <view class="list">
- <view class="message" v-for="(item,index) in commentList" :key="index">
- <u-avatar class="avator" size="72" :src="item.commentPic ||'https://qufang.oss-cn-beijing.aliyuncs.com/upload/icon/xcx/jjycrm/my/headPicture.png'"></u-avatar>
- <view class="right">
- <view class="name">
- {{item.commentName||"未知昵称"}}
- </view>
- <view class="subtitle" v-if="item.commentAutoGraph">
- {{item.commentAutoGraph}}
- </view>
- <view class="answer" v-if="item.replyName">
- 回复@{{item.replyName}}
- </view>
- <view class="content" v-if="item.content">
- {{item.content}}
- </view>
- <view class="pic" v-if="item.picUrl">
- <image style="width: 100%;max-width: 240px;" :src="item.picUrl" mode="widthFix"></image>
- </view>
-
- <view class="bottom">
- <view class="time">
- {{item.createTime}}
- </view>
- <view class="button" v-if="myId != item.commentUser" @click.stop="answer(item.commentUser,item.id)">
- 回复
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </scroll-view>
- <!-- 写评价 -->
- <view class="bottomArea">
- <image class="voice" @click.stop="changeVoiceShow" src="/static/images/recordingManagement/voice.png" mode=""></image>
- <view class="inputArea">
- <textarea :value="content" :focus="textareaFocus" type="text" @input="changeContent" :auto-height="true" class="editor"
- :class="{'active':editing}" @click.stop="changeEditing(true)" @confirm="sendComment">
- </textarea>
- <view class="placeholder" :class="{'editing':editing}" v-if="!content && !editing">写评价</view>
- <image class="edit" v-if="!editing && content == ''" src="/static/images/recordingManagement/edit.png" mode=""></image>
- </view>
- <image class="like" v-if="myId != createUser && !editing" @click="changeLike" src="/static/images/recordingManagement/like.png"
- mode=""></image>
- <image class="add" @click.stop="uploadImage" v-if="!editing && content == ''" src="/static/images/recordingManagement/add.png"
- mode=""></image>
- <view class="send" @click="sendComment" v-if="content!=''">
- 发送
- </view>
- </view>
- <!-- 回到顶部 -->
- <!-- <view class="backTop" @click="gotoTop">
- <image src="/static/images/backTop.png" mode=""></image>
- </view> -->
- <!-- 语音输入 -->
- <cover-view class="voiceContent" v-if="voiceShow" @click="changeVoiceShow">
- <cover-view class="box" @click.stop="" @touchstart="voiceStart" @touchend="voiceEnd">
- <cover-view class="center">
- <cover-image class="voice" src="/static/images/voice.png" mode="widthFix"></cover-image>
- <cover-view class="text">
- {{isRecording?'正在输入':'长按语音输入'}}
- </cover-view>
- </cover-view>
- </cover-view>
- </cover-view>
-
- </view>
- </template>
-
- <script>
- var app = getApp();
- var util = require("../../../utils/util.js");
- var config = require("../../../config");
-
- var plugin = requirePlugin("WechatSI")
- let manager = plugin.getRecordRecognitionManager();
-
- export default {
- data() {
- return {
- dialogList: [], // 录音对话转移列表
- isshowFile: false, // 录音文件默认隐藏
- luyinList: [], //录音文件列表
- fileIndex: 0, //文件索引
- fileId: '', //选中的录音ID
- id: "",
- audioStop: false,
- customerId: '',
- date: "",
- time: "",
- message: "", //聊天记录表
- durationTimeStr: "",
- autoLoad: true,
- playNow: 0,
- scrollTop: 0,
- scrollId: "",
- editing: false,
- isLiked: null,
- createUser: null,
- commentList: [], //评论列表
- content: "",
- voiceShow: false,
- isRecording: false,
- answerUserId: null,
- answerId: null,
- textareaFocus: false,
- myId: uni.getStorageSync("weapp_session_userInfo_data").accountId,
- startTime:"",
-
- alltimeStr:"00:00",
- audioPlay: false, //当前的播放状态控制
- sliderValue: 0, //进度条最小值
- end: false,
- sliderMax: 0, //进度条最大值
- innerAudioContext: "", //播放实例
- currentTimeStr: "00:00", //当前进度的时间
- timeStr: "00:00", //总的时间
- recordPath: "",
- csdFileindex:0,
- biaoqian:"",
- biaoqianyaisshow:false,
- startFile:'',
- num: 0, //上拉 转写文件下标
- Bnum: 0, //下拉 转写文件下标,
- timer:null
- };
- },
- onLoad: function(options) {
- this.startTime=options.startTime
- this.customerId=options.customerId,
- this.biaoqian=options.biaoqian;
- this.startFile=options.startFile;
-
- this.getdianzan()
- this.getCommentList();
- this.getView()
- let that=this
- this.timer=setTimeout(function(){
- that.addHot()
- },30000)
- },
- onShow: function() {
- this.initRecord();
- this.innerAudioContext = uni.createInnerAudioContext();
- this.innerAudioContext.autoplay = false;
- this.innerAudioContext.title = '音频';
- this.onPlay()
- this.onPause()
- this.onCanplay()
- this.onEnded()
- this.onSeeking()
- this.onSeeked()
- this.TimeUpdate()
- this.getluyinList();
- },
- // 在组件实例被从页面节点树移除时执行
- destroyed: function() {
- if (this.innerAudioContext) {
- this.innerAudioContext.destroy();
- }
- },
- onUnload:function(){
- this.innerAudioContext.destroy();
- },
- methods: {
- addHot(){
- // console.log('30')
- this.$u.post('/zkstudyrecord',{
- targetId: this.customerId
- })
- .then(res=>{
- // console.log(res)
- })
- },
- getView(){
- this.$u.get('/addtodigest/addPageviews',{
- id:this.customerId
- })
- .then(res=>{
- // console.log(res)
- })
- // uni.request({
- // url: config.service.getView,
- // method: "POST",
- // data: {id:this.customerId},
- // header: {
- // 'content-type': 'application/json',
- // 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
- // },
- // success: (data) => {
- // console.log(data)
- // }
- // })
- },
- onPlay(){
- this.innerAudioContext.onPlay(() => {
- // 播放监听
- console.log('播放!');
- this.audioPlay = true;
- });
- },
- onPause(){
- this.innerAudioContext.onPause(() => {
- // 暂停监听
- console.log('暂停播放!');
- this.audioPlay = false
- });
- },
- onCanplay() {
- this.innerAudioContext.onCanplay((callback) => {
- console.log("缓冲回调",this.innerAudioContext.duration);
- })
- },
- onEnded(){
- this.innerAudioContext.onEnded(() => {
- // 结束播放监听
- console.log('播放结束!');
- this.audioPlay = false;
- this.qeihuanwenjian()
- });
- },
- onSeeking(){
- this.innerAudioContext.onSeeking((res) => {
- console.log("进行跳转", res);
- })
- },
- onSeeked(){
- this.innerAudioContext.onSeeked((res) => {
- console.log("结束跳转", res);
- this.$forceUpdate()
- });
- },
- TimeUpdate(){
- this.innerAudioContext.onTimeUpdate(() => {
- const {
- currentTime,
- duration
- } = this.innerAudioContext;
- this.playNow = parseInt(currentTime * 1000)
- if (this.dialogList.length == 0) {
-
- } else {
- const message = this.dialogList[0].message
- for (let i = 0; i < message.length; i++) {
- if (Number(message[i].bg) < this.playNow && Number(message[i].ed) > this.playNow) {
- this.scrollId = "dialog" + this.csdFileindex + "text" + i;
- break;
- }
- }
- }
- const currTimeStr = this.formatTime(currentTime);
- this.sliderValue = parseInt(currentTime);
- // 变动的时间
- this.currentTimeStr = currTimeStr;
- //进度条最大值
- this.sliderMax = this.luyinList[this.csdFileindex].recordDuration;
- this.$forceUpdate()
- });
- },
-
- //下一页
- ltolower() {
- var lengthcz=this.luyinList.length-1;
- if (this.num >= lengthcz) {
- uni.showToast({
- title: '到底了',
- duration: 2000
- });
- return
- }else {
- this.num=this.num+1;
- uni.showLoading({
- title: '加载中'
- });
- setTimeout(function() {
- uni.hideLoading();
- }, 2000);
- uni.request({
- url: config.service.getCorpusAnalysis + '?corpusId=' + this.luyinList[this.num].id+"&customerId="+this.customerId, //仅为示例,并非真实接口地址。
- method: "GET",
- header: {
- 'content-type': 'application/json',
- 'Authorization': 'Bearer '+uni.getStorageSync('weapp_session_login_data').token
- },
- success: (data) => {
- if (data.data.code == 10000) {
- if (data.data.data.audioContent.length == 0) {
- setTimeout(function() {
- uni.hideLoading();
- }, 2000);
- } else {
- const jsonInfo = JSON.parse(data.data.data.audioContent);
- this.dialogList.push({
- message: jsonInfo
- });
- this.dialogList.forEach((asd, idx) => {
- asd.message.forEach((qwe, inde) => {
- qwe.isshow = false;
- })
- })
- }
- }
- },
- })
- }
- },
-
- //点击标签
- dianjibiaoqian(){
- if(this.biaoqian.length>4){
- this.biaoqianyaisshow= !this.biaoqianyaisshow;
- }
- },
- //获取点赞列表isLiked likegetLike
- getdianzan(){
- uni.request({
- url: config.service.likegetLike + '?targetId=' + this.customerId, //仅为示例,并非真实接口地址。
- method:"GET",
- header: {
- 'content-type': 'application/json',
- 'Authorization': 'Bearer '+uni.getStorageSync('weapp_session_login_data').token
- },
- success: (data) => {
- if(data.data.code==10000){
- this.isLiked=data.data.data.like;
- }else{
- uni.hideLoading();
- uni.showModal({
- title: '提示',
- content: '请求数据失败,请重新尝试',
- showCancel: false
- });
- }
- },
- fail(error) {
- uni.hideLoading();
- uni.showModal({
- title: '提示',
- content: '网络异常,请重新尝试',
- showCancel: false
- });
- return false;
- }
- });
- },
- // 获取评论列表
- getCommentList() {
- const that = this;
- util.getRequestPromise(config.service.cmmentList + '?targetId=' + this.customerId, {}, false, "GET").then(data => {
- let tmp = data;
- tmp.reverse();
- that.commentList = tmp;
- });
- },
- // 获取录音记录列表
- getluyinList() {
- const parames = {
- pageNum: 1,
- pageSize: 100,
- query: {
- whetherFinish: 1,
- customerId: this.customerId,
- id:this.startFile
- }
- }
- this.$u.post("/corpus/fendianFindByPage", parames).then(res => {
- if (res && res.length) {
- let alltime=1;
- res.forEach(item=>{
- alltime = item.recordDuration
- })
- this.alltimeStr=this.getTime(alltime)
- res.forEach((cet,index)=>{
- if(cet.id==this.startFile){
- this.csdFileindex=index;
- this.recordPath = res[index].recordPath
- this.sliderMax = this.getTime(res[index].recordDuration)
- this.timeStr = this.getTime(res[index].recordDuration)
- this.date=res[index].receptionTime
- this.num=index;//下拉起始位置
- this.Bnum=index;
- this.creatAudio();
- this.luyinList = res;
- this.getCorpusAnalysis()
- var itc=parseInt(this.startTime/1000)
- this.adasdasdasd(itc)
- }else{
- console.log("my")
- }
- })
- }
- })
- },
- //首次跳转
- adasdasdasd(e) {
- const currTimeStr = this.formatTime(e)
- this.currentTimeStr = currTimeStr
- this.innerAudioContext.seek(e);
- this.innerAudioContext.play();
- },
- //录音文件切换隐藏
- showFile() {
- this.isshowFile = !this.isshowFile
- },
- changeVoiceShow() {
- this.voiceShow = !this.voiceShow;
- },
- voiceStart: function() {
- manager.start({
- lang: "zh_CN"
- });
- },
- voiceEnd: function() {
- // uni.showToast();
- if (this.isRecording) {
- uni.showLoading({
- title: "识别中"
- })
- }
- this.voiceShow = false;
- this.isRecording = false;
- manager.stop();
- },
- // 语音初始化
- initRecord() {
- const that = this;
- manager.onStart = function(res) {
- that.isRecording = true;
- // this.voiceState = "onStart:" + res.msg + "正在录音"
- };
- //有新的识别内容返回,则会调用此事件
- manager.onRecognize = (res) => {
- console.log('ing' + res.result);
- }
-
- // 识别结束事件
- manager.onStop = (res) => {
- uni.hideLoading();
- let newText = that.content + res.result;
- if (newText.length > 140) {
- newText = newText.substring(0, 140)
- }
- that.content = newText;
- that.textareaFocus = true;
- }
-
- // 识别错误事件
- manager.onError = (res) => {
- uni.hideLoading();
- }
- },
- // 录音暂停播放
- changePlayState() {
- if (this.audioPlay == false) {
- this.innerAudioContext.play();
- } else {
- this.innerAudioContext.pause()
- }
- },
-
- //音频前进回退
- sliderChangeComplate(e) {
- const currTimeStr = this.formatTime(e.detail.value)
- this.currentTimeStr = currTimeStr
- this.innerAudioContext.seek(e.detail.value);
- this.innerAudioContext.play();
- },
-
-
- // 获取转义后的对话结果
- getCorpusAnalysis(){
- this.dialogList = [];
- uni.showLoading({
- title: '加载中'
- });
- uni.request({
- url: config.service.getCorpusAnalysis + '?corpusId=' + this.luyinList[this.csdFileindex].id+"&customerId="+this.customerId, //仅为示例,并非真实接口地址。
- method:"GET",
- header: {
- 'content-type': 'application/json',
- 'Authorization': 'Bearer '+uni.getStorageSync('weapp_session_login_data').token
- },
- success: (data) => {
- if(data.data.code==10000){
- const jsonInfo = JSON.parse(data.data.data.audioContent);
- this.dialogList.push({
- message: jsonInfo
- });
- setTimeout(function () {
- uni.hideLoading();
- }, 2000);
- }else{
- uni.hideLoading();
- uni.showModal({
- title: '提示',
- content: '请求数据失败,请重新尝试',
- showCancel: false
- });
- }
- },
- fail(error) {
- uni.hideLoading();
- uni.showModal({
- title: '提示',
- content: '网络异常,请重新尝试',
- showCancel: false
- });
- return false;
- }
- });
- },
- getTime(time) {
- return util.formatSecond(time)
- },
- // 文件切换播放
- filechange(item, i) {
- this.num=i;//下拉起始位置
- this.Bnum=i;
- console.log("下拉下标",this.Bnum)
- console.log("上拉下标",this.num)
- this.innerAudioContext.destroy()
- this.csdFileindex=i;
- this.recordPath = item.recordPath;
- this.sliderMax = this.getTime(item.recordDuration);
- this.timeStr = this.getTime(item.recordDuration);
- this.date=item.receptionTime;
- this.isshowFile=false;
- this.creatAudio()
- this.getCorpusAnalysis()
- },
- //录音实例
- creatAudio() {
- this.innerAudioContext = uni.createInnerAudioContext();
- this.innerAudioContext.autoplay = true;
- this.innerAudioContext.src = this.recordPath;
- this.innerAudioContext.title = '音频';
- this.onPlay()
- this.onPause()
- this.onCanplay()
- this.onEnded()
- this.onSeeking()
- this.onSeeked()
- this.TimeUpdate()
- },
- // 自动播放下一个文件
- qeihuanwenjian(){
- let index=this.csdFileindex+1;
- if(index<this.luyinList.length){
- this.csdFileindex=index;
- this.getCorpusAnalysis()
- let item=this.luyinList[this.csdFileindex];
- let i=this.csdFileindex;
- this.filechange(item,i)
- }
- },
-
-
-
- formatTime(num) {
- //格式化时间格式
- num = num.toFixed(0);
- let second = num % 60;
- if (second < 10) second = '0' + second;
- let min = Math.floor(num / 60);
- if (min < 10) min = '0' + min;
- return min + ":" + second;
- },
- changeContent(e) {
- this.content = e.detail.value;
- },
- answer(userId, tid) {
- this.answerId = tid;
- this.answerUserId = userId;
- this.editing = true;
- this.textareaFocus = true;
- },
- // 保存评论
- sendComment() {
- if (this.content == "") {
- uni.showToast({
- icon: "none",
- title: "请输入标题"
- })
- return;
- }
- let parames = {
- targetId: this.customerId,
- content: this.content,
- commentType: 1
- };
- if (this.answerUserId) {
- parames.replyCommentId = this.answerId;
- parames.replyUser = this.answerUserId;
- }
- const that = this;
- util.getRequestPromise(config.service.saveCmment, parames, false).then(data => {
- that.getCommentList();
- uni.showToast({
- title: "评论成功",
- icon: "none"
- })
- that.textareaFocus = false;
- that.content = "";
- });
- },
- uploadImage() {
- const that = this;
- var parames = {
- targetId: that.id,
- commentType: 1
- };
- if (this.answerUserId) {
- parames.replyCommentId = this.answerId;
- parames.replyUser = this.answerUserId;
- }
- uni.chooseImage({
- count: 1, //默认9
- sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
- sourceType: ['album', 'camera'],
- success: function(res) {
- uni.showLoading({
- title: "上传中"
- })
- uni.uploadFile({
- url: config.service.saveCmmentUpload,
- filePath: res.tempFilePaths[0],
- name: 'file',
- header: {
- 'Authorization': 'Bearer '+uni.getStorageSync('weapp_session_login_data').token
- },
- formData: parames,
- success: (uploadFileRes) => {
- that.getCommentList();
- uni.hideLoading();
- uni.showToast({
- icon: "none",
- title: "上传成功"
- })
- console.log(uploadFileRes.data);
- }
- });
- }
- });
- },
- uploadAudio() {
-
- },
- changeLike() {
- uni.showLoading({
- title: "请求中",
- mask: true
- })
- if (this.isLiked) {
- this.cancelLike();
- } else {
- this.saveLike();
- }
- },
- // 点赞
- saveLike() {
- const that = this;
- util.getRequestPromise(config.service.saveLike, {
- targetId: this.customerId
- }, false).then(data => {
- that.isLiked = true;
- uni.hideLoading();
- uni.showToast({
- icon: "none",
- title: "点赞成功"
- })
- });
- },
- // 取消点赞
- cancelLike() {
- const that = this;
- util.getRequestPromise(config.service.cancelLike, {
- targetId: this.customerId
- }, false).then(data => {
- that.isLiked = false;
- uni.hideLoading();
- uni.showToast({
- icon: "none",
- title: "取消点赞成功"
- })
- });
- },
- gotoChat() {
- this.scrollId = null;
- this.$nextTick(() => {
- this.scrollId = "hash";
- })
- },
- gotoTop() {
- this.scrollId = null;
- this.$nextTick(() => {
- this.scrollId = "top";
- })
- },
- changeEditing(type) {
- this.editing = type;
- this.answerId = null;
- this.answerUserId = null;
- this.textareaFocus = false;
- this.dialogList.forEach(res=>{
- res.message.forEach(asd=>{
- asd.isshow=false;
- })
- })
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .audio-container {
- width: 100%;
- display: flex;
- justify-content: space-between;
- align-items: center;
-
- .audio-head {
- width: 60rpx;
- height: 60rpx;
- flex-shrink: 0;
- }
-
- .audio-head .image {
- width: 100%;
- height: 100%;
- }
-
- .audio-slider {
- width: 96%;
- position: relative;
- padding: 2px 0rpx 0px 20px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
-
- .audio-slider .slider {
- width: 100%;
- padding: 0px 15rpx;
- box-sizing: border-box;
- }
-
- .audio-time {
- width: 110rpx;
- text-align: right;
- font-size: 24rpx;
- line-height: 28rpx;
- color: #70798D;
- display: flex;
- justify-content: space-between;
- }
-
- .audio-play {
- width: 40rpx;
- height: 40rpx;
- flex-shrink: 0;
- }
-
- .audio-play .image {
- width: 100%;
- height: 100%;
- }
- }
- .biaoqiantom{
- background-color: #008EF2;
- color: #FFFFFF;
- border: none;
- }
- // 表单
- .tian-view{
- width: 570upx;
- background-color: #FFFFFF;
- border-bottom: 1px solid #ededee;
- display: flex;
- min-height: 96rpx;
- .tian-view-t1{
- width: 20rpx;
- font-size: 34rpx;
- height: 34rpx;
- line-height: 110rpx;
- letter-spacing: 0px;
- color: red;
- }
- .tian-view-t2{
- width:30%;
- min-height: 96rpx;
- line-height: 96rpx;
- font-size: 34rpx;
- color: #333;
- }
- .tian-view-t3{
- width: 61%;
- padding-top: 31rpx;
- padding-bottom:31rpx;
- display:flex;
- .tian-input{
- width:98%;
- font-size: 34rpx;
- border: none;
- }
- }
- }
- .zhezhoa {
- position: fixed;
- top: 0;
- left: 0;
- z-index: 999;
- width: 100%;
- height: 100vh;
- opacity: 0.5;
- background-color: #666666;
- }
- .bounced {
- width: 570upx;
- background: #FFFFFF;
- z-index: 1000;
- border-radius: 10upx;
- position: fixed;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- /* 50%为自身尺寸的一半 */
- .jiajinghuatit{
- width: 100%;
- height: 68rpx;
- font-size: 30rpx;
- text-align: center;
- line-height: 68rpx;
- }
- .jiajinghuaview{
- padding: 18rpx 18rpx 18rpx 18rpx;
- display: flex;
- flex-wrap:wrap;
- .jiajinghuaview1{
- padding: 8rpx 8rpx 8rpx 8rpx;
- font-size: 26rpx;
- border-radius: 12rpx;
- border: 1px solid #979797;
- margin-left: 8rpx;
- }
- .jighuaview2{
- padding: 8rpx 8rpx 8rpx 8rpx;
- font-size: 26rpx;
- border-radius: 12rpx;
- border: 1px solid #979797;
- margin-left: 8rpx;
- display: flex;
- .view1-text{
- text-align: center;
- // border-right: 1rpx solid red;
- }
- .view1-img{
- width: 50rpx;
- }
- }
- }
- .bounced3 {
- height: 100upx;
- width: 100%;
- margin-top: 40upx;
- border-top: 1px solid #dddddd;
- display: flex;
- }
-
- .bounced3-1 {
- width: 50%;
- height: 100%;
- text-align: center;
- line-height: 100upx;
- border-right: 1px solid #dddddd;
- font-size: 36upx;
- color: #999999;
- }
-
- .bounced3-2 {
- width: 50%;
- height: 100%;
- text-align: center;
- line-height: 100upx;
- font-size: 36upx;
- color: #108ee9;
- }
- }
- .bosdttom{
- color: #008EF2;
- }
- .tab-box {
- width: 100%;
- display: flex;
- justify-content: center;
- align-items: center;
-
- .yinpinshibie {
- width: 156rpx;
- height: 50rpx;
- font-size: 36rpx;
- font-weight: 400;
- color: #333333;
- text-align: center;
- line-height: 50rpx;
- letter-spacing: 2rpx;
- margin-right: 188rpx;
-
- &.active {
- position: relative;
-
- &::after {
- position: absolute;
- content: '';
- width: 119rpx;
- height: 8rpx;
- background: #008EF2;
- border-radius: 4rpx;
- top: 50rpx;
- right: 0;
- left: 0;
- margin: 0 auto;
- }
- }
- }
-
- .rate {
- width: 156rpx;
- height: 50rpx;
- font-size: 36rpx;
- font-weight: 400;
- color: #333333;
- line-height: 50rpx;
- letter-spacing: 2rpx;
- text-align: center;
-
- &.active {
- position: relative;
-
- &::after {
- position: absolute;
- content: '';
- width: 119rpx;
- height: 8rpx;
- background: #008EF2;
- border-radius: 4rpx;
- top: 50rpx;
- right: 0;
- left: 0;
- margin: 0 auto;
- }
- }
- }
- }
-
- .dialog-block {
- margin: 20rpx 0;
- border-bottom: 1px solid #ccc;
-
- .fileName {
- text-align: center;
- margin: 10rpx auto;
- width: 115rpx;
- height: 42rpx;
- line-height: 42rpx;
- background: #EFEFEF;
- border-radius: 4rpx;
- font-size: 20rpx;
- font-weight: 400;
- color: #333333;
- }
- }
-
- // 评分
- .rate-box {
- padding: 10rpx 20rpx;
-
- .date {
- width: 300rpx;
- height: 33rpx;
- font-size: 24rpx;
- font-weight: 400;
- color: #333333;
- line-height: 33rpx;
- letter-spacing: 1rpx;
- margin-bottom: 8rpx;
- }
-
- .title {
- width: 100%;
- height: 42rpx;
- font-size: 30rpx;
- font-weight: 500;
- color: #333333;
- line-height: 42rpx;
- letter-spacing: 2rpx;
- margin-bottom: 20rpx;
- }
-
- .level1 {
- display: flex;
- align-items: center;
-
- .level-name {
- width: 104rpx;
- height: 33rpx;
- font-size: 24rpx;
- font-weight: 500;
- color: #333333;
- line-height: 33rpx;
- letter-spacing: 1rpx;
- margin-right: 10rpx;
- }
-
- .level-progress {
- flex: 1;
- border-radius: 11rpx;
- height: 21rpx;
- background-color: #BEE4FF;
- position: relative;
-
- .color {
- width: 0;
- position: absolute;
- top: 0;
- left: 0;
- height: 21rpx;
- border-radius: 11rpx 0 0 11rpx;
- background-color: #008EF2;
- }
- }
-
- .level-rate {
- width: 65rpx;
- height: 33rpx;
- font-size: 24rpx;
- font-weight: 500;
- color: #333333;
- line-height: 33rpx;
- letter-spacing: 1rpx;
- margin: 0 20rpx 0 15rpx;
- }
-
- .arrow {
- width: 37rpx;
- height: 21rpx;
- padding: 5rpx 20rpx;
- }
-
- .rotatearrow {
- transform: rotate(270deg);
- }
- }
-
- .level1-subbox {
- display: flex;
- margin-top: 20rpx;
- flex-wrap: wrap;
-
- .sub-name {
- width: 50%;
- display: flex;
- margin-bottom: 18rpx;
-
- .subitem-name {
- width: 104rpx;
- height: 33rpx;
- font-size: 24rpx;
- font-weight: 400;
- color: #999999;
- line-height: 33rpx;
- letter-spacing: 1rpx;
- margin-right: 12rpx;
- }
-
- .checkimg {
- width: 27rpx;
- height: 27rpx;
- }
-
- }
- }
- }
-
- .luyin {
- height: 100rpx;
- width: 100%;
- }
-
- .translation {
- padding-left: 30rpx;
- padding-right: 30rpx;
- background: #FFFFFF;
- display: flex;
- flex-direction: column;
- height: 100vh;
- }
-
- .translation .top {
- margin: 0 -30upx;
- padding: 0 30upx;
- background: #ffffff;
- border-bottom: 1rpx solid #F2F2F2;
- padding-bottom: 10rpx;
- }
-
- .translation .top .title {
- display: flex;
- justify-content: space-between;
-
- .hash {
- color: rgba(21, 144, 233, 1);
- font-size: 24upx;
- }
- }
-
- .call_record_time {
- height: 44rpx;
- font-size: 28rpx;
- font-weight: 600;
- color: #008EF2;
- line-height: 44rpx;
- }
-
- .call_record_time_one {
- height: 48rpx;
- font-size: 24rpx;
- font-weight: 500;
- color: #70798d;
- line-height: 48rpx;
- display: flex;
- justify-content: space-between;
- position: relative;
- .diangweitupian{
- width: 46rpx;
- height: 46rpx;
- // border: 1px solid red;
- position: absolute;
- top: 0rpx;
- right: 75rpx;
- }
- .file-change {
- position: absolute;
- top: 50rpx;
- right: 0rpx;
- width: 184rpx;
- background: #FFFFFF;
- box-shadow: 0rpx 0rpx 6rpx 2rpx rgba(230, 230, 230, 0.5);
- border-radius: 4rpx;
- z-index: 99;
- height: auto;
- max-height: 600rpx;
- overflow: auto;
- }
-
- .file-item {
- width: 184rpx;
- height: 60rpx;
- line-height: 60rpx;
- text-align: center;
- font-size: 30rpx;
- font-weight: 400;
- color: #333333;
- border-bottom: 1rpx solid #E2E2E2;
- }
-
- .file-item:last-child {
- border: 0
- }
-
- .fileactive {
- color: #008EF2
- }
- }
- .dingweishiy{
- position: relative;
- .tankuangcss{
- position: absolute;
- bottom: -50rpx;
- left:0rpx;
- width: 100%;
- // border: 1rpx solid red;
- font-size: 24rpx;
- color: #FFFFFF;
- padding-top: 4rpx;
- padding-bottom:4rpx;
- display: flex;
- justify-content: center;
- border-radius: 15rpx;
- z-index: 1000;
- }
- .biaoqianya{
- width: 631rpx;
- margin: 0 auto;
- position: absolute;
- bottom: -120rpx;
- left:0rpx;
- z-index: 2000;
- color: #FFFFFF;
- .biaoqianyaisshow{
- background-image: url(../../../static/images/biaoqianya.png);
- background-size: 100% 100%;
- text-align: left;
- text-indent: 20rpx;
- }
- }
- }
-
- .scroll-Y {
- font-size: 36upx;
- color: #999999;
- background: #FFFFFF;
- margin-top: 30upx;
- flex: 1;
- overflow-y: scroll;
- width: 100%;
- }
-
- .scroll-Y .text {
- margin: 80upx 30upx;
- line-height: 80upx;
- display: flex;
- align-items: center;
- }
-
- .scroll-Y .text[data-speaker="2"],
- .scroll-Y .text[data-speaker="4"],
- .scroll-Y .text[data-speaker="6"] {
- flex-direction: row-reverse;
- text-align: right;
-
- .content {
- margin-left: 0;
- margin-right: 30upx;
- background: #F6F6F6;
- color: #999999;
- }
- }
-
- .scroll-Y .text .avatar {
- width: 64upx;
- height: 64upx;
- line-height: 64upx;
- text-align: center;
- // border: 1rpx solid red;
- font-size: 36rpx;
- border-radius: 50%;
- background: #F2F2F2;
- color: #008EF2;
- // display: flex;
- // justify-content: center;
- // align-items: center;
- // image {
- // width: 40upx;
- // }
- }
-
- .scroll-Y .text .content {
- margin-left: 30upx;
- line-height: 60rpx;
- text-align: left;
- padding: 0 5px;
- background: #2BC805;
- border-radius: 8upx;
- max-width: 442rpx;
- color: #FFFFFF;
- }
-
- .scroll-Y .text.active .content {
- color: #38FFF1;
- position: relative;
- }
-
- .scroll-Y .text.active[data-speaker="2"] .content,
- .scroll-Y .text.active[data-speaker="4"] .content,
- .scroll-Y .text.active[data-speaker="6"] .content {
- color: #FF7538;
- position: relative;
- }
-
- .likeArea {
- width: 86upx;
- height: 84upx;
- margin: 20upx auto 38upx auto;
- border-radius: 50%;
- display: flex;
- justify-content: center;
- align-items: center;
- border: 1upx solid #C1C2C1;
-
- &.liked {
- border: 1upx solid rgba(21, 144, 233, 1);
- }
-
- image {
- width: 38upx;
- height: 39upx;
- }
- }
-
- .chat {
- display: flex;
- flex-direction: column;
- border-top: 1upx solid rgba(151, 151, 151, 0.4);
- padding-top: 20upx;
-
- .total {
- color: rgba(21, 144, 233, 1);
- font-size: 24upx;
- }
-
- .list {
- display: flex;
- flex-direction: column;
-
- .message {
- display: flex;
- margin-top: 20upx;
-
- border-bottom: 1upx solid rgba(151, 151, 151, 0.4);
- padding-bottom: 20upx;
-
- &:last-child {
- border-bottom: 0;
- }
-
- .avator {
- margin-left: 120upx;
- }
-
- &:first-child {
- .avator {
- margin-left: 0;
- }
- }
-
- .right {
- display: flex;
- flex-direction: column;
- margin-left: 20upx;
- flex: 1;
-
- .name {
- color: rgba(16, 16, 16, 1);
- font-size: 30upx;
- }
-
- .subtitle {
- color: rgba(120, 120, 120, 1);
- font-size: 24upx;
- margin-top: 16upx;
- }
-
- .answer {
- font-size: 24upx;
- color: #787878;
- }
-
- .content {
- color: rgba(49, 48, 48, 1);
- font-size: 30upx;
- margin-top: 20upx;
- position: relative;
- }
-
- .bottom {
- margin-top: 16upx;
- display: flex;
- justify-content: space-between;
-
- .time {
- color: rgba(185, 185, 185, 1);
- font-size: 20upx;
- }
-
- .button {
- color: rgba(144, 144, 144, 1);
- font-size: 30upx;
- width: 111upx;
- height: 44upx;
- border-radius: 22upx;
- border: 1upx solid rgba(151, 151, 151, 1);
- text-align: center;
- }
- }
- }
- }
- }
- }
-
- .bottomArea {
- min-height: 90upx;
- background: #F0F2F5;
- width: 100vw;
- margin: 0 -30rpx;
- display: flex;
- align-items: center;
- border-top: 1upx solid rgba(151, 151, 151, 0.25);
-
- .voice {
- width: 44upx;
- height: 44upx;
- margin-left: 38upx;
- }
-
- .inputArea {
- margin-left: 38upx;
- margin-right: 38upx;
- flex: 1;
- display: flex;
- position: relative;
-
- .edit {
- width: 30upx;
- height: 28upx;
- position: absolute;
- top: 31upx;
- left: 27upx;
- }
-
- .editor {
- background: rgba(0, 139, 245, 0.17);
- border-radius: 29upx;
- flex: 1;
- min-height: 58upx;
- width: unset;
- padding: 0 32upx;
- font-size: 30upx;
- margin: 16rpx 0;
- line-height: 29px;
- }
-
- .placeholder {
- position: absolute;
- left: 70rpx;
- top: 22rpx;
- color: #26A2FF;
-
- &.editing {
- left: 36rpx;
- }
- }
- }
-
- .download {
- width: 41upx;
- height: 35upx;
- margin-right: 36upx;
- }
-
- .like {
- width: 38upx;
- height: 39upx;
- margin-right: 38upx;
- }
-
- .add {
- width: 50upx;
- height: 50upx;
- margin-right: 38upx;
- }
-
- .send {
- background: #1590e9;
- color: white;
- padding: 10rpx 20rpx;
- margin: 5px;
- border-radius: 8rpx;
- }
- }
-
- .backTop {
- width: 60upx;
- height: 60upx;
- background: rgba(211, 235, 253, 1);
- box-shadow: 0upx 0upx 2upx 4upx rgba(38, 161, 255, 0.04);
- border-radius: 50%;
- position: fixed;
- bottom: 200upx;
- right: 8upx;
- display: flex;
- justify-content: center;
- align-items: center;
-
- image {
- width: 26upx;
- height: 34upx;
- }
- }
-
- .voiceContent {
- position: fixed;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- width: 100vw;
- height: 100vh;
- display: flex;
- justify-content: center;
- align-items: center;
- background: rgba(30, 30, 30, 0.4592);
- z-index: 10001;
- }
-
- .box {
- background: rgba(21, 144, 233, 0.299);
- width: 524upx;
- height: 524upx;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
-
- .center {
- width: 412upx;
- height: 412upx;
- background: #1590E9;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
-
- .voice {
- width: 110upx;
- height: 133upx;
- }
-
- .text {
- color: #FFFFFF;
- font-size: 36upx;
- margin-top: 24upx;
- }
- }
- }
- </style>
|