(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-74d0d27c"],{"90b2":function(t,a,e){"use strict";var s=e("b071"),i=e.n(s);i.a},b071:function(t,a,e){},c6a6:function(t,a,e){"use strict";e.r(a);var s=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("transition",{attrs:{name:"msgbox-fade"}},[t.visible?e("div",{staticClass:"pub-modal-mask pub-scroll-box"},[t.openInfo?e("div",{staticClass:"detail-bg",class:{"is-quantity":t.quantity},on:{touchstart:t.touchstartForH5,touchend:t.touchendForH5}},[e("i",{staticClass:"el-icon-close",on:{click:function(a){t.visible=!1}}}),e("nav",{staticClass:"nav-bar"},[e("i",{staticClass:"el-icon-arrow-left",on:{click:function(a){t.visible=!1}}})]),t.itemUserInfo.cover_photo?e("img",{staticClass:"avatar",attrs:{src:t.itemUserInfo.cover_photo,alt:""}}):e("div",{staticClass:"avatar no-avatar",class:"avatar_bg"+t.info.userId%9},[t._v(t._s(t.itemUserInfo.nick_name&&t.itemUserInfo.nick_name.slice(0,2).toUpperCase()))]),e("span",{staticClass:"name"},[t._v(t._s(t.itemUserInfo.nick_name))]),e("div",{staticClass:"text"},[t._v(t._s(t.info.content.title))]),t.quantity?e("div",{staticClass:"money"},[t._v("\n "+t._s(t.formatNum(t.quantity))+" "),e("em",[t._v(t._s(t.openInfo.tokenType))])]):t._e(),t.quantity?e("p",{staticClass:"state"},[t._v(t._s(t.$t("redPacket.transferTo")))]):t._e(),e("p",{staticClass:"state-num"},[t._v("\n "+t._s(t.$t("redPacket.tip4",{total:t.openInfo.num_total,num:t.openInfo.num_total-t.openInfo.num_left,unit:t.$t("redPacket.unit")}))+"\n ")]),e("ul",{staticClass:"packet-list pub-scroll-box"},t._l(t.openInfo.logs,function(a,s){return e("li",{key:s},[a.cover_photo?e("img",{staticClass:"avatar",attrs:{src:a.cover_photo+"?imageview/0/w/180",alt:""}}):e("div",{staticClass:"avatar no-avatar",class:"avatar_bg"+a.user_id%9},[t._v("\n "+t._s(a.nick_name.slice(0,2).toUpperCase())+"\n ")]),e("div",{staticClass:"content"},[e("div",{staticClass:"top"},[e("span",{staticClass:"user-name"},[t._v(t._s(a.nick_name))]),e("span",{staticClass:"amount"},[t._v(t._s(t.formatNum(a.quantity_int))+" "+t._s(t.openInfo.tokenType))])]),e("div",{staticClass:"bottom"},[e("span",{staticClass:"time"},[t._v(t._s(t.formatTime(a.update_time_int)))]),a.best?e("span",{staticClass:"best"}):t._e()])])])}),0),e("p",{staticClass:"tips"},[t._v(t._s(t.$t("redPacket.tip3")))])]):e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.isLoading,expression:"isLoading"}],staticClass:"packet-bg"},[e("div",{staticClass:"bg"}),e("i",{staticClass:"el-icon-close",on:{click:function(a){t.visible=!1}}}),e("div",{staticClass:"user-info",class:{small:1==t.info.ext.redpack_status}},[t.itemUserInfo.cover_photo?e("img",{staticClass:"avatar",attrs:{src:t.itemUserInfo.cover_photo,alt:""}}):e("div",{staticClass:"avatar no-avatar",class:"avatar_bg"+t.info.userId%9},[t._v(t._s(t.itemUserInfo.nick_name&&t.itemUserInfo.nick_name.slice(0,2).toUpperCase()))]),e("span",{staticClass:"name"},[t._v(t._s(t.itemUserInfo.nick_name))]),0==t.info.ext.redpack_status?e("div",{staticClass:"text"},[t._v(t._s(t.info.content.title))]):t._e()]),0==t.info.ext.redpack_status?e("div",{staticClass:"open-btn",class:{loading:t.isLoading},on:{click:t.openPacket}},[t._v(t._s(t.$t("redPacket.open")))]):1==t.info.ext.redpack_status?e("div",{staticClass:"redpack-tips"},[t._v("\n "+t._s(t.$t("redPacket.noPacketTips"))+"\n ")]):2==t.info.ext.redpack_status?e("div",{staticClass:"redpack-tips"},[t._v("\n "+t._s(t.$t("redPacket.expiredPacketTips"))+"\n ")]):t._e(),t.userId==t.info.userId||1==t.info.ext.redpack_status?e("div",{staticClass:"detail",on:{click:t.showDetail}},[t._v(t._s(t.$t("redPacket.seePacketDetail")))]):t._e()])]):t._e()])},i=[],n=(e("612f"),e("b06f"),e("0da4"),e("3050"),e("03a8")),o=e.n(n),r=(e("7415"),e("3f47")),c=e("5975"),l=e("b322"),d=e.n(l),u=e("52c1"),p=e("33f8"),f=e("50af"),_=e.n(f),m={name:"packetGet",data:function(){return{openInfo:null,isLoading:!1,isHasDetail:!1,meechatType:Object(p["o"])(),startClientX:0,itemUserInfo:{}}},computed:Object(r["a"])({},Object(u["e"])(["userId","account","userInfo","group"]),{trxId:function(){return this.info.content.trxId},quantity:function(){var t=this;if(this.openInfo&&this.openInfo.logs&&this.openInfo.logs.length){var a=this.openInfo.logs,e=a.find(function(a){return a.user_id==t.userId});return e?e.quantity_int:0}return 0},isPrivate:function(){return this.$store.getters.isPrivate}}),methods:{checkCanSend:function(){var t=this.info.content.tokenType.toLowerCase();if(!this.isPrivate&&!this.group.isJoin)return o()({message:this.$t("group.joinTip"),type:"error"}),!1;var a=!0;return"eos"!=t&&"meetone"!=t&&"eth"!=t||(a=this.userInfo.binds.some(function(a){return a.type==t&&a.account}),a||o()({message:this.$t("redPacket.bindForEosTips",{type:t}),type:"error"})),a},openPacket:function(){var t=this;this.checkCanSend()&&(this.isLoading=!0,c["a"].redpack.grabPacket({trx_id:this.trxId}).then(function(a){var e=a.data;-1001===e.code?t.$store.commit("unpdatePacketItem",{type:"redpack_status",trxId:t.trxId,data:1}):(t.openInfo=e.data,t.$store.commit("unpdatePacketItem",{type:"grabbed",trxId:t.trxId,data:1}))}).finally(function(){t.isLoading=!1}))},showDetail:function(){var t=this;c["a"].redpack.grabDetail({trx_id:this.trxId}).then(function(a){var e=a.data;t.visible=!0,t.openInfo=e.data,t.itemUserInfo=t.group.members[e.data.from]||{},"h5"==t.meechatType&&t.initSwipeForH5()})},formatNum:function(t){return d.a.divide(Number(t),1e4)},formatTime:function(t){return _()(t).format("HH:mm")},preHandleOpenInfo:function(t){if(t&&t.logs&&t.logs.length===t.num_total){var a=t.logs[0];t.logs.forEach(function(t){t.quantity_int>a.quantity_int&&(a=t)}),a.best=!0}},touchstartForH5:function(t){"h5"==this.meechatType&&(this.startClientX=t.changedTouches[0].clientX)},touchendForH5:function(t){if("h5"==this.meechatType){var a=t.changedTouches[0].clientX;Math.abs(a-this.startClientX)>60&&(this.visible=!1)}}},created:function(){var t=this;this.isShowDetail?this.showDetail():this.userId?c["a"].redpack.grabDetail({trx_id:this.trxId}).then(function(a){var e=a.data;t.info.userId==t.userId&&t.isPrivate||t.info.ext.grabbed?t.openInfo=e.data:0==e.data.num_left&&t.$store.commit("unpdatePacketItem",{type:"redpack_status",trxId:t.trxId,data:e.data.redpack_status}),t.visible=!0,t.itemUserInfo=t.group.members[e.data.from]||{}}):o()({message:this.$t("public.loginTip"),type:"warning"})}},v=m,h=(e("90b2"),e("17cc")),k=Object(h["a"])(v,s,i,!1,null,"193e18ff",null);a["default"]=k.exports}}]);