require('../../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/activity/liveRoom/components/prizePop"],{"3cbc":function(t,e,n){},"970b":function(t,e,n){"use strict";var i=n("3cbc"),r=n.n(i);r.a},b0ca:function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return u})),n.d(e,"a",(function(){return i}));var i={uniPopup:function(){return n.e("uni_modules/uni-popup/components/uni-popup/uni-popup").then(n.bind(null,"b29f"))}},r=function(){var t=this.$createElement,e=(this._self._c,this.win&&!this.showPrizeInfo?this.winnerList.length:null),n=this.win||this.showPrizeInfo?null:this.winnerList.length;this.$mp.data=Object.assign({},{$root:{g0:e,g1:n}})},u=[]},b2a7:function(t,e,n){"use strict";n.r(e);var i=n("cd5a"),r=n.n(i);for(var u in i)["default"].indexOf(u)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(u);e["default"]=r.a},b934:function(t,e,n){"use strict";n.r(e);var i=n("b0ca"),r=n("b2a7");for(var u in r)["default"].indexOf(u)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(u);n("970b");var o=n("828b"),s=Object(o["a"])(r["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],void 0);e["default"]=s.exports},cd5a:function(t,e,n){"use strict";var i=n("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=i(n("7ca3")),u=n("4d38"),o=n("7e2d");function s(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}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){(0,r.default)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var a={name:"prizeBox",data:function(){return{imgHost:u.HTTP_REQUEST_URL,win:!1,showPrizeInfo:!0,winnerList:[],prizeSummary:"",currentUid:0,currentRoundId:0,winnerListCache:{},autoCloseTimer:null}},computed:{headerBg:function(){return"url("+u.HTTP_REQUEST_URL+"/statics/images/activity/lucky_pop_bg.png)"},emptyBg:function(){return"url("+u.HTTP_REQUEST_URL+"/statics/images/activity/lucky_header_bg.png)"}},methods:{showPop:function(){this.$refs.prizePopup.open(),this.startAutoCloseTimer()},showResult:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.currentUid=Number(e||0),this.currentRoundId=Number(t.round_id||0);var n=(t.winner_uids||[]).map((function(t){return Number(t)}));this.win=this.currentUid>0&&n.includes(this.currentUid),this.winnerList=this.buildWinnerList(t),this.prizeSummary=t.prize_summary||"",this.showPrizeInfo=!0,this.$refs.prizePopup.open(),this.startAutoCloseTimer(),this.fetchWinnerList(t)},closeModal:function(){this.clearAutoCloseTimer(),this.showPrizeInfo=!0,this.$refs.prizePopup.close()},startAutoCloseTimer:function(){var t=this;this.clearAutoCloseTimer(),this.autoCloseTimer=setTimeout((function(){t.closeModal()}),1e4)},clearAutoCloseTimer:function(){this.autoCloseTimer&&(clearTimeout(this.autoCloseTimer),this.autoCloseTimer=null)},getPrizeUser:function(){this.showPrizeInfo=!1},buildWinnerList:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(e.winner_uids||[]).map((function(t){return Number(t)})),i=Array.isArray(e.winner_list)?e.winner_list:Object.values(e.winner_list||{}),r=i.map((function(e){var n=Number(e.uid||0),i=e.nickname_masked||e.nickname||"用户".concat(n);return c(c({},e),{},{uid:n,nickname:i,nickname_masked:i,is_me:t.currentUid>0&&n===t.currentUid})}));return!r.length&&n.length&&(r=n.map((function(e){return{uid:e,nickname:"用户".concat(e),nickname_masked:"用户".concat(e),avatar:"",is_me:t.currentUid>0&&e===t.currentUid}}))),r},fetchWinnerList:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Number(e.round_id||0);n&&(this.winnerListCache[n]?this.winnerList=this.winnerListCache[n]:(0,o.getLiveLuckyBagWinnerListApi)(n).then((function(e){var i=e&&e.data||{},r=Array.isArray(i.list)?i.list:[],u=r.map((function(e){var n=Number(e.uid||0),i=e.nickname_masked||e.nickname||"用户".concat(n);return c(c({},e),{},{uid:n,nickname:i,nickname_masked:i,is_me:t.currentUid>0&&n===t.currentUid})}));t.$set(t.winnerListCache,n,u),n===t.currentRoundId&&u.length&&(t.winnerList=u)})).catch((function(){})))}},beforeDestroy:function(){this.clearAutoCloseTimer()}};e.default=a}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    'pages/activity/liveRoom/components/prizePop-create-component',
    {
        'pages/activity/liveRoom/components/prizePop-create-component':(function(module, exports, __webpack_require__){
            __webpack_require__('df3c')['createComponent'](__webpack_require__("b934"))
        })
    },
    [['pages/activity/liveRoom/components/prizePop-create-component']]
]);
