(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-7090560a"],{"07d6":function(t,e,i){"use strict";i.r(e);var r=i("85f4"),s={data:()=>({positionList:[],form:{name:"",time:0,day:0,hour:0,min:0,price:"",description:"",position_id:"",status:1}}),methods:{submitForm(t){if(this.form.time=24*this.form.day*60*60+60*this.form.hour*60+60*this.form.min,this.form.time<60)return this.$message.error("时间最小为1分钟!"),!1;this.$refs[t].validate(t=>{if(!t)return!1;Object(r.a)({...this.form}).then(t=>{this.$message.success("新增成功!"),setTimeout(()=>this.$router.go(-1),500)}).catch(t=>{this.$message.error("创建失败!")})})},getPositionList(){Object(r.f)({status:1}).then(t=>{this.positionList=t.data})}},mounted(){this.getPositionList()}},o=i("2877"),a=Object(o.a)(s,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("div",{staticClass:"ls-card"},[i("el-page-header",{attrs:{content:"新建套餐"},on:{back:function(e){return t.$router.go(-1)}}})],1),i("div",{staticClass:"ls-card m-t-16"},[i("div",{staticClass:"card-title"},[t._v("新建套餐")]),i("div",{staticClass:"card-content m-t-24"},[i("el-form",{ref:"ruleForm",attrs:{model:t.form,"label-width":"80px"}},[i("el-form-item",{attrs:{prop:"name",label:"套餐名字"}},[i("el-input",{model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),i("el-form-item",{attrs:{prop:"time",label:"套餐时长"}},[i("el-input",{staticStyle:{width:"100px"},attrs:{type:"number",placeholder:"天数"},model:{value:t.form.day,callback:function(e){t.$set(t.form,"day",e)},expression:"form.day"}}),i("span",{staticClass:"m-r-12"},[t._v("天")]),i("el-input",{staticStyle:{width:"100px"},attrs:{type:"number",placeholder:"小时"},model:{value:t.form.hour,callback:function(e){t.$set(t.form,"hour",e)},expression:"form.hour"}}),i("span",{staticClass:"m-r-12"},[t._v("小时")]),i("el-input",{staticStyle:{width:"100px"},attrs:{type:"number",placeholder:"分钟"},model:{value:t.form.min,callback:function(e){t.$set(t.form,"min",e)},expression:"form.min"}}),i("span",{staticClass:"m-r-12"},[t._v("分钟")])],1),i("el-form-item",{attrs:{prop:"price",label:"套餐价格"}},[i("el-input",{attrs:{type:"number"},model:{value:t.form.price,callback:function(e){t.$set(t.form,"price",e)},expression:"form.price"}})],1),i("el-form-item",{attrs:{prop:"description",label:"套餐描述"}},[i("el-input",{model:{value:t.form.description,callback:function(e){t.$set(t.form,"description",e)},expression:"form.description"}})],1),i("el-form-item",{attrs:{prop:"position_id",required:"",label:"广告位置"}},[i("el-select",{attrs:{placeholder:"请选择"},model:{value:t.form.position_id,callback:function(e){t.$set(t.form,"position_id",e)},expression:"form.position_id"}},t._l(t.positionList,(function(t,e){return i("el-option",{key:"positionList"+e,attrs:{label:t.name,value:t.id}})})),1)],1),i("el-form-item",{attrs:{prop:"status",label:"状态"}},[i("el-switch",{attrs:{"active-value":1,"inactive-value":0},model:{value:t.form.status,callback:function(e){t.$set(t.form,"status",e)},expression:"form.status"}})],1),i("el-form-item",[i("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.submitForm("ruleForm")}}},[t._v("新建")])],1)],1)],1)])])}),[],!1,null,null,null);e.default=a.exports},"85f4":function(t,e,i){"use strict";i.d(e,"a",(function(){return s})),i.d(e,"d",(function(){return o})),i.d(e,"c",(function(){return a})),i.d(e,"e",(function(){return n})),i.d(e,"f",(function(){return l})),i.d(e,"g",(function(){return m})),i.d(e,"b",(function(){return c}));var r=i("6b2d");const s=t=>r.a.post("pin.PinPackage/add",t),o=t=>r.a.get("pin.PinPackage/list",{params:t}),a=t=>r.a.get("pin.PinPackage/detail",{params:t}),n=t=>r.a.post("pin.PinPackage/update",t),l=t=>r.a.get("pin.PinPosition/list",{params:t}),m=t=>r.a.post("pin.PinPosition/update",t),c=t=>r.a.get("pin.PinPackage/del",{params:t})}}]);