(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d21f0ca"],{d7bc:function(e,t,o){"use strict";o.r(t);var a=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"app-container"},[o("div",{staticClass:"app-form margin-top"},[o("div",{staticClass:"app-form-group"},[o("div",{staticClass:"app-form-ti"},[e._v("基础配置")]),o("form-generator",{ref:"basicForm",attrs:{"form-config":e.formConfig,"show-footer":!1},scopedSlots:e._u([{key:"lottery_obtain_rule",fn:function(t){var a=t.form;return[o("el-form-item",{attrs:{label:"抽奖次数获取规则"}},[o("el-table",{staticStyle:{"max-width":"600px"},attrs:{data:a.lottery_obtain_rule.consume,border:""}},[o("el-table-column",{attrs:{label:"消费金额",prop:"money"},scopedSlots:e._u([{key:"default",fn:function(t){return[o("el-input",{attrs:{type:"number",placeholder:"请输入消费金额"},model:{value:t.row.money,callback:function(o){e.$set(t.row,"money",o)},expression:"scope.row.money"}})]}}],null,!0)}),o("el-table-column",{attrs:{label:"获得抽奖次数",prop:"num"},scopedSlots:e._u([{key:"default",fn:function(t){return[o("el-input",{attrs:{placeholder:"请输入抽奖次数"},model:{value:t.row.num,callback:function(o){e.$set(t.row,"num",e._n(o))},expression:"scope.row.num"}})]}}],null,!0)}),o("el-table-column",{attrs:{label:"操作",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[o("el-button",{attrs:{type:"danger",size:"mini"},on:{click:function(o){return e.delLotteryObtainRule(t.$index)}}},[e._v("删除")])]}}],null,!0)})],1),o("el-button",{staticClass:"margin-top-sm",attrs:{type:"primary"},on:{click:e.addLotteryObtainRule}},[e._v("添加")])],1)]}}]),model:{value:e.formData,callback:function(t){e.formData=t},expression:"formData"}})],1),1==e.formData.status?o("div",{staticClass:"app-form-group margin-top"},[o("div",{staticClass:"app-form-ti"},[e._v("样式设置")]),o("form-generator",{ref:"styleForm",attrs:{"form-config":e.styleConfig,"show-footer":!0,showCancel:!0,cancelText:"返回"},on:{submit:e.handleBasicSubmit,cancel:e.handleCancel},model:{value:e.formData,callback:function(t){e.formData=t},expression:"formData"}})],1):e._e()])])},l=[],r=o("7f70"),i=(o("792e"),o("e8d6"),o("baf6"),o("3882"),o("8327")),n={name:"LuckywheelSet",data:function(){return{formData:{status:1,lottery_rule:"",bg:"",yp_bg:"",title_image:"",pointer_image:"",lottery_btn_image:"",record_btn_image:"",rule_btn_image:"",popup_image:"",lottery_obtain:[1,2],lottery_method:[1,2],lottery_obtain_rule:{consume:[{money:"",num:""}]}},styleConfig:[{type:"image",label:"标题图片",prop:"title_image",placeholder:"请上传标题图片"},{type:"image",label:"背景",prop:"bg",placeholder:"请上传背景"},{type:"image",label:"转盘背景",prop:"yp_bg",placeholder:"请上传转盘背景"},{type:"image",label:"轮盘指针图片",prop:"pointer_image",placeholder:"请上传指针图片"},{type:"image",label:"抽奖按钮图片",prop:"lottery_btn_image",placeholder:"请上传抽奖按钮图片"},{type:"image",label:"记录按钮图片",prop:"record_btn_image",placeholder:"请上传记录按钮图片"},{type:"image",label:"规则按钮图片",prop:"rule_btn_image",placeholder:"请上传规则按钮图片"},{type:"image",label:"弹窗图片",prop:"popup_image",placeholder:"请上传弹窗图片"}]}},computed:Object(r["a"])(Object(r["a"])({},Object(i["b"])(["config"])),{},{formConfig:function(){var e=[{type:"radio",label:"状态",prop:"status",required:!0,width:"400px",options:[{label:"启用",value:1},{label:"禁用",value:0}]}];return 1==this.formData.status&&(e.push({type:"checkbox",label:"抽奖方式",prop:"lottery_method",multiple:!0,required:!0,width:"400px",options:[{label:"次数抽奖",value:1},{label:"积分抽奖",value:2}]}),this.formData.lottery_method&&this.formData.lottery_method.includes(1)&&e.push({type:"checkbox",label:"抽奖次数获取方式",prop:"lottery_obtain",required:!0,multiple:!0,width:"400px",options:[{label:"购买商品",value:1},{label:"消费金额",value:2}]}),this.formData.lottery_method&&this.formData.lottery_method.includes(2)&&e.push({type:"integer",label:"消耗积分",prop:"lottery_score",prepend:"每次消耗",append:"积分"}),this.formData.lottery_obtain&&this.formData.lottery_obtain.includes(2)&&this.formData.lottery_method&&this.formData.lottery_method.includes(1)&&e.push({type:"custom",label:"抽奖次数获取规则",prop:"lottery_obtain_rule",slot:!0}),e.push({type:"editor",label:"抽奖规则",prop:"lottery_rule",required:!0,placeholder:"请输入抽奖规则"})),e}}),created:function(){this.init()},watch:{config:{handler:function(e){this.init()},deep:!0,immediate:!0}},methods:{init:function(){var e=this.$util.restJson(this.config.luckywheel);e&&(this.formData=e)},handleBasicSubmit:function(e){var t=this;this.api.post("luckywheel/config/set",e).then((function(e){1==e.code?(t.$util.success(e.message),t.$store.dispatch("settings/getSetting")):t.$util.error(e.message)}))},handleCancel:function(){this.$router.back()},addLotteryObtainRule:function(){this.formData.lottery_obtain_rule.consume.push({money:"",num:""})},delLotteryObtainRule:function(e){this.formData.lottery_obtain_rule.consume.splice(e,1)}}},s=n,p=o("3d7a"),u=Object(p["a"])(s,a,l,!1,null,"4f4b0952",null);t["default"]=u.exports}}]);