Bläddra i källkod

Merge branch 'master' of http://git.cc-lotus.info/service-platform/mobile-official

liuyu 4 år sedan
förälder
incheckning
a871c35f2f

+ 8 - 0
src/router/index.js

@@ -40,6 +40,14 @@ const routes = [
     meta: { title: '直播详情', isleftarrow: true },
     component: () => import('../views/live/detail.vue'),
   },
+  // 直播房间详情
+  {
+    path: '/onlive/roomInfo',
+    name: 'onlive_roomInfo',
+    meta: { title: '直播房间详情', isleftarrow: true },
+    component: () => import('../views/onlive/roomInfo.vue'),
+  },
+
   // 科技超市
   {
     path: '/market/index',

+ 2 - 0
src/store/index.js

@@ -17,6 +17,7 @@ import user from './user';
 import place from './place';
 import onliveUser from './onlive/user';
 import onliveUser from './onlive/gensign';
+import room from './onlive/room';
 import * as ustate from '@/store/common/state';
 import * as umutations from '@/store/common/mutations';
 
@@ -44,5 +45,6 @@ export default new Vuex.Store({
     dock,
     place,
     onliveUser,
+    room,
   },
 });

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

@@ -0,0 +1,46 @@
+// 房间
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  roomInfo: `/api/onlive/room`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit = 10, ...info } = {}) {
+    const res = await this.$axios.$get(api.roomInfo, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.roomInfo}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.roomInfo}/${payload}`);
+    return res;
+  },
+  async update({ commit }, { id, ...info } = {}) {
+    const res = await this.$axios.$post(`${api.roomInfo}/update/${id}`, {
+      ...info,
+    });
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.roomInfo}/${payload}`);
+    return res;
+  },
+};
+
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 2 - 0
src/views/live/parts/liveList.vue

@@ -15,6 +15,7 @@
           <el-col :span="6" class="right">
             <p @click="$router.push({ path: '/live/roomDetail', query: { id: item.id,roomname:item.roomname } })" v-if="item.roomname">进入房间</p>
             <p @click="$router.push({ path: '/live/detail', query: { id: item.id } })" v-else>进入房间</p>
+            <p @click="$router.push({ path: '/onlive/roomInfo', query: { roomname: item.roomname } })">房间详情</p>
           </el-col>
         </el-col>
       </el-col>
@@ -103,6 +104,7 @@ export default {
       color: #fff;
       padding: 5px 8px;
       border-radius: 5px;
+      margin: 0 0 10px 0;
     }
   }
 }

+ 68 - 0
src/views/onlive/roomInfo.vue

@@ -0,0 +1,68 @@
+<template>
+  <div id="roomInfo">
+    <el-row>
+      <el-col :span="24" class="style">
+        <el-col :span="24" class="top">
+          <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
+        </el-col>
+        <el-col :span="24" class="main">
+          房间详情
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, mapMutations, createNamespacedHelpers } from 'vuex';
+import NavBar from '@/layout/common/topInfo.vue';
+import footInfo from '@/layout/common/footInfo.vue';
+const { mapActions: room } = createNamespacedHelpers('room');
+export default {
+  name: 'roomInfo',
+  props: {},
+  components: {
+    NavBar,
+  },
+  data: function() {
+    return {
+      // 头部标题
+      title: '',
+      // meta为true
+      isleftarrow: '',
+      // 返回
+      navShow: true,
+    };
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+    token() {
+      return this.$route.query.token;
+    },
+  },
+  mounted() {
+    this.title = this.$route.meta.title;
+    this.isleftarrow = this.$route.meta.isleftarrow;
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.style {
+  width: 100%;
+  min-height: 667px;
+  position: relative;
+  background-color: #f9fafc;
+}
+.top {
+  height: 46px;
+  overflow: hidden;
+  position: relative;
+  z-index: 999;
+}
+.main {
+  min-height: 570px;
+}
+</style>