(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-70b8"],{"7/LB":function(t,e,s){"use strict";s.r(e);var a={name:"EditAdvertise",components:{AdvertiseDetail:s("jMxe").a}},o=s("KHd+"),i=Object(o.a)(a,function(){var t=this.$createElement;return(this._self._c||t)("advertise-detail",{attrs:{"is-edit":!0}})},[],!1,null,null,null);i.options.__file="edit.vue";e.default=i.exports},HNXI:function(t,e,s){"use strict";s.d(e,"a",function(){return o}),s.d(e,"c",function(){return i}),s.d(e,"b",function(){return n});var a=s("t3Un");function o(t){return Object(a.a)({url:"/api/advertise/create",method:"post",data:t})}function i(t){return Object(a.a)({url:"/api/advertise/list",method:"get",params:t})}function n(t){return Object(a.a)({url:"/api/advertise/edit",method:"get",params:{id:t}})}},JTsr:function(t,e,s){},ZySA:function(t,e,s){"use strict";var a=s("P2sY"),o=s.n(a),i=(s("jUE0"),{bind:function(t,e){t.addEventListener("click",function(s){var a=o()({},e.value),i=o()({ele:t,type:"hit",color:"rgba(0, 0, 0, 0.15)"},a),n=i.ele;if(n){n.style.position="relative",n.style.overflow="hidden";var r=n.getBoundingClientRect(),l=n.querySelector(".waves-ripple");switch(l?l.className="waves-ripple":((l=document.createElement("span")).className="waves-ripple",l.style.height=l.style.width=Math.max(r.width,r.height)+"px",n.appendChild(l)),i.type){case"center":l.style.top=r.height/2-l.offsetHeight/2+"px",l.style.left=r.width/2-l.offsetWidth/2+"px";break;default:l.style.top=(s.pageY-r.top-l.offsetHeight/2-document.documentElement.scrollTop||document.body.scrollTop)+"px",l.style.left=(s.pageX-r.left-l.offsetWidth/2-document.documentElement.scrollLeft||document.body.scrollLeft)+"px"}return l.style.backgroundColor=i.color,l.className="waves-ripple z-active",!1}},!1)}}),n=function(t){t.directive("waves",i)};window.Vue&&(window.waves=i,Vue.use(n)),i.install=n;e.a=i},jMxe:function(t,e,s){"use strict";var a=s("P2sY"),o=s.n(a),i=s("Grqa"),n=s("uARZ"),r=s("9TPh"),l=s("ZySA"),c=s("HNXI"),u={status:"draft",id:"",invitees_num:"",unlocks_num:"",content:"",create_time:"",update_time:""},p={name:"AdvertiseDetail",components:{MDinput:i.a,Sticky:n.a,Dropzone:r.a},directives:{waves:l.a},props:{isEdit:{type:Boolean,default:!1}},data:function(){var t=this,e=function(e,s,a){""===s?(t.$message({message:e.field+"为必传项",type:"error"}),a(new Error(e.field+"为必传项"))):a()};return{postForm:o()({},u),loading:!1,rules:{invitees_num:[{validator:e,trigger:"blur"}],unlocks_num:[{validator:e,trigger:"blur"}],content:[{validator:e,trigger:"blur"}]},tempRoute:{}}},computed:{contentShortLength:function(){return this.postForm.content.length},lang:function(){return this.$store.getters.language}},created:function(){if(this.isEdit){var t=this.$route.params&&this.$route.params.id;this.fetchData(t)}else this.postForm=o()({},u);this.tempRoute=o()({},this.$route)},methods:{fetchData:function(t){var e=this;Object(c.b)(t).then(function(t){e.postForm=t.data.data}).catch(function(t){})},submitForm:function(){var t=this;this.$refs.postForm.validate(function(e){return!!e&&(t.loading=!0,t.postForm.content.length?(Object(c.a)(t.postForm).then(function(e){500===e.data.data.code?t.$notify({title:"失败",message:e.data.data.message,type:"danger",duration:2e3}):(t.$notify({title:"成功",message:e.data.data.message,type:"success",duration:2e3}),setTimeout(function(){t.$router.push("/advertise/list")},1e3))}).catch(function(e){t.$notify({title:"失败",message:"操作失败",type:"danger",duration:2e3})}),t.postForm.status="published",void(t.loading=!1)):(t.$message.error("内容不能为空"),t.loading=!1,!1))})}}},d=(s("vYDr"),s("KHd+")),m=Object(d.a)(p,function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"createPost-container"},[s("el-form",{ref:"postForm",staticClass:"form-container",attrs:{model:t.postForm,rules:t.rules}},[s("sticky",{attrs:{"class-name":"sub-navbar "+t.postForm.status}},[s("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{"margin-left":"10px"},attrs:{type:"success"},on:{click:t.submitForm}},[t._v("保存\n ")])],1),t._v(" "),s("div",{staticClass:"createPost-main-container"},[s("el-row",{attrs:{gutter:20}},[s("el-card",{staticClass:"box-card"},[s("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[s("span",[t._v("邀请文案")])]),t._v(" "),s("el-row",[s("el-col",{attrs:{span:24}},[s("div",{staticClass:"postInfo-container"},[s("el-row",[s("el-col",{attrs:{span:12}},[t.isEdit?s("el-form-item",{staticClass:"postInfo-container-item",attrs:{"label-width":"75px",label:"文案ID:"}},[s("el-input",{staticClass:"article-textarea",staticStyle:{width:"230px"},attrs:{rows:1,type:"number",disabled:""},model:{value:t.postForm.id,callback:function(e){t.$set(t.postForm,"id",e)},expression:"postForm.id"}})],1):t._e()],1),t._v(" "),s("el-col",{attrs:{span:12}},[t.isEdit?s("el-form-item",{staticClass:"postInfo-container-item",attrs:{"label-width":"75px",label:"创建时间:"}},[s("el-input",{staticClass:"article-textarea",staticStyle:{width:"230px"},attrs:{rows:1,type:"text",disabled:""},model:{value:t.postForm.create_time,callback:function(e){t.$set(t.postForm,"create_time",e)},expression:"postForm.create_time"}})],1):t._e(),t._v(" "),t.isEdit?s("el-form-item",{staticClass:"postInfo-container-item",attrs:{"label-width":"75px",label:"更新时间:"}},[s("el-input",{staticClass:"article-textarea",staticStyle:{width:"230px"},attrs:{rows:1,type:"text",disabled:""},model:{value:t.postForm.update_time,callback:function(e){t.$set(t.postForm,"update_time",e)},expression:"postForm.update_time"}})],1):t._e()],1)],1),t._v(" "),s("el-row",[s("el-col",{attrs:{span:12}},[s("el-form-item",{staticClass:"postInfo-container-item",staticStyle:{"margin-bottom":"20px"},attrs:{"label-width":"90px",label:"每次解锁数:",prop:"unlocks_num"}},[s("el-input",{staticStyle:{width:"80%"},attrs:{type:"number"},model:{value:t.postForm.unlocks_num,callback:function(e){t.$set(t.postForm,"unlocks_num",e)},expression:"postForm.unlocks_num"}})],1)],1),t._v(" "),s("el-col",{attrs:{span:12}},[s("el-form-item",{staticClass:"postInfo-container-item",staticStyle:{"margin-bottom":"20px"},attrs:{"label-width":"100px",label:"邀请人数要求:",prop:"invitees_num"}},[s("el-input",{staticStyle:{width:"80%"},attrs:{type:"number"},model:{value:t.postForm.invitees_num,callback:function(e){t.$set(t.postForm,"invitees_num",e)},expression:"postForm.invitees_num"}})],1)],1)],1),t._v(" "),s("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{"label-width":"75px",label:"文案内容:",porp:"content"}},[s("el-input",{staticClass:"article-textarea",attrs:{rows:2,type:"textarea",autosize:"",placeholder:"使用{}替换数字",maxlength:"60"},model:{value:t.postForm.content,callback:function(e){t.$set(t.postForm,"content",e)},expression:"postForm.content"}}),t._v(" "),s("span",{directives:[{name:"show",rawName:"v-show",value:t.contentShortLength,expression:"contentShortLength"}],staticClass:"word-counter"},[t._v(t._s(t.contentShortLength)+"字")])],1)],1)])],1)],1)],1)],1)],1)],1)},[],!1,null,"223d89cc",null);m.options.__file="AdvertiseDetail.vue";e.a=m.exports},jUE0:function(t,e,s){},vYDr:function(t,e,s){"use strict";var a=s("JTsr");s.n(a).a}}]);
-
Davve authorede0995fd5