王总上门按摩后台代码
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.
 
 
 
 
 
shangmenanmo/public/h6/static/js/technician-pages-order-reco...

1 lines
8.0 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["technician-pages-order-recorder"],{"0918":function(e,t,n){"use strict";n.r(t);var r=n("436a"),a=n("516d");for(var i in a)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(i);var o=n("828b"),c=Object(o["a"])(a["default"],r["b"],r["c"],!1,null,"bb5b0fbc",null,!1,r["a"],void 0);t["default"]=c.exports},"436a":function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){}));var r=function(){var e=this.$createElement,t=this._self._c||e;return t("v-uni-view",{staticClass:"recorder"})},a=[]},"516d":function(e,t,n){"use strict";n.r(t);var r=n("9772"),a=n.n(r);for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i);t["default"]=a.a},"749d":function(e,t,n){"use strict";n.r(t);var r=n("bdfa"),a=n.n(r);for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i);t["default"]=a.a},7763:function(e,t,n){"use strict";n.r(t);var r=n("e81e"),a=n("749d");for(var i in a)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(i);var o=n("828b"),c=Object(o["a"])(a["default"],r["b"],r["c"],!1,null,"1744d01b",null,!1,r["a"],void 0);t["default"]=c.exports},9772:function(e,t,n){"use strict";n("6a54"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n("5ef2"),n("bf0f"),n("2797"),n("aa9c"),n("18f7"),n("de6c"),n("dc89"),n("2425"),n("c9b5"),n("ab80"),n("dd2b"),n("e838");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},bdfa:function(e,t,n){"use strict";n("6a54");var r=n("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n("e966");var a=r(n("2634")),i=r(n("2fdc")),o=r(n("9b1b")),c=n("8f59"),s=r(n("0918")),d={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=n,this.initIndex()},onPullDownRefresh:function(){uni.showNavigationBarLoading(),this.initRefresh(),uni.stopPullDownRefresh()},onReachBottom:function(){this.list.current_page>=this.list.last_page||this.loading||(this.param.page=this.param.page+1,this.loading=!0,this.getList())},methods:(0,o.default)((0,o.default)((0,o.default)({},(0,c.mapActions)(["getConfigInfo","getCoachInfo","toPlayAudio"])),(0,c.mapMutations)(["updateUserItem"])),{},{initIndex:function(){var e=arguments,t=this;return(0,i.default)((0,a.default)().mark((function n(){var r,i;return(0,a.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(r=e.length>0&&void 0!==e[0]&&e[0],r||!t.$jweixin.isWechat()){n.next=5;break}return n.next=4,t.$jweixin.initJssdk();case 4:t.$jweixin.wxReady((function(){t.$jweixin.hideOptionMenu()}));case 5:i={id:824,uniacid:666,openid:"oDG4342lxj6wUH73W7pKLzTTvL6w",nickName:"蕭萧",avatarUrl:"https://lbqnyv3.migugu.com/image/666/23/04/ef3f58f161d24baca189988d6a874dff.jpeg",create_time:1673263802,status:1,cap_id:0,city:"",country:"",gender:0,language:"",province:"",balance:94820.65,phone:"18284514093",session_key:"1Q5sSHtzYlhUFD1Y9eFDWw==",pid:824,cash:265.9,unionid:"o3fbU0SmMbQLD4BKPyxcoD1KhAko",app_openid:"oOxoV6NEt8Zl3P6lA7JWLH7NxMNc",web_openid:"oFcA90U0Dy1YtuX91vppB5_LYgio",wechat_openid:"oDG4342lxj6wUH73W7pKLzTTvL6w",last_login_type:0,new_cash:"230.65",lock:153,is_fx:1,ios_openid:"0",push_id:"",alipay_number:"18284514093",alipay_name:"",ip:"222.211.238.65"},"f99e8e0daa9fb6d3575e1a32a4b27c57",t.updateUserItem({key:"isShowLogin",val:!1}),t.updateUserItem({key:"userInfo",val:i}),t.updateUserItem({key:"autograph",val:"f99e8e0daa9fb6d3575e1a32a4b27c57"});case 10:case"end":return n.stop()}}),n)})))()},handlerOnCahnger:function(){this.recorder_status?this.$refs.recorder.stop():this.$refs.recorder.start(),this.recorder_status=!this.recorder_status},handlerOnSave:function(){var e=this;return(0,i.default)((0,a.default)().mark((function t(){var n,r,i,o,c,s;return(0,a.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return console.log("======handlerOnSave"),n=e.recorder.localUrl,r=void 0===n?"":n,i=parseInt((new Date).getTime()/1e3),o="服务过程录音-".concat(i,".mp3"),alert(i),alert(o),t.next=8,e.$api.base.uploadFile({filePath:r,formData:{type:"audio",name:o}});case 8:c=t.sent,s=c.attachment_path,alert(s),e.recorder.url=s;case 12:case"end":return t.stop()}}),t)})))()},handlerSuccess:function(e){console.log(e,"======handlerSuccess"),this.recorder=e},handlerError:function(e){switch(e){case"101":uni.showModal({content:"当前浏览器版本较低,请更换浏览器使用,推荐在微信中打开。"});break;case"201":uni.showModal({content:"麦克风权限被拒绝,请刷新页面后授权麦克风权限。"});break;default:uni.showModal({content:"未知错误,请刷新页面重试"});break}}})};t.default=d},e81e: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("0918").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=[]}}]);