index.js 5.1 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/pond/index/index"],{"0108":function(t,n,e){"use strict";e.r(n);var i=e("6b33"),r=e("d581");for(var o in r)"default"!==o&&function(t){e.d(n,t,(function(){return r[t]}))}(o);e("1043");var a,c=e("f0c5"),s=Object(c["a"])(r["default"],i["b"],i["c"],!1,null,"202750ed",null,!1,i["a"],a);n["default"]=s.exports},1043:function(t,n,e){"use strict";var i=e("bce4"),r=e.n(i);r.a},"5ddd":function(t,n,e){"use strict";(function(t){e("8748");i(e("66fd"));var n=i(e("0108"));function i(t){return t&&t.__esModule?t:{default:t}}t(n.default)}).call(this,e("543d")["createPage"])},"6b33":function(t,n,e){"use strict";var i,r=function(){var t=this,n=t.$createElement;t._self._c},o=[];e.d(n,"b",(function(){return r})),e.d(n,"c",(function(){return o})),e.d(n,"a",(function(){return i}))},b88a:function(t,n,e){"use strict";(function(t){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=e("2f62");function r(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,i)}return e}function o(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?r(Object(e),!0).forEach((function(n){a(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):r(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}function a(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var c=function(){e.e("components/page-component/app-share-qr-code-poster/app-share-qr-code-poster").then(function(){return resolve(e("9f9b"))}.bind(null,e)).catch(e.oe)},s={name:"index",components:{appShareQrCodePoster:c},computed:o({},(0,i.mapState)({appImg:function(t){return t.mallConfig.plugin.pond.app_image},userInfo:function(t){return t.user.info}})),data:function(){var t,n,e;return{bout:t,btn:n,animation:e,circleList:[],awardList:[],colorCircleFirst:"#F12416",colorCircleSecond:"#FFFFFF",colorAwardDefault:"#F5F0FC",colorAwardSelect:"#FFE400",indexSelect:0,prizeIndex:0,isRunning:!1,animationData:{},status:0,setting:null,oppty:0,msg:"",name:"",poster:this.$api.pond.poster,shareShow:!1}},onShow:function(){var n=this;n.$showLoading({title:"加载中"}),n.$request({url:this.$api.pond.index}).then((function(e){if(n.$hideLoading(),e.data){n.oppty=e.data.oppty,n.msg=e.msg,n.setting=e.data.setting;for(var i=e.data.list,r=18,o=18,a=0;a<8;a++)0===a?(r=18,o=18):a<3?o=o+196+8:a<5?r=r+158+8:a<7?o=o-196-8:a<8&&(r=r-158-8),i[a].topAward=r+"rpx",i[a].leftAward=o+"rpx";n.awardList=i,n.boutAnimation(),n.btnAnimation()}else t.showToast({title:e.msg,icon:"none"})})).catch((function(t){n.$hideLoading()}))},onShareAppMessage:function(){return this.$shareAppMessage({title:this.$children[0].navigationBarTitle,path:"/plugins/pond/index/index",params:{}})},onHide:function(){clearInterval(this.bout),clearInterval(this.btn)},methods:{home:function(){t.redirectTo({url:"/pages/index/index"})},prize:function(){t.navigateTo({url:"/plugins/pond/prize/prize"})},rules:function(){t.navigateTo({url:"/plugins/pond/rule/rule?rules="+this.setting.rule})},share:function(){this.shareShow=!0},startGame:function(){var n=this;if(!n.isRunning){if(n.msg)return t.showToast({title:n.msg,icon:"none"}),void(n.isRunning=!1);clearInterval(n.btn),n.animation.translate(0,0).step(),n.animationData=n.animation.export(),n.isRunning=!0,n.prizeIndex=0;var e=0,i=n.indexSelect,r=n.awardList,o=setInterval((function(){e+=30,i++,i%=8,n.indexSelect=i,n.prizeIndex>0&&i+1==n.prizeIndex&&(clearInterval(o),n.btnAnimation(),n.isRunning=!1,n.name=r[i].name,n.status=5==r[i].type?1:2)}),200+e);n.$request({url:n.$api.pond.lottery}).then((function(e){0!==e.code?(clearInterval(o),t.showToast({title:e.msg,icon:"none"}),n.isRunning=!1,n.btnAnimation()):r.map((function(t,i,o){t.id==e.data.id&&(console.log(r[i].name),setTimeout((function(){n.prizeIndex=i+1,n.oppty=e.data.oppty,n.msg=e.msg}),2e3))}))})).catch((function(t){clearInterval(o),n.isRunning=!1,n.btnAnimation()}))}},boutAnimation:function(){for(var t=this,n=4,e=4,i=[],r=0;r<24;r++){if(0===r)e=8,n=8;else if(r<6)e=4,n+=110;else if(6===r)e=8,n=660;else if(r<12)e+=92,n=663;else if(12===r)e=545,n=660;else if(r<18)e=550,n-=110;else if(18===r)e=545,n=10;else{if(!(r<24))return;e-=92,n=5}i.push({topCircle:e+"rpx",leftCircle:n+"rpx"})}t.circleList=i,t.bout=setInterval((function(){var n=t.colorCircleFirst;t.colorCircleFirst=t.colorCircleSecond,t.colorCircleSecond=n}),900)},btnAnimation:function(){var n=this,e=t.createAnimation({duration:500,timingFunction:"step-start",delay:0,transformOrigin:"50% 50%"});n.animation=e;var i=!0;n.btn=setInterval((function(){i?(e.translate(0,0).step(),i=!1):(e.translate(0,-3).step(),i=!0),n.animationData=e.export()}),900)},closeActModal:function(){this.status=0}}};n.default=s}).call(this,e("543d")["default"])},bce4:function(t,n,e){},d581:function(t,n,e){"use strict";e.r(n);var i=e("b88a"),r=e.n(i);for(var o in i)"default"!==o&&function(t){e.d(n,t,(function(){return i[t]}))}(o);n["default"]=r.a}},[["5ddd","common/runtime","common/vendor"]]]);