Browse Source

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

liuyu 4 years ago
parent
commit
53417dd823
4 changed files with 23 additions and 15 deletions
  1. 7 6
      src/components/parts/chat.vue
  2. 3 0
      src/main.js
  3. 5 5
      src/plugins/setting.js
  4. 8 4
      src/views/onlive/roomInfo.vue

+ 7 - 6
src/components/parts/chat.vue

@@ -10,11 +10,11 @@
             </p>
           </li>
         </ul>
-        <el-row type="flex" :gutter="10" style="padding-top:20px;height:40px;line-height:40px">
-          <el-col :span="20">
+        <el-row type="flex" :gutter="10" style="padding-top:10px;">
+          <el-col :span="19">
             <el-input v-model="text" size="mini"></el-input>
           </el-col>
-          <el-col :span="4">
+          <el-col :span="5">
             <el-button @click="send" size="mini" round style="background: #ff8500;color: #fff;">发送</el-button>
           </el-col>
         </el-row>
@@ -72,6 +72,7 @@ export default {
       });
     },
     onMessage(message) {
+      console.log('lasjdas');
       // console.log('receive a message: ', message.body);
       let body = _.get(message, 'body');
       if (body) {
@@ -120,7 +121,7 @@ export default {
 .chat {
   float: left;
   width: 100%;
-  height: 515px;
+  height: 340px;
   border-radius: 5px;
   box-shadow: 0 0 5px #c20808;
   padding: 0 10px 0px 10px;
@@ -159,14 +160,14 @@ export default {
   background: #fff;
   float: left;
   width: 100%;
-  height: 480px;
+  height: 340px;
   overflow: hidden;
 }
 
 .chat .chatList ul {
   float: left;
   width: 100%;
-  height: 405px;
+  height: 275px;
   padding: 5px 0 0 0;
   overflow: auto;
   margin: 10px 0 0 0;

+ 3 - 0
src/main.js

@@ -12,12 +12,15 @@ import '@/plugins/loading';
 import '@/plugins/var';
 import '@/plugins/methods';
 import '@/plugins/setting';
+import InitStomp from '@/plugins/stomp';
+Vue.config.productionTip = false;
 
 new Vue({
   router,
   store,
   render: h => h(App),
 }).$mount('#app');
+InitStomp();
 window.vm = new Vue({
   router,
 });

+ 5 - 5
src/plugins/setting.js

@@ -2,16 +2,16 @@ import Vue from 'vue';
 
 Vue.config.weixin = {
   // baseUrl: process.env.BASE_URL + 'weixin',
-  baseUrl: `http://${location.host}/weixin`,
+  baseUrl: 'http://10.16.8.209:9005',
 };
 
 Vue.config.stomp = {
-  // brokerURL: 'ws://192.168.1.190:15674/ws',
+  // brokerURL: 'ws://http://free.liaoningdoupo.com/ws',
   brokerURL: '/ws', // ws://${location.host}/ws
   connectHeaders: {
-    host: 'smart',
-    login: 'web',
-    passcode: 'web123',
+    host: 'visit',
+    login: 'visit', //visit
+    passcode: 'visit', //visit123
   },
   // debug: true,
   reconnectDelay: 5000,

+ 8 - 4
src/views/onlive/roomInfo.vue

@@ -7,8 +7,9 @@
         </el-col>
         <el-col :span="24" class="main">
           <van-image :src="roomInfos.filedir" class="image"></van-image>
-          <van-count-down v-if="time > 0" class="time" :time="time" format="DD 天 HH 时 mm 分 ss 秒" />
-          <el-col v-else-if="time <= 0" class="time">直播已开始</el-col>
+          <van-count-down v-if="time > 0 && endtime > 0" class="time" :time="time" format="DD 天 HH 时 mm 分 ss 秒" />
+          <el-col v-else-if="time <= 0 && endtime > 0" class="time">直播已开始</el-col>
+          <el-col v-else-if="endtime <= 0" class="time">直播已结束</el-col>
           <van-tabs v-model="active" line-width="50px" title-active-color="#ee0a24">
             <van-tab title="简介">
               <van-col :span="24" class="title">{{ roomInfos.title }}</van-col>
@@ -51,6 +52,7 @@ export default {
       roomInfos: {},
       time: '',
       active: 1,
+      endtime: '',
     };
   },
   created() {
@@ -64,9 +66,11 @@ export default {
         console.log(res.data);
 
         this.$set(this, `roomInfos`, res.data);
-        const date = moment(res.data.starttime).format('x');
+        const starttime = moment(res.data.starttime).format('x');
+        const endtime = moment(res.data.endtime).format('x');
         const now = moment(new Date()).format('x');
-        this.$set(this, `time`, date - now);
+        this.$set(this, `time`, starttime - now);
+        this.$set(this, `endtime`, endtime - now);
       }
     },
   },