liuyu 4 years ago
parent
commit
75bf247aec
6 changed files with 150 additions and 44 deletions
  1. 6 1
      package-lock.json
  2. 3 2
      package.json
  3. BIN
      src/assets/bg.png
  4. 19 0
      src/store/onlive/room.js
  5. 121 41
      src/views/live/roomDetail.vue
  6. 1 0
      src/views/onlive/roomInfo.vue

+ 6 - 1
package-lock.json

@@ -1,5 +1,5 @@
 {
-  "name": "mobile-official",
+  "name": "live-mobile",
   "version": "0.1.0",
   "lockfileVersion": 1,
   "requires": true,
@@ -11945,6 +11945,11 @@
       "resolved": "https://registry.npm.taobao.org/webwackify/download/webwackify-0.1.6.tgz",
       "integrity": "sha1-HUKhKsYYI9fjRaveCE6qpipKles="
     },
+    "weixin-jsapi": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npm.taobao.org/weixin-jsapi/download/weixin-jsapi-1.1.0.tgz",
+      "integrity": "sha1-UalaIiTFnR2PAv3bxt5S2hazRLM="
+    },
     "which": {
       "version": "1.3.1",
       "resolved": "https://registry.npm.taobao.org/which/download/which-1.3.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwhich%2Fdownload%2Fwhich-1.3.1.tgz",

+ 3 - 2
package.json

@@ -9,7 +9,6 @@
   },
   "dependencies": {
     "@stomp/stompjs": "^5.4.4",
-    "stomp": "^0.1.1",
     "axios": "^0.19.2",
     "core-js": "^3.6.4",
     "element-ui": "^2.13.2",
@@ -17,13 +16,15 @@
     "lodash": "^4.17.15",
     "moment": "^2.26.0",
     "naf-core": "^0.1.2",
+    "stomp": "^0.1.1",
     "trtc-js-sdk": "^4.4.0",
     "vant": "^2.8.5",
     "vue": "^2.6.11",
     "vue-meta": "^2.3.4",
     "vue-router": "^3.3.2",
     "vue-video-player": "^5.0.2",
-    "vuex": "^3.1.3"
+    "vuex": "^3.1.3",
+    "weixin-jsapi": "^1.1.0"
   },
   "devDependencies": {
     "@vue/cli-plugin-babel": "~4.3.0",

BIN
src/assets/bg.png


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

@@ -8,6 +8,7 @@ const api = {
   lookuserInfo: `/api/onlive/lookuser`,
   lookusercount: `/api/onlive/lookuser/roomcount`,
   lookuserswichrole: `/api/onlive/lookuser/swichrole`,
+  lookrecord: `/api/onlive/lookrecord`,
 };
 const state = () => ({});
 const mutations = {};
@@ -21,6 +22,10 @@ const actions = {
     });
     return res;
   },
+  async lookrecord({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.lookrecord}`, payload);
+    return res;
+  },
   async create({ commit }, payload) {
     const res = await this.$axios.$post(`${api.roomInfo}`, payload);
     return res;
@@ -30,6 +35,20 @@ const actions = {
     const res = await this.$axios.$post(`${api.lookuserInfo}`, payload);
     return res;
   },
+  async lookquery({ commit }, { skip = 0, limit = 10, ...info } = {}) {
+    const res = await this.$axios.$get(api.lookuserInfo, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  async lookupdate({ commit }, { ...info } = {}) {
+    const res = await this.$axios.$post(`${api.lookuserInfo}/updatexf`, {
+      ...info,
+    });
+    return res;
+  },
   async lookusercount({ commit }, { ...info } = {}) {
     const res = await this.$axios.$get(`${api.lookusercount}`, {
       ...info,

+ 121 - 41
src/views/live/roomDetail.vue

@@ -12,43 +12,68 @@
         <el-button type="warning" round @click="full()" size="mini"><i class="el-icon-rank"></i></el-button>
       </div>
     </van-overlay>
-    <el-row>
+    <el-row class="chatrow">
       <el-col :span="24" class="info">
-        <el-col :span="24" class="title">
-          <span>{{ roomInfos.title }}</span>
-        </el-col>
         <el-col :span="24" class="num">
           <span>观看:{{ total }}</span>
         </el-col>
-        <el-col :span="24" class="advert">
-          <el-col :span="24">
-            <van-swipe :autoplay="3000">
-              <van-swipe-item v-for="(advert, index) in roomInfos.adverts" :key="index">
-                <img width="100%" height="100px" v-lazy="advert.imgdir" @click="imgclick(advert.imgurl)" />
-              </van-swipe-item>
-            </van-swipe>
-          </el-col>
-        </el-col>
-        <el-col :span="24" class="chat">
-          <el-col :span="24" class="chatInfo" id="chatSell">
-            <el-col :span="24" class="list" v-for="(item, index) in dataList" :key="index">
-              <p>
-                <span :class="item.sendname == user.name ? 'selfColor' : ''">{{ item.sendname }}:</span>
-                <span>{{ item.content }}</span>
-              </p>
-            </el-col>
-          </el-col>
-          <el-col :span="24" class="submit">
-            <el-col :span="19" class="input">
-              <el-input type="textarea" maxlength="5000" show-word-limit v-model="content"></el-input>
+      </el-col>
+    </el-row>
+    <van-tabs type="card" @click="tabsClick">
+      <van-tab title="会议简介">
+        <van-col :span="24">
+          <van-col class="content">{{ roomInfos.content }}</van-col>
+        </van-col>
+        <van-col :span="24">
+          <van-swipe :autoplay="3000">
+            <van-swipe-item v-for="(advert, index) in roomInfos.adverts" :key="index">
+              <img width="100%" height="100px" v-lazy="advert.imgdir" @click="imgclick(advert.imgurl)" />
+            </van-swipe-item>
+          </van-swipe>
+        </van-col>
+      </van-tab>
+      <van-tab title="互动留言">
+        <el-row>
+          <el-col :span="24" class="info">
+            <el-col :span="24" class="chat">
+              <el-col :span="24" class="chatInfo" id="chatSell">
+                <el-col :span="24" class="list" v-for="(item, index) in dataList" :key="index">
+                  <p>
+                    <span :class="item.sendname == user.name ? 'selfColor' : ''">{{ item.sendname }}:</span>
+                    <span>{{ item.content }}</span>
+                  </p>
+                </el-col>
+              </el-col>
             </el-col>
-            <el-col :span="5" class="btn">
-              <el-button type="primary" size="mini" @click="chatCreate">发送</el-button>
+            <el-col :span="24" class="submit">
+              <el-col :span="19" class="input">
+                <el-input type="textarea" maxlength="5000" show-word-limit v-model="content"></el-input>
+              </el-col>
+              <el-col :span="5" class="btn">
+                <el-button type="primary" size="mini" @click="chatCreate">发送</el-button>
+              </el-col>
             </el-col>
           </el-col>
-        </el-col>
-      </el-col>
-    </el-row>
+        </el-row>
+      </van-tab>
+      <van-tab title="参与成员">
+        <van-col :span="24" class="userList">
+          <van-grid :column-num="3">
+            <van-grid-item v-for="(item, index) in userList" :key="index" icon="manager" :text="item.username" />
+          </van-grid>
+        </van-col>
+      </van-tab>
+      <van-tab title="申请评分">
+        <van-col :span="24">
+          <van-field v-model="isxf" name="isxf" left-icon="star-o" label="学分" placeholder="请填写需要授予学分" />
+        </van-col>
+        <van-col :span="24">
+          <van-button icon="star-o" type="primary" @click="sqClick">
+            申请
+          </van-button>
+        </van-col>
+      </van-tab>
+    </van-tabs>
   </div>
 </template>
 
@@ -95,6 +120,8 @@ export default {
       dataList: [],
       lvideoid_: '',
       rvideoid_: '',
+      userList: [],
+      isxf: '',
     };
   },
   created() {
@@ -106,10 +133,50 @@ export default {
   mounted() {
     this.channel();
   },
+  destroyed() {
+    const that = this;
+    window.addEventListener('pagehide', function() {
+      console.log('页面要关闭了');
+      that.recordSave();
+    });
+  },
   methods: {
     ...gensign(['gensignFetch']),
-    ...room(['lookuserFetch', 'fetch', 'lookusercount']),
+    ...room(['lookuserFetch', 'fetch', 'lookusercount', 'lookquery', 'lookupdate', 'lookrecord']),
     ...chat(['query', 'create']),
+    async recordSave() {
+      let data = {};
+      data.type = '1';
+      data.roomid = this.id;
+      data.roomname = this.roomname;
+      data.userid = this.user.uid;
+      data.username = this.user.name;
+      const res = await this.lookrecord(data);
+    },
+    async sqClick() {
+      let data = {};
+      data.roomid = this.id;
+      data.isxf = this.isxf;
+      data.userid = this.user.uid;
+      const res = await this.lookupdate(data);
+      if (this.$checkRes(res)) {
+        console.log(res.data);
+        this.$message({
+          message: '操作成功',
+          type: 'success',
+        });
+      }
+    },
+    async tabsClick(name, title) {
+      if (title === '参与成员') {
+        this.lookuserQuery();
+      }
+    },
+    async lookuserQuery({ skip = 0, limit = 1000 } = {}) {
+      const info = { roomid: this.id };
+      let res = await this.lookquery({ skip, limit, ...info });
+      this.$set(this, `userList`, res.data);
+    },
     async chatSearch({ skip = 0, limit = 1000 } = {}) {
       const info = { roomid: this.id };
       let res = await this.query({ skip, limit, ...info });
@@ -143,7 +210,7 @@ export default {
         this.content = '';
       }
       this.$nextTick(() => {
-        //document.getElementById('chatSell').scrollTop = document.getElementById('chatSell').scrollHeight + 275;
+        document.getElementById('chatSell').scrollTop = document.getElementById('chatSell').scrollHeight + 275;
       });
     },
     async lookuserSearch() {
@@ -319,6 +386,9 @@ export default {
   width: 100%;
   height: 200px;
 }
+.content {
+  padding: 10px;
+}
 .info {
   .title {
     text-align: center;
@@ -335,9 +405,11 @@ export default {
     padding: 10px;
   }
   .chat {
-    height: 260px;
+    height: 380px;
+    min-height: 380px;
     .chatInfo {
-      height: 185px;
+      height: 280px;
+      min-height: 280px;
       overflow-y: auto;
       padding: 0 10px;
       margin: 0 0 10px 0;
@@ -358,13 +430,14 @@ export default {
         }
       }
     }
-    .submit {
-      position: absolute;
-      bottom: 0;
-      .el-button {
-        width: 100%;
-        padding: 20px 0;
-      }
+  }
+  .submit {
+    width: 100%;
+    position: absolute;
+    bottom: 0px;
+    .el-button {
+      width: 100%;
+      padding: 20px 0;
     }
   }
 }
@@ -409,4 +482,11 @@ export default {
   z-index: 999;
   position: absolute;
 }
+.userList {
+  height: 380px;
+  min-height: 380px;
+  overflow-y: auto;
+  padding: 0 10px;
+  margin: 0 0 10px 0;
+}
 </style>

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

@@ -48,6 +48,7 @@
 import { mapState, mapMutations, createNamespacedHelpers } from 'vuex';
 import NavBar from '@/layout/common/topInfo.vue';
 import footInfo from '@/layout/common/footInfo.vue';
+import wx from 'weixin-jsapi';
 var moment = require('moment');
 const { mapActions: room } = createNamespacedHelpers('room');
 const jwt = require('jsonwebtoken');