guhongwei 4 jaren geleden
bovenliggende
commit
fb8b565abc

+ 149 - 0
src/layout/chatCommon/chat.vue

@@ -0,0 +1,149 @@
+<template>
+  <div id="chat">
+    <van-row>
+      <van-col span="24" class="main">
+        <van-col span="24" class="one">
+          <template v-for="(i, index) in list">
+            <template v-if="isSender(i, index)">
+              <van-col span="24" class="senderTime" :key="`div${i.id}${index}`">
+                <span :key="`senderTime${i.id}${index}`">[{{ i.send_time }}] {{ i.sender_name }}</span>
+                <span v-html="i.content" :key="`senderContent${i.id}${index}`"></span>
+              </van-col>
+            </template>
+            <template v-else>
+              <van-col span="24" class="receverTime" :key="`div${i.id}${index}`">
+                <span :key="`receverTime${i.id}${index}`"> {{ i.sender_name }} [{{ i.send_time }}]</span>
+                <span v-html="i.content" :key="`receverContent${i.id}${index}`"></span>
+              </van-col>
+            </template>
+          </template>
+        </van-col>
+        <van-col span="24" class="two">
+          <van-col span="20" class="cont">
+            <van-field v-model="content" placeholder="请输入内容" />
+          </van-col>
+          <van-col span="4" class="btn">
+            <van-button type="info" size="small" @click="send">发送</van-button>
+          </van-col>
+        </van-col>
+      </van-col>
+    </van-row>
+  </div>
+</template>
+
+<script>
+import { Toast } from 'vant';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const _ = require('lodash');
+export default {
+  name: 'chat',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      content: '',
+      // 消息列表
+      list: [
+        {
+          send_time: '2021-01-01',
+          sender_id: '6108e8e171c873254c2c3ff8',
+          sender_name: '发言人',
+          content: '发言内容',
+        },
+        {
+          send_time: '2021-01-01',
+          sender_id: '6108e8e171c873254c2c3ff9',
+          sender_name: '自己',
+          content: '发言内容',
+        },
+      ],
+    };
+  },
+  created() {
+    console.log(this.user);
+  },
+  methods: {
+    send() {
+      this.$toast({ type: `success`, message: `发言成功` });
+    },
+    // 判断发言人
+    isSender(data) {
+      return this.user.id !== data.sender_id;
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .one {
+    height: 350px;
+    overflow-x: hidden;
+    overflow-y: auto;
+    padding: 10px 5px;
+    .senderTime {
+      float: left;
+      width: 100%;
+      text-align: left;
+      color: #666;
+      font-size: 14px;
+      margin: 0 0 5px 0;
+    }
+    .senderTime span:last-child {
+      float: left;
+      width: 100%;
+      text-align: left;
+      color: #000;
+    }
+    .receverTime {
+      float: right;
+      width: 100%;
+      color: #666;
+      font-size: 14px;
+      margin: 0 0 5px 0;
+    }
+    .receverTime span:first-child {
+      float: right;
+      width: 100%;
+      text-align: right;
+    }
+    .receverTime span:last-child {
+      float: right;
+      width: 100%;
+      text-align: right;
+      color: #000;
+    }
+  }
+  .two {
+    height: 40px;
+    border-top: 1px solid #ccc;
+    .cont {
+      /deep/.van-cell {
+        line-height: 20px;
+        padding: 10px;
+      }
+    }
+    .btn {
+      text-align: center;
+      /deep/.van-button--small {
+        width: 54px;
+        height: 40px;
+        padding: 0;
+      }
+    }
+  }
+}
+</style>

+ 1 - 1
src/layout/login/login-2.vue

@@ -32,7 +32,7 @@ export default {
     async onSubmit(values) {
       let res = await this.login({ user: values });
       if (this.$checkRes(res)) {
-        this.$router.push({ path: this.$route.query.path });
+        this.$router.push({ path: '/exchange/center/index' });
       } else {
         this.$toast({ type: 'fail', message: res.errmsg });
       }

+ 38 - 0
src/router/index.js

@@ -233,6 +233,44 @@ const exchange = [
     meta: { title: '个人中心' },
     component: () => import('../views/exchange/center/index.vue'),
   },
+  // 管理用户
+  {
+    path: '/exchange/center/adminCenter/mechanism/index',
+    meta: { title: '机构用户' },
+    component: () => import('../views/exchange/center/adminCenter/mechanism/index.vue'),
+  },
+  {
+    path: '/exchange/center/adminCenter/mechanism/detail',
+    meta: { title: '机构用户-详细信息' },
+    component: () => import('../views/exchange/center/adminCenter/mechanism/detail.vue'),
+  },
+  {
+    path: '/exchange/center/adminCenter/users/index',
+    meta: { title: '平台用户' },
+    component: () => import('../views/exchange/center/adminCenter/users/index.vue'),
+  },
+  {
+    path: '/exchange/center/adminCenter/message/index',
+    meta: { title: '我的消息' },
+    component: () => import('../views/exchange/center/adminCenter/message/index.vue'),
+  },
+  {
+    path: '/exchange/center/adminCenter/disclosure/index',
+    meta: { title: '申请管理' },
+    component: () => import('../views/exchange/center/adminCenter/disclosure/index.vue'),
+  },
+  {
+    path: '/exchange/center/adminCenter/patent/index',
+    meta: { title: '专利管理' },
+    component: () => import('../views/exchange/center/adminCenter/patent/index.vue'),
+  },
+  {
+    path: '/exchange/center/adminCenter/trade/index',
+    meta: { title: '交易管理' },
+    component: () => import('../views/exchange/center/adminCenter/trade/index.vue'),
+  },
+  // 机构用户
+  // 个人(企业)用户
   // {
   //   path: '/exchange/center/basic/index',
   //   meta: { title: '详细信息' },

+ 36 - 0
src/views/exchange/center/adminCenter/disclosure/index.vue

@@ -0,0 +1,36 @@
+<template>
+  <div id="index">
+    <van-row>
+      <van-col span="24" class="main"> test </van-col>
+    </van-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 87 - 0
src/views/exchange/center/adminCenter/mechanism/detail.vue

@@ -0,0 +1,87 @@
+<template>
+  <div id="detail">
+    <admin-frame :usePage="false" topType="2" :rightArrow="false" @back="back" :useNav="false">
+      <template v-slot:info>
+        <detail-1 :form="form" :pidList="pidList" @onSubmit="onSubmit"></detail-1>
+      </template>
+    </admin-frame>
+  </div>
+</template>
+
+<script>
+import detail1 from './parts/detail_1.vue';
+import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: adminLogin } = createNamespacedHelpers('adminLogin');
+export default {
+  name: 'detail',
+  props: {},
+  components: {
+    adminFrame,
+    detail1,
+  },
+  data: function () {
+    return {
+      form: {},
+      pidList: [],
+    };
+  },
+  async created() {
+    await this.search();
+  },
+  methods: {
+    ...adminLogin(['query', 'fetch', 'update', 'delete']),
+    async search() {
+      let res = await this.query({ role: '1' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `pidList`, res.data);
+      }
+      if (this.id) {
+        res = await this.fetch(this.id);
+        if (this.$checkRes(res)) {
+          res.data.pidName = this.pidList.find((i) => i.id == res.data.pid).name;
+          this.$set(this, `form`, res.data);
+        }
+      }
+    },
+    // 查看详情
+    async onSubmit(data) {
+      data.role = '2';
+      if (data.id) {
+        let res = await this.update(data);
+        if (this.$checkRes(res)) {
+          this.$toast({ type: `success`, message: `信息修改成功` });
+          this.back();
+        }
+      } else {
+        let res = await this.create(data);
+        if (this.$checkRes(res)) {
+          this.$toast({ type: `success`, message: `信息创建成功` });
+          this.back();
+        }
+      }
+    },
+    back() {
+      this.$router.push({ path: `/exchange/center/adminCenter/mechanism/index` });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 71 - 0
src/views/exchange/center/adminCenter/mechanism/index.vue

@@ -0,0 +1,71 @@
+<template>
+  <div id="index">
+    <admin-frame @search="search" :limit="limit" :total="total" topType="2" @add="add" @back="back">
+      <template v-slot:info>
+        <list-1 :list="list" @detail="detail"></list-1>
+      </template>
+    </admin-frame>
+  </div>
+</template>
+
+<script>
+import list1 from './parts/list_1.vue';
+import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: adminLogin } = createNamespacedHelpers('adminLogin');
+export default {
+  name: 'index',
+  props: {},
+  components: {
+    adminFrame,
+    list1,
+  },
+  data: function () {
+    return {
+      list: [],
+      limit: 10,
+      total: 0,
+    };
+  },
+  async created() {
+    await this.search();
+  },
+  methods: {
+    ...adminLogin(['query', 'fetch', 'update', 'delete']),
+    async search({ skip = 0, limit = this.limit, searchName, ...info } = {}) {
+      if (this.user.role == '1' || this.user.role == '2') info.pid = this.user.id;
+      if (searchName) info.name = this.searchName;
+      let res = await this.query({ skip, limit, role: '2', ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+    // 查看详情
+    detail(data) {
+      this.$router.push({ path: `/exchange/center/adminCenter/mechanism/detail`, query: { id: data.id } });
+    },
+    add() {
+      this.$router.push({ path: `/exchange/center/adminCenter/mechanism/detail` });
+    },
+    back() {
+      this.$router.push({ path: `/exchange/center/index` });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 66 - 0
src/views/exchange/center/adminCenter/mechanism/parts/detail_1.vue

@@ -0,0 +1,66 @@
+<template>
+  <div id="detail_1">
+    <van-row>
+      <van-col span="24" class="main">
+        <van-form @submit="onSubmit">
+          <van-field v-model="form.pid" name="pid" label="管理员id" style="display: none" />
+          <van-field readonly clickable name="pidName" :value="form.pidName" label="管理员" placeholder="点击选择" @click="showPicker = true" />
+          <van-popup v-model="showPicker" position="bottom">
+            <van-picker show-toolbar :columns="pidList" value-key="name" @confirm="pidCon" @cancel="showPicker = false" />
+          </van-popup>
+          <van-field v-model="form.code" name="code" label="机构代码或邀请码" :rules="[{ required: true, message: '机构代码或邀请码' }]" />
+          <van-field v-model="form.deptname" name="deptname" label="机构代码" :rules="[{ required: true, message: '机构代码' }]" />
+          <van-field v-model="form.name" name="name" label="姓名" :rules="[{ required: true, message: '姓名' }]" />
+          <van-field v-model="form.phone" name="phone" label="手机号" :rules="[{ required: true, message: '手机号' }]" />
+          <van-field v-model="form.passwd" name="passwd" label="密码" type="password" :rules="[{ required: true, message: '密码' }]" />
+          <div style="margin: 16px">
+            <van-button round block type="info" native-type="submit">提交</van-button>
+          </div>
+        </van-form>
+      </van-col>
+    </van-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'detail_1',
+  props: {
+    form: { type: Object },
+    pidList: { type: Array },
+  },
+  components: {},
+  data: function () {
+    return {
+      showPicker: false,
+    };
+  },
+  created() {},
+  methods: {
+    onSubmit() {
+      this.$emit('onSubmit', this.form);
+    },
+    pidCon(value) {
+      this.$set(this.form, `pid`, value.id);
+      this.$set(this.form, `pidName`, value.name);
+      this.showPicker = false;
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 82 - 0
src/views/exchange/center/adminCenter/mechanism/parts/list_1.vue

@@ -0,0 +1,82 @@
+<template>
+  <div id="list_1">
+    <van-col span="24" class="main">
+      <van-col span="24" class="list" v-for="(item, index) in list" :key="index" @click.native="detail(item)">
+        <van-col span="24" class="title">
+          {{ item.name }}
+        </van-col>
+        <van-col span="24" class="other">
+          <van-col span="24" class="otherInfo">
+            机构代码或邀请码:<span style="color: zzzzz#ff0000">{{ item.code || '暂无' }}</span>
+          </van-col>
+          <van-col span="24" class="otherInfo">
+            机构名称:<span>{{ item.deptname || '暂无' }}</span>
+          </van-col>
+          <van-col span="24" class="otherInfo">
+            联系电话:<span>{{ item.phone || '暂无' }}</span>
+          </van-col>
+        </van-col>
+      </van-col>
+    </van-col>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'list_1',
+  props: {
+    list: { type: Array },
+  },
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {
+    detail(data) {
+      this.$emit('detail', data);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  padding: 8px 8px 0 8px;
+  .list {
+    background-color: #fff;
+    margin: 0 0 8px 0;
+    padding: 8px;
+    border-radius: 5px;
+    .title {
+      font-size: 16px;
+      font-weight: bold;
+      margin: 0 0 5px 0;
+    }
+    .other {
+      .otherInfo {
+        font-size: 14px;
+        color: #666;
+        margin: 0 0 5px 0;
+        span {
+          color: #000;
+        }
+      }
+    }
+  }
+}
+</style>

+ 36 - 0
src/views/exchange/center/adminCenter/message/index.vue

@@ -0,0 +1,36 @@
+<template>
+  <div id="index">
+    <van-row>
+      <van-col span="24" class="main"> test </van-col>
+    </van-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 36 - 0
src/views/exchange/center/adminCenter/patent/index.vue

@@ -0,0 +1,36 @@
+<template>
+  <div id="index">
+    <van-row>
+      <van-col span="24" class="main"> test </van-col>
+    </van-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 36 - 0
src/views/exchange/center/adminCenter/trade/index.vue

@@ -0,0 +1,36 @@
+<template>
+  <div id="index">
+    <van-row>
+      <van-col span="24" class="main"> test </van-col>
+    </van-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 36 - 0
src/views/exchange/center/adminCenter/users/index.vue

@@ -0,0 +1,36 @@
+<template>
+  <div id="index">
+    <van-row>
+      <van-col span="24" class="main"> test </van-col>
+    </van-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 12 - 2
src/views/exchange/center/parts/role-1.vue

@@ -2,7 +2,13 @@
   <div id="role-1">
     <van-row>
       <van-col span="24" class="main">
-        <van-cell title="管理用户" is-link />
+        <van-cell title="机构用户" @click="to('mechanism')" is-link />
+        <van-cell title="平台用户" @click="to('users')" is-link />
+        <van-cell title="我的消息" @click="to('message')" is-link />
+        <van-cell title="申请管理" @click="to('disclosure')" is-link />
+        <van-cell title="专利管理" @click="to('patent')" is-link />
+        <van-cell title="交易管理" @click="to('trade')" is-link />
+        <!-- <van-cell title="统计" is-link /> -->
       </van-col>
     </van-row>
   </div>
@@ -18,7 +24,11 @@ export default {
     return {};
   },
   created() {},
-  methods: {},
+  methods: {
+    to(type) {
+      this.$router.push({ path: `/exchange/center/adminCenter/${type}/index` });
+    },
+  },
   computed: {
     ...mapState(['user']),
   },

+ 7 - 1
src/views/exchange/center/parts/role-3.vue

@@ -3,6 +3,7 @@
     <van-row>
       <van-col span="24" class="main">
         <van-cell title="个人用户/企业用户" is-link />
+        <van-cell title="专利运营" @click="patentBtn" is-link />
       </van-col>
     </van-row>
   </div>
@@ -18,7 +19,12 @@ export default {
     return {};
   },
   created() {},
-  methods: {},
+  methods: {
+    // 专利运营
+    patentBtn() {
+      this.$router.push({ path: '/service/patent/index' });
+    },
+  },
   computed: {
     ...mapState(['user']),
   },

+ 6 - 1
src/views/service/patent/parts/userTop.vue

@@ -2,7 +2,7 @@
   <div id="userTop">
     <van-row>
       <van-col span="24" class="main">
-        <van-col span="24" class="one">
+        <van-col span="24" class="one" @click.native="back">
           <van-col span="24" class="image">
             <van-image :src="icon"></van-image>
           </van-col>
@@ -22,6 +22,7 @@
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
+var moment = require('moment');
 export default {
   name: 'userTop',
   props: {},
@@ -48,6 +49,10 @@ export default {
         this.$set(this, `userInfo`, data);
       }
     },
+    // 返回个人中心
+    back() {
+      this.$router.push({ path: '/exchange/center/index' });
+    },
   },
   computed: {
     ...mapState(['user']),

+ 31 - 1
src/views/service/patent/user/userBtn.vue

@@ -95,10 +95,17 @@
         </van-col>
       </van-col>
     </van-row>
+    <van-col span="24" class="sticky">
+      <span @click="chat">咨询<br />服务</span>
+    </van-col>
+    <van-dialog v-model="chatShow" class="dialog" title="咨询服务" :showConfirmButton="false" :showCancelButton="false" :closeOnClickOverlay="true">
+      <frame-chat></frame-chat>
+    </van-dialog>
   </div>
 </template>
 
 <script>
+import frameChat from '@/layout/chatCommon/chat.vue';
 import banner1 from '../parts/banner-1.vue';
 import market1 from '../parts/market-1.vue';
 import news1 from '../parts/news-1.vue';
@@ -110,9 +117,12 @@ export default {
     banner1,
     market1,
     news1,
+    frameChat,
   },
   data: function () {
-    return {};
+    return {
+      chatShow: false,
+    };
   },
   created() {},
   methods: {
@@ -123,6 +133,9 @@ export default {
         this.$router.push({ path: '/login', query: { path: '/service/patent/index', type: '1' } });
       }
     },
+    chat() {
+      this.chatShow = true;
+    },
   },
   computed: {
     ...mapState(['user']),
@@ -166,4 +179,21 @@ export default {
     }
   }
 }
+.sticky {
+  position: fixed;
+  bottom: 30px;
+  z-index: 999;
+  text-align: right;
+  right: 15px;
+  span {
+    display: inline-block;
+    width: 50px;
+    padding: 6px 0;
+    background-color: #409eff;
+    color: #ffffff;
+    border-radius: 90px;
+    font-size: 14px;
+    text-align: center;
+  }
+}
 </style>