(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7cf7404a"],{"55ee":function(t,e,n){},"5ef1":function(t,e,n){"use strict";n("55ee")},b7a0:function(t,e,n){"use strict";n.r(e);var o=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ids-jpush-check"},[e("v-flex",{staticClass:"connect-info",attrs:{xs12:""}},[e("span",[t._v("我的当前连接：")]),e("span",{class:[{"connect-true":"已连接"==t.curConnect}]},[t._v("\n      "+t._s(t.curConnect))])]),e("v-flex",{staticClass:"connect-info",attrs:{xs12:""}},[e("span",[t._v("我的连接总数： "+t._s(t.connectTotal))])]),e("v-flex",{staticClass:"connect-info",attrs:{xs12:""}},[e("v-btn",{attrs:{flat:"",color:"primary"},on:{click:function(e){return t.onGetConnectTotal()}}},[e("v-icon",[t._v("mdi-magnify")]),e("span",[t._v("读取连接总数")])],1),e("v-btn",{attrs:{flat:"",color:"primary",disabled:!t.canClear},on:{click:function(e){return t.onClearAllConnect()}}},[e("v-icon",[t._v("mdi-close-circle")]),e("span",[t._v("清除所有连接，并重新设置当前连接")])],1)],1)],1)},r=[],c=n("2f62"),i=n("897d"),a=n.n(i),s=n("4532"),u=n("c7ac"),l=n("3d20"),f=n.n(l);function m(t){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m(t)}function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?v(Object(n),!0).forEach((function(e){p(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function p(t,e,n){return e=g(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function g(t){var e=b(t,"string");return"symbol"===m(e)?e:String(e)}function b(t,e){if("object"!==m(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!==m(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var C={name:"iDS-JPushCheck",components:{PullTo:a.a},data:function(){return{curConnect:"未连接",connectTotal:0}},computed:{height:function(){return"calc(".concat(window.innerHeight,"px - 48px - ").concat(s["a"].vm.getContentBottomHeight()," ")+")"},canClear:function(){return this.connectTotal>0}},methods:h(h({setTimer:function(){var t=this;this.timer=setInterval((function(){t.getCurConnectState()}),2e3)},getCurConnectState:function(){this.curConnect=u["a"].JPush.g_curConnect?"已连接":"未连接",this.connectTotal=0==this.connectTotal&&u["a"].JPush.g_curConnect?1:this.connectTotal},getConnectTotal:function(){var t=this;this.fetchJpushAliaseRegisterInfo({id:s["a"].vm.getUserId(),authorization:{Authorization:"Bearer "+s["a"].vm.getUserToken()},vm:s["a"].vm}).then((function(){var e=t.getJpushAliaseRegisterInfo(),n=e.registration_ids.length;t.connectTotal=0==n&&u["a"].JPush.g_curConnect?1:n}))},onGetConnectTotal:function(){this.getConnectTotal()},onClearAllConnect:function(){var t=this,e=this;f.a.fire({text:"确定清除所有连接,并重新设置当前连接？",title:"清除",type:"info",showConfirmButton:!0,showCancelButton:!0,confirmButtonText:"确认",cancelButtonText:"取消",allowOutsideClick:!1}).then((function(n){n.value&&e.clearJpushAliaseRegisterInfo({id:s["a"].vm.getUserId(),authorization:{Authorization:"Bearer "+s["a"].vm.getUserToken()},vm:s["a"].vm}).then((function(){u["a"].JPush.g_curConnect=!1,e.curConnect="未连接",t.connectTotal=0,u["a"].JPush.setJPushAlias()}))}))},changeView:function(){s["a"].vm.setTitle("消息通知检测"),s["a"].vm.setBackDisabled(!1),s["a"].vm.setBackIcon("arrow_back"),s["a"].vm.setBottomNavVisible(!1),s["a"].vm.setBottomBtnVisible(!1),s["a"].vm.setMsgInputVisible(!1),s["a"].vm.setContentHeight({value:"calc(".concat(window.innerHeight,"px - 48px ")+")"}),s["a"].vm.setMenuDisabled(!0)}},Object(c["c"])("user",["getJpushAliaseRegisterInfo"])),Object(c["b"])("user",["fetchJpushAliaseRegisterInfo","clearJpushAliaseRegisterInfo"])),created:function(){console.log("调试代码"),null!=s["a"].vm.getUserToken()&&null!=s["a"].vm.getUserId()?(this.getCurConnectState(),this.getConnectTotal(),this.changeView()):window.location.href="/"},mounted:function(){"browser"!==s["a"].vm.getPlatform()&&this.setTimer()},beforeDestroy:function(){s["a"].vm.setMenuDisabled(!0),s["a"].vm.setMenuItems([]),s["a"].vm.setMenuIcon(""),"browser"!==s["a"].vm.getPlatform()&&window.clearInterval(this.timer)}},d=C,y=(n("5ef1"),n("2877")),w=Object(y["a"])(d,o,r,!1,null,null,null);e["default"]=w.exports}}]);