zhaoxiaohai 3 years ago
parent
commit
040f32dc8e

+ 2 - 2
components/My_NavTabs/index.wxml

@@ -1,5 +1,5 @@
 <view class="tabs_box">
-    <view class="tbas_list" bindtap="setTabsIndex">
-        <view wx:for="{{tabsList}}" data-index="{{index}}" class="{{tabsIndex==index?'active':''}}">{{item}}</view>
+    <view class="tbas_list">
+        <view wx:for="{{tabsList}}" data-index="{{index}}" class="{{tabsIndex==index?'active':''}}" bindtap="setTabsIndex">{{item}}</view>
     </view>
 </view>

+ 17 - 4
pages/liveStreaming/index.js

@@ -26,6 +26,7 @@ Page({
     myShowModel2: false, // 真正申请中提示
     listRowIndex: -1, //列表选中项
     CheckTheType: '当前直播', //查看类型
+    onlineNumber: 0, //实时观看人数
   },
 
   /**
@@ -40,6 +41,13 @@ Page({
     detail
   }) {
     if (detail == this.data.CheckTheType) return;
+    if (detail == '历史直播') {
+      if (this.data.liveSessionList.length == 0) return wx.showToast({
+        title: '当前没有开播记录',
+        icon: "none"
+      })
+      return
+    }
     this.setData({
       CheckTheType: detail
     })
@@ -64,6 +72,7 @@ Page({
         console.log("聊天", res)
       })
     }, 2000); */
+    //实时观看人数
     _Http.basic({
       "accesstoken": token,
       "classname": "customer.live.live",
@@ -72,7 +81,10 @@ Page({
         "channelid": channelid
       }
     }).then(res => {
-      console.log(res)
+      if (res.msg != '成功') return;
+      this.setData({
+        onlineNumber: res.data.count
+      })
     })
   },
   /* 获取当前用户列表 */
@@ -168,7 +180,7 @@ Page({
       //获取实时数据
       this.realTime()
       //直播场次列表查询
-      this.getLiveSessionList()
+      if (res.code == 1) this.getLiveSessionList();
     })
   },
   /* 直播场次列表查询 */
@@ -202,7 +214,7 @@ Page({
         pageTotal: res.pageTotal,
         sessionList
       });
-      this.viewDetails(0)
+      if (res.data.length > 0) this.viewDetails(0);
     })
   },
   /* 查看场次详情 */
@@ -210,6 +222,7 @@ Page({
     this.viewDetails(e.detail.value);
   },
   viewDetails(index) {
+    console.log(index, this.data.liveSessionList[index])
     const sessionid = this.data.liveSessionList[index].sessionid;
     this.setData({
       showStartTime: this.data.liveSessionList[index].starttime,
@@ -321,6 +334,7 @@ Page({
   setIndex({
     detail
   }) {
+    if (this.data.tabsIndex == detail) return;
     this.setData({
       tabsIndex: detail,
       pageNumber: 1,
@@ -328,7 +342,6 @@ Page({
       userPageNumber: 1,
       userPageTotal: 1
     });
-    if (detail == undefined) return;
     this.getLiveInfo();
     if (detail == 2) this.getCooperationAgentsLiveList();
   },

+ 5 - 0
pages/liveStreaming/index.wxml

@@ -57,6 +57,11 @@
         <!-- 实时聊天信息 -->
         <view class="live-chat" hidden="{{CheckTheType!='当前直播'}}">
             <view class="live-chat-title">观看人数:{{onlineNumber}}</view>
+            <view class="live-chat-mag" wx:for="{{3}}">
+                <view class="live-chat-mag-userName">用户名:</view>
+                <view class="live-chat-mag-text">找是打发斯蒂芬找是打发斯蒂芬找是打发斯蒂芬找是打发斯蒂芬找是打发斯蒂芬找是打发斯蒂芬找是打发斯蒂芬找是打发斯蒂芬</view>
+                <view class="live-chat-mag-time">10:52</view>
+            </view>
         </view>
         <!-- 数据宫格 -->
         <view hidden="{{CheckTheType!='历史直播'}}" class="live-chat" style="height: 274rpx;" hidden="{{CheckTheType!='历史直播'}}">

+ 26 - 0
pages/liveStreaming/index.wxss

@@ -169,4 +169,30 @@
 .exhibition {
     float: left;
     margin-top: 10rpx;
+}
+
+.live-chat-mag {
+    display: flex;
+    width: 100%;
+    line-height: 30rpx;
+    padding: 10rpx 20rpx;
+    font-size: 20rpx;
+    color: rgba(0, 0, 0, 0.85);
+    box-sizing: border-box;
+}
+
+.live-chat-mag-userName {
+    flex-shrink: 0;
+}
+
+.live-chat-mag-text {
+    flex: 1;
+    width: 0;
+    /* word-break: break-all; */
+    white-space: pre-wrap;
+}
+
+.live-chat-mag-time {
+    padding-left: 8rpx;
+    flex-shrink: 0;
 }

+ 7 - 6
pages/webView/index.js

@@ -14,10 +14,9 @@ Page({
      * 生命周期函数--监听页面加载
      */
     onLoad: function (options) {
-        console.log(options)
         //判断是否纯在登录态度
         if (!wx.getStorageSync('userData').token) {
-            getApp().globalData.liveUrl = url;
+            getApp().globalData.liveUrl = options.url;
             wx.reLaunch({
                 url: '/pages/login/index'
             })
@@ -28,10 +27,12 @@ Page({
                 "method": "query_usermsg",
                 "content": {}
             }).then(res => {
-                getApp().globalData.liveUrl = url;
-                wx.reLaunch({
-                    url: '/pages/login/index'
-                })
+                if (res.msg != '成功') {
+                    getApp().globalData.liveUrl = options.url;
+                    wx.reLaunch({
+                        url: '/pages/login/index'
+                    })
+                }
             })
         };
         this.setData({