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.
1 line
8.0 KiB
1 line
8.0 KiB
5 months ago
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["technician-pages-order-recorder"],{"01c3":function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return r}));var r={mumuRecorder:n("2e8c").default},a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("v-uni-view",{staticClass:"order-pages"},[n("v-uni-view",{staticClass:"pd-lg",on:{click:function(t){t.stopPropagation(),arguments[0]=t=e.$handleEvent(t),e.handlerOnCahnger.apply(void 0,arguments)}}},[e._v("H5 录音")]),n("v-uni-view",{staticClass:"pd-lg",on:{click:function(t){t.stopPropagation(),arguments[0]=t=e.$handleEvent(t),e.handlerOnSave.apply(void 0,arguments)}}},[e._v("保存录音文件")]),n("v-uni-view",[e._v(e._s(e.recorder))]),e._v("---------------------------------------------------------------------------------------------------"),e.recorder&&e.recorder.data?n("v-uni-view",[n("v-uni-view",[e._v("data.data ---- "+e._s(e.recorder.data))]),n("v-uni-view",[e._v("data.type---------"+e._s(e.recorder.data.type||"------"))])],1):e._e(),n("mumu-recorder",{ref:"recorder",on:{success:function(t){arguments[0]=t=e.$handleEvent(t),e.handlerSuccess.apply(void 0,arguments)},error:function(t){arguments[0]=t=e.$handleEvent(t),e.handlerError.apply(void 0,arguments)}}})],1)},i=[]},"0814":function(e,t,n){"use strict";n("7a82"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n("c975"),n("d3b7"),n("159b"),n("14d9"),n("3ca3"),n("ddb0"),n("2b3d"),n("9861"),n("d401"),n("25f0"),n("a434"),n("acd8");var r={data:function(){return{isUserMedia:!1,stream:null,audio:null,recorder:null,chunks:[],startTime:0}},mounted:function(){if(-1===origin.indexOf("https"))throw this.$emit("error","100"),"请在 https 环境中使用本插件。";if(!navigator.mediaDevices||!window.MediaRecorder)throw this.$emit("error","101"),"当前浏览器不支持";this.getRecorderManager()},methods:{getRecorderManager:function(){var e=this;this.audio=document.createElement("audio"),navigator.mediaDevices.getUserMedia({audio:!0}).then((function(t){e.isUserMedia=!0,t.getTracks().forEach((function(e){e.stop()}))})).catch((function(t){e.onErrorHandler(t)}))},start:function(){var e=this;if(!this.isUserMedia)return console.log("设备不支持");navigator.mediaDevices.getUserMedia({audio:!0}).then((function(t){e.startTime=(new Date).getTime(),e.stream=t,e.recorder=new MediaRecorder(t),e.recorder.ondataavailable=e.getRecordingData,e.recorder.onstop=e.saveRecordingData,e.recorder.start()})).catch((function(t){e.onErrorHandler(t)}))},stop:function(){this.recorder.stop(),this.stream.getTracks().forEach((function(e){e.stop()}))},getRecordingData:function(e){this.chunks.push(e.data)},saveRecordingData:function(){var e=new Blob(this.chunks,{type:"audio/mpeg"}),t=URL.createObjectURL(e),n=(new Date).getTime(),r=(n-this.startTime).toString().split("");r.splice(r.length-2),r.splice(r.length-1,0,"."),r=parseFloat(r.join(""));var a={data:e,duration:r,localUrl:t};this.$emit("success",a)},onErrorHandler:function(e){if(console.log(e,"========onErrorHandler"),"NotAllowedError"===e.name)throw this.$emit("error","201"),"用户拒绝了当前的浏览器实例的访问请求";if("NotReadableError"===e.name)throw this.$emit("error","101"),"当前浏览器不支持";throw this.$emit("error","500"),"调用失败,原因不详"}},destroyed:function(){this.stop()},clear:function(){}};t.default=r},"1f2d":function(e,t,n){"use strict";n("7a82");var r=n("4ea4").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n("e25e");var a=r(n("c7eb")),i=r(n("1da1")),o=r(n("5530")),c=n("26cb"),s=r(n("2e8c")),u={components:{MumuRecorder:s.default},data:function(){return{options:{},recorder:null,recorder_status:!1}},computed:(0,c.mapState)({primaryColor:function(e){return e.config.configInfo.primaryColor},subColor:function(e){return e.config.configInfo.subColor},configInfo:function(e){return e.config.configInfo},userInfo:function(e){return e.user.userInfo}}),onLoad:function(e){this.options=e;var t=e.tab,n=void 0===t?0:t;this.activeIndex=
|