bayi vor 1 Jahr
Ursprung
Commit
41ea55835d

+ 1 - 0
app.json

@@ -24,6 +24,7 @@
         "pages/notice/index",
         "pages/friend/index",
         "pages/invite/index",
+        "pages/inviteRanking/index",
         "pages/aiAvatar/index",
         "pages/searchFriend/index"
     ],

+ 12 - 3
pages/invite/index.js

@@ -287,7 +287,7 @@ Page({
             top: 4924,
             left: 16
         }],
-        count: 1,
+        count: 61,
         state: false,
         modelInfo: {
             title: '',
@@ -295,7 +295,7 @@ Page({
             text2: ''
         }
     },
-    async onShow() {
+    async onLoad() {
         if (this.data.count > 2) {
             wx.pageScrollTo({
                 selector: `#p${this.data.count<60?this.data.count:60}`,
@@ -309,7 +309,11 @@ Page({
         let info = currentTarget.dataset.info
         this.setData({
             state: true,
-            modelInfo: info.id <= this.data.count ? {
+            modelInfo: this.data.count >= 60 ? {
+                title: '恭喜,冲关成功!',
+                text: '您展现了非凡的实力和毅力,获得SVIP终身会员',
+                text2: '也期待着您未来的更多精彩表现!'
+            } : info.id <= this.data.count ? {
                 title: `恭喜,您已通关第${info.num}关`,
                 text: info.text,
                 text2: info.text2
@@ -335,6 +339,11 @@ Page({
             })
         }
     },
+    jumpRanking() {
+        wx.navigateTo({
+            url: '/pages/inviteRanking/index',
+        })
+    },
     /**
      * 用户点击右上角分享
      */

+ 3 - 2
pages/invite/index.wxml

@@ -1,6 +1,6 @@
 <wxs src="../../utils/filter.wxs" module="filters" />
 <view class="invite">
-    <image src="/static/phb.png" class="ranking" />
+    <image src="/static/phb.png" class="ranking" bindtap="jumpRanking" />
     <image src="/static/yqgl.png" class="strategy"
         data-iconDetail="http://reader-wx.ai160.com/images/reader/v3/yxgl.jpg" bindtap="jumpIntro" />
     <view class="body">
@@ -12,7 +12,8 @@
         <image wx:for="{{treasureList}}" wx:key='id' src="{{item.id>count?item.close:item.open}}"
             style="top:{{item.top}}rpx;left:{{item.left}}rpx" class="treasure {{item.id<=count?'shake':''}}"
             bindtap="openTips" data-info="{{item}}" />
-        <image src="{{60>count?'/static/always.png':'/static/always-2.png'}}" class="always" />
+        <image src="{{60>count?'/static/always.png':'/static/always-2.png'}}" class="always {{60<=count?'shake':''}}"
+            bindtap="openTips" data-info="{id:60}" />
     </view>
 </view>
 <view class="mediaBox" wx:if="{{state}}">

+ 77 - 0
pages/inviteRanking/index.js

@@ -0,0 +1,77 @@
+import {
+    getRankingData
+} from '~/api/global'
+Page({
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        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.getRankingData(2)
+    },
+    async getRankingData(id) {
+        let {
+            ranking,
+            userList,
+            currentWeek,
+            weekBegin,
+            weekEnd,
+            title,
+            explain
+        } = await getRankingData(id)
+        wx.setNavigationBarTitle({
+            title
+        })
+        this.setData({
+            ranking,
+            userList,
+            currentWeek,
+            weekBegin,
+            weekEnd,
+            explain
+        })
+    },
+    jumpIndex() {
+        wx.switchTab({
+            url: '/pages/index/index',
+        })
+    },
+    jumpUserInfo({
+        currentTarget
+    }) {
+        if (!currentTarget.dataset.uid) {
+            return
+        }
+        wx.navigateTo({
+            url: `/pages/personal/index?uid=${currentTarget.dataset.uid}&type=${this.data.rankingType==4?'pk':'user'}`,
+        })
+    },
+    onShareAppMessage() {
+        return {
+            title: this.data.rankingType == 3 ? '我要上热门,就差你的一个赞,快来帮帮我吧!' : '这个小程序太赞了!孩子朗读能力蹭蹭上涨,推荐你试试!',
+            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'
+        }
+    }
+})

+ 4 - 0
pages/inviteRanking/index.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "排行榜"
+}

+ 193 - 0
pages/inviteRanking/index.less

@@ -0,0 +1,193 @@
+.rankingBox {
+    width: 100vw;
+    height: 100vh;
+    display: flex;
+    flex-direction: column;
+
+    .podiumBox {
+        position: relative;
+        height: 510rpx;
+        background-size: cover;
+
+        .dateBox {
+            position: relative;
+            margin-top: 52rpx;
+            font-size: 30rpx;
+            text-align: center;
+            font-weight: bold;
+            color: #2DCE66;
+        }
+
+        .podiumContent {
+            position: absolute;
+            top: 222rpx;
+            width: 100%;
+
+            .user {
+                position: absolute;
+                width: 150rpx;
+                display: flex;
+                flex-direction: column;
+                align-items: center;
+
+                .avatar {
+                    width: 92rpx;
+                    height: 92rpx;
+                    border-radius: 50%;
+                }
+
+                .iconBox {
+                    margin: 8rpx 0rpx 4rpx;
+                    display: flex;
+                    align-items: center;
+
+                    .icon {
+                        width: 30rpx;
+                        height: 30rpx;
+                    }
+
+                    .num {
+                        margin-left: 6rpx;
+                        color: white;
+                        font-size: 28rpx;
+                    }
+                }
+
+                .nickName {
+                    text-align: center;
+                    font-size: 24rpx;
+                    color: white;
+                    width: 100%;
+                }
+            }
+
+            .first {
+                top: 0rpx;
+                left: 304rpx;
+            }
+
+            .second {
+                top: 53rpx;
+                left: 114rpx;
+
+                .avatar {
+                    width: 84rpx;
+                    height: 84rpx;
+                }
+            }
+
+            .third {
+                top: 72rpx;
+                right: 112rpx;
+
+                .avatar {
+                    width: 84rpx;
+                    height: 84rpx;
+                }
+            }
+        }
+    }
+
+    .podiumList {
+        flex: 1;
+        overflow: hidden;
+
+        .scrollBox {
+            height: 100%;
+            padding: 0rpx 30rpx;
+            box-sizing: border-box;
+
+            .row {
+                display: flex;
+                align-items: center;
+                justify-content: space-between;
+                padding: 23rpx 0rpx;
+                border-bottom: 1rpx solid #ddd;
+
+                .left {
+                    display: flex;
+                    align-items: center;
+                    justify-content: space-between;
+
+                    .num {
+                        font-size: 37rpx;
+                        width: 28rpx;
+                    }
+
+                    .avatar {
+                        margin: 0rpx 28rpx 0rpx 44rpx;
+                        width: 78rpx;
+                        height: 78rpx;
+                        background-color: #EBEBEB;
+                        border-radius: 50%;
+                    }
+
+                    .nickName {
+                        font-size: 34rpx;
+                        width: 240rpx;
+                    }
+                }
+
+                .right {
+                    text-align: center;
+
+                    .icon {
+                        width: 30rpx;
+                        height: 30rpx;
+                    }
+
+                    .num {
+                        font-size: 32rpx;
+                        color: #666;
+                    }
+                }
+            }
+        }
+    }
+
+    .footer {
+        width: 100%;
+        padding: 26rpx 60rpx 30rpx 90rpx;
+        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;
+
+            text {
+                color: #4AC4FF;
+                font-size: 38rpx;
+                margin-left: 10rpx;
+            }
+        }
+
+        .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;
+            font-size: 26rpx;
+
+            .share {
+                width: 26rpx;
+                height: 24rpx;
+                margin-right: 14rpx;
+            }
+        }
+    }
+}
+
+.invitation {
+    background: url('http://reader-wx.ai160.com/images/reader/v3/rank2.jpg')no-repeat;
+
+    .tips2 {
+        color: #2DCE66;
+    }
+}

+ 69 - 0
pages/inviteRanking/index.wxml

@@ -0,0 +1,69 @@
+<view class="rankingBox">
+    <view class="podiumBox invitation">
+        <view class="dateBox">
+            邀新排行榜
+        </view>
+        <view class="podiumContent">
+            <view class="user first">
+                <image src="{{userList[0].avatar}}" class="avatar" bindtap="jumpUserInfo"
+                    data-uid='{{userList[0].uid}}' />
+                <view class="iconBox">
+                    <image src="/static/yx.png" class="icon" />
+                    <view class="num">{{userList[0].count}}</view>
+                </view>
+                <view class="nickName textOver">
+                    {{userList[0].nickName||userList[0].eid}}
+                </view>
+            </view>
+            <view class="user second">
+                <image src="{{userList[1].avatar}}" class="avatar" bindtap="jumpUserInfo"
+                    data-uid='{{userList[1].uid}}' />
+                <view class="iconBox">
+                    <image src="/static/yx.png" class="icon" />
+                    <view class="num">{{userList[1].count}}</view>
+                </view>
+                <view class="nickName textOver">
+                    {{userList[1].nickName||userList[1].eid}}
+                </view>
+            </view>
+            <view class="user third">
+                <image src="{{userList[2].avatar}}" class="avatar" bindtap="jumpUserInfo"
+                    data-uid='{{userList[2].uid}}' />
+                <view class="iconBox">
+                    <image src="/static/yx.png" class="icon" />
+                    <view class="num">{{userList[2].count}}</view>
+                </view>
+                <view class="nickName textOver">
+                    {{userList[2].nickName||userList[2].eid}}
+                </view>
+            </view>
+        </view>
+    </view>
+    <view class="podiumList">
+        <scroll-view scroll-y="true" enhanced="true" show-scrollbar="{{false}}" class="scrollBox">
+            <view class="row" wx:for="{{userList.length-3}}" wx:key="index">
+                <view class="left">
+                    <view class="num">{{index+4}}</view>
+                    <image src="{{userList[index+3].avatar}}" class="avatar" bindtap="jumpUserInfo"
+                        data-uid='{{userList[index+3].uid}}' />
+                    <view class="nickName textOver">
+                        {{userList[index+3].nickName||userList[index+3].eid}}
+                    </view>
+                </view>
+                <view class="right">
+                    <image src="/static/yx.png" class="icon" />
+                    <view class="num"> {{userList[index+3].count}}</view>
+                </view>
+            </view>
+        </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>
+</view>

+ 162 - 0
pages/inviteRanking/index.wxss

@@ -0,0 +1,162 @@
+.rankingBox {
+  width: 100vw;
+  height: 100vh;
+  display: flex;
+  flex-direction: column;
+}
+.rankingBox .podiumBox {
+  position: relative;
+  height: 510rpx;
+  background-size: cover;
+}
+.rankingBox .podiumBox .dateBox {
+  position: relative;
+  margin-top: 52rpx;
+  font-size: 30rpx;
+  text-align: center;
+  font-weight: bold;
+  color: #2DCE66;
+}
+.rankingBox .podiumBox .podiumContent {
+  position: absolute;
+  top: 222rpx;
+  width: 100%;
+}
+.rankingBox .podiumBox .podiumContent .user {
+  position: absolute;
+  width: 150rpx;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+.rankingBox .podiumBox .podiumContent .user .avatar {
+  width: 92rpx;
+  height: 92rpx;
+  border-radius: 50%;
+}
+.rankingBox .podiumBox .podiumContent .user .iconBox {
+  margin: 8rpx 0rpx 4rpx;
+  display: flex;
+  align-items: center;
+}
+.rankingBox .podiumBox .podiumContent .user .iconBox .icon {
+  width: 30rpx;
+  height: 30rpx;
+}
+.rankingBox .podiumBox .podiumContent .user .iconBox .num {
+  margin-left: 6rpx;
+  color: white;
+  font-size: 28rpx;
+}
+.rankingBox .podiumBox .podiumContent .user .nickName {
+  text-align: center;
+  font-size: 24rpx;
+  color: white;
+  width: 100%;
+}
+.rankingBox .podiumBox .podiumContent .first {
+  top: 0rpx;
+  left: 304rpx;
+}
+.rankingBox .podiumBox .podiumContent .second {
+  top: 53rpx;
+  left: 114rpx;
+}
+.rankingBox .podiumBox .podiumContent .second .avatar {
+  width: 84rpx;
+  height: 84rpx;
+}
+.rankingBox .podiumBox .podiumContent .third {
+  top: 72rpx;
+  right: 112rpx;
+}
+.rankingBox .podiumBox .podiumContent .third .avatar {
+  width: 84rpx;
+  height: 84rpx;
+}
+.rankingBox .podiumList {
+  flex: 1;
+  overflow: hidden;
+}
+.rankingBox .podiumList .scrollBox {
+  height: 100%;
+  padding: 0rpx 30rpx;
+  box-sizing: border-box;
+}
+.rankingBox .podiumList .scrollBox .row {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 23rpx 0rpx;
+  border-bottom: 1rpx solid #ddd;
+}
+.rankingBox .podiumList .scrollBox .row .left {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+.rankingBox .podiumList .scrollBox .row .left .num {
+  font-size: 37rpx;
+  width: 28rpx;
+}
+.rankingBox .podiumList .scrollBox .row .left .avatar {
+  margin: 0rpx 28rpx 0rpx 44rpx;
+  width: 78rpx;
+  height: 78rpx;
+  background-color: #EBEBEB;
+  border-radius: 50%;
+}
+.rankingBox .podiumList .scrollBox .row .left .nickName {
+  font-size: 34rpx;
+  width: 240rpx;
+}
+.rankingBox .podiumList .scrollBox .row .right {
+  text-align: center;
+}
+.rankingBox .podiumList .scrollBox .row .right .icon {
+  width: 30rpx;
+  height: 30rpx;
+}
+.rankingBox .podiumList .scrollBox .row .right .num {
+  font-size: 32rpx;
+  color: #666;
+}
+.rankingBox .footer {
+  width: 100%;
+  padding: 26rpx 60rpx 30rpx 90rpx;
+  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.5);
+}
+.rankingBox .footer .left {
+  font-size: 26rpx;
+  font-weight: bold;
+}
+.rankingBox .footer .left text {
+  color: #4AC4FF;
+  font-size: 38rpx;
+  margin-left: 10rpx;
+}
+.rankingBox .footer .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;
+  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;
+}
+.invitation .tips2 {
+  color: #2DCE66;
+}

+ 5 - 5
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 {
-    baseUrl = 'https://reader-api.ai160.com/wx'
-    oldUrl = 'https://reader-api.ai160.com'
-}
+} 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 = {