require('../../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/goods/lottery/grids/index"],{"0bf9":function(t,e,o){"use strict";o.d(e,"b",(function(){return n})),o.d(e,"c",(function(){return a})),o.d(e,"a",(function(){}));var n=function(){var t=this.$createElement;this._self._c},a=[]},"141b":function(t,e,o){"use strict";var n=o("2482"),a=o.n(n);a.a},2482:function(t,e,o){},"5d74":function(t,e,o){"use strict";(function(t){var n=o("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=o("bf77"),i=(o("77d7"),n(o("cef6"))),r=o("7ba4"),c=o("ce7e"),d=o("8f59"),l=o("bad7"),s=(getApp(),{components:{template1:function(){o.e("pages/goods/lottery/template/template1").then(function(){return resolve(o("c222"))}.bind(null,o)).catch(o.oe)},template2:function(){o.e("pages/goods/lottery/template/template2").then(function(){return resolve(o("376a"))}.bind(null,o)).catch(o.oe)},gridsLottery:function(){Promise.all([o.e("pages/goods/common/vendor"),o.e("pages/goods/components/lottery/index")]).then(function(){return resolve(o("afe7"))}.bind(null,o)).catch(o.oe)},showBox:function(){o.e("pages/goods/lottery/components/showbox").then(function(){return resolve(o("a195"))}.bind(null,o)).catch(o.oe)},noticeBar:function(){o.e("pages/goods/lottery/components/noticeBar").then(function(){return resolve(o("2fed"))}.bind(null,o)).catch(o.oe)},lotteryAleart:function(){o.e("pages/goods/components/lotteryAleart/index").then(function(){return resolve(o("a3df"))}.bind(null,o)).catch(o.oe)},zbCode:function(){Promise.all([o.e("common/vendor"),o.e("components/zb-code/zb-code")]).then(function(){return resolve(o("dddb"))}.bind(null,o)).catch(o.oe)},emptyPage:function(){o.e("components/emptyPage").then(function(){return resolve(o("bc18"))}.bind(null,o)).catch(o.oe)},home:function(){Promise.all([o.e("common/vendor"),o.e("components/home/index")]).then(function(){return resolve(o("b7a2"))}.bind(null,o)).catch(o.oe)},NavBar:function(){o.e("components/NavBar").then(function(){return resolve(o("5962"))}.bind(null,o)).catch(o.oe)}},mixins:[i.default],data:function(){return{lotteryShow:!0,loading:!1,H5ShareBox:!1,addressModel:!1,lottery_num:0,aleartType:0,aleartStatus:!1,lottery_draw_param:{startIndex:3,totalCount:3,winingIndex:1,speed:100},userList:{type:"user",data:[]},myList:{type:"me",data:[]},htmlData:{type:"html",data:""},prizeData:{type:"prize",data:[]},prize:[],factor_num:0,id:0,alData:{},type:"",followCode:!1,codeShow:!1,cid:"1",ifShow:!0,val:"",lv:3,onval:!0,loadMake:!0,src:"",codeSrc:"",image:"",is_content:0,is_all_record:0,is_personal_record:0,factor:0,imgHost:l.HTTP_REQUEST_URL,isShowAuth:!1,rulesShow:!1,isRotating:!1,lotteryType:0,iconColor:"#FFFFFF",isScrolling:!1}},computed:(0,d.mapGetters)(["isLogin"]),watch:{isLogin:{handler:function(t,e){},deep:!0}},onLoad:function(t){this.type=t.type,this.isLogin&&this.getLotteryData(this.type)},onShow:function(){t.removeStorageSync("form_type_cart"),this.isLogin||(0,r.toLogin)()},onPageScroll:function(t){t.scrollTop>50?(this.iconColor="#333333",this.isScrolling=!0):(this.iconColor="#FFFFFF",this.isScrolling=!1)},methods:{H5Share:function(){this.H5ShareBox=!0},onLoadFun:function(){this.getLotteryData(this.type),this.isShowAuth=!1},authColse:function(t){this.isShowAuth=t},getLotteryData:function(e){var o=this;t.showLoading({title:"获取抽奖信息"}),(0,a.getLotteryData)(e).then((function(e){o.loading=!0,o.factor_num=e.data.lottery.factor_num,o.id=e.data.lottery.id,o.image=e.data.lottery.image,o.prize=e.data.lottery.prize,o.lottery_num=e.data.lottery_num,o.htmlData.data=e.data.lottery.content,o.is_content=e.data.lottery.is_content,o.is_personal_record=e.data.lottery.is_personal_record,o.is_all_record=e.data.lottery.is_all_record,o.factor=e.data.lottery.factor,o.userList.data=e.data.all_record,o.myList.data=e.data.user_record,o.lotteryType=e.data.lottery.type,1==o.lotteryType&&o.prize.push({}),o.prizeData.data=e.data.lottery.prize,t.hideLoading()})).catch((function(e){t.hideLoading(),o.lotteryShow=!1,o.loading=!0,o.$util.Tips({title:e})}))},closeLottery:function(e){var o=this;this.aleartStatus=!1,this.getLotteryData(this.type),6===this.alData.type&&(0,c.postCartAdd)({cartNum:1,new:1,is_new:1,productId:this.alData.product_id,uniqueId:this.alData.unique,luckRecordId:this.alData.lottery_record_id}).then((function(e){t.navigateTo({url:"/pages/goods/order_confirm/index?new=1&luckRecordId=".concat(o.alData.lottery_record_id,"&cartId=").concat(e.data.cartId)})})).catch((function(t){o.$util.Tips({title:"".concat(t,",请联系客服")})}))},getAddress:function(t){var e=this,o=t;o.id=this.alData.lottery_record_id,o.address=t.address.province+t.address.city+t.address.district+t.detail,(0,a.receiveLottery)(o).then((function(t){e.$util.Tips({title:"领取成功"}),e.addressModel=!1})).catch((function(t){e.$util.Tips({title:t})}))},getWiningIndex:function(t){var e=this;this.aleartType=0;var o=this;(0,a.startLottery)({id:this.id,type:this.type}).then((function(n){if("subscribe"===n.data.code)return o.$set(o,"followCode",!0),void(e.codeSrc=n.data.url);e.prize.forEach((function(o,a){n.data.id===o.id&&(e.alData=n.data,e.lottery_draw_param.winingIndex=a,t(e.lottery_draw_param))}))})).catch((function(t){e.$util.Tips({title:t})}))},luck_draw_finish:function(t){this.aleartType=2,this.aleartStatus=!0,this.isRotating=!1},qrR:function(t){this.codeSrc=t},moveHandle:function(){}}});e.default=s}).call(this,o("df3c")["default"])},"84b4":function(t,e,o){"use strict";o.r(e);var n=o("5d74"),a=o.n(n);for(var i in n)["default"].indexOf(i)<0&&function(t){o.d(e,t,(function(){return n[t]}))}(i);e["default"]=a.a},"9d83":function(t,e,o){"use strict";(function(t,e){var n=o("47a9");o("7561");n(o("3240"));var a=n(o("a60f"));t.__webpack_require_UNI_MP_PLUGIN__=o,e(a.default)}).call(this,o("3223")["default"],o("df3c")["createPage"])},a60f:function(t,e,o){"use strict";o.r(e);var n=o("0bf9"),a=o("84b4");for(var i in a)["default"].indexOf(i)<0&&function(t){o.d(e,t,(function(){return a[t]}))}(i);o("141b");var r=o("828b"),c=Object(r["a"])(a["default"],n["b"],n["c"],!1,null,"509db6f8",null,!1,n["a"],void 0);e["default"]=c.exports}},[["9d83","common/runtime","common/vendor","pages/goods/common/vendor"]]]);