_uid~436e9b74.d09b8dc.js 5.1 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([[90],{1322:function(t,e,r){"use strict";var n=r(948);r.n(n).a},1466:function(t,e,r){"use strict";r.r(e);r(30);var n=r(137),o=(r(35),r(8)),c="被举报用户不存在",l="获取被举报用户信息出错",d={name:"Report",data:function(){return{maxWordLimit:500,typeList:[],detail:"",beReportUser:{icon_url:"",nickname:""},beReportUserId:""}},asyncData:function(t){return Object(o.a)(regeneratorRuntime.mark((function e(){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.$axios,t.params,n=t.error,t.req,t.app,e.next=3,r.$post("/api/user/getInfo");case 3:(o=e.sent).data&&o.data.uid||n({statusCode:404,message:"页面未找到"});case 5:case"end":return e.stop()}}),e)})))()},created:function(){return Object(o.a)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})))()},mounted:function(){var t=this;return Object(o.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.needLogin();case 2:t.getTypeList(),t.getBeReportUserInfo();case 4:case"end":return e.stop()}}),e)})))()},methods:{getTypeList:function(){var t=this;this.$axios.get("/api/report/get_report_type").then((function(e){if(console.log(e,e.data),1===e.data.status){for(var r=Object(n.a)(e&&e.data&&e.data.data||[]),o=[],i=0;i<r.length;i++)o.push({name:r[i],selected:0===i});t.typeList=[].concat(o)}}))},getBeReportUserInfo:function(){var t=this,e=this.$route.params.uid;e?(this.beReportUserId=e,this.$axios.get("/api/user/getUserInfo?id=".concat(e)).then((function(e){var data=e.data;1===data.status?t.beReportUser=data.data.info:data.status&&(console.log("res.status",data.status),t.$message.closeAll(),t.$message.error(data.status.message||l))})).catch((function(e){t.$message.closeAll(),t.$message.error("")}))):this.$message.error(c)},submitForm:function(){var t=this,e=this.typeList,r=this.detail,n=this.beReportUserId;this.beReportUser;if(this.beReportUser.nickname){var o=[];if(e.forEach((function(t){t.selected&&o.push(t.name)})),o=o.join(","))if(!r||r.length<10)this.$message.warning("详情描述不得少于10字符");else if(r.length>500)this.$message.warning("详情描述不得超过500字符");else{var p={reported_uid:n,type:o,detail:r,from:"web端主页"};this.$axios.post("/api/report/create",p).then((function(e){1===e.data.status?(t.$message.success("提交成功,客栈将在7日内联系处理"),setTimeout((function(){history.back()}),1e3)):t.$message.error("提交失败")})).catch((function(e){console.log(e),t.$message.error("提交失败")}))}else this.$message.warning("请选择举报类型")}else this.$message.warning(c)},chooseReport:function(t){t.selected=!t.selected}}},h=(r(1322),r(10)),component=Object(h.a)(d,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"Report"},[t._m(0),t._v(" "),r("div",{staticClass:"bodyArea"},[t._m(1),t._v(" "),r("div",{staticClass:"reportBox"},[r("div",{staticClass:"reportUser"},[t._m(2),t._v(" "),r("div",{staticClass:"right"},[r("img",{staticClass:"img",attrs:{src:t.beReportUser.icon_url,alt:""}}),t._v(" "),r("p",{staticClass:"name"},[t._v(t._s(t.beReportUser.nickname||""))])])]),t._v(" "),r("div",{staticClass:"reportType"},[t._m(3),t._v(" "),r("div",{staticClass:"right"},t._l(t.typeList,(function(e,n){return r("div",{key:"typeListCell"+n,staticClass:"cell",on:{click:function(r){return t.chooseReport(e)}}},[r("div",{staticClass:"check",class:{ok:e.selected}}),t._v(" "),r("div",{staticClass:"word"},[t._v(t._s(e.name))])])})),0)]),t._v(" "),r("div",{staticClass:"reportDesc"},[t._m(4),t._v(" "),r("div",{staticClass:"right"},[r("el-input",{staticStyle:{width:"540px","min-height":"110px"},attrs:{type:"textarea",autosize:{minRows:5,maxRows:30},placeholder:"请输入...",resize:"none","show-word-limit":!0,maxlength:t.maxWordLimit},model:{value:t.detail,callback:function(e){t.detail=e},expression:"detail"}})],1)]),t._v(" "),r("div",{staticClass:"reportButton"},[r("div",{staticClass:"left"}),t._v(" "),r("div",{staticClass:"right",on:{click:t.submitForm}},[r("p",[t._v("确认提交")])])])])])])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"titleArea"},[e("p",[this._v("举报用户")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"topTips"},[e("p",[this._v("程序客栈严厉打击:发布违法违规类信息、个人主页简历造假、个人主页信息侵权等违规违法行为,如您发现对方存在违法违规等行为,请反馈给我们")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"left"},[e("p",[this._v("举报对象")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"left"},[e("p",[this._v("举报类型")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"left"},[e("p",[this._v("详情描述")])])}],!1,null,"5e56b85e",null);e.default=component.exports},948:function(t,e,r){}}]);