(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0c15aa"],{"464f":function(t,e,a){"use strict";a.r(e);var o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-container"},[a("div",{staticClass:"app-form margin-top"},[a("div",{staticClass:"app-form-group"},[a("div",{staticClass:"app-form-ti"},[t._v("基础配置")]),a("form-generator",{ref:"basicForm",attrs:{"form-config":t.formConfig,"show-footer":!0,showCancel:!0,cancelText:"返回"},on:{submit:t.handleBasicSubmit,cancel:t.handleCancel},model:{value:t.formData,callback:function(e){t.formData=e},expression:"formData"}})],1)])])},i=[],s=a("7f70"),r=(a("792e"),a("e8d6"),a("3882"),a("8327")),n={name:"cashlotteryConfigSet",data:function(){return{formData:{status:1,lottery_method:[],lottery_consume_money:0}}},computed:Object(s["a"])(Object(s["a"])({},Object(r["b"])(["config"])),{},{isOpenRewardAd:function(){return!!(this.config&&this.config.incentivead&&this.config.incentivead.status&&1==this.config.incentivead.status)},formConfig:function(){var t=[{type:"radio",label:"状态",prop:"status",required:!0,width:"400px",options:[{label:"启用",value:1},{label:"禁用",value:0}]}];return 1==this.formData.status&&t.push({type:"checkbox",label:"抽奖方式",prop:"lottery_method",required:!0,multiple:!0,width:"400px",options:[{label:"每天抽奖",value:0},{label:"消费金额",value:1}]},{type:"number",label:"消费金额",prop:"lottery_consume_money",required:!(!this.formData.lottery_method||!this.formData.lottery_method.includes(1)),width:"400px",show:!(!this.formData.lottery_method||!this.formData.lottery_method.includes(1))},{type:"radio",label:"观看激励视频广告抽奖",prop:"everyday_lottery_incentivead",required:!(!this.formData.lottery_method||!this.formData.lottery_method.includes(0))&&this.isOpenRewardAd,width:"400px",options:[{label:"启用",value:1},{label:"禁用",value:0}],show:!(!this.formData.lottery_method||!this.formData.lottery_method.includes(0))&&this.isOpenRewardAd}),t}}),created:function(){this.init()},watch:{config:{handler:function(t){this.init()},deep:!0,immediate:!0}},methods:{init:function(){this.config.cashlottery&&(this.formData=this.$util.restJson(this.config.cashlottery),Array.isArray(this.formData.lottery_method)||(this.formData.lottery_method=[]))},handleBasicSubmit:function(t){var e=this;this.api.post("cashlottery/config/set",t).then((function(t){1==t.code?(e.$util.success(t.message),e.$store.dispatch("settings/getSetting")):e.$util.error(t.message)}))},handleCancel:function(){this.$router.back()}}},l=n,c=a("3d7a"),h=Object(c["a"])(l,o,i,!1,null,"0c0da3ff",null);e["default"]=h.exports}}]);