Commit 93015ed2 authored by zhanglu's avatar zhanglu

Merge branch 'fix/gender' into 'master'

Fix/gender

See merge request alpha/sun!26
parents b125bb9d 7bf3e49d
This diff is collapsed.
.upload-container[data-v-54c5d4d6]{width:100%;position:relative}.upload-container[data-v-54c5d4d6]:after{content:"";display:table;clear:both}.upload-container .image-uploader[data-v-54c5d4d6]{width:35%;float:left}.upload-container .image-preview[data-v-54c5d4d6]{width:200px;height:200px;position:relative;border:1px dashed #d9d9d9;float:left;margin-left:50px}.upload-container .image-preview .image-preview-wrapper[data-v-54c5d4d6]{position:relative;width:100%;height:100%}.upload-container .image-preview .image-preview-wrapper img[data-v-54c5d4d6]{width:100%;height:100%}.upload-container .image-preview .image-preview-action[data-v-54c5d4d6]{position:absolute;width:100%;height:100%;left:0;top:0;cursor:default;color:#fff;opacity:0;font-size:20px;background-color:rgba(0,0,0,.5);-webkit-transition:opacity .3s;transition:opacity .3s;cursor:pointer;text-align:center;line-height:200px}.upload-container .image-preview .image-preview-action .el-icon-delete[data-v-54c5d4d6]{font-size:36px}.upload-container .image-preview:hover .image-preview-action[data-v-54c5d4d6]{opacity:1}.upload-container .image-app-preview[data-v-54c5d4d6]{width:320px;height:180px;position:relative;border:1px dashed #d9d9d9;float:left;margin-left:50px}.upload-container .image-app-preview .app-fake-conver[data-v-54c5d4d6]{height:44px;position:absolute;width:100%;text-align:center;line-height:64px;color:#fff}.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.createPost-container[data-v-35650662]{position:relative}.createPost-container .createPost-main-container[data-v-35650662]{padding:40px 45px 20px 50px}.createPost-container .createPost-main-container .postInfo-container[data-v-35650662]{position:relative;margin-bottom:10px}.createPost-container .createPost-main-container .postInfo-container[data-v-35650662]:after{content:"";display:table;clear:both}.createPost-container .createPost-main-container .postInfo-container .postInfo-container-item[data-v-35650662]{float:left}.createPost-container .createPost-main-container .editor-container[data-v-35650662]{min-height:500px;margin:0 0 30px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container[data-v-35650662]{text-align:right;margin-right:10px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container .editor-upload-btn[data-v-35650662]{display:inline-block}.createPost-container .word-counter[data-v-35650662]{width:40px;position:absolute;right:-10px;top:0}
\ No newline at end of file
.upload-container[data-v-54c5d4d6]{width:100%;position:relative}.upload-container[data-v-54c5d4d6]:after{content:"";display:table;clear:both}.upload-container .image-uploader[data-v-54c5d4d6]{width:35%;float:left}.upload-container .image-preview[data-v-54c5d4d6]{width:200px;height:200px;position:relative;border:1px dashed #d9d9d9;float:left;margin-left:50px}.upload-container .image-preview .image-preview-wrapper[data-v-54c5d4d6]{position:relative;width:100%;height:100%}.upload-container .image-preview .image-preview-wrapper img[data-v-54c5d4d6]{width:100%;height:100%}.upload-container .image-preview .image-preview-action[data-v-54c5d4d6]{position:absolute;width:100%;height:100%;left:0;top:0;cursor:default;color:#fff;opacity:0;font-size:20px;background-color:rgba(0,0,0,.5);-webkit-transition:opacity .3s;transition:opacity .3s;cursor:pointer;text-align:center;line-height:200px}.upload-container .image-preview .image-preview-action .el-icon-delete[data-v-54c5d4d6]{font-size:36px}.upload-container .image-preview:hover .image-preview-action[data-v-54c5d4d6]{opacity:1}.upload-container .image-app-preview[data-v-54c5d4d6]{width:320px;height:180px;position:relative;border:1px dashed #d9d9d9;float:left;margin-left:50px}.upload-container .image-app-preview .app-fake-conver[data-v-54c5d4d6]{height:44px;position:absolute;width:100%;text-align:center;line-height:64px;color:#fff}.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.createPost-container[data-v-212ef548]{position:relative}.createPost-container .createPost-main-container[data-v-212ef548]{padding:40px 45px 20px 50px}.createPost-container .createPost-main-container .postInfo-container[data-v-212ef548]{position:relative;margin-bottom:10px}.createPost-container .createPost-main-container .postInfo-container[data-v-212ef548]:after{content:"";display:table;clear:both}.createPost-container .createPost-main-container .postInfo-container .postInfo-container-item[data-v-212ef548]{float:left}.createPost-container .createPost-main-container .editor-container[data-v-212ef548]{min-height:500px;margin:0 0 30px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container[data-v-212ef548]{text-align:right;margin-right:10px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container .editor-upload-btn[data-v-212ef548]{display:inline-block}.createPost-container .word-counter[data-v-212ef548]{width:40px;position:absolute;right:-10px;top:0}
\ No newline at end of file
.upload-container[data-v-54c5d4d6]{width:100%;position:relative}.upload-container[data-v-54c5d4d6]:after{content:"";display:table;clear:both}.upload-container .image-uploader[data-v-54c5d4d6]{width:35%;float:left}.upload-container .image-preview[data-v-54c5d4d6]{width:200px;height:200px;position:relative;border:1px dashed #d9d9d9;float:left;margin-left:50px}.upload-container .image-preview .image-preview-wrapper[data-v-54c5d4d6]{position:relative;width:100%;height:100%}.upload-container .image-preview .image-preview-wrapper img[data-v-54c5d4d6]{width:100%;height:100%}.upload-container .image-preview .image-preview-action[data-v-54c5d4d6]{position:absolute;width:100%;height:100%;left:0;top:0;cursor:default;color:#fff;opacity:0;font-size:20px;background-color:rgba(0,0,0,.5);-webkit-transition:opacity .3s;transition:opacity .3s;cursor:pointer;text-align:center;line-height:200px}.upload-container .image-preview .image-preview-action .el-icon-delete[data-v-54c5d4d6]{font-size:36px}.upload-container .image-preview:hover .image-preview-action[data-v-54c5d4d6]{opacity:1}.upload-container .image-app-preview[data-v-54c5d4d6]{width:320px;height:180px;position:relative;border:1px dashed #d9d9d9;float:left;margin-left:50px}.upload-container .image-app-preview .app-fake-conver[data-v-54c5d4d6]{height:44px;position:absolute;width:100%;text-align:center;line-height:64px;color:#fff}.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.createPost-container[data-v-35650662]{position:relative}.createPost-container .createPost-main-container[data-v-35650662]{padding:40px 45px 20px 50px}.createPost-container .createPost-main-container .postInfo-container[data-v-35650662]{position:relative;margin-bottom:10px}.createPost-container .createPost-main-container .postInfo-container[data-v-35650662]:after{content:"";display:table;clear:both}.createPost-container .createPost-main-container .postInfo-container .postInfo-container-item[data-v-35650662]{float:left}.createPost-container .createPost-main-container .editor-container[data-v-35650662]{min-height:500px;margin:0 0 30px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container[data-v-35650662]{text-align:right;margin-right:10px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container .editor-upload-btn[data-v-35650662]{display:inline-block}.createPost-container .word-counter[data-v-35650662]{width:40px;position:absolute;right:-10px;top:0}
\ No newline at end of file
.upload-container[data-v-54c5d4d6]{width:100%;position:relative}.upload-container[data-v-54c5d4d6]:after{content:"";display:table;clear:both}.upload-container .image-uploader[data-v-54c5d4d6]{width:35%;float:left}.upload-container .image-preview[data-v-54c5d4d6]{width:200px;height:200px;position:relative;border:1px dashed #d9d9d9;float:left;margin-left:50px}.upload-container .image-preview .image-preview-wrapper[data-v-54c5d4d6]{position:relative;width:100%;height:100%}.upload-container .image-preview .image-preview-wrapper img[data-v-54c5d4d6]{width:100%;height:100%}.upload-container .image-preview .image-preview-action[data-v-54c5d4d6]{position:absolute;width:100%;height:100%;left:0;top:0;cursor:default;color:#fff;opacity:0;font-size:20px;background-color:rgba(0,0,0,.5);-webkit-transition:opacity .3s;transition:opacity .3s;cursor:pointer;text-align:center;line-height:200px}.upload-container .image-preview .image-preview-action .el-icon-delete[data-v-54c5d4d6]{font-size:36px}.upload-container .image-preview:hover .image-preview-action[data-v-54c5d4d6]{opacity:1}.upload-container .image-app-preview[data-v-54c5d4d6]{width:320px;height:180px;position:relative;border:1px dashed #d9d9d9;float:left;margin-left:50px}.upload-container .image-app-preview .app-fake-conver[data-v-54c5d4d6]{height:44px;position:absolute;width:100%;text-align:center;line-height:64px;color:#fff}.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.createPost-container[data-v-212ef548]{position:relative}.createPost-container .createPost-main-container[data-v-212ef548]{padding:40px 45px 20px 50px}.createPost-container .createPost-main-container .postInfo-container[data-v-212ef548]{position:relative;margin-bottom:10px}.createPost-container .createPost-main-container .postInfo-container[data-v-212ef548]:after{content:"";display:table;clear:both}.createPost-container .createPost-main-container .postInfo-container .postInfo-container-item[data-v-212ef548]{float:left}.createPost-container .createPost-main-container .editor-container[data-v-212ef548]{min-height:500px;margin:0 0 30px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container[data-v-212ef548]{text-align:right;margin-right:10px}.createPost-container .createPost-main-container .editor-container .editor-upload-btn-container .editor-upload-btn[data-v-212ef548]{display:inline-block}.createPost-container .word-counter[data-v-212ef548]{width:40px;position:absolute;right:-10px;top:0}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-1518"],{"+z3U":function(t,e,a){"use strict";var o=a("P2sY"),n=a.n(o),i=a("glbJ"),s=a("4d7F"),r=a.n(s),l=a("MSNs"),c={name:"SingleImageUpload3",props:{value:{type:String,default:""},uploadType:{type:Number,default:""}},data:function(){return{tempUrl:"",dataObj:{uploadType:this.uploadType}}},computed:{imageUrl:function(){return this.value}},methods:{rmImage:function(){this.emitInput("")},emitInput:function(t){this.$emit("input",t)},handleImageSuccess:function(t){this.emitInput(t.data.file_url)},handleBeforeUpload:function(){var t=this,e=this;return new r.a(function(a,o){Object(l.a)().then(function(o){var n=o.data.qiniu_key,i=o.data.qiniu_token;e._data.dataObj.token=i,e._data.dataObj.key=n,t.tempUrl=o.data.qiniu_url,a(!0)}).catch(function(t){console.log(t),o(!1)})})}}},u=(a("PRYl"),a("KHd+")),d=Object(u.a)(c,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"upload-container"},[a("el-upload",{staticClass:"image-uploader",attrs:{data:t.dataObj,multiple:!1,"show-file-list":!1,"on-success":t.handleImageSuccess,drag:"","before-upload":t.handleBeforeUpload,action:"/api/file/upload"}},[a("i",{staticClass:"el-icon-upload"}),t._v(" "),a("div",{staticClass:"el-upload__text"},[t._v("将文件拖到此处,或"),a("em",[t._v("点击上传")])])]),t._v(" "),a("div",{staticClass:"image-preview"},[a("div",{directives:[{name:"show",rawName:"v-show",value:t.imageUrl.length>1,expression:"imageUrl.length>1"}],staticClass:"image-preview-wrapper"},[a("img",{attrs:{src:t.imageUrl,disabled:!0}}),t._v(" "),a("div",{staticClass:"image-preview-action"},[a("i",{staticClass:"el-icon-delete",on:{click:t.rmImage}})])])])],1)},[],!1,null,"54c5d4d6",null);d.options.__file="faceupload.vue";var p=d.exports,m=a("Grqa"),f=a("uARZ"),v=a("ZySA"),g=a("Mz3J"),h=(a("Yfch"),a("XB8m")),y={status:"draft",uploadType:"",name:"",sex:"",ordinary_image_url:"",modeling_obj_url:""},b={name:"FaceStarDetail",components:{Tinymce:i.a,MDinput:m.a,FaceUpload:p,Sticky:f.a,Pagination:g.a},directives:{waves:v.a},props:{isEdit:{type:Boolean,default:!1}},data:function(){var t=this,e=function(e,a,o){""===a?(t.$message({message:e.field+"为必传项",type:"error"}),o(new Error(e.field+"为必传项"))):o()};return{postForm:n()({},y),loading:!1,city:"",tags:[],rules:{name:[{validator:e,trigger:"blur"}],sex:[{validator:e,trigger:"blur"}]},tempRoute:{},GenderTypeOptions:[{key:0,display_name:"男"},{key:1,display_name:"女"}],uploadType:-99,isdisabledFn:!1}},computed:{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=n()({},y);this.tempRoute=n()({},this.$route)},methods:{fetchData:function(t){var e=this;Object(h.c)(t).then(function(t){e.postForm=t.data.data.data}).catch(function(t){console.log(t)})},submitForm:function(){var t=this;this.$refs.postForm.validate(function(e){return e?(t.loading=!0,""===t.postForm.ordinary_image_url?(t.$message.error("头像一不能为空~"),t.loading=!1,!1):""===t.postForm.modeling_obj_url?(t.$message.error("头像二不能为空~"),t.loading=!1,!1):(t.isdisabledFn=!0,Object(h.b)(t.postForm).then(function(e){t.$notify({title:"成功",message:e.data.data.message,type:"success",duration:2e3}),t.$router.go(0)}).catch(function(e){t.$notify({title:"失败",message:"操作失败",type:"danger",duration:2e3})}),t.postForm.status="published",void(t.loading=!1))):(console.log("error submit!!"),!1)})},getRemoteCityList:function(t){var e=this;citySearch(t).then(function(t){t.data.data.data&&(e.regionListOptions=t.data.data.data)})},getRemoteTagList:function(t){var e=this;tagSearch(t).then(function(t){t.data.data.data&&(e.tagListOptions=t.data.data.data)})}}},_=(a("hDwf"),Object(u.a)(b,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"createPost-container"},[a("el-form",{ref:"postForm",staticClass:"form-container",attrs:{model:t.postForm,rules:t.rules}},[a("sticky",{attrs:{"class-name":"sub-navbar "+t.postForm.status}},[a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{"margin-left":"10px"},attrs:{type:"success",disabled:t.isdisabledFn},on:{click:t.submitForm}},[t._v("保存\n ")])],1),t._v(" "),a("div",{staticClass:"createPost-main-container"},[a("el-row",{attrs:{gutter:20}},[a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",[t._v("Face明星")])]),t._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"postInfo-container"},[a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{staticStyle:{"margin-bottom":"20px"},attrs:{"label-width":"75px",label:"*用户名:",prop:"nick_name"}},[a("el-input",{staticStyle:{width:"230px"},attrs:{type:"text"},model:{value:t.postForm.name,callback:function(e){t.$set(t.postForm,"name",e)},expression:"postForm.name"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{"label-width":"75px",label:"*性别:",prop:"gender"}},[a("el-select",{staticClass:"postInfo-container-item",staticStyle:{width:"230px"},attrs:{placeholder:"性别:",clearable:""},model:{value:t.postForm.sex,callback:function(e){t.$set(t.postForm,"sex",e)},expression:"postForm.sex"}},t._l(t.GenderTypeOptions,function(t){return a("el-option",{key:t.key,attrs:{label:t.display_name,value:t.key}})}))],1)],1)],1)],1)])],1),t._v(" "),a("div",[a("el-form-item",{staticStyle:{"margin-bottom":"20px"},attrs:{"label-width":"75px",label:"*原图:",prop:"avatar"}},[a("span",{model:{value:t.uploadType,callback:function(e){t.uploadType=e},expression:"uploadType"}}),t._v(" "),a("FaceUpload",{attrs:{uploadType:t.uploadType},model:{value:t.postForm.ordinary_image_url,callback:function(e){t.$set(t.postForm,"ordinary_image_url",e)},expression:"postForm.ordinary_image_url"}})],1)],1),t._v(" "),a("div",[a("el-form-item",{staticStyle:{"margin-bottom":"20px"},attrs:{"label-width":"75px",label:"*模型:",prop:"avatar"}},[a("span",{model:{value:t.uploadType,callback:function(e){t.uploadType=e},expression:"uploadType"}}),t._v(" "),a("FaceUpload",{attrs:{uploadType:t.uploadType},model:{value:t.postForm.modeling_obj_url,callback:function(e){t.$set(t.postForm,"modeling_obj_url",e)},expression:"postForm.modeling_obj_url"}})],1)],1)],1)],1)],1)],1)],1)},[],!1,null,"35650662",null));_.options.__file="FaceStarDetail.vue";e.a=_.exports},CXrD:function(t,e,a){"use strict";a.r(e);var o={name:"EditFaceStar",components:{FaceStarDetail:a("+z3U").a}},n=a("KHd+"),i=Object(n.a)(o,function(){var t=this.$createElement;return(this._self._c||t)("face-star-detail",{attrs:{"is-edit":!0}})},[],!1,null,null,null);i.options.__file="edit.vue";e.default=i.exports},MSNs:function(t,e,a){"use strict";a.d(e,"a",function(){return n});var o=a("t3Un");function n(){return Object(o.a)({url:"/api/get_token",method:"get"})}},PRYl:function(t,e,a){"use strict";var o=a("Ujl/");a.n(o).a},"Ujl/":function(t,e,a){},XB8m:function(t,e,a){"use strict";a.d(e,"b",function(){return n}),a.d(e,"d",function(){return i}),a.d(e,"a",function(){return s}),a.d(e,"c",function(){return r});var o=a("t3Un");function n(t){return Object(o.a)({url:"/api/face/star/create",method:"post",data:t})}function i(t){return Object(o.a)({url:"/api/face/star/list",method:"get",params:t})}function s(t){return console.log(t),Object(o.a)({url:"/api/face/star/list/update",method:"post",data:t})}function r(t){return Object(o.a)({url:"/api/face/star/detail",method:"get",params:{id:t}})}},Y5bG:function(t,e,a){"use strict";a.d(e,"a",function(){return n}),Math.easeInOutQuad=function(t,e,a,o){return(t/=o/2)<1?a/2*t*t+e:-a/2*(--t*(t-2)-1)+e};var o=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)};function n(t,e,a){var n=document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop,i=t-n,s=0;e=void 0===e?500:e;!function t(){s+=20,function(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}(Math.easeInOutQuad(s,n,i,e)),s<e?o(t):a&&"function"==typeof a&&a()}()}},Yfch:function(t,e,a){"use strict"},ZySA:function(t,e,a){"use strict";var o=a("P2sY"),n=a.n(o),i=(a("jUE0"),{bind:function(t,e){t.addEventListener("click",function(a){var o=n()({},e.value),i=n()({ele:t,type:"hit",color:"rgba(0, 0, 0, 0.15)"},o),s=i.ele;if(s){s.style.position="relative",s.style.overflow="hidden";var r=s.getBoundingClientRect(),l=s.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",s.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=(a.pageY-r.top-l.offsetHeight/2-document.documentElement.scrollTop||document.body.scrollTop)+"px",l.style.left=(a.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)}}),s=function(t){t.directive("waves",i)};window.Vue&&(window.waves=i,Vue.use(s)),i.install=s;e.a=i},hDwf:function(t,e,a){"use strict";var o=a("tqk+");a.n(o).a},jUE0:function(t,e,a){},"tqk+":function(t,e,a){}}]);
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-1625"],{"+z3U":function(t,e,a){"use strict";var o=a("P2sY"),n=a.n(o),i=a("glbJ"),s=a("4d7F"),r=a.n(s),l=a("MSNs"),c={name:"SingleImageUpload3",props:{value:{type:String,default:""},uploadType:{type:Number,default:""}},data:function(){return{tempUrl:"",dataObj:{uploadType:this.uploadType}}},computed:{imageUrl:function(){return this.value}},methods:{rmImage:function(){this.emitInput("")},emitInput:function(t){this.$emit("input",t)},handleImageSuccess:function(t){this.emitInput(t.data.file_url)},handleBeforeUpload:function(){var t=this,e=this;return new r.a(function(a,o){Object(l.a)().then(function(o){var n=o.data.qiniu_key,i=o.data.qiniu_token;e._data.dataObj.token=i,e._data.dataObj.key=n,t.tempUrl=o.data.qiniu_url,a(!0)}).catch(function(t){console.log(t),o(!1)})})}}},u=(a("PRYl"),a("KHd+")),d=Object(u.a)(c,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"upload-container"},[a("el-upload",{staticClass:"image-uploader",attrs:{data:t.dataObj,multiple:!1,"show-file-list":!1,"on-success":t.handleImageSuccess,drag:"","before-upload":t.handleBeforeUpload,action:"/api/file/upload"}},[a("i",{staticClass:"el-icon-upload"}),t._v(" "),a("div",{staticClass:"el-upload__text"},[t._v("将文件拖到此处,或"),a("em",[t._v("点击上传")])])]),t._v(" "),a("div",{staticClass:"image-preview"},[a("div",{directives:[{name:"show",rawName:"v-show",value:t.imageUrl.length>1,expression:"imageUrl.length>1"}],staticClass:"image-preview-wrapper"},[a("img",{attrs:{src:t.imageUrl,disabled:!0}}),t._v(" "),a("div",{staticClass:"image-preview-action"},[a("i",{staticClass:"el-icon-delete",on:{click:t.rmImage}})])])])],1)},[],!1,null,"54c5d4d6",null);d.options.__file="faceupload.vue";var p=d.exports,m=a("Grqa"),f=a("uARZ"),v=a("ZySA"),g=a("Mz3J"),h=(a("Yfch"),a("XB8m")),y=[{key:1,display_name:"男"},{key:2,display_name:"女"}],b=y.reduce(function(t,e){return t[e.key]=e.display_name,t},{}),_=(y.reduce(function(t,e){return t[e.key]=e.display_name,t},{}),{status:"draft",uploadType:"",name:"",sex:"",ordinary_image_url:"",modeling_obj_url:""}),w={name:"FaceStarDetail",components:{Tinymce:i.a,MDinput:m.a,FaceUpload:p,Sticky:f.a,Pagination:g.a},directives:{waves:v.a},props:{isEdit:{type:Boolean,default:!1}},data:function(){var t=this,e=function(e,a,o){""===a?(t.$message({message:e.field+"为必传项",type:"error"}),o(new Error(e.field+"为必传项"))):o()};return{postForm:n()({},_),loading:!1,city:"",tags:[],rules:{name:[{validator:e,trigger:"blur"}],sex:[{validator:e,trigger:"blur"}]},tempRoute:{},GenderTypeOptions:[{key:1,display_name:"男"},{key:2,display_name:"女"}],uploadType:-99,isdisabledFn:!1}},computed:{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=n()({},_);this.tempRoute=n()({},this.$route)},methods:{fetchData:function(t){var e=this;Object(h.c)(t).then(function(t){e.postForm=t.data.data.data,e.postForm.sex=b[t.data.data.data.sex]}).catch(function(t){console.log(t)})},submitForm:function(){var t=this;this.$refs.postForm.validate(function(e){if(!e)return console.log("error submit!!"),!1;if(t.loading=!0,""===t.postForm.ordinary_image_url)return t.$message.error("头像一不能为空~"),t.loading=!1,!1;if(""===t.postForm.modeling_obj_url)return t.$message.error("头像二不能为空~"),t.loading=!1,!1;var a={"男":1,"女":2};t.isdisabledFn=!0,a.hasOwnProperty(t.postForm.sex)&&(t.postForm.sex=a[t.postForm.sex]),t.isdisabledFn=!0,Object(h.b)(t.postForm).then(function(e){t.$notify({title:"成功",message:e.data.data.message,type:"success",duration:2e3}),t.$router.go(0)}).catch(function(e){t.$notify({title:"失败",message:"操作失败",type:"danger",duration:2e3})}),t.postForm.status="published",t.loading=!1})},getRemoteCityList:function(t){var e=this;citySearch(t).then(function(t){t.data.data.data&&(e.regionListOptions=t.data.data.data)})},getRemoteTagList:function(t){var e=this;tagSearch(t).then(function(t){t.data.data.data&&(e.tagListOptions=t.data.data.data)})}}},F=(a("sRG1"),Object(u.a)(w,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"createPost-container"},[a("el-form",{ref:"postForm",staticClass:"form-container",attrs:{model:t.postForm,rules:t.rules}},[a("sticky",{attrs:{"class-name":"sub-navbar "+t.postForm.status}},[a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{"margin-left":"10px"},attrs:{type:"success",disabled:t.isdisabledFn},on:{click:t.submitForm}},[t._v("保存\n ")])],1),t._v(" "),a("div",{staticClass:"createPost-main-container"},[a("el-row",{attrs:{gutter:20}},[a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",[t._v("Face明星")])]),t._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"postInfo-container"},[a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{staticStyle:{"margin-bottom":"20px"},attrs:{"label-width":"75px",label:"*用户名:",prop:"nick_name"}},[a("el-input",{staticStyle:{width:"230px"},attrs:{type:"text"},model:{value:t.postForm.name,callback:function(e){t.$set(t.postForm,"name",e)},expression:"postForm.name"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{"label-width":"75px",label:"*性别:",prop:"gender"}},[a("el-select",{staticClass:"postInfo-container-item",staticStyle:{width:"230px"},attrs:{placeholder:"性别:",clearable:""},model:{value:t.postForm.sex,callback:function(e){t.$set(t.postForm,"sex",e)},expression:"postForm.sex"}},t._l(t.GenderTypeOptions,function(t){return a("el-option",{key:t.key,attrs:{label:t.display_name,value:t.key}})}))],1)],1)],1)],1)])],1),t._v(" "),a("div",[a("el-form-item",{staticStyle:{"margin-bottom":"20px"},attrs:{"label-width":"75px",label:"*原图:",prop:"avatar"}},[a("span",{model:{value:t.uploadType,callback:function(e){t.uploadType=e},expression:"uploadType"}}),t._v(" "),a("FaceUpload",{attrs:{uploadType:t.uploadType},model:{value:t.postForm.ordinary_image_url,callback:function(e){t.$set(t.postForm,"ordinary_image_url",e)},expression:"postForm.ordinary_image_url"}})],1)],1),t._v(" "),a("div",[a("el-form-item",{staticStyle:{"margin-bottom":"20px"},attrs:{"label-width":"75px",label:"*模型:",prop:"avatar"}},[a("span",{model:{value:t.uploadType,callback:function(e){t.uploadType=e},expression:"uploadType"}}),t._v(" "),a("FaceUpload",{attrs:{uploadType:t.uploadType},model:{value:t.postForm.modeling_obj_url,callback:function(e){t.$set(t.postForm,"modeling_obj_url",e)},expression:"postForm.modeling_obj_url"}})],1)],1)],1)],1)],1)],1)],1)},[],!1,null,"212ef548",null));F.options.__file="FaceStarDetail.vue";e.a=F.exports},CXrD:function(t,e,a){"use strict";a.r(e);var o={name:"EditFaceStar",components:{FaceStarDetail:a("+z3U").a}},n=a("KHd+"),i=Object(n.a)(o,function(){var t=this.$createElement;return(this._self._c||t)("face-star-detail",{attrs:{"is-edit":!0}})},[],!1,null,null,null);i.options.__file="edit.vue";e.default=i.exports},MSNs:function(t,e,a){"use strict";a.d(e,"a",function(){return n});var o=a("t3Un");function n(){return Object(o.a)({url:"/api/get_token",method:"get"})}},PRYl:function(t,e,a){"use strict";var o=a("Ujl/");a.n(o).a},"Ujl/":function(t,e,a){},XB8m:function(t,e,a){"use strict";a.d(e,"b",function(){return n}),a.d(e,"d",function(){return i}),a.d(e,"a",function(){return s}),a.d(e,"c",function(){return r});var o=a("t3Un");function n(t){return Object(o.a)({url:"/api/face/star/create",method:"post",data:t})}function i(t){return Object(o.a)({url:"/api/face/star/list",method:"get",params:t})}function s(t){return console.log(t),Object(o.a)({url:"/api/face/star/list/update",method:"post",data:t})}function r(t){return Object(o.a)({url:"/api/face/star/detail",method:"get",params:{id:t}})}},Y5bG:function(t,e,a){"use strict";a.d(e,"a",function(){return n}),Math.easeInOutQuad=function(t,e,a,o){return(t/=o/2)<1?a/2*t*t+e:-a/2*(--t*(t-2)-1)+e};var o=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)};function n(t,e,a){var n=document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop,i=t-n,s=0;e=void 0===e?500:e;!function t(){s+=20,function(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}(Math.easeInOutQuad(s,n,i,e)),s<e?o(t):a&&"function"==typeof a&&a()}()}},Yfch:function(t,e,a){"use strict"},ZySA:function(t,e,a){"use strict";var o=a("P2sY"),n=a.n(o),i=(a("jUE0"),{bind:function(t,e){t.addEventListener("click",function(a){var o=n()({},e.value),i=n()({ele:t,type:"hit",color:"rgba(0, 0, 0, 0.15)"},o),s=i.ele;if(s){s.style.position="relative",s.style.overflow="hidden";var r=s.getBoundingClientRect(),l=s.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",s.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=(a.pageY-r.top-l.offsetHeight/2-document.documentElement.scrollTop||document.body.scrollTop)+"px",l.style.left=(a.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)}}),s=function(t){t.directive("waves",i)};window.Vue&&(window.waves=i,Vue.use(s)),i.install=s;e.a=i},jUE0:function(t,e,a){},q2ZA:function(t,e,a){},sRG1:function(t,e,a){"use strict";var o=a("q2ZA");a.n(o).a}}]);
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-61c4"],{"+z3U":function(t,e,a){"use strict";var o=a("P2sY"),n=a.n(o),i=a("glbJ"),s=a("4d7F"),r=a.n(s),l=a("MSNs"),c={name:"SingleImageUpload3",props:{value:{type:String,default:""},uploadType:{type:Number,default:""}},data:function(){return{tempUrl:"",dataObj:{uploadType:this.uploadType}}},computed:{imageUrl:function(){return this.value}},methods:{rmImage:function(){this.emitInput("")},emitInput:function(t){this.$emit("input",t)},handleImageSuccess:function(t){this.emitInput(t.data.file_url)},handleBeforeUpload:function(){var t=this,e=this;return new r.a(function(a,o){Object(l.a)().then(function(o){var n=o.data.qiniu_key,i=o.data.qiniu_token;e._data.dataObj.token=i,e._data.dataObj.key=n,t.tempUrl=o.data.qiniu_url,a(!0)}).catch(function(t){console.log(t),o(!1)})})}}},u=(a("PRYl"),a("KHd+")),d=Object(u.a)(c,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"upload-container"},[a("el-upload",{staticClass:"image-uploader",attrs:{data:t.dataObj,multiple:!1,"show-file-list":!1,"on-success":t.handleImageSuccess,drag:"","before-upload":t.handleBeforeUpload,action:"/api/file/upload"}},[a("i",{staticClass:"el-icon-upload"}),t._v(" "),a("div",{staticClass:"el-upload__text"},[t._v("将文件拖到此处,或"),a("em",[t._v("点击上传")])])]),t._v(" "),a("div",{staticClass:"image-preview"},[a("div",{directives:[{name:"show",rawName:"v-show",value:t.imageUrl.length>1,expression:"imageUrl.length>1"}],staticClass:"image-preview-wrapper"},[a("img",{attrs:{src:t.imageUrl,disabled:!0}}),t._v(" "),a("div",{staticClass:"image-preview-action"},[a("i",{staticClass:"el-icon-delete",on:{click:t.rmImage}})])])])],1)},[],!1,null,"54c5d4d6",null);d.options.__file="faceupload.vue";var p=d.exports,m=a("Grqa"),f=a("uARZ"),v=a("ZySA"),g=a("Mz3J"),h=(a("Yfch"),a("XB8m")),y=[{key:1,display_name:"男"},{key:2,display_name:"女"}],b=y.reduce(function(t,e){return t[e.key]=e.display_name,t},{}),_=(y.reduce(function(t,e){return t[e.key]=e.display_name,t},{}),{status:"draft",uploadType:"",name:"",sex:"",ordinary_image_url:"",modeling_obj_url:""}),w={name:"FaceStarDetail",components:{Tinymce:i.a,MDinput:m.a,FaceUpload:p,Sticky:f.a,Pagination:g.a},directives:{waves:v.a},props:{isEdit:{type:Boolean,default:!1}},data:function(){var t=this,e=function(e,a,o){""===a?(t.$message({message:e.field+"为必传项",type:"error"}),o(new Error(e.field+"为必传项"))):o()};return{postForm:n()({},_),loading:!1,city:"",tags:[],rules:{name:[{validator:e,trigger:"blur"}],sex:[{validator:e,trigger:"blur"}]},tempRoute:{},GenderTypeOptions:[{key:1,display_name:"男"},{key:2,display_name:"女"}],uploadType:-99,isdisabledFn:!1}},computed:{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=n()({},_);this.tempRoute=n()({},this.$route)},methods:{fetchData:function(t){var e=this;Object(h.c)(t).then(function(t){e.postForm=t.data.data.data,e.postForm.sex=b[t.data.data.data.sex]}).catch(function(t){console.log(t)})},submitForm:function(){var t=this;this.$refs.postForm.validate(function(e){if(!e)return console.log("error submit!!"),!1;if(t.loading=!0,""===t.postForm.ordinary_image_url)return t.$message.error("头像一不能为空~"),t.loading=!1,!1;if(""===t.postForm.modeling_obj_url)return t.$message.error("头像二不能为空~"),t.loading=!1,!1;var a={"男":1,"女":2};t.isdisabledFn=!0,a.hasOwnProperty(t.postForm.sex)&&(t.postForm.sex=a[t.postForm.sex]),t.isdisabledFn=!0,Object(h.b)(t.postForm).then(function(e){t.$notify({title:"成功",message:e.data.data.message,type:"success",duration:2e3}),t.$router.go(0)}).catch(function(e){t.$notify({title:"失败",message:"操作失败",type:"danger",duration:2e3})}),t.postForm.status="published",t.loading=!1})},getRemoteCityList:function(t){var e=this;citySearch(t).then(function(t){t.data.data.data&&(e.regionListOptions=t.data.data.data)})},getRemoteTagList:function(t){var e=this;tagSearch(t).then(function(t){t.data.data.data&&(e.tagListOptions=t.data.data.data)})}}},F=(a("sRG1"),Object(u.a)(w,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"createPost-container"},[a("el-form",{ref:"postForm",staticClass:"form-container",attrs:{model:t.postForm,rules:t.rules}},[a("sticky",{attrs:{"class-name":"sub-navbar "+t.postForm.status}},[a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{"margin-left":"10px"},attrs:{type:"success",disabled:t.isdisabledFn},on:{click:t.submitForm}},[t._v("保存\n ")])],1),t._v(" "),a("div",{staticClass:"createPost-main-container"},[a("el-row",{attrs:{gutter:20}},[a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",[t._v("Face明星")])]),t._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"postInfo-container"},[a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{staticStyle:{"margin-bottom":"20px"},attrs:{"label-width":"75px",label:"*用户名:",prop:"nick_name"}},[a("el-input",{staticStyle:{width:"230px"},attrs:{type:"text"},model:{value:t.postForm.name,callback:function(e){t.$set(t.postForm,"name",e)},expression:"postForm.name"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{"label-width":"75px",label:"*性别:",prop:"gender"}},[a("el-select",{staticClass:"postInfo-container-item",staticStyle:{width:"230px"},attrs:{placeholder:"性别:",clearable:""},model:{value:t.postForm.sex,callback:function(e){t.$set(t.postForm,"sex",e)},expression:"postForm.sex"}},t._l(t.GenderTypeOptions,function(t){return a("el-option",{key:t.key,attrs:{label:t.display_name,value:t.key}})}))],1)],1)],1)],1)])],1),t._v(" "),a("div",[a("el-form-item",{staticStyle:{"margin-bottom":"20px"},attrs:{"label-width":"75px",label:"*原图:",prop:"avatar"}},[a("span",{model:{value:t.uploadType,callback:function(e){t.uploadType=e},expression:"uploadType"}}),t._v(" "),a("FaceUpload",{attrs:{uploadType:t.uploadType},model:{value:t.postForm.ordinary_image_url,callback:function(e){t.$set(t.postForm,"ordinary_image_url",e)},expression:"postForm.ordinary_image_url"}})],1)],1),t._v(" "),a("div",[a("el-form-item",{staticStyle:{"margin-bottom":"20px"},attrs:{"label-width":"75px",label:"*模型:",prop:"avatar"}},[a("span",{model:{value:t.uploadType,callback:function(e){t.uploadType=e},expression:"uploadType"}}),t._v(" "),a("FaceUpload",{attrs:{uploadType:t.uploadType},model:{value:t.postForm.modeling_obj_url,callback:function(e){t.$set(t.postForm,"modeling_obj_url",e)},expression:"postForm.modeling_obj_url"}})],1)],1)],1)],1)],1)],1)],1)},[],!1,null,"212ef548",null));F.options.__file="FaceStarDetail.vue";e.a=F.exports},HmOD:function(t,e,a){"use strict";a.r(e);var o={name:"CreateFaceStar",components:{FaceStarDetail:a("+z3U").a}},n=a("KHd+"),i=Object(n.a)(o,function(){var t=this.$createElement;return(this._self._c||t)("face-star-detail",{attrs:{"is-edit":!1}})},[],!1,null,null,null);i.options.__file="create.vue";e.default=i.exports},MSNs:function(t,e,a){"use strict";a.d(e,"a",function(){return n});var o=a("t3Un");function n(){return Object(o.a)({url:"/api/get_token",method:"get"})}},PRYl:function(t,e,a){"use strict";var o=a("Ujl/");a.n(o).a},"Ujl/":function(t,e,a){},XB8m:function(t,e,a){"use strict";a.d(e,"b",function(){return n}),a.d(e,"d",function(){return i}),a.d(e,"a",function(){return s}),a.d(e,"c",function(){return r});var o=a("t3Un");function n(t){return Object(o.a)({url:"/api/face/star/create",method:"post",data:t})}function i(t){return Object(o.a)({url:"/api/face/star/list",method:"get",params:t})}function s(t){return console.log(t),Object(o.a)({url:"/api/face/star/list/update",method:"post",data:t})}function r(t){return Object(o.a)({url:"/api/face/star/detail",method:"get",params:{id:t}})}},Y5bG:function(t,e,a){"use strict";a.d(e,"a",function(){return n}),Math.easeInOutQuad=function(t,e,a,o){return(t/=o/2)<1?a/2*t*t+e:-a/2*(--t*(t-2)-1)+e};var o=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)};function n(t,e,a){var n=document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop,i=t-n,s=0;e=void 0===e?500:e;!function t(){s+=20,function(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}(Math.easeInOutQuad(s,n,i,e)),s<e?o(t):a&&"function"==typeof a&&a()}()}},Yfch:function(t,e,a){"use strict"},ZySA:function(t,e,a){"use strict";var o=a("P2sY"),n=a.n(o),i=(a("jUE0"),{bind:function(t,e){t.addEventListener("click",function(a){var o=n()({},e.value),i=n()({ele:t,type:"hit",color:"rgba(0, 0, 0, 0.15)"},o),s=i.ele;if(s){s.style.position="relative",s.style.overflow="hidden";var r=s.getBoundingClientRect(),l=s.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",s.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=(a.pageY-r.top-l.offsetHeight/2-document.documentElement.scrollTop||document.body.scrollTop)+"px",l.style.left=(a.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)}}),s=function(t){t.directive("waves",i)};window.Vue&&(window.waves=i,Vue.use(s)),i.install=s;e.a=i},jUE0:function(t,e,a){},q2ZA:function(t,e,a){},sRG1:function(t,e,a){"use strict";var o=a("q2ZA");a.n(o).a}}]);
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-624b"],{"+z3U":function(t,e,a){"use strict";var o=a("P2sY"),n=a.n(o),i=a("glbJ"),s=a("4d7F"),r=a.n(s),l=a("MSNs"),c={name:"SingleImageUpload3",props:{value:{type:String,default:""},uploadType:{type:Number,default:""}},data:function(){return{tempUrl:"",dataObj:{uploadType:this.uploadType}}},computed:{imageUrl:function(){return this.value}},methods:{rmImage:function(){this.emitInput("")},emitInput:function(t){this.$emit("input",t)},handleImageSuccess:function(t){this.emitInput(t.data.file_url)},handleBeforeUpload:function(){var t=this,e=this;return new r.a(function(a,o){Object(l.a)().then(function(o){var n=o.data.qiniu_key,i=o.data.qiniu_token;e._data.dataObj.token=i,e._data.dataObj.key=n,t.tempUrl=o.data.qiniu_url,a(!0)}).catch(function(t){console.log(t),o(!1)})})}}},u=(a("PRYl"),a("KHd+")),d=Object(u.a)(c,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"upload-container"},[a("el-upload",{staticClass:"image-uploader",attrs:{data:t.dataObj,multiple:!1,"show-file-list":!1,"on-success":t.handleImageSuccess,drag:"","before-upload":t.handleBeforeUpload,action:"/api/file/upload"}},[a("i",{staticClass:"el-icon-upload"}),t._v(" "),a("div",{staticClass:"el-upload__text"},[t._v("将文件拖到此处,或"),a("em",[t._v("点击上传")])])]),t._v(" "),a("div",{staticClass:"image-preview"},[a("div",{directives:[{name:"show",rawName:"v-show",value:t.imageUrl.length>1,expression:"imageUrl.length>1"}],staticClass:"image-preview-wrapper"},[a("img",{attrs:{src:t.imageUrl,disabled:!0}}),t._v(" "),a("div",{staticClass:"image-preview-action"},[a("i",{staticClass:"el-icon-delete",on:{click:t.rmImage}})])])])],1)},[],!1,null,"54c5d4d6",null);d.options.__file="faceupload.vue";var p=d.exports,m=a("Grqa"),f=a("uARZ"),v=a("ZySA"),g=a("Mz3J"),h=(a("Yfch"),a("XB8m")),y={status:"draft",uploadType:"",name:"",sex:"",ordinary_image_url:"",modeling_obj_url:""},b={name:"FaceStarDetail",components:{Tinymce:i.a,MDinput:m.a,FaceUpload:p,Sticky:f.a,Pagination:g.a},directives:{waves:v.a},props:{isEdit:{type:Boolean,default:!1}},data:function(){var t=this,e=function(e,a,o){""===a?(t.$message({message:e.field+"为必传项",type:"error"}),o(new Error(e.field+"为必传项"))):o()};return{postForm:n()({},y),loading:!1,city:"",tags:[],rules:{name:[{validator:e,trigger:"blur"}],sex:[{validator:e,trigger:"blur"}]},tempRoute:{},GenderTypeOptions:[{key:0,display_name:"男"},{key:1,display_name:"女"}],uploadType:-99,isdisabledFn:!1}},computed:{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=n()({},y);this.tempRoute=n()({},this.$route)},methods:{fetchData:function(t){var e=this;Object(h.c)(t).then(function(t){e.postForm=t.data.data.data}).catch(function(t){console.log(t)})},submitForm:function(){var t=this;this.$refs.postForm.validate(function(e){return e?(t.loading=!0,""===t.postForm.ordinary_image_url?(t.$message.error("头像一不能为空~"),t.loading=!1,!1):""===t.postForm.modeling_obj_url?(t.$message.error("头像二不能为空~"),t.loading=!1,!1):(t.isdisabledFn=!0,Object(h.b)(t.postForm).then(function(e){t.$notify({title:"成功",message:e.data.data.message,type:"success",duration:2e3}),t.$router.go(0)}).catch(function(e){t.$notify({title:"失败",message:"操作失败",type:"danger",duration:2e3})}),t.postForm.status="published",void(t.loading=!1))):(console.log("error submit!!"),!1)})},getRemoteCityList:function(t){var e=this;citySearch(t).then(function(t){t.data.data.data&&(e.regionListOptions=t.data.data.data)})},getRemoteTagList:function(t){var e=this;tagSearch(t).then(function(t){t.data.data.data&&(e.tagListOptions=t.data.data.data)})}}},_=(a("hDwf"),Object(u.a)(b,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"createPost-container"},[a("el-form",{ref:"postForm",staticClass:"form-container",attrs:{model:t.postForm,rules:t.rules}},[a("sticky",{attrs:{"class-name":"sub-navbar "+t.postForm.status}},[a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{"margin-left":"10px"},attrs:{type:"success",disabled:t.isdisabledFn},on:{click:t.submitForm}},[t._v("保存\n ")])],1),t._v(" "),a("div",{staticClass:"createPost-main-container"},[a("el-row",{attrs:{gutter:20}},[a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",[t._v("Face明星")])]),t._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("div",{staticClass:"postInfo-container"},[a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{staticStyle:{"margin-bottom":"20px"},attrs:{"label-width":"75px",label:"*用户名:",prop:"nick_name"}},[a("el-input",{staticStyle:{width:"230px"},attrs:{type:"text"},model:{value:t.postForm.name,callback:function(e){t.$set(t.postForm,"name",e)},expression:"postForm.name"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{"label-width":"75px",label:"*性别:",prop:"gender"}},[a("el-select",{staticClass:"postInfo-container-item",staticStyle:{width:"230px"},attrs:{placeholder:"性别:",clearable:""},model:{value:t.postForm.sex,callback:function(e){t.$set(t.postForm,"sex",e)},expression:"postForm.sex"}},t._l(t.GenderTypeOptions,function(t){return a("el-option",{key:t.key,attrs:{label:t.display_name,value:t.key}})}))],1)],1)],1)],1)])],1),t._v(" "),a("div",[a("el-form-item",{staticStyle:{"margin-bottom":"20px"},attrs:{"label-width":"75px",label:"*原图:",prop:"avatar"}},[a("span",{model:{value:t.uploadType,callback:function(e){t.uploadType=e},expression:"uploadType"}}),t._v(" "),a("FaceUpload",{attrs:{uploadType:t.uploadType},model:{value:t.postForm.ordinary_image_url,callback:function(e){t.$set(t.postForm,"ordinary_image_url",e)},expression:"postForm.ordinary_image_url"}})],1)],1),t._v(" "),a("div",[a("el-form-item",{staticStyle:{"margin-bottom":"20px"},attrs:{"label-width":"75px",label:"*模型:",prop:"avatar"}},[a("span",{model:{value:t.uploadType,callback:function(e){t.uploadType=e},expression:"uploadType"}}),t._v(" "),a("FaceUpload",{attrs:{uploadType:t.uploadType},model:{value:t.postForm.modeling_obj_url,callback:function(e){t.$set(t.postForm,"modeling_obj_url",e)},expression:"postForm.modeling_obj_url"}})],1)],1)],1)],1)],1)],1)],1)},[],!1,null,"35650662",null));_.options.__file="FaceStarDetail.vue";e.a=_.exports},HmOD:function(t,e,a){"use strict";a.r(e);var o={name:"CreateFaceStar",components:{FaceStarDetail:a("+z3U").a}},n=a("KHd+"),i=Object(n.a)(o,function(){var t=this.$createElement;return(this._self._c||t)("face-star-detail",{attrs:{"is-edit":!1}})},[],!1,null,null,null);i.options.__file="create.vue";e.default=i.exports},MSNs:function(t,e,a){"use strict";a.d(e,"a",function(){return n});var o=a("t3Un");function n(){return Object(o.a)({url:"/api/get_token",method:"get"})}},PRYl:function(t,e,a){"use strict";var o=a("Ujl/");a.n(o).a},"Ujl/":function(t,e,a){},XB8m:function(t,e,a){"use strict";a.d(e,"b",function(){return n}),a.d(e,"d",function(){return i}),a.d(e,"a",function(){return s}),a.d(e,"c",function(){return r});var o=a("t3Un");function n(t){return Object(o.a)({url:"/api/face/star/create",method:"post",data:t})}function i(t){return Object(o.a)({url:"/api/face/star/list",method:"get",params:t})}function s(t){return console.log(t),Object(o.a)({url:"/api/face/star/list/update",method:"post",data:t})}function r(t){return Object(o.a)({url:"/api/face/star/detail",method:"get",params:{id:t}})}},Y5bG:function(t,e,a){"use strict";a.d(e,"a",function(){return n}),Math.easeInOutQuad=function(t,e,a,o){return(t/=o/2)<1?a/2*t*t+e:-a/2*(--t*(t-2)-1)+e};var o=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)};function n(t,e,a){var n=document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop,i=t-n,s=0;e=void 0===e?500:e;!function t(){s+=20,function(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}(Math.easeInOutQuad(s,n,i,e)),s<e?o(t):a&&"function"==typeof a&&a()}()}},Yfch:function(t,e,a){"use strict"},ZySA:function(t,e,a){"use strict";var o=a("P2sY"),n=a.n(o),i=(a("jUE0"),{bind:function(t,e){t.addEventListener("click",function(a){var o=n()({},e.value),i=n()({ele:t,type:"hit",color:"rgba(0, 0, 0, 0.15)"},o),s=i.ele;if(s){s.style.position="relative",s.style.overflow="hidden";var r=s.getBoundingClientRect(),l=s.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",s.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=(a.pageY-r.top-l.offsetHeight/2-document.documentElement.scrollTop||document.body.scrollTop)+"px",l.style.left=(a.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)}}),s=function(t){t.directive("waves",i)};window.Vue&&(window.waves=i,Vue.use(s)),i.install=s;e.a=i},hDwf:function(t,e,a){"use strict";var o=a("tqk+");a.n(o).a},jUE0:function(t,e,a){},"tqk+":function(t,e,a){}}]);
\ No newline at end of file
......@@ -72,6 +72,20 @@
import {validateURL} from '@/utils/validate'
import {faceStarCreate, facestarDetail} from '@/api/face_image_upload'
const SexOptions = [
{'key': 1, 'display_name': '男'},
{'key': 2, 'display_name': '女'},
]
const sexTypeKeyValue = SexOptions.reduce((acc, cur) => {
acc[cur.key] = cur.display_name
return acc
}, {})
const ValueToSexTypeKeyValue = SexOptions.reduce((acc, cur) => {
acc[cur.key] = cur.display_name
return acc
}, {})
const defaultForm = {
status: 'draft',
......@@ -118,8 +132,8 @@
},
tempRoute: {},
GenderTypeOptions: [
{'key': 0, 'display_name': '男'},
{'key': 1, 'display_name': '女'},
{'key': 1, 'display_name': '男'},
{'key': 2, 'display_name': '女'},
],
uploadType: -99,
isdisabledFn: false
......@@ -144,6 +158,7 @@
fetchData(id) {
facestarDetail(id).then(response => {
this.postForm = response.data.data.data
this.postForm.sex = sexTypeKeyValue[response.data.data.data.sex]
}).catch(err => {
console.log(err)
})
......@@ -163,6 +178,14 @@
this.loading = false
return false
}
const gender = {
'男': 1,
'女': 2
}
this.isdisabledFn = true
if (gender.hasOwnProperty(this.postForm.sex)){
this.postForm.sex = gender[this.postForm.sex]
}
this.isdisabledFn = true
faceStarCreate(this.postForm).then(response => {
this.$notify({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment