1 line
7.3 KiB
JavaScript
Executable File
1 line
7.3 KiB
JavaScript
Executable File
require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages_promotion/game/smash_eggs"],{"5dd4":function(e,n,t){"use strict";t.r(n);var i=t("892c"),o=t("9e56");for(var u in o)["default"].indexOf(u)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(u);t("a17d"),t("6245");var s=t("828b"),a=Object(s["a"])(o["default"],i["b"],i["c"],!1,null,"2a82fadc",null,!1,i["a"],void 0);n["default"]=a.exports},6245:function(e,n,t){"use strict";var i=t("c7d7"),o=t.n(i);o.a},"71fa":function(e,n,t){"use strict";(function(e){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i={components:{uniPopup:function(){t.e("components/uni-popup/uni-popup").then(function(){return resolve(t("d745"))}.bind(null,t)).catch(t.oe)},LTime:function(){Promise.all([t.e("pages_promotion/common/vendor"),t.e("pages_promotion/components/l-time/l-time")]).then(function(){return resolve(t("7477"))}.bind(null,t)).catch(t.oe)}},data:function(){return{id:0,gameInfo:{no_winning_desc:"",surplus_num:0},result:{is_winning:0,award_type:0,point:0,balance:0,relate_name:""},isClick:!1,eggStatus:0,scrollTimer:null,point:0,animate:!1,shareImg:""}},onLoad:function(n){var t=this;if(setTimeout((function(){t.addonIsExist.egg||(t.$util.showToast({title:"商家未开启砸金蛋",mask:!0,duration:2e3}),setTimeout((function(){t.$util.redirectTo("/pages/index/index")}),2e3))}),1e3),n.id&&(this.id=n.id),n.source_member&&e.setStorageSync("source_member",n.source_member),n.scene){var i=decodeURIComponent(n.scene);i=i.split("&"),i.length&&i.forEach((function(n){-1!=n.indexOf("id")&&(t.id=n.split("-")[1]),-1!=n.indexOf("sku_id")&&(t.skuId=n.split("-")[1]),-1!=n.indexOf("m")&&e.setStorageSync("source_member",n.split("-")[1]),-1!=n.indexOf("is_test")&&e.setStorageSync("is_test",1)}))}this.getGameInfo()},onShow:function(){this.storeToken&&(e.getStorageSync("source_member")&&this.$util.onSourceMember(e.getStorageSync("source_member")),this.getMemberPointInfo())},watch:{storeToken:function(e,n){e&&(this.getMemberPointInfo(),this.getGameInfo())}},onShareAppMessage:function(e){var n=this.gameInfo.game_name,t=this.$util.getCurrentShareRoute(this.memberInfo?this.memberInfo.member_id:0),i=t.path;return{title:n,path:i,imageUrl:"",success:function(e){},fail:function(e){}}},onShareTimeline:function(){var e=this.gameInfo.game_name,n=this.$util.getCurrentShareRoute(this.memberInfo?this.memberInfo.member_id:0),t=n.query;return{title:e,query:t,imageUrl:""}},methods:{getMemberPointInfo:function(){var e=this;this.$api.sendRequest({url:"/api/memberaccount/info",data:{account_type:"point"},success:function(n){n.data&&(e.point=parseInt(n.data.point))}})},lottery:function(){var e=this;this.storeToken?1==this.gameInfo.status&&(this.gameInfo.surplus_num<=0?this.$util.showToast({title:"您的抽奖次数已用完"}):this.gameInfo.points>0&&this.point<this.gameInfo.points?this.$util.showToast({title:"积分不足"}):this.isClick||(this.isClick=!0,this.$api.sendRequest({url:"/egg/api/egg/lottery",data:{id:this.id},success:function(n){n.code>=0?(e.result=n.data,e.start(),e.point-=e.gameInfo.points,e.getGameInfo()):e.$util.showToast({title:n.message})}}))):this.$refs.login.open("/pages_promotion/game/smash_eggs?id="+this.id)},getGameInfo:function(){var e=this;this.$api.sendRequest({url:"/egg/api/egg/info",data:{id:this.id},success:function(n){n.code>=0&&n.data?(e.gameInfo=n.data,e.$refs.loadingCover&&e.$refs.loadingCover.hide(),e.gameInfo.is_show_winner&&e.gameInfo.draw_record.length>6&&(e.scrollTimer=setInterval(e.scrollRecord,2e3))):(e.$util.showToast({title:"未获取到活动信息!"}),setTimeout((function(){e.$util.redirectTo("/pages/index/index")}),1500))},fail:function(n){e.$util.showToast({title:"未获取到活动信息!"}),setTimeout((function(){e.$util.redirectTo("/pages/index/index")}),1500)}})},start:function(){var e=this;this.$refs.transitionPopup.open(),setTimeout((function(){e.eggStatus=1}),1e3),setTimeout((function(){e.eggStatus=2}),3e3),setTimeout((function(){e.$refs.transitionPopup.close(),e.$refs.resultPopup.open()}),3300)},scrollRecord:function(){var e=this;this.animate=!0,setTimeout((function(){e.gameInfo.draw_record.push(e.gameInfo.draw_record[0]),e.gameInfo.draw_record.shift(),e.animate=!1}),1e3)},closePopup:function(){this.isClick=!1,this.eggStatus=0,this.$refs.resultPopup.close()},openRulePopup:function(){this.$refs.rulePopup.open()},closeRulePopup:function(){this.$refs.rulePopup.close()}},filters:{cover:function(e){return"string"==typeof e&&e.length>0?e.substr(0,1)+"******"+e.substr(-1):""}},onHide:function(){clearInterval(this.scrollTimer)}};n.default=i}).call(this,t("df3c")["default"])},"892c":function(e,n,t){"use strict";t.d(n,"b",(function(){return o})),t.d(n,"c",(function(){return u})),t.d(n,"a",(function(){return i}));var i={uniPopup:function(){return t.e("components/uni-popup/uni-popup").then(t.bind(null,"d745"))},loadingCover:function(){return t.e("components/loading-cover/loading-cover").then(t.bind(null,"c003"))},nsLogin:function(){return Promise.all([t.e("common/vendor"),t.e("components/ns-login/ns-login")]).then(t.bind(null,"2910"))},hoverNav:function(){return t.e("components/hover-nav/hover-nav").then(t.bind(null,"c1f1"))}},o=function(){var e=this,n=e.$createElement,t=(e._self._c,e.$util.img("public/uniapp/game/egg_head.png")),i=e.$util.img("public/uniapp/game/golden_eggs.png"),o=e.$util.img("public/uniapp/game/golden_eggs.png"),u=e.$util.img("public/uniapp/game/golden_eggs.png"),s=e.gameInfo.is_show_winner&&e.gameInfo.draw_record.length,a=s?e.__map(e.gameInfo.draw_record,(function(n,t){var i=e.__get_orig(n),o=e._f("cover")(n.member_nick_name);return{$orig:i,f0:o}})):null,r=0==e.eggStatus?e.$util.img("public/uniapp/game/golden_eggs_0.png"):null,l=1==e.eggStatus?e.$util.img("public/uniapp/game/golden_eggs_1.png"):null,g=2==e.eggStatus?e.$util.img("public/uniapp/game/golden_eggs_2.png"):null,c=e.$util.img("public/uniapp/game/hammer.png"),p=e.result.is_winning&&1==e.result.award_type?e.$util.img("public/uniapp/game/point.png"):null,m=e.result.is_winning&&2==e.result.award_type?e.$util.img("public/uniapp/game/balance.png"):null,f=e.result.is_winning&&3==e.result.award_type?e.$util.img("public/uniapp/game/coupon.png"):null,d=e.result.is_winning&&4==e.result.award_type?e.$util.img("public/uniapp/game/gift.png"):null,h=e.result.is_winning?e.$util.img("public/uniapp/game/result_yes.png"):null,_=e.result.is_winning?null:e.$util.img("public/uniapp/game/result_look.png"),b=e.result.is_winning?null:e.$util.img("public/uniapp/game/result_no.png"),$=e.$util.img("public/uniapp/game/rule_head.png"),v=e.$util.timeStampTurnTime(e.gameInfo.start_time),I=e.$util.timeStampTurnTime(e.gameInfo.end_time);e._isMounted||(e.e0=function(n){return e.$util.redirectTo("/pages_promotion/game/record",{id:e.id})}),e.$mp.data=Object.assign({},{$root:{g0:t,g1:i,g2:o,g3:u,g4:s,l0:a,g5:r,g6:l,g7:g,g8:c,g9:p,g10:m,g11:f,g12:d,g13:h,g14:_,g15:b,g16:$,g17:v,g18:I}})},u=[]},"9e56":function(e,n,t){"use strict";t.r(n);var i=t("71fa"),o=t.n(i);for(var u in i)["default"].indexOf(u)<0&&function(e){t.d(n,e,(function(){return i[e]}))}(u);n["default"]=o.a},a17d:function(e,n,t){"use strict";var i=t("c76b"),o=t.n(i);o.a},c76b:function(e,n,t){},c7d7:function(e,n,t){},ec99:function(e,n,t){"use strict";(function(e,n){var i=t("47a9");t("d381");i(t("3240"));var o=i(t("5dd4"));e.__webpack_require_UNI_MP_PLUGIN__=t,n(o.default)}).call(this,t("3223")["default"],t("df3c")["createPage"])}},[["ec99","common/runtime","common/vendor"]]]); |