bayi il y a 1 an
Parent
commit
a2ac6e078b
5 fichiers modifiés avec 21 ajouts et 11 suppressions
  1. 11 3
      pages/ranking/index.js
  2. 2 1
      pages/ranking/index.less
  3. 4 4
      pages/ranking/index.wxml
  4. 1 0
      pages/ranking/index.wxss
  5. 3 3
      utils/request.js

+ 11 - 3
pages/ranking/index.js

@@ -31,7 +31,7 @@ Page({
         })
         wx.setNavigationBarColor({
             frontColor: '#ffffff',
-            backgroundColor: options.type == '2' ? '#2DCE66' : options.type == '3' ? '#FF7E6C' : '#967DFF',
+            backgroundColor: options.type == '2' ? '#50AE75' : options.type == '3' ? '#FF7E6C' : '#8468FA',
         })
         let {
             ranking,
@@ -44,8 +44,16 @@ Page({
             explain
         })
     },
-    switchType(d) {
-        console.log(d);
+    switchType({
+        target
+    }) {
+        console.log(target.dataset);
+        let rankingType = target.dataset.type
+        if (rankingType && rankingType != this.data.rankingType) {
+            this.getRankInfo({
+                type: rankingType
+            })
+        }
     },
     jumpIndex() {
         wx.switchTab({

+ 2 - 1
pages/ranking/index.less

@@ -219,10 +219,11 @@
     background: url('https://reader-wx.ai160.com/images/reader/v3/pk-bg.png')no-repeat;
 
     .tips2 {
-        color: #967DFF  !important;
+        color: #967DFF !important;
     }
 }
 
 .iconPk {
     width: 42rpx !important;
+    color: #50AE75 !important;
 }

+ 4 - 4
pages/ranking/index.wxml

@@ -1,13 +1,13 @@
 <view class="rankingBox">
     <view class="podiumBox {{podiumBoxBg}}">
-        <view class="switchType"  bindtap="switchType">
-            <view class="ilk {{rankingType=='3'?'current tips2':''}}" data-type='1'>
+        <view class="switchType" bindtap="switchType">
+            <view class="ilk {{rankingType=='3'?'current tips2':''}}" data-type='3'>
                 热播榜
             </view>
-            <view class="ilk {{rankingType=='4'?'current tips2':''}}">
+            <view class="ilk {{rankingType=='4'?'current tips2':''}}" data-type='4'>
                 挑战PK榜
             </view>
-            <view class="ilk {{rankingType=='2'?'current tips2':''}}">
+            <view class="ilk {{rankingType=='2'?'current tips2':''}}" data-type='2'>
                 邀新榜
             </view>
         </view>

+ 1 - 0
pages/ranking/index.wxss

@@ -187,4 +187,5 @@
 }
 .iconPk {
   width: 42rpx !important;
+  color: #50AE75 !important;
 }

+ 3 - 3
utils/request.js

@@ -6,13 +6,13 @@ const {
         envVersion
     }
 } = wx.getAccountInfoSync();
-/* if (envVersion == 'develop') {
+if (envVersion == 'develop') {
     baseUrl = 'https://reader-api.efunbox.cn/wx'
     oldUrl = 'https://reader-api.efunbox.cn'
-} else { */
+} else {
     baseUrl = 'https://reader-api.ai160.com/wx'
     oldUrl = 'https://reader-api.ai160.com'
-// }
+}
 
 function request(url, method, data, oldBaseUrl = false, intercept = true) {
     let header = {