bayi 1 год назад
Родитель
Сommit
e576ffcee4
5 измененных файлов с 140 добавлено и 69 удалено
  1. 1 0
      app.js
  2. 10 23
      pages/inviteRanking/index.js
  3. 59 21
      pages/inviteRanking/index.less
  4. 21 7
      pages/inviteRanking/index.wxml
  5. 49 18
      pages/inviteRanking/index.wxss

+ 1 - 0
app.js

@@ -31,6 +31,7 @@ App({
         if (uid) {
             let userInfo = await getMyInfo()
             this.setUser(userInfo.user)
+            this.globalData.userInfo = userInfo.user
             this.deviceLogin()
             if (getApp().callBack) {
                 getApp().callBack();

+ 10 - 23
pages/inviteRanking/index.js

@@ -6,39 +6,30 @@ Page({
      * 页面的初始数据
      */
     data: {
+        userInfo: {},
         ranking: '',
         userList: [],
-        currentWeek: 0,
-        weekBegin: '',
-        weekEnd: '',
-        //2:邀新榜,3:热播榜,4:挑战pk榜
-        rankingType: '',
-        explain: ''
     },
 
     /**
      * 生命周期函数--监听页面加载
      */
     onLoad(options) {
-        this.setData({
-            rankingType: options.type,
-        })
-
         wx.setNavigationBarColor({
             frontColor: '#ffffff',
             backgroundColor: '#2DCE66'
         })
+        this.setData({
+            userInfo: getApp().globalData.userInfo
+        })
+        console.log(getApp().globalData.userInfo);
         this.getRankingData(2)
     },
     async getRankingData(id) {
         let {
             ranking,
             userList,
-            currentWeek,
-            weekBegin,
-            weekEnd,
             title,
-            explain
         } = await getRankingData(id)
         wx.setNavigationBarTitle({
             title
@@ -46,10 +37,6 @@ Page({
         this.setData({
             ranking,
             userList,
-            currentWeek,
-            weekBegin,
-            weekEnd,
-            explain
         })
     },
     jumpIndex() {
@@ -63,15 +50,15 @@ Page({
         if (!currentTarget.dataset.uid) {
             return
         }
-        wx.navigateTo({
-            url: `/pages/personal/index?uid=${currentTarget.dataset.uid}&type=${this.data.rankingType==4?'pk':'user'}`,
-        })
+        /*  wx.navigateTo({
+             url: `/pages/personal/index?uid=${currentTarget.dataset.uid}&type=${this.data.rankingType==4?'pk':'user'}`,
+         }) */
     },
     onShareAppMessage() {
         return {
-            title: this.data.rankingType == 3 ? '我要上热门,就差你的一个赞,快来帮帮我吧!' : '这个小程序太赞了!孩子朗读能力蹭蹭上涨,推荐你试试!',
+            title: '这个小程序太赞了!孩子朗读能力蹭蹭上涨,推荐你试试!',
             path: `/pages/index/index?uid=${wx.getStorageSync('uid')}`,
-            imageUrl: this.data.rankingType == 3 ? 'http://reader-wx.ai160.com/images/reader/v3/375-300-3.jpg' : 'http://reader-wx.ai160.com/images/reader/v3/375-300-2.jpg'
+            imageUrl: 'http://reader-wx.ai160.com/images/reader/v3/375-300-2.jpg'
         }
     }
 })

+ 59 - 21
pages/inviteRanking/index.less

@@ -147,38 +147,76 @@
 
     .footer {
         width: 100%;
-        padding: 26rpx 60rpx 30rpx 90rpx;
+        padding: 24rpx 46rpx 20rpx;
         box-sizing: border-box;
-        display: flex;
-        justify-content: space-between;
-        align-items: center;
         background-color: white;
         box-shadow: 0 2rpx 24rpx 0 rgba(0, 0, 0, 0.50);
 
-        .left {
-            font-size: 26rpx;
-            font-weight: bold;
+        .detail {
+            margin-bottom: 30rpx;
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+
+            .left {
+                display: flex;
+                align-items: center;
+
+                .avatar {
+                    background-color: #EBEBEB;
+                    width: 68rpx;
+                    height: 68rpx;
+                    border-radius: 50%;
+                    margin-right: 24rpx;
+                }
+
+                .nickName {
+                    font-size: 30rpx;
+                    width: 200rpx;
+                }
+            }
+
+            .right {
+                width: 350rpx;
+                display: flex;
+                align-items: center;
+                justify-content: space-between;
+                font-size: 30rpx;
+                color: #FF630C;
 
-            text {
-                color: #4AC4FF;
-                font-size: 38rpx;
-                margin-left: 10rpx;
+                .info {
+                    .i2 {
+                        font-size: 20rpx;
+                        color: #666666;
+                    }
+                }
             }
         }
 
-        .rigth {
-            padding: 12rpx 34rpx;
-            padding-left: 26rpx;
-            border-radius: 50rpx;
-            background-image: linear-gradient(270deg, #33C3FF 0%, #81C7FF 100%, #14C962 100%);
-            box-shadow: 0 4rpx 10rpx 0 rgba(50, 197, 255, 0.46);
-            color: white;
+        .operate {
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
             font-size: 26rpx;
+            color: white;
+            text-align: center;
+
+            .record {
+                width: 268rpx;
+                padding: 14rpx 0rpx;
+                background: linear-gradient(141deg, #FC9F02 0%, #FF7C34 100%);
+                box-shadow: inset 0rpx -2rpx 3rpx 0rpx #FF7000;
+                border-radius: 50rpx;
+            }
 
             .share {
-                width: 26rpx;
-                height: 24rpx;
-                margin-right: 14rpx;
+                width: 268rpx;
+                padding: 14rpx 0rpx;
+                border-radius: 50rpx;
+                background-image: linear-gradient(270deg, #33C3FF 0%, #81C7FF 100%, #14C962 100%);
+                color: white;
+                box-shadow: 0 4rpx 10rpx 0 rgba(50, 197, 255, 0.46);
+                font-size: 26rpx;
             }
         }
     }

+ 21 - 7
pages/inviteRanking/index.wxml

@@ -58,12 +58,26 @@
         </scroll-view>
     </view>
     <view class="footer">
-        <view class="left">我的排名<text>{{ranking?ranking:'100+'}}</text></view>
-        <button class="resetBtn rigth" open-type="share" wx:if="{{rankingType!=4}}">
-            <image src="/static/forward.png" class="share" />呼朋唤友来加热
-        </button>
-        <button class="resetBtn rigth" wx:else bindtap="jumpIndex">
-            我要冲榜
-        </button>
+        <view class="detail">
+            <view class="left">
+                <image src="{{userInfo.avatar}}" class="avatar" />
+                <view class="nickName textOver">{{userInfo.nickName}}</view>
+            </view>
+            <view class="right">
+                <view class="info">
+                    <view class="i1">第33名</view>
+                    <view class="i2">距离上一名还差5</view>
+                </view>
+                <view class="num">
+                    10
+                </view>
+            </view>
+        </view>
+        <view class="operate">
+            <view class="record">邀请记录</view>
+            <button class="resetBtn share" open-type="share">
+                邀请我的同学朋友
+            </button>
+        </view>
     </view>
 </view>

+ 49 - 18
pages/inviteRanking/index.wxss

@@ -123,37 +123,68 @@
 }
 .rankingBox .footer {
   width: 100%;
-  padding: 26rpx 60rpx 30rpx 90rpx;
+  padding: 24rpx 46rpx 20rpx;
   box-sizing: border-box;
+  background-color: white;
+  box-shadow: 0 2rpx 24rpx 0 rgba(0, 0, 0, 0.5);
+}
+.rankingBox .footer .detail {
+  margin-bottom: 30rpx;
   display: flex;
+  align-items: center;
   justify-content: space-between;
+}
+.rankingBox .footer .detail .left {
+  display: flex;
   align-items: center;
-  background-color: white;
-  box-shadow: 0 2rpx 24rpx 0 rgba(0, 0, 0, 0.5);
 }
-.rankingBox .footer .left {
+.rankingBox .footer .detail .left .avatar {
+  background-color: #EBEBEB;
+  width: 68rpx;
+  height: 68rpx;
+  border-radius: 50%;
+  margin-right: 24rpx;
+}
+.rankingBox .footer .detail .left .nickName {
+  font-size: 30rpx;
+  width: 200rpx;
+}
+.rankingBox .footer .detail .right {
+  width: 350rpx;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  font-size: 30rpx;
+  color: #FF630C;
+}
+.rankingBox .footer .detail .right .info .i2 {
+  font-size: 20rpx;
+  color: #666666;
+}
+.rankingBox .footer .operate {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
   font-size: 26rpx;
-  font-weight: bold;
+  color: white;
+  text-align: center;
 }
-.rankingBox .footer .left text {
-  color: #4AC4FF;
-  font-size: 38rpx;
-  margin-left: 10rpx;
+.rankingBox .footer .operate .record {
+  width: 268rpx;
+  padding: 14rpx 0rpx;
+  background: linear-gradient(141deg, #FC9F02 0%, #FF7C34 100%);
+  box-shadow: inset 0rpx -2rpx 3rpx 0rpx #FF7000;
+  border-radius: 50rpx;
 }
-.rankingBox .footer .rigth {
-  padding: 12rpx 34rpx;
-  padding-left: 26rpx;
+.rankingBox .footer .operate .share {
+  width: 268rpx;
+  padding: 14rpx 0rpx;
   border-radius: 50rpx;
   background-image: linear-gradient(270deg, #33C3FF 0%, #81C7FF 100%, #14C962 100%);
-  box-shadow: 0 4rpx 10rpx 0 rgba(50, 197, 255, 0.46);
   color: white;
+  box-shadow: 0 4rpx 10rpx 0 rgba(50, 197, 255, 0.46);
   font-size: 26rpx;
 }
-.rankingBox .footer .rigth .share {
-  width: 26rpx;
-  height: 24rpx;
-  margin-right: 14rpx;
-}
 .invitation {
   background: url('http://reader-wx.ai160.com/images/reader/v3/rank2.jpg') no-repeat;
 }