| 1 |
- require('../../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages_basics/views/earlyWarningManage/videoMonitoring"],{"010d":function(t,e,n){"use strict";n.r(e);var o=n("ca5d"),a=n.n(o);for(var r in o)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(r);e["default"]=a.a},7586:function(t,e,n){},a7c5:function(t,e,n){"use strict";var o=n("7586"),a=n.n(o);a.a},c5f7:function(t,e,n){"use strict";(function(t,e){var o=n("47a9");n("e7a6");o(n("3240"));var a=o(n("d108"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(a.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},ca5d:function(t,e,n){"use strict";(function(t,o){var a=n("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=a(n("7eb4")),i=a(n("ee10")),s=n("f414"),c=n("a831"),u={name:"rectifyList",components:{},data:function(){return{videoCover:t.getStorageSync("videoCover"),tabTextTow:[{name:"RFID摄像头"},{name:"房间内监控1"},{name:"房间内监控2"},{name:"房间内监控3"},{name:"房间内监控3"},{name:"房间内监控3"}],curTabTow:0,urlList:[{}],videoHardwareNUM:[],trumpetList:[],liveType:!1,sendLock:!0,recorderManager:o.getRecorderManager(),videoHardwareList:[],hardwareList:[],subId:"",floorId:""}},onLoad:function(t){(t.subId||t.floorId)&&(this.subId=t.subId,this.floorId=t.floorId)},onShow:function(){},mounted:function(){this.getDeviceList(),this.GetVideoList()},methods:{tabClickTow:function(t,e){this.curTabTow=e,console.log(t)},scrollGet:function(){},videoErrorCallback:function(t){console.log("播放失败",t)},GetVideoList:function(){var e=this;return(0,i.default)(r.default.mark((function n(){var o,a,i,s,c,u,l,d,f;return r.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return o={page:"1",count:"10",deviceIds:e.itemData.hardwareNUM},n.next=3,GetStartList(o);case 3:if(a=n.sent,i=a.data,200==i.code){for(s=[],c=0;c<i.data.length;c++)u=t.getStorageSync("cameraUrl"),l=i.data[c].hls,l=l.split("rtp/"),d=u+"rtp/"+l[1],f={id:i.data[c].deviceID,url:d},s.push(f),console.log("obj",f);e.urlList=s}case 6:case"end":return n.stop()}}),n)})))()},getDeviceList:function(){var t=this;return(0,i.default)(r.default.mark((function e(){var n,o,a,i;return r.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n={subId:t.subId,floorId:t.floorId},e.next=3,(0,c.iotAppSpeakerFindHorn)(n);case 3:if(o=e.sent,a=o.data,200==a.code){for(i=0;i<a.data.length;i++)a.data[i].type=!1;t.$set(t,"trumpetList",a.data)}case 6:case"end":return e.stop()}}),e)})))()},trumpetClick:function(t){this.trumpetList[t].type=!this.trumpetList[t].type},recordButton:function(e){console.log("按下");for(var n=0,a=0;a<this.trumpetList.length;a++)this.trumpetList[a].type&&n++;if(0!=n){this.liveType=!0,console.log("录制",e),this.startPoint=e.touches[0];this.recorderManager.start({duration:1e4,sampleRate:16e3,numberOfChannels:1,encodeBitRate:48e3,format:"mp3",frameSize:50}),this.recorderManager.onStart((function(){console.log("recorder start")})),this.recorderManager.onError((function(t){console.log(t)})),o.showToast({title:"正在录音,上划取消发送",icon:"none",duration:6e4}),this.sendLock=!1}else t.showToast({title:"请选择喇叭",icon:"none",mask:!0,duration:2e3})},cancelButton:function(t){console.log("移动");for(var e=0,n=0;n<this.trumpetList.length;n++)this.trumpetList[n].type&&e++;if(0!=e){this.liveType=!1,console.log("取消",t);var a=t.touches[t.touches.length-1].clientY-this.startPoint.clientY;Math.abs(a)>50?(o.showToast({title:"松开手指,取消发送",icon:"none",duration:6e4}),this.sendLock=!0):(o.showToast({title:"正在录音,上划取消发送",icon:"none",duration:6e4}),this.sendLock=!1)}},sendButton:function(t){var e=this;console.log("松开");for(var n=0,a=0;a<this.trumpetList.length;a++)this.trumpetList[a].type&&n++;0!=n&&(this.liveType=!1,console.log("发送",t),o.hideToast(),this.recorderManager.stop(),this.recorderManager.onStop((function(t){e.sendLock||(console.log("1",e.recorderManager),e.uploadImg(t.tempFilePath)),console.log("停止录音",t.tempFilePath),console.log("sendLock",e.sendLock)})))},uploadImg:function(e){var n=this;return(0,i.default)(r.default.mark((function o(){var a;return r.default.wrap((function(o){while(1)switch(o.prev=o.next){case 0:a=n,t.uploadFile({url:s.config.base_url+"/system/file/upload",header:{Authorization:t.getStorageSync("token")},filePath:e,name:"file",formData:{user:"test"},success:function(e){var n=JSON.parse(e.data);if(200==n.code){console.log("上传成功",n);var o="http://"+t.getStorageSync("mqttIntranetUrl").split(":")[0]+"/"+n.data.url;a.iotAppSpeakerPlayVoice(o)}else t.showToast({title:n.msg,icon:"none",mask:!0,duration:2e3})},fail:function(e){t.hideLoading()},complete:function(){}});case 2:case"end":return o.stop()}}),o)})))()},iotAppSpeakerPlayVoice:function(e){var n=this;return(0,i.default)(r.default.mark((function o(){var a,i,s,u,l,d;return r.default.wrap((function(o){while(1)switch(o.prev=o.next){case 0:for(a=n,i=[],s=0;s<a.trumpetList.length;s++)a.trumpetList[s].type&&i.push(a.trumpetList[s].deviceNo);return u={deviceNo:i.join(","),voiceUrls:e,cycle:1,level:1e3},o.next=6,(0,c.iotAppSpeakerPlayVoice)(u);case 6:l=o.sent,d=l.data,200==d.code&&t.showToast({title:"发送成功",icon:"none",mask:!0,duration:2e3});case 9:case"end":return o.stop()}}),o)})))()},handleClick:function(t,e){}}};e.default=u}).call(this,n("df3c")["default"],n("3223")["default"])},d108:function(t,e,n){"use strict";n.r(e);var o=n("ee22"),a=n("010d");for(var r in a)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(r);n("a7c5");var i=n("828b"),s=Object(i["a"])(a["default"],o["b"],o["c"],!1,null,"226ca880",null,!1,o["a"],void 0);e["default"]=s.exports},ee22:function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){}));var o=function(){var t=this,e=t.$createElement,n=(t._self._c,t.__map(t.trumpetList,(function(e,n){var o=t.__get_orig(e),a=e.type?null:t.imagesUrl("commonality/icon_sskz_zc.png"),r=e.type?t.imagesUrl("commonality/icon_sskz_xz.png"):null;return{$orig:o,m0:a,m1:r}})));t.$mp.data=Object.assign({},{$root:{l0:n}})},a=[]}},[["c5f7","common/runtime","common/vendor"]]]);
|