(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesActivity/index/order"],{"13f6":function(t,e,i){"use strict";var n=i("ce64"),a=i.n(n);a.a},3925:function(t,e,i){"use strict";i.r(e);var n=i("faba"),a=i("e5a6");for(var o in a)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(o);i("13f6");var c=i("828b"),r=Object(c["a"])(a["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],void 0);e["default"]=r.exports},a6dd:function(t,e,i){"use strict";(function(t,e){var n=i("47a9");i("aa6c");n(i("3240"));var a=n(i("3925"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(a.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},ce64:function(t,e,i){},e34f:function(t,e,i){"use strict";(function(t){var n=i("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=n(i("7eb4")),o=n(i("ee10")),c=n(i("7ca3")),r=i("8f59");function s(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function u(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?s(Object(i),!0).forEach((function(e){(0,c.default)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):s(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var f={data:function(){return{loadEnd:!1,activityId:null,activityInfo:{}}},computed:u({},(0,r.mapState)({themeColor:function(t){return t.app.themeColor},subscribeId:function(t){return t.app.subscribeNotifyIds.applet_activity_apply}})),onLoad:function(e){var i=this;this.activityId=e.id,t.showLoading({title:"加载中"}),this.getActivity((function(){i.loadEnd=!0,t.hideLoading()}))},methods:{getActivity:function(e){var i=this;this.$util.request("activity.details",{id:this.activityId}).then((function(n){e&&e(),1==n.code?(i.activityInfo=n.data,i.activityInfo.time_frame=i.getTimeFrame(n.data.start_time,n.data.end_time),i.activityInfo.images?i.activityInfo.image=i.activityInfo.images.split(",")[0]:i.activityInfo.image_list=""):t.showToast({title:n.msg,icon:"none"})})).catch((function(t){console.error("获取活动详情 ",t)}))},getTimeFrame:function(t,e){var i=this.$util.formatDate(t,"object"),n=this.$util.formatDate(e,"object"),a="".concat(String(i.year).slice(2),"/").concat(i.month,"/").concat(i.day," ").concat(i.hours,":").concat(i.minutes),o="".concat(String(n.year).slice(2),"/").concat(n.month,"/").concat(n.day," ").concat(n.hours,":").concat(n.minutes);return a+"~"+o},handleSubmit:function(){var e=this;return(0,o.default)(a.default.mark((function i(){return a.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:t.showLoading({title:"加载中",mask:!0}),e.subscribeMessage((function(){var i={activity_id:e.activityId};1==e.activityInfo.apply_field_state&&(i.data=e.$store.state.app.activityField),e.$util.request("activity.submit",i).then((function(i){1==i.code?i.data?e.onPayment(i.data):t.reLaunch({url:"/pagesActivity/index/success?freeType=1",success:function(){t.hideLoading()}}):t.showToast({title:i.msg,icon:"none",duration:2e3})})).catch((function(t){console.error("活动报名 ",t)}))}));case 2:case"end":return i.stop()}}),i)})))()},onPayment:function(e){t.requestPayment(u(u({provider:"wxpay"},e),{},{success:function(){t.hideLoading(),t.reLaunch({url:"/pagesActivity/index/success"})},fail:function(){t.hideLoading(),t.showToast({title:"支付已取消",icon:"none"})}}))},subscribeMessage:function(e){var i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t.requestSubscribeMessage({tmplIds:this.subscribeId?[this.subscribeId]:[],success:function(){e()},fail:function(a){20004==a.errCode?(t.hideLoading(),t.showModal({title:"提示",content:"请前往设置打开接受通知",confirmColor:i.themeColor,confirmText:"继续报名",success:function(t){t.confirm&&e()}})):a.errCode?(t.hideLoading(),t.showModal({title:"提示",content:"消息订阅失败，无法接收到活动通知，错误码："+a.errCode,confirmColor:i.themeColor,confirmText:"继续报名",success:function(t){t.confirm&&e()}})):++n>3?i.subscribeMessage(e,n):e()}})}}};e.default=f}).call(this,i("df3c")["default"])},e5a6:function(t,e,i){"use strict";i.r(e);var n=i("e34f"),a=i.n(n);for(var o in n)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(o);e["default"]=a.a},faba:function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return a})),i.d(e,"a",(function(){}));var n=function(){var t=this.$createElement,e=(this._self._c,this.loadEnd?parseFloat(this.activityInfo.fees):null),i=this.loadEnd?parseFloat(this.activityInfo.fees):null,n=this.loadEnd?parseFloat(this.activityInfo.fees):null;this.$mp.data=Object.assign({},{$root:{m0:e,m1:i,m2:n}})},a=[]}},[["a6dd","common/runtime","common/vendor"]]]);