1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-e76e1b18"],{"0e91":function(t,e,o){},47267:function(t,e,o){},"66f0":function(t,e,o){"use strict";o.r(e);var a=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("article-detail",{attrs:{"is-edit":!0}})},s=[],i=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"createPost-container"},[o("el-form",{ref:"postForm",staticClass:"form-container",attrs:{"label-position":t.labelPosition,model:t.postForm,rules:t.rules,"label-width":"120px"}},[o("div",{staticClass:"createPost-main-container"},[o("el-form-item",{attrs:{prop:"zs_hot_line",label:"招商热线"}},[o("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:""},model:{value:t.postForm.zs_hot_line,callback:function(e){t.$set(t.postForm,"zs_hot_line",e)},expression:"postForm.zs_hot_line"}})],1),o("el-form-item",{attrs:{prop:"kf_hot_line",label:"客服热线"}},[o("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:""},model:{value:t.postForm.kf_hot_line,callback:function(e){t.$set(t.postForm,"kf_hot_line",e)},expression:"postForm.kf_hot_line"}})],1),o("el-form-item",{attrs:{prop:"sw_concat",label:"商务合作联系"}},[o("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:""},model:{value:t.postForm.sw_concat,callback:function(e){t.$set(t.postForm,"sw_concat",e)},expression:"postForm.sw_concat"}})],1),o("el-form-item",{attrs:{prop:"zp_mail",label:"招聘邮箱"}},[o("el-input",{staticStyle:{width:"400px"},attrs:{placeholder:""},model:{value:t.postForm.zp_mail,callback:function(e){t.$set(t.postForm,"zp_mail",e)},expression:"postForm.zp_mail"}})],1),o("el-form-item",{attrs:{prop:"address",label:"公司地址"}},[o("el-input",{staticStyle:{width:"600px"},attrs:{placeholder:""},model:{value:t.postForm.address,callback:function(e){t.$set(t.postForm,"address",e)},expression:"postForm.address"}})],1),o("el-form-item",{attrs:{prop:"qq_concat",label:"qq咨询"}},[o("el-input",{staticStyle:{width:"600px"},attrs:{placeholder:""},model:{value:t.postForm.qq_concat,callback:function(e){t.$set(t.postForm,"qq_concat",e)},expression:"postForm.qq_concat"}})],1),o("el-form-item",{attrs:{prop:"kf_wechat",label:"客服微信"}},[o("Upload",{model:{value:t.postForm.kf_wechat,callback:function(e){t.$set(t.postForm,"kf_wechat",e)},expression:"postForm.kf_wechat"}})],1),o("el-form-item",{attrs:{prop:"kf_wechat",label:"新浪二维码"}},[o("Upload",{model:{value:t.postForm.sina_img,callback:function(e){t.$set(t.postForm,"sina_img",e)},expression:"postForm.sina_img"}})],1),o("el-form-item",{attrs:{prop:"kf_wechat",label:"公司微信"}},[o("Upload",{model:{value:t.postForm.wx_img,callback:function(e){t.$set(t.postForm,"wx_img",e)},expression:"postForm.wx_img"}})],1),o("el-row",[t.isEdit?t._e():o("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{type:"success"},on:{click:t.submitForm}},[t._v(" 提交 ")]),t.isEdit?o("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{type:"success"},on:{click:t.updateArticle}},[t._v(" 修改 ")]):t._e()],1)],1)])],1)},l=[],n=o("b775");function r(t){return Object(n["a"])({url:"/setting/read",method:"get",params:{type:t}})}function c(t,e){return Object(n["a"])({url:"/setting/update",method:"post",data:t})}var p=o("70a2"),m={zs_hot_line:"",kf_hot_line:"",sw_concat:"",zp_mail:"",address:"",qq_concat:"",id:"",kf_wechat:"",sina_img:"",wx_img:""},u={name:"ArticleDetail",components:{Upload:p["a"]},props:{isEdit:{type:Boolean,default:!1}},data:function(){return{postForm:Object.assign({},m),loading:!1,userListOptions:[],rules:{},tempRoute:{},labelPosition:"left"}},computed:{contentShortLength:function(){return this.postForm.content_short.length},displayTime:{get:function(){return+new Date(this.postForm.display_time)},set:function(t){this.postForm.display_time=new Date(t)}}},created:function(){this.isEdit&&this.fetchData(),this.tempRoute=Object.assign({},this.$route)},methods:{fetchData:function(){var t=this,e="shop_num";r(e).then((function(e){t.postForm=e.data.info})).catch((function(t){console.log(t)}))},updateArticle:function(){var t=this;this.postForm.type="shop_num",c(this.postForm,"about").then((function(e){t.$notify({title:"修改",message:"修改成功",type:"success",duration:2e3}),t.postForm.status="published",t.loading=!1,t.listLoading=!1}))},draftForm:function(){0!==this.postForm.content.length&&0!==this.postForm.title.length?(this.$message({message:"保存成功",type:"success",showClose:!0,duration:1e3}),this.postForm.status="draft"):this.$message({message:"请填写必要内容",type:"warning"})}}},d=u,h=(o("a2da"),o("2877")),f=Object(h["a"])(d,i,l,!1,null,"72fb9f44",null),g=f.exports,_={name:"EditForm",components:{ArticleDetail:g}},v=_,w=Object(h["a"])(v,a,s,!1,null,null,null);e["default"]=w.exports},"70a2":function(t,e,o){"use strict";var a=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"upload-container"},[o("el-upload",{staticClass:"image-uploader",attrs:{data:t.dataObj,multiple:!1,"show-file-list":!1,"on-success":t.handleImageSuccess,drag:"",action:"#","http-request":t.uploadImage}},[o("i",{staticClass:"el-icon-upload"}),o("div",{staticClass:"el-upload__text"},[t._v(" 将文件拖到此处,或"),o("em",[t._v("点击上传")])])]),o("div",{staticClass:"image-preview"},[o("div",{directives:[{name:"show",rawName:"v-show",value:t.coverImg.length>1,expression:"coverImg.length>1"}],staticClass:"image-preview-wrapper"},[o("img",{attrs:{src:t.coverImg}}),o("div",{staticClass:"image-preview-action"},[o("i",{staticClass:"el-icon-delete",on:{click:t.rmImage}})])])])],1)},s=[],i=o("b775");function l(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object(i["a"])({url:"/upload/upload?uploadWx=".concat(e),method:"post",data:t})}var n={name:"SingleImageUpload3",props:{value:{type:String,default:""},wxUpload:{type:String,default:""}},data:function(){return{tempUrl:"",dataObj:{token:"",key:""},imgUrl:this.value}},computed:{coverImg:function(){return this.value}},methods:{rmImage:function(){this.emitInput("")},emitInput:function(t){this.$emit("input",t)},handleImageSuccess:function(t){this.emitInput(this.imgUrl)},beforeUpload:function(t){var e="image/jpeg"===t.type||"image/jpg",o=t.size/1024/1024<5;return e||this.$message.error("上传文件只能是图片格式!"),o||this.$message.error("上传文件大小不能超过 5MB!"),e&&o},uploadImage:function(t){var e=this;console.log(this.wxUpload),console.log(this.wxUpload.length);var o=new FormData;o.append("image",t.file),l(o,this.wxUpload.length>1).then((function(o){console.log("上传图片成功"),e.imgUrl=o.data.url,e.wxUpload.length>1&&e.$emit("wxMedia",e.wxUpload+"%llz%"+o.data.mediaId),t.onSuccess()})).catch((function(e){console.log("图片上传失败"),t.onError()}))}}},r=n,c=(o("f158"),o("2877")),p=Object(c["a"])(r,a,s,!1,null,"0c37ee6a",null);e["a"]=p.exports},a2da:function(t,e,o){"use strict";var a=o("0e91"),s=o.n(a);s.a},f158:function(t,e,o){"use strict";var a=o("47267"),s=o.n(a);s.a}}]);
|