(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/mine/subscribe/index"],{"026e":function(t,e,n){"use strict";(function(t,e){var i=n("47a9");n("aa6c");i(n("3240"));var o=i(n("5c6c"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(o.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},"05b1":function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){}));var i=function(){var t=this.$createElement,e=(this._self._c,this.loadEnd?parseInt(this.subscribeCount):null);this.$mp.data=Object.assign({},{$root:{m0:e}})},o=[]},"1cfd":function(t,e,n){"use strict";var i=n("68d1"),o=n.n(i);o.a},"5c6c":function(t,e,n){"use strict";n.r(e);var i=n("05b1"),o=n("7bc1");for(var c in o)["default"].indexOf(c)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(c);n("1cfd");var r=n("828b"),s=Object(r["a"])(o["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],void 0);e["default"]=s.exports},6403:function(t,e,n){"use strict";(function(t){var i=n("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=i(n("7ca3")),c=n("8f59");function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}var s={data:function(){return{loadEnd:!1,titleBarHeight:0,subscribeCount:0}},computed:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){(0,o.default)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},(0,c.mapState)({themeColor:function(t){return t.app.themeColor},subscribeId:function(t){return t.app.subscribeNotifyIds.applet_initiation_admin}})),mounted:function(){var e=t.getSystemInfoSync().statusBarHeight,n=t.getMenuButtonBoundingClientRect();this.titleBarHeight=e+2*(n.top-e)+n.height},onLoad:function(){var e=this;t.showLoading({title:"加载中"}),this.getSubscribe((function(){t.hideLoading(),e.loadEnd=!0}))},onPullDownRefresh:function(){this.getSubscribe((function(){t.stopPullDownRefresh()}))},methods:{getSubscribe:function(e){var n=this;this.$util.request("main.message.count").then((function(i){e&&e(),1==i.code?n.subscribeCount=i.data.subscribe_count:t.showToast({title:i.msg,icon:"none"})})).catch((function(t){e&&e(),console.error("获取订阅数量 ",t)}))},handleSubscribe:function(){var e=this;t.showLoading({title:"加载中",mask:!0}),this.subscribeMessage((function(){e.$util.request("main.message.subscribe").then((function(n){t.hideLoading(),1==n.code?(t.showToast({icon:"success",title:"订阅成功"}),e.getSubscribe()):t.showToast({title:n.msg,icon:"none"})})).catch((function(e){t.hideLoading(),console.error("提交订阅消息 ",e)}))}))},subscribeMessage:function(e){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t.requestSubscribeMessage({tmplIds:this.subscribeId?[this.subscribeId]:[],success:function(i){"accept"==i[n.subscribeId]?e():(t.hideLoading(),t.showToast({icon:"error",title:"订阅失败"}))},fail:function(o){20004==o.errCode?(t.hideLoading(),t.showModal({title:"提示",content:"请前往设置打开接受通知",confirmText:"确定",showCancel:!1})):o.errCode?(t.hideLoading(),t.showModal({title:"提示",content:"消息订阅失败，无法接收到订阅通知，错误码："+o.errCode,confirmText:"确定",showCancel:!1})):++i>3?n.subscribeMessage(e,i):e()}})}}};e.default=s}).call(this,n("df3c")["default"])},"68d1":function(t,e,n){},"7bc1":function(t,e,n){"use strict";n.r(e);var i=n("6403"),o=n.n(i);for(var c in i)["default"].indexOf(c)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(c);e["default"]=o.a}},[["026e","common/runtime","common/vendor"]]]);