(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/luckdraw/luckdraw"],{"04fa":function(t,n,e){"use strict";e.r(n);var i=e("8110"),o=e("1652");for(var r in o)"default"!==r&&function(t){e.d(n,t,(function(){return o[t]}))}(r);e("8eb1");var a,s=e("f0c5"),c=Object(s["a"])(o["default"],i["b"],i["c"],!1,null,"48e452a4",null,!1,i["a"],a);n["default"]=c.exports},1652:function(t,n,e){"use strict";e.r(n);var i=e("66be"),o=e.n(i);for(var r in i)"default"!==r&&function(t){e.d(n,t,(function(){return i[t]}))}(r);n["default"]=o.a},"58f8":function(t,n,e){"use strict";(function(t){e("9f3b");i(e("66fd"));var n=i(e("04fa"));function i(t){return t&&t.__esModule?t:{default:t}}t(n.default)}).call(this,e("543d")["createPage"])},"66be":function(t,n,e){"use strict";(function(t){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=e("2f62");function o(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 r(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?o(Object(e),!0).forEach((function(n){a(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):o(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 s={data:function(){return{circleList:24,awardList:[{img:"",name:"谢谢参与",num:0},{img:"/static/supprt/xin.png",name:"5票",num:5},{img:"/static/supprt/xin.png",name:"10票",num:10},{img:"/static/supprt/xin.png",name:"20票",num:20},{img:"/static/supprt/xin.png",name:"50票",num:50},{img:"/static/supprt/xin.png",name:"66票",num:66},{img:"/static/supprt/xin.png",name:"100票",num:100},{img:"/static/supprt/xin.png",name:"188票",num:188}],indexSelect:0,isRunning:!1,dayList:["普通用户每日可有2次抽奖机会","每日零点刷新抽奖机会数量","抽奖次数不累计","每天可邀请4位好友助力，助力成功一次可增加一次抽奖机会"],isLogin:!1,choice:0,isShow:!1,id:""}},computed:r({},(0,i.mapState)(["hasLogin","userInfo"])),onLoad:function(t){this.id=t.id,this.getUserInfo()},onShareAppMessage:function(){if(this.id){var n=t.getStorageSync("userInfo")||"";return{title:"助力抽奖",path:"/pages/support/support?cid="+n.token+"&id="+this.id,imageUrl:"/static/nahan.jpg"}}},methods:{getUserInfo:function(){var t=this;this.hasLogin?this.request({url:this.path+"/api/xyb/star/customerInfo",success:function(n){var e=n.data;t.choice=e.data.chouNum,console.log(e)}}):this.showIsShow()},wxGetUserInfo:function(){var n=this;t.login({provider:"weixin",success:function(e){t.getUserInfo({provider:"weixin",success:function(t){n.request({url:n.path+"/api/xyb/wechat/wxLogin",data:{code:e.code,sex:t.userInfo.gender,head:t.userInfo.avatarUrl,nick:t.userInfo.nickName},success:function(e){var i=e.data;t.userInfo.token=i.data.openid,n.login(t.userInfo),n.hideIsShow()}})}})}})},hideIsShow:function(){this.isShow=!1},showIsShow:function(){this.isShow=!0},showModal:function(){this.isLogin=!0},close:function(){this.isLogin=!1},getRandom:function(t){var n=Math.random()>.5?"2":"1";t=t||3;for(var e=0;e<t;e++)n+=Math.floor(10*Math.random());return Number(n)},addPiao:function(t){var n=this;this.request({url:this.path+"/api/xyb/star/getMuch",data:{typeId:1,much:t},success:function(t){var e=t.data;console.log(e),n.custChoice()}})},custChoice:function(){var t=this;this.request({url:this.path+"/api/xyb/star/customerInfoUpdate",data:{type:0},success:function(n){n.data;console.log("抽奖次数减一"),t.getUserInfo()}})},startDrawing:function(){var n=this;if(this.choice>0){if(!this.isRunning){this.isRunning=!0;var e=0,i=0,o=this.getRandom(3),r=setInterval((function(){++e,e%=8,n.indexSelect=e,i+=40,i>o&&(clearInterval(r),r=null,t.showModal({title:"恭喜您",content:"获得了【"+n.awardList[e].name+"】",confirmColor:"#5677FC",showCancel:!1,success:function(t){t.confirm&&(n.isRunning=!1)},complete:function(){var t=n.awardList[e].num;n.addPiao(t)}}))}),70+i)}}else t.showToast({title:"抽奖次数不足",icon:"none"})}}};n.default=s}).call(this,e("543d")["default"])},8110:function(t,n,e){"use strict";var i,o=function(){var t=this,n=t.$createElement;t._self._c},r=[];e.d(n,"b",(function(){return o})),e.d(n,"c",(function(){return r})),e.d(n,"a",(function(){return i}))},"8eb1":function(t,n,e){"use strict";var i=e("9762"),o=e.n(i);o.a},9762:function(t,n,e){}},[["58f8","common/runtime","common/vendor"]]]);