浏览代码

feat: #对接摄影师审核页面

loki 3 年之前
父节点
当前提交
f05ca380a6

+ 8 - 0
src/api/photoer/index.js

@@ -0,0 +1,8 @@
+import api from '@/utils/request';
+
+export const getList = params =>
+	api.post(`/yxl-back-end/admin/photoer/page`, params);
+export const getItem = ({ id, ...params }) =>
+	api.get(`/yxl-back-end/admin/photoer/${id}`, params);
+export const auditItem = ({ id, ...params }) =>
+	api.put(`/yxl-back-end/admin/photoer/${id}/audit`, params);

+ 33 - 21
src/components/Breadcrumb.vue

@@ -1,8 +1,12 @@
 <template>
   <el-breadcrumb class="app-breadcrumb" separator="/">
     <transition-group name="breadcrumb">
-      <el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
-        <span v-if="item.redirect==='noRedirect'||index==levelList.length-1" class="no-redirect">{{ item.meta.title }}</span>
+      <el-breadcrumb-item v-for="(item, index) in levelList" :key="item.path">
+        <span
+          v-if="item.redirect === 'noRedirect' || index == levelList.length - 1"
+          class="no-redirect"
+          >{{ item.meta.title }}</span
+        >
         <a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a>
       </el-breadcrumb-item>
     </transition-group>
@@ -10,57 +14,65 @@
 </template>
 
 <script>
-import pathToRegexp from 'path-to-regexp'
+import pathToRegexp from 'path-to-regexp';
 
 export default {
   data() {
     return {
       levelList: null
-    }
+    };
   },
   watch: {
     $route() {
-      this.getBreadcrumb()
+      this.getBreadcrumb();
     }
   },
   created() {
-    this.getBreadcrumb()
+    this.getBreadcrumb();
   },
   methods: {
     getBreadcrumb() {
       // only show routes with meta.title
-      let matched = this.$route.matched.filter(item => item.meta && item.meta.title)
-      const first = matched[0]
+      let matched = this.$route.matched.filter(
+        item => item.meta && item.meta.title
+      );
+      const first = matched[0];
 
       if (!this.isDashboard(first)) {
-        matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched)
+        matched = [{ path: 'dashboard', meta: { title: 'Dashboard' } }].concat(
+          matched
+        );
       }
 
-      this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
+      this.levelList = matched.filter(
+        item => item.meta && item.meta.title && item.meta.breadcrumb !== false
+      );
     },
     isDashboard(route) {
-      const name = route && route.name
+      const name = route && route.name;
       if (!name) {
-        return false
+        return false;
       }
-      return name.trim().toLocaleLowerCase() === 'Dashboard'.toLocaleLowerCase()
+      return (
+        name.trim().toLocaleLowerCase() === 'Dashboard'.toLocaleLowerCase()
+      );
     },
     pathCompile(path) {
       // To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
-      const { params } = this.$route
-      var toPath = pathToRegexp.compile(path)
-      return toPath(params)
+      const { params } = this.$route;
+      var toPath = pathToRegexp.compile(path);
+      return toPath(params);
     },
     handleLink(item) {
-      const { redirect, path } = item
+      const { redirect, path } = item;
       if (redirect) {
-        this.$router.push(redirect)
-        return
+        this.$router.push(redirect);
+        return;
       }
-      this.$router.push(this.pathCompile(path))
+      this.$router.push(this.pathCompile(path));
     }
   }
-}
+};
 </script>
 
 <style lang="scss" scoped>

+ 3 - 0
src/const/auditType.js

@@ -0,0 +1,3 @@
+import { setStatus } from '@/utils';
+
+export default setStatus(['通过', '待审核', '拒绝'], [1, 0, -1]);

+ 8 - 0
src/utils/dialog-helper.js

@@ -10,6 +10,7 @@ import TrendItem from 'views/baseManagement/trending/modal/ItemModal.vue';
 import SceneVerifyItem from 'views/sceneManagement/sceneVerify/modal/ItemModal.vue';
 import SceneItem from 'views/sceneManagement/sceneList/modal/ItemModal.vue';
 import WithdrawalRecordVerifyItem from 'views/statistics/withdrawalRecord/modal/ItemModal.vue';
+import PhotoerVerifyItem from 'views/photographerManagement/photographerVerify/modal/ItemModal.vue';
 
 const modal = (Component, props) => {
   let _component = null;
@@ -101,3 +102,10 @@ let WithdrawalRecordVerifyItemModal = data => {
 Vue.prototype.$WithdrawalRecordVerifyItemModal = params => {
   WithdrawalRecordVerifyItemModal(params);
 };
+
+let PhotoerVerifyItemModal = data => {
+  modal(PhotoerVerifyItem, data);
+};
+Vue.prototype.$PhotoerVerifyItemModal = params => {
+  PhotoerVerifyItemModal(params);
+};

+ 1 - 3
src/views/baseManagement/infoManagement/modal/ItemModal.vue

@@ -23,10 +23,8 @@
       <el-form-item label="封面" prop="cover">
         <upload v-model="form.cover" params="prefix=/tweet" />
       </el-form-item>
-
-      <!-- TODO 上传封面 -->
       <el-form-item label="内容" prop="content">
-        <RichText v-model="form.content"></RichText>
+        <RichText v-model="form.content" />
       </el-form-item>
       <el-form-item label="状态">
         <el-radio-group v-model="form.isShow" prop="isShow">

+ 6 - 1
src/views/baseManagement/problemFeedbackManagement/index.vue

@@ -33,7 +33,12 @@ export default {
       columns: [
         {
           key: 'nickname',
-          name: '用户名称',
+          name: '用户昵称',
+          width: '160'
+        },
+        {
+          key: 'realName',
+          name: '真实姓名',
           width: '160'
         },
         {

+ 9 - 3
src/views/baseManagement/problemFeedbackManagement/toolbar.vue

@@ -11,12 +11,12 @@ export default {
       fields: [
         {
           type: 'text',
-          name: 'title',
-          label: '用户称'
+          name: 'accountNickname',
+          label: '用户称'
         },
         {
           type: 'text',
-          name: 'status',
+          name: 'phonenumber',
           label: '用户手机号',
           labelWidth: '100px'
         },
@@ -25,6 +25,12 @@ export default {
           name: 'date',
           label: '反馈日期',
           apiName: ['start', 'end']
+        },
+        {
+          type: 'text',
+          name: 'content',
+          label: '反馈内容关键词',
+          labelWidth: '120px'
         }
       ]
     };

+ 1 - 1
src/views/helpInfo/information/toolbar.vue

@@ -18,7 +18,7 @@ export default {
         },
         {
           type: 'issueTypeSelect',
-          name: 'type',
+          name: 'helpGroupId',
           label: '分类',
           labelWidth: '100px'
         },

+ 94 - 32
src/views/photographerManagement/photographerVerify/index.vue

@@ -15,6 +15,7 @@
 <script>
 import toolbar from './toolbar';
 import mxFilterList from '@/mixins/filterList';
+import { getList } from '@/api/photoer';
 
 export default {
   name: 'PhotographerVerify',
@@ -23,65 +24,126 @@ export default {
 
   mixins: [
     mxFilterList({
-      // fetchList: iGetList // 在下方data再声明一个 fetchList: iGetList 同等效果
+      fetchList: getList // 在下方data再声明一个 fetchList: iGetList 同等效果
     })
   ],
 
   data() {
     return {
       columns: [
+        // {
+        //   key: 'photo',
+        //   name: '会员ID',
+        //   width: '160'
+        // }
         {
-          key: 'photo',
-          name: '会员ID',
-          width: '160'
-        },
-        {
-          key: 'region',
+          key: 'realName',
           name: '申请者',
           width: '180'
         },
         {
-          key: 'region',
-          name: '姓名',
-          width: '120'
-        },
-        {
-          key: 'region',
-          name: '身份证号码',
+          key: 'idCardNumber',
+          name: '身份证号',
           minWidth: '180'
         },
         {
-          key: 'region',
+          key: 'phonenumber',
           name: '手机号',
-          width: '180'
-        },
-        {
-          key: 'region',
-          name: '微信号',
-          width: '180'
-        },
-        {
-          key: 'region',
-          name: '电子邮箱',
-          width: '180'
+          minWidth: '180'
         },
         {
-          key: 'region',
-          name: '常合作场景',
-          minWidth: '180'
+          key: 'logo',
+          name: '有关图片',
+          width: '160',
+          render: (h, { row }) =>
+            h('img', {
+              style: {
+                width: '120px',
+                height: '90px'
+              },
+              attrs: {
+                src: row.bodyPhoto
+              },
+              on: {
+                click: () =>
+                  this.$AdvanceViewImageModal({
+                    items: [
+                      { src: row.bodyPhoto },
+                      { src: row.idCardFront },
+                      { src: row.idCardBack }
+                    ]
+                  })
+              }
+            })
         },
         {
-          key: 'region',
+          key: 'auditStatus',
           name: '状态',
-          minWidth: '180'
+          minWidth: '180',
+          type: 'tag',
+          fetchTagType: val => {
+            switch (val) {
+              case 1:
+                return 'success';
+              case 0:
+                return 'info';
+              case -1:
+                return 'error';
+              default:
+                return 'info';
+            }
+          },
+          tagName: row => {
+            switch (row.auditStatus) {
+              case 1:
+                return '通过';
+              case 0:
+                return '待审核';
+              case -1:
+                return '拒绝';
+              default:
+                return '-';
+            }
+          }
         },
         {
           key: 'action',
           name: '操作',
-          minWidth: '180'
+          width: '120',
+          render: (h, { row }) => {
+            const action = [];
+            action.push(
+              h(
+                'el-button',
+                {
+                  props: {
+                    type: 'text'
+                  },
+                  on: {
+                    click: () =>
+                      this.$PhotoerVerifyItemModal({
+                        id: row.id,
+                        auditStatus: row.auditStatus
+                      })
+                  }
+                },
+                '编辑'
+              )
+            );
+
+            return h('div', action);
+          }
         }
       ]
     };
+  },
+
+  created() {
+    this.$g_on('photoer_reload', this.reload);
+  },
+
+  beforeDestroy() {
+    this.$g_off('photoer_reload', this.reload);
   }
 };
 </script>

+ 173 - 0
src/views/photographerManagement/photographerVerify/modal/ItemModal.vue

@@ -0,0 +1,173 @@
+<template>
+  <el-dialog
+    :title="title"
+    :visible.sync="modal"
+    width="80%"
+    :close-on-click-modal="false"
+    @close="
+      res => {
+        $emit('cancel');
+      }
+    "
+  >
+    <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+      <el-form-item label="证照号码"> {{ form.idCardNumber }} </el-form-item>
+      <el-form-item label="申请人姓名"> {{ form.realName }} </el-form-item>
+      <el-form-item label="手机号"> {{ form.phonenumber }} </el-form-item>
+      <el-form-item label="半身照"
+        ><img
+          :src="form.bodyPhoto"
+          class="pre-img"
+          @click="
+            () =>
+              this.$AdvanceViewImageModal({
+                items: [{ src: form.bodyPhoto }]
+              })
+          "
+        />
+      </el-form-item>
+      <el-form-item label="证件正面"
+        ><img
+          :src="form.idCardFront"
+          class="pre-img"
+          @click="
+            () =>
+              this.$AdvanceViewImageModal({
+                items: [{ src: form.idCardFront }]
+              })
+          "
+        />
+      </el-form-item>
+      <el-form-item label="证件背面"
+        ><img
+          :src="form.idCardBack"
+          class="pre-img"
+          @click="
+            () =>
+              this.$AdvanceViewImageModal({
+                items: [{ src: form.idCardBack }]
+              })
+          "
+        />
+      </el-form-item>
+      <el-form-item label="审核状态" prop="auditStatus">
+        <el-radio-group v-if="auditStatus !== 1" v-model="form.auditStatus">
+          <el-radio :label="1">通过</el-radio>
+          <el-radio :label="-1">不通过</el-radio>
+        </el-radio-group>
+        <span v-else>{{ form.auditStatus | auditStatusName }}</span>
+      </el-form-item>
+      <el-form-item label="审核备注">
+        <el-input
+          v-if="auditStatus !== 1"
+          v-model="form.auditMsg"
+          type="textarea"
+          :rows="2"
+          placeholder="请输入内容"
+        >
+        </el-input>
+        <span v-else>{{ form.auditMsg }}</span>
+      </el-form-item>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="modal = false">取消</el-button>
+      <el-button type="primary" @click="handleConfirm">确定</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+import { getItem, auditItem } from '@/api/photoer';
+
+export default {
+  name: 'PhotoerVerifyItemModal',
+
+  filters: {
+    auditStatusName: function(num) {
+      switch (num) {
+        case 1:
+          return '通过';
+        case 0:
+          return '待审核';
+        case -1:
+          return '拒绝';
+        default:
+          return '-';
+      }
+    }
+  },
+
+  props: {
+    id: {
+      type: String,
+      default: ''
+    },
+    auditStatus: {
+      type: Number,
+      default: 0
+    }
+  },
+
+  data() {
+    return {
+      title: '摄影师详情',
+      modal: true,
+      form: {
+        auditStatus: null,
+        auditMsg: ''
+      },
+      rules: {
+        auditStatus: [
+          { required: true, message: '请选择是否通过', trigger: 'blur' }
+        ]
+      }
+    };
+  },
+
+  watch: {
+    id: {
+      handler(id) {
+        id && this.loadData();
+      },
+      immediate: true
+    }
+  },
+
+  mounted() {},
+
+  methods: {
+    async loadData() {
+      const { success, data, msg } = await getItem({
+        id: this.id
+      });
+      if (success) {
+        this.form = data;
+      }
+    },
+
+    handleConfirm() {
+      this.$refs.form.validate(async valid => {
+        if (valid) {
+          const params = {
+            auditStatus: this.form.auditStatus,
+            auditMsg: this.form.auditMsg
+          };
+          if (this.id) params.id = this.form.id;
+          const { success, msg } = await auditItem(params);
+          if (success) {
+            this.$success('保存成功!');
+            this.modal = false;
+            this.$g_emit('photoer_reload');
+          }
+        }
+      });
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.pre-img {
+  height: 80px;
+}
+</style>

+ 7 - 3
src/views/photographerManagement/photographerVerify/toolbar.vue

@@ -3,6 +3,8 @@
 </template>
 
 <script>
+import AUDITTYPE from '@/const/auditType';
+
 export default {
   name: 'PhotographerVerifyToolbar',
 
@@ -11,19 +13,21 @@ export default {
       fields: [
         {
           type: 'text',
-          name: 'title',
+          name: 'realName',
           label: '申请者'
         },
         {
           type: 'text',
-          name: 'status',
+          name: 'phonenumber',
           label: '用户手机号',
           labelWidth: '100px'
         },
         {
           type: 'select',
           name: 'date',
-          label: '状态'
+          label: '状态',
+          options: AUDITTYPE,
+          format: val => val
         }
       ]
     };

+ 0 - 1
src/views/sceneManagement/sceneVerify/modal/ItemModal.vue

@@ -196,7 +196,6 @@ export default {
             auditStatus: this.form.auditStatus,
             auditMsg: this.form.auditMsg
           };
-          console.log(params);
           if (this.id) params.id = this.form.infoId;
           const { success, msg } = await auditItem(params);
           if (success) {

+ 3 - 3
src/views/sceneManagement/sceneVerify/toolbar.vue

@@ -3,7 +3,7 @@
 </template>
 
 <script>
-import TYPE from '@/const/type';
+import AUDITTYPE from '@/const/auditType';
 import SCENETYPE from '@/const/sceneType';
 
 export default {
@@ -26,8 +26,8 @@ export default {
           type: 'select',
           name: 'status',
           label: '状态',
-          options: TYPE,
-          format: val => (val !== null && val !== '' ? !!val : null)
+          options: AUDITTYPE,
+          format: val => val
         },
         {
           type: 'select',