guhongwei 4 år sedan
förälder
incheckning
afcb180980
2 ändrade filer med 17 tillägg och 0 borttagningar
  1. 5 0
      src/store/onlive/room.js
  2. 12 0
      src/views/live/parts/roomsDetail.vue

+ 5 - 0
src/store/onlive/room.js

@@ -5,6 +5,7 @@ import _ from 'lodash';
 Vue.use(Vuex);
 const api = {
   roomInfo: `/api/onlive/room`,
+  lookuserInfo: `/api/onlive/lookuser`,
 };
 const state = () => ({});
 const mutations = {};
@@ -22,6 +23,10 @@ const actions = {
     const res = await this.$axios.$post(`${api.roomInfo}`, payload);
     return res;
   },
+  async lookuserFetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.lookuserInfo}`, payload);
+    return res;
+  },
   async roomfetch({ commit }, payload) {
     const res = await this.$axios.$get(`${api.roomInfo}/roomname`, payload);
     return res;

+ 12 - 0
src/views/live/parts/roomsDetail.vue

@@ -32,6 +32,7 @@
 import TRTC from 'trtc-js-sdk';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: gensign } = createNamespacedHelpers('gensign');
+const { mapActions: room } = createNamespacedHelpers('room');
 export default {
   name: 'roomsDetail',
   props: {},
@@ -46,9 +47,20 @@ export default {
   },
   created() {
     this.initclient();
+    this.lookuserSearch();
   },
   methods: {
     ...gensign(['gensignFetch']),
+    ...room(['lookuserFetch']),
+    async lookuserSearch() {
+      let data = {};
+      data.roomid = this.id;
+      data.roomname = this.roomname;
+      data.userid = this.user.userid;
+      data.username = this.user.name;
+      const res = await this.lookuserFetch(data);
+      console.log(res);
+    },
     onSubmit() {
       console.log(this.input);
     },