(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-a71cebd6"],{"30c2":function(t,e,i){"use strict";i.r(e);var s=i("85f4"),a=(i("b6c4"),{data:()=>({positionList:[],day:0,hour:0,min:0,form:{id:0,name:"",time:0,price:"",description:"",position_id:"",status:1}}),methods:{submitForm(t){if(this.form.time=24*this.day*60*60+60*this.hour*60+60*this.min,this.form.time<60)return this.$message.error("时间最小为1分钟!"),!1;this.$refs[t].validate(t=>{if(!t)return!1;Object(s.e)({...this.form}).then(t=>{this.$message.success("更新成功!"),setTimeout(()=>this.$router.go(-1),500)}).catch(t=>{this.$message.error("更新失败!")})})},getPositionList(){Object(s.f)({status:1}).then(t=>{this.positionList=t.data})},getPackageDetail(){Object(s.c)({id:this.form.id}).then(t=>{this.form=t.data;var e=this.form.time;this.day=Math.floor(e/86400),e%=86400,this.hour=Math.floor(e/3600),e%=3600,this.min=Math.floor(e/60),e%=60})}},mounted(){this.getPackageDetail(),this.getPositionList()},created(){const t=this.$route.query;this.form.id=t.id}}),r=i("2877"),o=Object(r.a)(a,(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:{placeholder:"天数"},model:{value:t.day,callback:function(e){t.day=e},expression:"day"}}),i("span",{staticClass:"m-r-12"},[t._v("天")]),i("el-input",{staticStyle:{width:"100px"},attrs:{placeholder:"小时"},model:{value:t.hour,callback:function(e){t.hour=e},expression:"hour"}}),i("span",{staticClass:"m-r-12"},[t._v("小时")]),i("el-input",{staticStyle:{width:"100px"},attrs:{placeholder:"分钟"},model:{value:t.min,callback:function(e){t.min=e},expression:"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=o.exports},"6b2d":function(t,e,i){"use strict";var s=i("0613"),a=i("bc3a"),r=i.n(a),o=i("d70b"),n=i("afbc"),c=i("5c96"),l=i("6ddb");const m={baseURL:o.a.baseURL+"/adminapi",headers:{"content-type":"application/json"}},u=(Object(l.g)(()=>(s.a.commit("setToken",""),s.a.commit("setUserInfo",{}),s.a.commit("setPermission",{}),n.b.push("/account/login"),Promise.reject())),r.a.create(m));u.interceptors.request.use(t=>{const e=s.a.getters.token;return e&&(t.headers.token=e),t.headers.version=o.a.version,t},t=>Promise.reject(t)),u.interceptors.response.use(t=>t.data,t=>(Object(c.Message)({type:"error",message:"系统错误，请稍候再试"}),Promise.reject(t))),e.a=u},"85f4":function(t,e,i){"use strict";i.d(e,"a",(function(){return a})),i.d(e,"d",(function(){return r})),i.d(e,"c",(function(){return o})),i.d(e,"e",(function(){return n})),i.d(e,"f",(function(){return c})),i.d(e,"g",(function(){return l})),i.d(e,"b",(function(){return m}));var s=i("6b2d");const a=t=>s.a.post("pin.PinPackage/add",t),r=t=>s.a.get("pin.PinPackage/list",{params:t}),o=t=>s.a.get("pin.PinPackage/detail",{params:t}),n=t=>s.a.post("pin.PinPackage/update",t),c=t=>s.a.get("pin.PinPosition/list",{params:t}),l=t=>s.a.post("pin.PinPosition/update",t),m=t=>s.a.get("pin.PinPackage/del",{params:t})}}]);