liyongli 3 سال پیش
والد
کامیت
33d6e388b9

+ 3 - 1
pages/home/components/topic/topic.js

@@ -361,7 +361,9 @@ Component({
       if (!toUrl) return;
       toUrl = false;
       let title = this.data.title;
-      let url = "/pages/live/live?title=" + title + "&season=" + (this.data.select - 0 + 1) + "&isdou=" + this.data.headData.has_live_douyin_data + "&iskuai=" + this.data.headData.has_live_kuaishou_data;
+      let type = this.data.headData.has_live_douyin_data ? "douyin" : this.data.headData.has_live_kuaishou_data ? "kuaishou" : "";
+      let url = "/pages/live/live?title=" + title + "&season=" + (this.data.select - 0 + 1) + "&isdou=" + this.data.headData.has_live_douyin_data + "&iskuai=" + this.data.headData.has_live_kuaishou_data + "&type=" + type;
+      // let url = "/pages/live/live?title=" + title + "&season=" + (this.data.select - 0 + 1) + "&isdou=true&iskuai=true&type=douyin";
       wx.navigateTo({
         url,
         complete: function (res) {

+ 6 - 13
pages/live/components/douyin/douyin.wxml

@@ -43,25 +43,18 @@
     <view class="localCells">观众来源</view>
   </view>
 
-  <!-- <view class="information">
-    <view class="itemView">
-      <pie id="pie001" wx:if="{{series.length}}" canvasId="pie002" list="{{series}}" />
-    </view>
-    <view class="itemView">
-      <pie id="pie001" canvasId="pie002" list="{{oriList}}" />
-    </view>
-  </view> -->
   <view class="itemView">
-    <pie id="pie001" wx:if="{{series.length}}" canvasId="pie002" list="{{series}}" />
+    <pie id="pie001" wx:if="{{series.length}}" canvasId="douyinpie001" list="{{series}}" />
   </view>
-  <chart wx:if="{{region.length && region[0].length}}" list="{{region}}" id="{{'id' + 1}}" canvasId="{{'canvasId' + 1}}"
-    yType="value" xType="name" />
+  <chart wx:if="{{region.length && region[0].length}}" list="{{region}}" id="{{'douyinid' + 1}}"
+    canvasId="{{'douyincanvasId' + 1}}" yType="value" xType="name" />
 
   <view class="itemView" wx:for="{{lineList}}" wx:key="id">
     <view wx:if="item.peopleList.length" class="localCells">{{item.title}}</view>
     <view wx:if="item.peopleList.length" class="subTitle">{{item.subTitle}}</view>
-    <lineChart id="{{item.id}}" wx:if="item.peopleList.length" canvasId="{{item.canvasId}}" type="{{item.type}}"
-      list="{{item.peopleList || []}}" yType="{{item.yType}}" xType="{{item.xType}}" color="{{item.color}}" />
+    <lineChart id="{{'douyin'+item.id}}" wx:if="item.peopleList.length" canvasId="{{'douyin'+item.canvasId}}"
+      type="{{item.type}}" list="{{item.peopleList || []}}" yType="{{item.yType}}" xType="{{item.xType}}"
+      color="{{item.color}}" />
   </view>
 
 </view>

+ 6 - 11
pages/live/components/kuaishou/kuaishou.wxml

@@ -41,21 +41,16 @@
   <view class="itemView">
     <view class="localCells">观众来源</view>
   </view>
-  <view class="information">
-    <view class="itemView">
-      <pie id="pie001" wx:if="{{series.length}}" canvasId="pie002" list="{{series}}" />
-    </view>
-    <view class="itemView">
-      <pie id="pie001" canvasId="pie002" list="{{oriList}}" />
-    </view>
-  </view>
-  <chart wx:if="{{region.length && region[0].length}}" yCompany="%" list="{{region}}" id="{{'id' + 1}}" canvasId="{{'canvasId' + 1}}"
-    yType="value" xType="name" />
+
+  <pie id="pie001" wx:if="{{series.length}}" canvasId="kuaishoupie002" list="{{series}}" />
+  <pie id="pie001" wx:if="{{oriList.length}}" canvasId="kuaishoupie002" list="{{oriList}}" />
+  <chart wx:if="{{region.length && region[0].length}}" yCompany="%" list="{{region}}" id="{{'id' + 1}}"
+    canvasId="{{'kuaishou' + 1}}" yType="value" xType="name" />
 
   <view class="itemView" wx:for="{{lineList}}" wx:key="id">
     <view wx:if="item.peopleList.length" class="localCells">{{item.title}}</view>
     <view wx:if="item.peopleList.length" class="subTitle">{{item.subTitle}}</view>
-    <lineChart id="{{item.id}}" wx:if="item.peopleList.length" canvasId="{{item.canvasId}}" type="{{item.type}}"
+    <lineChart id="{{'kuaishou' + item.id}}" wx:if="item.peopleList.length" canvasId="{{'kuaishou' + item.canvasId}}" type="{{item.type}}"
       list="{{item.peopleList || []}}" yType="{{item.yType}}" xType="{{item.xType}}" color="{{item.color}}" />
   </view>
 

+ 8 - 4
pages/live/live.js

@@ -14,16 +14,19 @@ Page({
   },
 
   tabChange(e) {
-    this.setData({
-      select: e.currentTarget.dataset.index
+    // this.setData({
+    //   select: e.currentTarget.dataset.index
+    // })
+    wx.redirectTo({
+      url: "/pages/live/live?title=" + this.data.title + "&season=" + (this.data.season - 0 ) + "&isdou=" + this.data.isdou + "&iskuai=" + this.data.iskuai + "&type=" +e.currentTarget.dataset.index,
     })
   },
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    let isdou = options.isdou === 'ture' ? true : false,
-    iskuai = options.iskuai === 'ture' ? true : false, list = [];
+    let isdou = options.isdou === 'true' ? true : false,
+    iskuai = options.iskuai === 'true' ? true : false, list = [];
     isdou && list.push({
       "text": "抖音",
       "img": "douyin",
@@ -37,6 +40,7 @@ Page({
     console.log(options)
     this.setData({
       title: options.title,
+      select: options.type,
       season: options.season - 0,
       isdou,
       iskuai,