Bläddra i källkod

联调朗读扣次数、活动说明

bayi 2 år sedan
förälder
incheckning
f53d7b232d

+ 67 - 61
pages/rankIntro/index.js

@@ -1,65 +1,71 @@
 // pages/rankIntro/index.js
 Page({
 
-  /**
-   * 页面的初始数据
-   */
-  data: {
-  },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad(options) {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload() {
-
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh() {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom() {
-
-  },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage() {
-
-  }
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        explain: ""
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+        wx.setNavigationBarTitle({
+            title: options.title
+        })
+        this.setData({
+            explain: options.img
+        })
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+
+    }
 })

+ 2 - 2
pages/rankIntro/index.json

@@ -1,4 +1,4 @@
 {
-  "usingComponents": {},
-  "navigationBarTitleText": "榜单说明"
+    "usingComponents": {},
+    "navigationBarTitleText": "说明"
 }

+ 5 - 1
pages/rankIntro/index.less

@@ -1,3 +1,7 @@
 .rankInfoBox {
-  width: 100%;
+    width: 100%;
+    min-height: 100vh;
+    image {
+        width: 100%;
+    }
 }

+ 1 - 1
pages/rankIntro/index.wxml

@@ -1,3 +1,3 @@
 <view class="rankInfoBox">
-
+    <image src="{{explain}}" mode="widthFix" />
 </view>

+ 4 - 0
pages/rankIntro/index.wxss

@@ -1,3 +1,7 @@
 .rankInfoBox {
   width: 100%;
+  min-height: 100vh;
+}
+.rankInfoBox image {
+  width: 100%;
 }

+ 55 - 52
pages/ranking/index.js

@@ -1,58 +1,61 @@
 import {
-  getRankingData
+    getRankingData
 } from '~/api/global'
 Page({
 
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    ranking: '',
-    userList: [],
-    //2:邀新榜,3:热播榜,4:挑战pk榜
-    rankingType: '',
-    icon: '',
-    podiumBoxBg: ''
-  },
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        ranking: '',
+        userList: [],
+        //2:邀新榜,3:热播榜,4:挑战pk榜
+        rankingType: '',
+        icon: '',
+        podiumBoxBg: '',
+        explain: ''
+    },
 
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad(options) {
-    this.setData({
-      rankingType: options.type,
-      icon: options.type == '2' ? '/static/yx.png' : options.type == '3' ? '/static/play.png' : '/static/win.png',
-      podiumBoxBg: options.type == '2' ? 'invitation' : options.type == '3' ? 'hot' : 'pk',
-    })
-    wx.setNavigationBarTitle({
-      title: options.title
-    })
-    wx.setNavigationBarColor({
-      frontColor: '#ffffff',
-      backgroundColor: options.type == '2' ? '#ff7f6c' : options.type == '3' ? '#6D9FFE' : '#967DFF',
-    })
-    this.getRankingData()
-  },
-  async getRankingData() {
-    let {
-      ranking,
-      userList
-    } = await getRankingData(this.data.rankingType)
-    this.setData({
-      ranking,
-      userList
-    })
-  },
-  jumpIntro() {
-    wx.navigateTo({
-      url: `/pages/rankIntro/index?type=${this.data.rankingType}`,
-    })
-  },
-  jumpUserInfo({
-    currentTarget
-  }) {
-    wx.navigateTo({
-      url: `/pages/personal/index?uid=${currentTarget.dataset.uid}&type=${this.data.rankingType==4?'pk':'user'}`,
-    })
-  },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+        this.setData({
+            rankingType: options.type,
+            icon: options.type == '2' ? '/static/yx.png' : options.type == '3' ? '/static/play.png' : '/static/win.png',
+            podiumBoxBg: options.type == '2' ? 'invitation' : options.type == '3' ? 'hot' : 'pk',
+        })
+        wx.setNavigationBarTitle({
+            title: options.title
+        })
+        wx.setNavigationBarColor({
+            frontColor: '#ffffff',
+            backgroundColor: options.type == '2' ? '#ff7f6c' : options.type == '3' ? '#6D9FFE' : '#967DFF',
+        })
+        this.getRankingData()
+    },
+    async getRankingData() {
+        let {
+            ranking,
+            userList,
+            explain
+        } = await getRankingData(this.data.rankingType)
+        this.setData({
+            ranking,
+            userList,
+            explain
+        })
+    },
+    jumpIntro() {
+        wx.navigateTo({
+            url: `/pages/rankIntro/index?title=榜单说明&img=${this.data.explain}`,
+        })
+    },
+    jumpUserInfo({
+        currentTarget
+    }) {
+        wx.navigateTo({
+            url: `/pages/personal/index?uid=${currentTarget.dataset.uid}&type=${this.data.rankingType==4?'pk':'user'}`,
+        })
+    },
 })