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 lines
13 KiB

  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/learning/Thefulltext/index"],{187:function(t,e,i){"use strict";var n;i.d(e,"b",(function(){return o})),i.d(e,"c",(function(){return s})),i.d(e,"a",(function(){return n}));try{n={uIcon:function(){return i.e("uview-ui/components/u-icon/u-icon").then(i.bind(null,584))},uAvatar:function(){return i.e("uview-ui/components/u-avatar/u-avatar").then(i.bind(null,585))}}}catch(a){if(-1===a.message.indexOf("Cannot find module")||-1===a.message.indexOf(".vue"))throw a;console.error(a.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var o=function(){var t=this,e=t.$createElement;t._self._c},s=[];o._withStripped=!0},347:function(t,e,i){"use strict";(function(t){i(3);n(i(2));var e=n(i(348));function n(t){return t&&t.__esModule?t:{default:t}}wx.__webpack_require_UNI_MP_PLUGIN__=i,t(e.default)}).call(this,i(0)["createPage"])},348:function(t,e,i){"use strict";i.r(e);var n=i(187),o=i(82);for(var s in o)"default"!==s&&function(t){i.d(e,t,(function(){return o[t]}))}(s);i(349);var a,r=i(1),u=Object(r["a"])(o["default"],n["b"],n["c"],!1,null,"7d491ad8",null,!1,n["a"],a);u.options.__file="pages/learning/Thefulltext/index.vue",e["default"]=u.exports},349:function(t,e,i){"use strict";var n=i(84),o=i.n(n);o.a},82:function(t,e,i){"use strict";i.r(e);var n=i(83),o=i.n(n);for(var s in n)"default"!==s&&function(t){i.d(e,t,(function(){return n[t]}))}(s);e["default"]=o.a},83:function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;getApp();var n=i(6),o=i(4),s=requirePlugin("WechatSI"),a=s.getRecordRecognitionManager(),r={data:function(){return{dialogList:[],isshowFile:!1,luyinList:[],id:"",customerId:"",message:"",durationTimeStr:"",autoLoad:!0,playNow:0,scrollTop:0,scrollId:"",editing:!1,isLiked:null,createUser:null,commentList:[],content:"",voiceShow:!1,isRecording:!1,answerUserId:null,answerId:null,textareaFocus:!1,myId:t.getStorageSync("weapp_session_userInfo_data").accountId,audioPlay:!1,sliderValue:0,end:!1,sliderMax:0,innerAudioContext:"",currentTimeStr:"00:00",timeStr:"00:00",recordPath:"",csdFileindex:0,date:"",alltimeStr:"00:00",num:0,Bnum:0,status:0,timer:null}},onLoad:function(t){this.customerId=t.customerId,this.getdianzan(),this.getCommentList(),this.getView();var e=this;this.timer=setTimeout((function(){e.addHot()}),3e4)},onShow:function(){this.initRecord();var e=getCurrentPages(),i=e[e.length-1],n=i.data.info;this.innerAudioContext=t.createInnerAudioContext(),this.innerAudioContext.autoplay=!1,this.innerAudioContext.title="音频",this.onPlay(),this.onPause(),this.onCanplay(),this.onEnded(),this.onSeeking(),this.onSeeked(),this.TimeUpdate(),this.getluyinList(n)},destroyed:function(){clearTimeout(this.timer),this.innerAudioContext.destroy()},onUnload:function(){this.innerAudioContext.destroy()},methods:{toKeywordsearch:function(){this.innerAudioContext.destroy(),t.navigateTo({url:"/pages/learning/Keywordsearch?customerId="+this.customerId+"&status="+this.status})},getView:function(){this.$u.get("/addtodigest/addPageviews",{id:this.customerId}).then((function(t){}))},addHot:function(){this.$u.get("/addtodigest/addHeat",{id:this.customerId}).then((function(t){}))},onPlay:function(){var t=this;this.innerAudioContext.onPlay((function(){console.log("播放!"),t.audioPlay=!0,wx.enableAlertBeforeUnload({message:"是否确认退出详情页面?",success:function(t){console.log("方法注册成功:",t)},fail:function(t){console.log("方法注册失败:",t)}})}))},onPause:function(){var t=this;this.innerAudioContext.onPause((function(){wx.disableAlertBeforeUnload({success:function(t){console.log(t)},fail:function(t){console.log(t)}}),console.log("暂停播放!"),t.audioPlay=!1}))},onCanplay:function(){var t=this;this.innerAudioContext.onCanplay((function(e){console.log("缓冲回调",t.innerAudioContext.duration)}))},onEnded:function(){var t=this;this.innerAudioContext.onEnded((function(){console.log("播放结束!"),t.audioPlay=!1,t.qeihuanwenjian()}))},onSeeking:function(){this.innerAudioContext.onSeeking((function(t){console.log("进行跳转",t)}))},onSeeked:function(){var t=this;this.innerAudioContext.onSeeked((function(e){console.log("结束跳转",e),t.$forceUpdate()}))},TimeUpdate:function(){var t=this;this.innerAudioContext.onTimeUpdate((function(){var e=t.innerAudioContext,i=e.currentTime;e.duration;if(t.playNow=parseInt(1e3*i),0==t.dialogList.length);else for(var n=t.dialogList[0].message,o=0;o<n.length;o++)if(Number(n[o].bg)<t.playNow&&Number(n[o].ed)>t.playNow){t.scrollId="dialog"+t.csdFileindex+"text"+o;break}var s=t.formatTime(i);t.sliderValue=parseInt(i),t.currentTimeStr=s,t.sliderMax=t.luyinList[t.csdFileindex].recordDuration,t.$forceUpdate()}))},ltolower:function(){var e=this,i=this.luyinList.length-1;this.num>=i?t.showToast({title:"到底了",duration:2e3}):(this.num=this.num+1,t.showLoading({title:"加载中"}),setTimeout((function(){t.hideLoading()}),2e3),t.request({url:o.service.getCorpusAnalysis+"?corpusId="+this.luyinList[this.num].id+"&customerId="+this.customerId,method:"GET",header:{"content-type":"application/json",Authorization:"Bearer "+t.getStorageSync("weapp_session_login_data").token},success:function(i){if(1e4==i.data.code)if(0==i.data.data.audioContent.length)setTimeout((function(){t.hideLoading()}),2e3);else{var n=JSON.parse(i.data.data.audioContent);e.dialogList.push({message:n}),e.dialogList.forEach((function(t,e){t.message.forEach((function(t,e){t.isshow=!1}))}))}}}))},rolltoupper:function(){var e=this;0!=this.csdFileindex&&0!=this.Bnum?(this.Bnum=this.Bnum-1,t.showLoading({title:"加载中"}),setTimeout((function(){t.hideLoading()}),2e3),t.request({url:o.service.getCorpusAnalysis+"?corpusId="+this.luyinList[this.Bnum].id+"&customerId="+this.customerId,method:"GET",header:{"content-type":"application/json",Authorization:"Bearer "+t.getStorageSync("weapp_session_login_data").token},success:function(i){if(1e4==i.data.code)if(0==i.data.data.audioContent.length)setTimeout((function(){t.hideLoading()}),2e3);else{var n=JSON.parse(i.data.data.audioContent);e.dialogList.unshift({message:n}),e.dialogList.forEach((function(t,e){t.message.forEach((function(t,e){t.isshow=!1}))}))}}})):t.showToast({title:"到头了",duration:2e3})},getdianzan:function(){var e=this;t.request({url:o.service.likegetLike+"?targetId="+this.customerId,method:"GET",header:{"content-type":"application/json",Authorization:"Bearer "+t.getStorageSync("weapp_session_login_data").token},success:function(i){1e4==i.data.code?e.isLiked=i.data.data.like:(t.hideLoading(),t.showModal({title:"提示",content:"请求数据失败,请重新尝试",showCancel:!1}))},fail:function(e){return t.hideLoading(),t.showModal({title:"提示",content:"网络异常,请重新尝试",showCancel:!1}),!1}})},getCommentList:function(){var t=this;n.getRequestPromise(o.service.cmmentList+"?targetId="+this.customerId,{},!1,"GET").then((function(e){var i=e;i.reverse(),t.commentList=i}))},getluyinList:function(t){var e=this;this.sliderMax=0,this.timeStr="00:00";var i={pageNum:1,pageSize:100,query:{customerId:this.customerId}};this.$u.post("/corpus/findByPage",i).then((function(i){if(i&&i.length){var n=1;i.forEach((function(t){n+=t.recordDuration})),e.alltimeStr=e.getTime(n),t?i.forEach((function(n,o){if(n.id==t.id){e.csdFileindex=o,e.recordPath=i[o].recordPath,e.sliderMax=e.getTime(i[o].recordDuration),e.timeStr=e.getTime(i[o].recordDuration),e.date=i[o].receptionTime,e.isshowFile=!1,e.getCorpusAnalysis(t),e.creatAudio();var s=parseInt(t.bg/1e3);e.adasdasdasd(s)}})):(e.recordPath=i[0].recordPath,e.sliderMax=e.getTime(i[0].recordDuration),e.timeStr=e.getTime(i[0].recordDuration),e.date=i[0].receptionTime,e.innerAudioContext.src=e.recordPath,e.changePlayState(),e.luyinList=i,e.getCorpusAnalysis())}}))},adasdasdasd:function(t){var e=this.formatTime(t);this.currentTimeStr=e,this.innerAudioContext.seek(t),this.innerAudioContext.play()},getCorpusAnalysis:function(e){var i=this;this.dialogList=[],t.showLoading({title:"加载中"}),t.request({url:o.service.getCorpusAnalysis+"?corpusId="+this.luyinList[this.csdFileindex].id+"&customerId="+this.customerId,method:"GET",header:{"content-type":"application/json",Authorization:"Bearer "+t.getStorageSync("weapp_session_login_data").token},success:function(e){if(1e4==e.data.code)if(0==e.data.data.audioContent.length)setTimeout((function(){t.hideLoading()}),2e3);else{var n=JSON.parse(e.data.data.audioContent);i.dialogList.push({message:n}),setTimeout((function(){t.hideLoading()}),2e3)}else t.hideLoading(),t.showModal({title:"提示",content:"请求数据失败,请重新尝试",showCancel:!1})},fail:function(e){return t.hideLoading(),t.showModal({title:"提示",content:"网络异常,请重新尝试",showCancel:!1}),!1}})},getTime:function(t){return n.formatSecond(t)},filechange:function(t,e){this.num=e,this.Bnum=e,this.innerAudioContext.destroy(),this.csdFileindex=e,this.recordPath=t.recordPath,this.sliderMax=this.getTime(t.recordDuration),this.timeStr=this.getTime(t.recordDuration),this.date=t.receptionTime,this.isshowFile=!1,this.creatAudio(),this.getCorpusAnalysis()},creatAudio:function(){this.innerAudioContext=t.createInnerAudioContext(),this.innerAudioContext.autoplay=!0,this.innerAudioContext.src=this.recordPath,this.innerAudioContext.title="音频",this.onPlay(),this.onPause(),this.onCanplay(),this.onEnded(),this.onSeeking(),this.onSeeked(),this.TimeUpdate()},qeihuanwenjian:function(){var t=this.csdFileindex+1;if(t<this.luyinList.length){this.csdFileindex=t,this.getCorpusAnalysis();var e=this.luyinList[this.csdFileindex],i=this.csdFileindex;this.filechange(e,i)}},changePlayState:function(){0==this.audioPlay?this.innerAudioContext.play():this.innerAudioContext.pause()},sliderChange:function(){},sliderChangeComplate:function(t){var e=this.formatTime(t.detail.value);this.currentTimeStr=e,this.innerAudioContext.seek(t.detail.value),this.innerAudioContext.play()},formatTime:function(t){t=t.toFixed(0);var e=t%60;e<10&&(e="0"+e);var i=Math.floor(t/60);return i<10&&(i="0"+i),i+":"+e},showFile:function(){this.isshowFile=!this.isshowFile},changeVoiceShow:function(){this.voiceShow=!this.voiceShow},voiceStart:function(){a.start({lang:"zh_CN"})},voiceEnd:function(){this.isRecording&&t.showLoading({title:"识别中"}),this.voiceShow=!1,this.isRecording=!1,a.stop()},initRecord:function(){var e=this;a.onStart=function(t){e.isRecording=!0},a.onRecognize=function(t){console.log("ing"+t.result)},a.onStop=function(i){t.hideLoading();var n=e.content+i.result;n.length>140&&(n=n.substring(0,140)),e.content=n,e.textareaFocus=!0},a.onError=function(e){t.hideLoading()}},changeContent:function(t){this.content=t.detail.value},answer:function(t,e){this.answerId=e,this.answerUserId=t,this.editing=!0,this.textareaFocus=!0},sendComment:function(){if(""!=this.content){var e={targetId:this.customerId,content:this.content,commentType:1};this.answerUserId&&(e.replyCommentId=this.answerId,e.replyUser=this.answerUserId);var i=this;n.getRequestPromise(o.service.saveCmment,e,!1).then((function(e){i.getCommentList(),t.showToast({title:"评论成功",icon:"none"}),i.textareaFocus=!1,i.content=""}))}else t.showToast({icon:"none",title:"请输入标题"})},uploadImage:function(){var e=this,i={targetId:e.id,commentType:1};this.answerUserId&&(i.replyCommentId=this.answerId,i.replyUser=this.answerUserId),t.chooseImage({count:1,sizeType:["original","compressed"],sourceType:["album","camera"],success:function(n){t.showLoading({title:"上传中"}),t.uploadFile({url:o.service.saveCmmentUpload,filePath:n.tempFilePaths[0],name:"file",header:{Authorization:"Bearer "+t.getStorageSync("weapp_session_login_data").token},formData:i,success:function(i){e.getCommentList(),t.hideLoading(),t.showToast({icon:"none",title:"上传成功"}),console.log(i.data)}})}})},uploadAudio:function(){},changeLike:function(){t.showLoading({title:"请求中",mask:!0}),this.isLiked?this.cancelLike():this.saveLike()},saveLike:function(){var e=this;n.getRequestPromise(o.service.saveLike,{targetId:this.customerId},!1).then((function(i){e.isLiked=!0,t.hideLoading(),t.showToast({icon:"none",title:"点赞成功"})}))},cancelLike:function(){var e=this;n.getRequestPromise(o.service.cancelLike,{targetId:this.customerId},!1).then((function(i){e.isLiked=!1,t.hideLoading(),t.showToast({icon:"none",title:"取消点赞成功"})}))},gotoChat:function(){var t=this;this.scrollId=null,this.$nextTick((function(){t.scrollId="hash"}))},gotoTop:function(){var t=this;this.scrollId=null,this.$nextTick((function(){t.scrollId="top"}))},changeEditing:function(t){this.editing=t,this.answerId=null,this.answerUserId=null,this.textareaFocus=!1,this.dialogList.forEach((function(t){t.message.forEach((function(t){t.isshow=!1}))}))}}};e.default=r}).call(this,i(0)["default"])},84:function(t,e,i){}},[[347,"common/runtime","common/vendor"]]]);
  2. //# sourceMappingURL=../../../../.sourcemap/mp-weixin/pages/learning/Thefulltext/index.js.map