1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5867d520"],{2374:function(t,e,a){"use strict";a.d(e,"a",function(){return o}),a.d(e,"b",function(){return s});var n=a("8982"),r="",i="/wx/noticePark";function o(t){return Object(n["a"])({url:r+i+"/add",method:"post",data:t})}function s(t){return Object(n["a"])({url:r+i+"/edit",method:"post",data:t})}},"24ec":function(t,e,a){"use strict";a.d(e,"i",function(){return s}),a.d(e,"e",function(){return c}),a.d(e,"c",function(){return u}),a.d(e,"j",function(){return d}),a.d(e,"g",function(){return l}),a.d(e,"p",function(){return f}),a.d(e,"m",function(){return h}),a.d(e,"n",function(){return m}),a.d(e,"o",function(){return p}),a.d(e,"a",function(){return b}),a.d(e,"f",function(){return g}),a.d(e,"l",function(){return v}),a.d(e,"k",function(){return j}),a.d(e,"d",function(){return w}),a.d(e,"h",function(){return O}),a.d(e,"b",function(){return x});var n=a("8982"),r="/industryParkApi",i="/wx/user",o="/wx/frameUser";function s(t){return Object(n["a"])({url:r+i+"/login_by_app_main",method:"post",data:t})}function c(t){return Object(n["a"])({url:r+i+"/editMyInformation",method:"post",data:t})}function u(t){return Object(n["a"])({url:r+i+"/changePassword",method:"post",data:t})}function d(t){return Object(n["a"])({url:r+o+"/getById",method:"post",data:t})}function l(t){return Object(n["a"])({url:r+i+"/getById",method:"post",data:t})}function f(t){return Object(n["a"])({url:r+i+"/wechatUnBind",method:"post",data:t})}function h(t){return Object(n["a"])({url:r+i+"/unbound",method:"post",data:t})}function m(t){return Object(n["a"])({url:r+i+"/unbound2",method:"post",data:t})}function p(t){return Object(n["a"])({url:r+i+"/wechatBind",method:"post",data:t})}function b(t){return Object(n["a"])({url:r+i+"/binding",method:"post",data:t})}function g(t){return Object(n["a"])({url:r+o+"/editPassword",method:"post",data:t})}function v(t){return Object(n["a"])({url:r+i+"/send",method:"post",data:t})}function j(t){return Object(n["a"])({url:r+i+"/register_by_account",method:"post",data:t})}function w(t){return Object(n["a"])({url:r+i+"/checkAccount",method:"post",data:t})}function O(t){return Object(n["a"])({url:r+i+"/userInfo/"+t,method:"post"})}function x(t){return Object(n["a"])({url:r+i+"/bizInfo/"+t,method:"post"})}},4212:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"repair-box"},[a("div",{staticClass:"repair-content fixed-page-content"},[a("div",{staticClass:"white-box page-1"},[a("div",{staticClass:"custom-white-box-content"},[a("div",{staticClass:"custom-input-box"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.detail.title,expression:"detail.title"}],attrs:{type:"text",maxlength:"50px",placeholder:"请填写标题"},domProps:{value:t.detail.title},on:{input:function(e){e.target.composing||t.$set(t.detail,"title",e.target.value)}}})])])]),a("div",{staticClass:"white-box page-2"},[a("div",{staticClass:"block-cell-item"},[a("div",{staticClass:"tit"},[a("div",{staticClass:"block-cell-item"},[t._m(0),a("div",{staticClass:"tit"},[a("van-uploader",{attrs:{multiple:!0,"max-count":6,"after-read":t.afterRead,"before-delete":t.beforeDelete},model:{value:t.fileList,callback:function(e){t.fileList=e},expression:"fileList"}})],1)])])])]),a("div",{staticClass:"block-cell-item page-3"},[a("div",{staticClass:"custom-textarea-box"},[t._m(1),a("van-field",{attrs:{rows:"8",autosize:"",type:"textarea",placeholder:"请输入","show-word-limit":""},model:{value:t.detail.content,callback:function(e){t.$set(t.detail,"content",e)},expression:"detail.content"}})],1)])]),a("div",{staticClass:"repair-bottom bottom-button"},[a("button",{staticClass:"btn",on:{click:t.submmit}},[t._v("发布")])])])},r=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("p",{staticClass:"label"},[t._v("\n\t\t\t\t\t\t\t图片上传"),a("span",{staticClass:"tips"},[t._v("(支持图片/视频上传限20M内,最多6张)")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"custom-item-tit"},[a("p",{staticClass:"tit"},[t._v("通知内容")])])}],i=a("795b"),o=a.n(i),s=(a("a481"),a("ac6a"),a("f499")),c=a.n(s),u=a("2374"),d=a("bc3a"),l=a.n(d),f=a("3089"),h=a("24ec"),m=a("5cab"),p={data:function(){return{fileList:[],fileUrlList:[],detail:{},form:{id:"",title:"",content:"",fileUrl:"",deptId:"",status:"published"}}},mounted:function(){this.form.id=this.$route.params.id,this.selectById(),this.getUserInfo()},methods:{getUserInfo:function(){var t=this;Object(h["j"])({id:m["a"].currUser().id}).then(function(e){e.data&&(t.userInfo=e.data,t.form.deptId=t.userInfo.deptName)})},submmit:function(){var t=this;this.form.fileUrl=c()(this.fileUrlList),this.form.title=this.detail.title,this.form.content=this.detail.content,Object(u["b"])(this.form).then(function(e){Object(f["Toast"])("发布成功"),t.$router.push({path:"/propertyNotice-app"})})},selectById:function(){var t=this;Object(u["getPropertyNoticeById"])({id:t.form.id}).then(function(e){var a=e.data;if(a.fileUrl&&a.fileUrl.length>2){t.fileList=[];var n=t.$common.castEval(a.fileUrl);n.forEach(function(e){t.fileList.push(JSON.parse('{"url":"'+e.url.replace("/server","/industryParkApi")+'","isImage": true}'))}),t.fileUrlList=n}t.detail=a})},afterRead:function(t){var e=this;t instanceof Array?t.map(function(t){e.uploadImg(t)}):this.uploadImg(t)},beforeDelete:function(t,e){var a=this;return a.fileUrlList.splice(e.index,1),function(t,n){var r=n.index;a.fileUrlList[e.index].splice(r,1)}},uploadImg:function(t){var e=this,a=new FormData;a.append("file",t.file),console.log(a.get("file"));var n={headers:{"Content-Type":"multipart/form-data","MVVM-Key":String((new Date).getTime()),xx:"anything"}};return new o.a(function(t,r){l.a.post("/industryParkApi/wx/fileController/upload",a,n).then(function(t){var a=t.data.data.substring(1,t.data.data.length);a=a.substring(0,a.length-1),e.fileUrlList.push(e.$common.castEval(a))}).catch(function(t,e){r(t,e)})})}}},b=p,g=(a("a881"),a("2877")),v=Object(g["a"])(b,n,r,!1,null,"fd947868",null);e["default"]=v.exports},8982:function(t,e,a){"use strict";a.d(e,"a",function(){return h}),a.d(e,"b",function(){return m});var n=a("795b"),r=a.n(n),i=a("bc3a"),o=a.n(i),s=a("4328"),c=a.n(s),u=a("4360"),d=a("5cab"),l=a("a18c"),f=a("3089");function h(t,e){t.headers||(t.headers={}),t.headers&&d["a"].getToken()&&(t.headers["RC-Token"]=d["a"].getToken());var a={method:t.method,url:t.url,data:c.a.stringify(t.data)};return e&&(a.data=t.data),t.headers&&(a.headers=t.headers),new r.a(function(e,n){o()(a).then(function(t){if(t&&t.data&&200===t.status){var a=t.data;switch(a.errno){case 501:Object(f["Toast"])(a.errmsg),setTimeout(function(){u["a"].dispatch("user/logout").then(function(){l["a"].push("/login")})},1500),n(a.errmsg);break;case 401:case 402:case 502:case 503:case 504:case 505:case 506:case 507:case 508:case 801:Object(f["Toast"])(a.errmsg),n(a.errmsg);break}e(a)}else console.log(t),n(t)}).catch(function(e,a){console.log(t.url+" fail",e,a),Object(f["Toast"])(e),n(e,a)})})}function m(t){t.headers||(t.headers={}),t.headers&&d["a"].getToken()&&(t.headers["RC-Token"]=d["a"].getToken());var e={method:t.method,url:t.url};return e.data=t.data,t.headers&&(e.headers=t.headers,e.headers["MVVM-Key"]=String((new Date).getTime()),e.headers["xx"]="anything",e.headers["Content-Type"]="application/json;charset=UTF-8"),console.log("request: ",t),new r.a(function(a,n){o.a.defaults.withCredentials=!0,o()(e).then(function(t){if(console.log("response:",t),t&&t.data&&200===t.status){var e=t.data;switch(e.errno){case 501:Object(f["Toast"])(e.errmsg),setTimeout(function(){u["a"].dispatch("user/logout").then(function(){l["a"].push("/login")})},1500),n(e.errmsg);break;case 401:case 402:case 502:case 503:case 504:case 505:case 506:case 507:case 508:case 801:Object(f["Toast"])(e.errmsg),n(e.errmsg);break}a(e)}else console.log(t),n(t)}).catch(function(e,a){console.log(t.url+" fail",e,a),Object(f["Toast"])(e),n(e,a)})})}},a881:function(t,e,a){"use strict";var n=a("bdbd"),r=a.n(n);r.a},bdbd:function(t,e,a){}}]);
|