(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/activity/detail/index"],{"28a4":function(t,e,i){"use strict";i.r(e);var a=i("c19a"),n=i("31a2");for(var o in n)"default"!==o&&function(t){i.d(e,t,(function(){return n[t]}))}(o);i("79a9");var c,s=i("f0c5"),u=Object(s["a"])(n["default"],a["b"],a["c"],!1,null,null,null,!1,a["a"],c);e["default"]=u.exports},"31a2":function(t,e,i){"use strict";i.r(e);var a=i("5dbf"),n=i.n(a);for(var o in a)"default"!==o&&function(t){i.d(e,t,(function(){return a[t]}))}(o);e["default"]=n.a},"576a":function(t,e,i){"use strict";(function(t){i("0371");a(i("66fd"));var e=a(i("28a4"));function a(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,i("543d")["createPage"])},"5dbf":function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=n(i("f431"));function n(t){return t&&t.__esModule?t:{default:t}}var o=getApp(),c={data:function(){return{activityId:"",activityDetail:{},current:1}},components:{},props:{},onLoad:function(e){var i=t.getStorageSync("activityId");e.id&&(this.setData({activityId:e.id}),this.getDetail()),i&&!e.id&&(console.log("扫码进来"),this.setData({activityId:i}),this.getDetail())},onReady:function(){},onShow:function(){},onHide:function(){},onUnload:function(){},onPullDownRefresh:function(){},onReachBottom:function(){},onShareAppMessage:function(){},methods:{getDetail:function(){var e=this;o.http("GET","activity/activityInfo/"+this.activityId).then((function(i){if(i.data.success){var n=i.data.data;n.time1=a.default.setTime(n.createTime).split(" ")[0],n.time2=a.default.setTime(n.applyStartTime).split(" ")[0],n.time3=a.default.setTime(n.applyEndTime).split(" ")[0],n.time4=a.default.setTime(n.activityEndTime).split(" ")[0],n.flag=n.flag.split(","),n.activityStartTime=a.default.setTime(n.activityStartTime),n.activityEndTime=a.default.setTime(n.activityEndTime),n.applyStartTime=a.default.setTime(n.applyStartTime),n.applyEndTime=a.default.setTime(n.applyEndTime),e.setData({activityDetail:n,current:n.status})}else t.showToast({title:i.data.msg,icon:"none"})}))},openMap:function(){var e=this.activityDetail.latitude,i=this.activityDetail.longitude;t.openLocation({latitude:e,longitude:i,scale:18})},shareClick:function(){t.showShareMenu({withShareTicket:!0,menus:["shareAppMessage","shareTimeline"]})},call:function(){t.makePhoneCall({phoneNumber:this.activityDetail.publisherVo.phone,fail:function(){console.log("取消")}})},collect:function(){var e=this,i={};i.id=this.activityDetail.id,i.type="collect",i.status=!this.activityDetail.collect,""!=t.getStorageSync("userInfo")?this.requestCollect(i):t.getUserProfile({desc:"展示用户信息",success:function(a){console.log(a);var n=a.iv,c=a.encryptedData,s=a.userInfo;t.login({success:function(a){o.http("POST","wxapp/auth",{code:a.code,iv:n,encryptedData:c}).then((function(a){a.data.success?(t.setStorageSync("token","Bearer "+a.data.data.token),t.setStorageSync("userInfo",s),e.requestCollect(i)):t.showToast({title:a.data.msg,icon:"none"})}))}})}})},requestCollect:function(e){var i=this;o.http("POST","activity/collect",e).then((function(e){e.data.success?(t.showToast({title:"操作成功!"}),i.getDetail()):t.showToast({title:e.data.msg,icon:"none"})}))},toSignPage:function(){""!=t.getStorageSync("userInfo")?t.navigateTo({url:"../signIn/index?id="+this.activityId}):this.getUserProfile()},toDescribe:function(){t.navigateTo({url:"../describe/index?id="+this.activityDetail.id})},getUserProfile:function(){var e=this;t.getUserProfile({desc:"展示用户信息",success:function(i){console.log(i);var a=i.iv,n=i.encryptedData,c=i.userInfo;t.login({success:function(i){o.http("POST","wxapp/auth",{code:i.code,iv:a,encryptedData:n}).then((function(i){i.data.success?(t.setStorageSync("token","Bearer "+i.data.data.token),t.setStorageSync("userInfo",c),t.navigateTo({url:"../signIn/index?id="+e.activityId})):t.showToast({title:i.data.msg,icon:"none"})}))}})}})}}};e.default=c}).call(this,i("543d")["default"])},"79a9":function(t,e,i){"use strict";var a=i("9a29"),n=i.n(a);n.a},"9a29":function(t,e,i){},c19a:function(t,e,i){"use strict";var a;i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return o})),i.d(e,"a",(function(){return a}));var n=function(){var t=this,e=t.$createElement;t._self._c},o=[]}},[["576a","common/runtime","common/vendor"]]]);