index.js 5.8 KB

1
  1. require('../../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/goods/lottery/grids/index"],{"1f6b":function(t,e,o){"use strict";(function(t){var a=o("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o("d74d"),r=(o("4818"),o("f8b7")),i=a(o("5c3b")),d=o("8e8a"),s=o("26cb"),c=o("865e"),l=(getApp(),{components:{gridsLottery:function(){Promise.all([o.e("pages/goods/common/vendor"),o.e("pages/goods/components/lottery/index")]).then(function(){return resolve(o("7ff4"))}.bind(null,o)).catch(o.oe)},showBox:function(){o.e("pages/goods/lottery/components/showbox").then(function(){return resolve(o("0f43"))}.bind(null,o)).catch(o.oe)},noticeBar:function(){o.e("pages/goods/lottery/components/noticeBar").then(function(){return resolve(o("62a7"))}.bind(null,o)).catch(o.oe)},lotteryAleart:function(){o.e("pages/goods/components/lotteryAleart/index").then(function(){return resolve(o("8ea2"))}.bind(null,o)).catch(o.oe)},userAddress:function(){Promise.all([o.e("common/vendor"),o.e("pages/goods/components/userAddress/index")]).then(function(){return resolve(o("841c"))}.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("d87d"))}.bind(null,o)).catch(o.oe)},home:function(){Promise.all([o.e("common/vendor"),o.e("components/home/index")]).then(function(){return resolve(o("377d"))}.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:""},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:c.HTTP_REQUEST_URL,isShowAuth:!1,userCount:{}}},computed:(0,s.mapGetters)(["isLogin"]),watch:{isLogin:{handler:function(t,e){t&&this.getLotteryData(this.type)},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,d.toLogin)()},methods:{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,n.getLotteryData)(e).then((function(e){var a=e.data,n=(a.lottery,a.todayCount),r=a.totalCount;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.prize.push({}),o.userCount={today:n,total:r},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,r.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){var a=e.data;t.navigateTo({url:"/pages/goods/lottery/grids/order?luckRecordId=".concat(o.alData.lottery_record_id,"&cartId=").concat(a.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,n.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,n.startLottery)({id:this.id,type:this.type}).then((function(a){if("subscribe"===a.data.code)return o.$set(o,"followCode",!0),void(e.codeSrc=a.data.url);e.prize.forEach((function(o,n){a.data.id===o.id&&(e.alData=a.data,e.lottery_draw_param.winingIndex=n,t(e.lottery_draw_param))}))})).catch((function(t){e.$util.Tips({title:t})}))},luck_draw_finish:function(t){this.aleartType=2,this.aleartStatus=!0},qrR:function(t){this.codeSrc=t}}});e.default=l}).call(this,o("543d")["default"])},"47b8":function(t,e,o){},"4f19":function(t,e,o){"use strict";o.d(e,"b",(function(){return a})),o.d(e,"c",(function(){return n})),o.d(e,"a",(function(){}));var a=function(){var t=this,e=t.$createElement,o=(t._self._c,t.lotteryShow&&t.loading?t.userList.data.length:null),a=t.lotteryShow&&t.loading?t.userList.data.length&&t.is_all_record:null,n=t.lotteryShow&&t.loading?t.myList.data.length&&t.is_personal_record:null;t._isMounted||(t.e0=function(){t.addressModel=!1}),t.$mp.data=Object.assign({},{$root:{g0:o,g1:a,g2:n}})},n=[]},"6c7d":function(t,e,o){"use strict";o.r(e);var a=o("1f6b"),n=o.n(a);for(var r in a)["default"].indexOf(r)<0&&function(t){o.d(e,t,(function(){return a[t]}))}(r);e["default"]=n.a},"6e52":function(t,e,o){"use strict";(function(t,e){var a=o("4ea4");o("59a4");a(o("66fd"));var n=a(o("920a"));t.__webpack_require_UNI_MP_PLUGIN__=o,e(n.default)}).call(this,o("bc2e")["default"],o("543d")["createPage"])},"920a":function(t,e,o){"use strict";o.r(e);var a=o("4f19"),n=o("6c7d");for(var r in n)["default"].indexOf(r)<0&&function(t){o.d(e,t,(function(){return n[t]}))}(r);o("b476");var i=o("f0c5"),d=Object(i["a"])(n["default"],a["b"],a["c"],!1,null,"c46d24b4",null,!1,a["a"],void 0);e["default"]=d.exports},b476:function(t,e,o){"use strict";var a=o("47b8"),n=o.n(a);n.a}},[["6e52","common/runtime","common/vendor","pages/goods/common/vendor"]]]);