zhaoxiaohai hace 3 años
padre
commit
16dede0a61

+ 1 - 1
components/My_SearchInputBox/index.wxss

@@ -18,7 +18,7 @@
 }
 
 .box-flexd {
-    position: fixed;
+    position: absolute;
     top: 0;
     left: 0;
 }

+ 62 - 15
pages/liveStreaming/index.js

@@ -99,14 +99,19 @@ Page({
         "channelid": this.data.accountMsg.channelid
       }
     }, false).then(res => {
-      if (this.data.oldDialogue.length == 0) {
-        for (let i = 0; i < res.data.length; i++) {
-          let data = res.data[i].datetime.split(" ");
-          res.data[i].datetime = data[1]
-        }
-        this.setData({
-          oldDialogue: res.data
-        })
+      if (res.msg != '成功') return wx.showToast({
+        title: res.data,
+        icon: "none"
+      })
+      for (let i = 0; i < res.data.length; i++) {
+        let data = res.data[i].datetime.split(" ");
+        res.data[i].datetime = data[1]
+      }
+      this.setData({
+        oldDialogue: res.data
+      })
+      /* if (this.data.oldDialogue.length == 0) {
+        
       } else {
         let oldDialogue = this.data.oldDialogue,
           newDialogue = res.data;
@@ -123,7 +128,7 @@ Page({
             oldDialogue
           })
         }
-      }
+      } */
     })
   },
   /* 获取当前用户列表 */
@@ -210,11 +215,27 @@ Page({
       "content": {}
     }).then(res => {
       const isSy = (method == "getSYLiveInfo") ? true : false;
+      console.log("直播账号详情", res)
       this.setData({
         accountStatus: res.code,
         accountMsg: res.data[0],
         isSy
       })
+      //获取授权地址
+      if (res.data[0].fisneedauth == 1) {
+        _Http.basic({
+          "accesstoken": wx.getStorageSync('userData').token,
+          "classname": "enterprise.live.live",
+          "method": "liveauthorization",
+          "content": {
+            "tliveid": res.data[0].tliveid
+          }
+        }).then(res => {
+          this.setData({
+            "accountMsg.fliveshowurl": res.msg
+          })
+        })
+      }
       //获取实时数据
       this.realTime()
       //直播场次列表查询
@@ -379,7 +400,7 @@ Page({
       userPageNumber: 1,
       userPageTotal: 1
     });
-    this.getLiveInfo();
+    if (detail != 2) this.getLiveInfo();
     if (detail == 2) this.getCooperationAgentsLiveList();
   },
   /* 获取合作商直播列表 */
@@ -397,11 +418,37 @@ Page({
   },
   /* 查看合作商直播 */
   toLive(e) {
-    let str = e.currentTarget.dataset.fliveshowurl;
-    const url = str.slice(0, 8) + '04de51d4c1.' + str.slice(8);
-    wx.navigateTo({
-      url: '/pages/webView/index?url=' + url,
-    })
+    const {
+      index
+    } = e.currentTarget.dataset,
+      data = this.data.partnerLiveList[index];
+    console.log(data.fisneedauth)
+    if (data.fisneedauth == 1) {
+      _Http.basic({
+        "accesstoken": wx.getStorageSync('userData').token,
+        "classname": "enterprise.live.live",
+        "method": "liveauthorization",
+        "content": {
+          "tliveid": data.tliveid
+        }
+      }).then(res => {
+        console.log(res)
+        if (res.data != '成功') return wx.showToast({
+          title: '网络错误,请稍后再试',
+        })
+        let str = res.msg;
+        const url = str.slice(0, 8) + '04de51d4c1.' + str.slice(8);
+        wx.navigateTo({
+          url: '/pages/webView/index?url=' + encodeURIComponent(url),
+        })
+      })
+    } else {
+      let str = data.fliveshowurl;
+      const url = str.slice(0, 8) + '04de51d4c1.' + str.slice(8);
+      wx.navigateTo({
+        url: '/pages/webView/index?url=' + encodeURIComponent(url)
+      })
+    }
   },
   /**
    * 生命周期函数--监听页面初次渲染完成

+ 1 - 1
pages/liveStreaming/index.wxml

@@ -130,7 +130,7 @@
 <view hidden="{{tabsIndex!=2}}">
     <My_liveAccountMsg title='观看信息'>
         <view slot='con' class="clearfix" style="padding-left: 10rpx;">
-            <view wx:for="{{partnerLiveList}}" class="exhibition" data-fliveshowurl="{{item.fliveshowurl}}" catchtap="toLive">
+            <view wx:for="{{partnerLiveList}}" class="exhibition" data-index="{{index}}" catchtap="toLive">
                 <image class="exhibition-img" src="{{item.channelcoverimageurl}}" mode="aspectFill"></image>
                 <view class="exhibition-bottom">
                     <view class="exhibition-bottom-title u-line-1">{{item.fagentname}}</view>

+ 5 - 3
pages/webView/index.js

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

+ 2 - 1
pages/webView/index.wxml

@@ -1 +1,2 @@
-<web-view src="{{url}}"></web-view>
+<web-view src="{{url}}"></web-view>
+<!-- <view style="word-break:break-all; width: 80vw;">{{url}}</view> -->