|
|
@@ -0,0 +1,170 @@
|
|
|
+<template>
|
|
|
+ <div class="Report">
|
|
|
+ <div class="titleArea">
|
|
|
+ <p>举报用户</p>
|
|
|
+ </div>
|
|
|
+ <div class="bodyArea">
|
|
|
+ <div class="topTips">
|
|
|
+ <p>程序客栈发布违法违规类信息、个人主页简历造假、个人主页信息侵权等违规违法行为,如您发现对方存在违法违规等行为,请反馈给我们</p>
|
|
|
+ </div>
|
|
|
+ <div class="reportBox">
|
|
|
+ <div class="reportUser">
|
|
|
+ <div class="left">
|
|
|
+ <p>举报对象</p>
|
|
|
+ </div>
|
|
|
+ <div class="right">
|
|
|
+ <img :src="beReportUser.icon_url" alt="" class="img">
|
|
|
+ <p class="name">{{beReportUser.nickname || ''}}</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="reportType">
|
|
|
+ <div class="left">
|
|
|
+ <p>举报类型</p>
|
|
|
+ </div>
|
|
|
+ <div class="right">
|
|
|
+ <div class="cell"
|
|
|
+ v-for="(item, index) in typeList"
|
|
|
+ :key="'typeListCell' + index"
|
|
|
+ @click="type=item"
|
|
|
+ >
|
|
|
+ <div class="check" :class="{ok: type === item}"/>
|
|
|
+ <div class="word">{{item}}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="reportDesc">
|
|
|
+ <div class="left">
|
|
|
+ <p>详情描述</p>
|
|
|
+ </div>
|
|
|
+ <div class="right">
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ :autosize="{ minRows: 5, maxRows: 30 }"
|
|
|
+ placeholder="请输入..."
|
|
|
+ v-model="detail"
|
|
|
+ resize="none"
|
|
|
+ :show-word-limit="true"
|
|
|
+ :maxlength="maxWordLimit"
|
|
|
+ style="width:540px; min-height: 110px;"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="reportButton">
|
|
|
+ <div class="left"></div>
|
|
|
+ <div class="right" @click="submitForm">
|
|
|
+ <p>确认提交</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+
|
|
|
+ let errMsg = {
|
|
|
+ noneUser: '被举报用户不存在',
|
|
|
+ getUserWrong: '获取被举报用户信息出错'
|
|
|
+ }
|
|
|
+ export default {
|
|
|
+ name: 'Report',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ maxWordLimit: 500,
|
|
|
+ typeList: [],
|
|
|
+ type: '',
|
|
|
+ detail: '',
|
|
|
+ beReportUser: {
|
|
|
+ icon_url: '',
|
|
|
+ nickname: ''
|
|
|
+ },
|
|
|
+ beReportUserId: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+
|
|
|
+ },
|
|
|
+ async mounted() {
|
|
|
+ await this.needLogin()
|
|
|
+ this.getTypeList()
|
|
|
+ this.getBeReportUserInfo()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /** 获取类型 */
|
|
|
+ getTypeList() {
|
|
|
+ this.$axios.get('/api/report/get_report_type').then(res=>{
|
|
|
+ console.log(res, res.data)
|
|
|
+ if (res.data.status === 1) {
|
|
|
+ this.typeList = [...(res && res.data && res.data.data || []) ]
|
|
|
+ this.type = this.typeList[0]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getBeReportUserInfo() {
|
|
|
+ const { uid } = this.$route.params
|
|
|
+ if (!uid) {
|
|
|
+ this.$message.error(errMsg.noneUser)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.beReportUserId = uid
|
|
|
+ this.$axios.get(`/api/user/getUserInfo?id=${uid}`).then(res=>{
|
|
|
+ let data = res.data
|
|
|
+ if (data.status === 1) {
|
|
|
+ this.beReportUser = data.data.info
|
|
|
+ } else if (data.status){
|
|
|
+ console.log('res.status', data.status)
|
|
|
+ this.$message.closeAll()
|
|
|
+ this.$message.error(data.status.message || errMsg.getUserWrong)
|
|
|
+ }
|
|
|
+ }).catch(e => {
|
|
|
+ this.$message.closeAll()
|
|
|
+ this.$message.error('')
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ /** 提交 **/
|
|
|
+ submitForm() {
|
|
|
+ const {type, detail, beReportUserId, beReportUser={}} = this
|
|
|
+ if (!this.beReportUser.nickname) {
|
|
|
+ this.$message.warning(errMsg.noneUser)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!type) {
|
|
|
+ this.$message.warning('请选择举报类型')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!detail || detail.length < 10) {
|
|
|
+ this.$message.warning('详情描述不得少于10字符')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (detail.length > 500) {
|
|
|
+ this.$message.warning('详情描述不得超过500字符')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let p = {
|
|
|
+ reported_uid: 11 || beReportUserId,
|
|
|
+ type,
|
|
|
+ detail,
|
|
|
+ from:'web端主页'
|
|
|
+ }
|
|
|
+ this.$axios.post('/api/report/create', p).then(res=>{
|
|
|
+ let data = res.data
|
|
|
+ if (data.status === 1) {
|
|
|
+ this.$message.success('提交成功,客栈将在7日内联系处理')
|
|
|
+ } else {
|
|
|
+ this.$message.error('提交失败')
|
|
|
+ }
|
|
|
+ }).catch(e=> {
|
|
|
+ console.log(e)
|
|
|
+ this.$message.error('提交失败')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ }
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+ @import '../../../assets/css/other/report.scss';
|
|
|
+</style>
|