bayi 2 rokov pred
rodič
commit
1c8c58f628

+ 58 - 57
app.json

@@ -1,59 +1,60 @@
 {
-  "pages": [
-    "pages/index/index",
-    "pages/activity/index",
-    "pages/message/index",
-    "pages/like/index",
-    "pages/chat/index",
-    "pages/comment/index",
-    "pages/match/index",
-    "pages/pkResult/index",
-    "pages/medalStore/index",
-    "pages/my/index",
-    "pages/score/index",
-    "pages/pkPage/index",
-    "pages/rankIntro/index",
-    "pages/ranking/index",
-    "pages/userWorks/index",
-    "pages/works/index",
-    "pages/personal/index",
-    "pages/childClassify/index",
-    "pages/reading/index",
-    "pages/otherWork/index",
-    "pages/editUser/index",
-    "pages/notice/index",
-    "pages/friend/index",
-    "pages/searchFriend/index"
-  ],
-  "tabBar": {
-    "custom": true,
-    "list": [{
-      "pagePath": "pages/index/index",
-      "text": "推荐"
-    }, {
-      "pagePath": "pages/activity/index",
-      "text": "活动"
-    }, {
-      "pagePath": "pages/works/index",
-      "text": "作品"
-    }, {
-      "pagePath": "pages/message/index",
-      "text": "消息"
-    }, {
-      "pagePath": "pages/my/index",
-      "text": "我的"
-    }]
-  },
-  "window": {
-    "backgroundTextStyle": "light",
-    "navigationBarBackgroundColor": "#F2F6FC",
-    "navigationBarTitleText": "朗读小咖秀",
-    "navigationBarTextStyle": "black",
-    "onReachBottomDistance": 50,
-    "enablePullDownRefresh": false
-  },
-  "resolveAlias": {
-    "~/*": "/*"
-  },
-  "sitemapLocation": "sitemap.json"
+    "pages": [
+        "pages/index/index",
+        "pages/activity/index",
+        "pages/message/index",
+        "pages/like/index",
+        "pages/chat/index",
+        "pages/comment/index",
+        "pages/match/index",
+        "pages/pkResult/index",
+        "pages/medalStore/index",
+        "pages/my/index",
+        "pages/score/index",
+        "pages/pkPage/index",
+        "pages/rankIntro/index",
+        "pages/ranking/index",
+        "pages/userWorks/index",
+        "pages/works/index",
+        "pages/personal/index",
+        "pages/childClassify/index",
+        "pages/reading/index",
+        "pages/otherWork/index",
+        "pages/editUser/index",
+        "pages/notice/index",
+        "pages/friend/index",
+        "pages/invite/index",
+        "pages/searchFriend/index"
+    ],
+    "tabBar": {
+        "custom": true,
+        "list": [{
+            "pagePath": "pages/index/index",
+            "text": "推荐"
+        }, {
+            "pagePath": "pages/activity/index",
+            "text": "活动"
+        }, {
+            "pagePath": "pages/works/index",
+            "text": "作品"
+        }, {
+            "pagePath": "pages/message/index",
+            "text": "消息"
+        }, {
+            "pagePath": "pages/my/index",
+            "text": "我的"
+        }]
+    },
+    "window": {
+        "backgroundTextStyle": "light",
+        "navigationBarBackgroundColor": "#F2F6FC",
+        "navigationBarTitleText": "朗读小咖秀",
+        "navigationBarTextStyle": "black",
+        "onReachBottomDistance": 50,
+        "enablePullDownRefresh": false
+    },
+    "resolveAlias": {
+        "~/*": "/*"
+    },
+    "sitemapLocation": "sitemap.json"
 }

+ 146 - 140
components/activityList/index.js

@@ -1,156 +1,162 @@
 const app = getApp()
 import {
-  getActivities
+    getActivities
 } from '~/api/global'
 import {
-  storeBindingsBehavior
+    storeBindingsBehavior
 } from 'mobx-miniprogram-bindings'
 import {
-  store
+    store
 } from '~/store/index'
 Component({
-  behaviors: [storeBindingsBehavior],
-  storeBindings: {
-    store,
-    fields: {
-      userInfo: 'userInfo'
+    behaviors: [storeBindingsBehavior],
+    storeBindings: {
+        store,
+        fields: {
+            userInfo: 'userInfo'
+        },
     },
-  },
-  properties: {
-    classify: {
-      type: Number,
-      value: 1
-    }
-  },
-  /**
-   * 组件的初始数据
-   */
-  data: {
-    //1:图片,2:邀新榜,3:热播榜,4:挑战pk榜,5,朗读赛,6,领取勋章,7年包红包8,次数红包
-    type: '4',
-    activityList: [],
-    isIos: app.globalData.isIOS,
-    dsqList: []
-  },
-  lifetimes: {
-    attached() {
-      this.getActivities()
-    },
-    detached() {
-      this.data.dsqList.forEach(item => {
-        clearInterval(item)
-      })
-    }
-  },
-  /**
-   * 组件的方法列表
-   */
-  methods: {
-    async getActivities() {
-      this.data.dsqList.forEach(item => {
-        clearInterval(item)
-      })
-      let activityList = await getActivities({
-        classify: this.properties.classify,
-        grade: this.data.userInfo.grade
-      })
-      this.setData({
-        activityList,
-      })
-      activityList.forEach((item, index) => {
-        if (item.bannerType == 4 && item.voucherType) {
-          this.activityTimeOut(item.endTime, index)
+    properties: {
+        classify: {
+            type: Number,
+            value: 1
         }
-      })
     },
-    jumpUserInfo({
-      currentTarget
-    }) {
-      if (!currentTarget.dataset.uid) {
-        return
-      }
-      wx.navigateTo({
-        url: `/pages/personal/index?uid=${currentTarget.dataset.uid}&type=user`,
-      })
+    /**
+     * 组件的初始数据
+     */
+    data: {
+        //1:图片,2:邀新榜,3:热播榜,4:挑战pk榜,5,朗读赛,6,领取勋章,7年包红包8,次数红包
+        type: '4',
+        activityList: [],
+        isIos: app.globalData.isIOS,
+        dsqList: []
     },
-    activityTimeOut(oTime, index) {
-      let inputTime = new Date(oTime)
-      let dsq = setInterval(() => {
-        var nowTime = new Date();
-        //把剩余时间毫秒数转化为秒
-        var times = (inputTime - nowTime) / 1000;
-        if (times <= 0) {
-          this.setData({
-            [`activityList[${index}].hour`]: '00',
-            [`activityList[${index}].minute`]: '00',
-            [`activityList[${index}].second`]: '00',
-            [`activityList[${index}].finish`]: true,
-          })
-          return clearInterval(dsq)
+    lifetimes: {
+        attached() {
+            this.getActivities()
+        },
+        detached() {
+            this.data.dsqList.forEach(item => {
+                clearInterval(item)
+            })
         }
-        //计算小时数 转化为整数
-        var h = parseInt(times / 60 / 60);
-        //如果小时数小于 10,要变成 0 + 数字的形式 赋值给盒子
-        let hour = h < 10 ? "0" + h : h;
-        //计算分钟数 转化为整数
-        var m = parseInt(times / 60 % 60);
-        //如果分钟数小于 10,要变成 0 + 数字的形式 赋值给盒子
-        let minute = m < 10 ? "0" + m : m;
-        //计算描述 转化为整数
-        var s = parseInt(times % 60);
-        //如果秒钟数小于 10,要变成 0 + 数字的形式 赋值给盒子
-        let second = s < 10 ? "0" + s : s;
-        this.setData({
-          [`activityList[${index}].hour`]: hour,
-          [`activityList[${index}].minute`]: minute,
-          [`activityList[${index}].second`]: second,
-          [`activityList[${index}].finish`]: false,
-        })
-        times = --times;
-      }, 1000);
-      this.setData({
-        dsqList: [...this.data.dsqList, dsq]
-      })
     },
-    activityEvent({
-      currentTarget
-    }) {
-      //1:图片,2:邀新榜,3:热播榜,4:挑战pk榜,5,朗读赛,6,领取勋章
-      let {
-        type,
-        id,
-        title,
-        explain
-      } = currentTarget.dataset.info
-      if (type == 1) {
-        wx.navigateTo({
-          url: `/pages/rankIntro/index?title=${title}&img=${explain}`,
-        })
-      }
-      if (type == 5) {
-        wx.navigateTo({
-          url: `/pages/match/index?activityId=${id}`,
-        })
-      }
-      if ([2, 3, 4].includes(type)) {
-        wx.navigateTo({
-          url: `/pages/ranking/index?id=${id}&type=${type}`,
-        })
-      }
-    },
-    drawVoucher({
-      currentTarget
-    }) {
-      let info = currentTarget.dataset.info
-      if (info.finish) {
-        return
-      }
-      this.selectComponent('#voucher').open({
-        type: info.type,
-        id: info.id,
-        voucherType: info.voucherType,
-        preferential: info.price
-      })
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+        async getActivities() {
+            this.data.dsqList.forEach(item => {
+                clearInterval(item)
+            })
+            let activityList = await getActivities({
+                classify: this.properties.classify,
+                grade: this.data.userInfo.grade
+            })
+            this.setData({
+                activityList,
+            })
+            activityList.forEach((item, index) => {
+                if (item.bannerType == 4 && item.voucherType) {
+                    this.activityTimeOut(item.endTime, index)
+                }
+            })
+        },
+        jumpUserInfo({
+            currentTarget
+        }) {
+            if (!currentTarget.dataset.uid) {
+                return
+            }
+            wx.navigateTo({
+                url: `/pages/personal/index?uid=${currentTarget.dataset.uid}&type=user`,
+            })
+        },
+        activityTimeOut(oTime, index) {
+            let inputTime = new Date(oTime)
+            let dsq = setInterval(() => {
+                var nowTime = new Date();
+                //把剩余时间毫秒数转化为秒
+                var times = (inputTime - nowTime) / 1000;
+                if (times <= 0) {
+                    this.setData({
+                        [`activityList[${index}].hour`]: '00',
+                        [`activityList[${index}].minute`]: '00',
+                        [`activityList[${index}].second`]: '00',
+                        [`activityList[${index}].finish`]: true,
+                    })
+                    return clearInterval(dsq)
+                }
+                //计算小时数 转化为整数
+                var h = parseInt(times / 60 / 60);
+                //如果小时数小于 10,要变成 0 + 数字的形式 赋值给盒子
+                let hour = h < 10 ? "0" + h : h;
+                //计算分钟数 转化为整数
+                var m = parseInt(times / 60 % 60);
+                //如果分钟数小于 10,要变成 0 + 数字的形式 赋值给盒子
+                let minute = m < 10 ? "0" + m : m;
+                //计算描述 转化为整数
+                var s = parseInt(times % 60);
+                //如果秒钟数小于 10,要变成 0 + 数字的形式 赋值给盒子
+                let second = s < 10 ? "0" + s : s;
+                this.setData({
+                    [`activityList[${index}].hour`]: hour,
+                    [`activityList[${index}].minute`]: minute,
+                    [`activityList[${index}].second`]: second,
+                    [`activityList[${index}].finish`]: false,
+                })
+                times = --times;
+            }, 1000);
+            this.setData({
+                dsqList: [...this.data.dsqList, dsq]
+            })
+        },
+        activityEvent({
+            currentTarget
+        }) {
+            //1:图片,2:邀新榜,3:热播榜,4:挑战pk榜,5,朗读赛,6,领取勋章
+            let {
+                type,
+                id,
+                title,
+                explain
+            } = currentTarget.dataset.info
+            if (type == 1) {
+                wx.navigateTo({
+                    url: `/pages/rankIntro/index?title=${title}&img=${explain}`,
+                })
+            }
+            if (type == 5) {
+                wx.navigateTo({
+                    url: `/pages/match/index?activityId=${id}`,
+                })
+            }
+            if ([2, 3, 4].includes(type)) {
+                wx.navigateTo({
+                    url: `/pages/ranking/index?id=${id}&type=${type}`,
+                })
+            }
+
+        },
+        jumpInvite() {
+            wx.navigateTo({
+                url: "/pages/invite/index",
+            })
+        },
+        drawVoucher({
+            currentTarget
+        }) {
+            let info = currentTarget.dataset.info
+            if (info.finish) {
+                return
+            }
+            this.selectComponent('#voucher').open({
+                type: info.type,
+                id: info.id,
+                voucherType: info.voucherType,
+                preferential: info.price
+            })
+        }
     }
-  }
 })

+ 3 - 8
components/activityList/index.wxml

@@ -1,17 +1,12 @@
 <wxs src="../../utils/filter.wxs" module="filters" />
 <view class="activityList">
     <!-- 邀新活动 -->
-    <view class="newActivityBox" bindtap="activityEvent">
-        <image src="http://reader-wx.ai160.com/images/reader/v3/learn/50fdd9225ae9b8c71a541981f2c46b95.png" class="cover" />
+    <view class="newActivityBox" bindtap="jumpInvite" wx:if="{{classify==1}}">
+        <image src="http://reader-wx.ai160.com/images/reader/v3/learn/50fdd9225ae9b8c71a541981f2c46b95.png"
+            class="cover" />
         <view class="footer">
             <view class="row">
                 <view class="title">永久vip免费拿</view>
-                <view class="partake">
-                    <text>{{filters.numFilter(item.joinCount)}}</text>人参与
-                </view>
-            </view>
-            <view class="row" style="margin-top: 10rpx;">
-                <view class="time"></view>
                 <view class="btn">
                     立即参与
                 </view>

+ 66 - 0
pages/invite/index.js

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

+ 4 - 0
pages/invite/index.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "永久vip免费拿!"
+}

+ 93 - 0
pages/invite/index.less

@@ -0,0 +1,93 @@
+.invite {
+    width: 100%;
+    padding: 0 24rpx;
+    box-sizing: border-box;
+    min-height: 100vh;
+    background-color: #291068;
+
+    .headerBg {
+        position: absolute;
+        top: 0;
+        left: 0;
+        width: 100%;
+        height: 811rpx;
+    }
+
+    .progressBox {
+        position: relative;
+        top: 380rpx;
+        z-index: 2;
+        padding: 20rpx;
+        box-sizing: border-box;
+        border: 20rpx solid #6B39D8;
+        background-color: #2D1F64;
+        border-radius: 42rpx;
+
+        .row {
+            position: relative;
+            width: 100%;
+            height: 110rpx;
+            margin-bottom: 80rpx;
+            display: flex;
+            align-items: flex-end;
+            justify-content: space-between;
+
+            .line {
+                position: absolute;
+                top: 80rpx;
+                left: 50%;
+                transform: translateX(-50%);
+                width: 90%;
+                height: 8rpx;
+                background-color: #FFD67B;
+            }
+
+            .numBox {
+                position: relative;
+                z-index: 2;
+                display: flex;
+                flex-direction: column;
+                align-items: center;
+
+                .num {
+                    margin-bottom: 6rpx;
+                    font-size: 22rpx;
+                    color: #FFFFFF;
+                }
+
+                .icon {
+                    width: 60rpx;
+                    height: 60rpx;
+                }
+
+                .rewardNum {
+                    position: absolute;
+                    bottom: 24rpx;
+                    font-weight: bold;
+                    font-size: 24rpx;
+                    color: #626262;
+                }
+
+                .rewardN {
+                    position: absolute;
+                    bottom: 8rpx;
+                    font-size: 14rpx;
+                    color: #626262;
+                }
+
+                .reward {
+                    width: 144rpx;
+                    height: 109rpx;
+                }
+            }
+
+            .qualify {
+
+                .rewardNum,
+                .rewardN {
+                    color: #962304;
+                }
+            }
+        }
+    }
+}

+ 60 - 0
pages/invite/index.wxml

@@ -0,0 +1,60 @@
+<view class="invite">
+    <image src="http://reader-wx.ai160.com/images/reader/v3/learn/yxbg.png" class='headerBg' />
+    <view class="progressBox">
+        <!-- 第一关 -->
+        <view class="row ">
+            <view class="line"></view>
+            <view class="numBox" wx:for="{{2}}" wx:key="index">
+                <view class="num">邀{{index+1}}人</view>
+                <image src="{{count>=index+1?'/static/lock-2.png':'/static/lock-1.png'}}" class="icon" />
+            </view>
+            <view class="numBox {{count>2?'qualify':''}}">
+                <view class="rewardNum">VIP7天</view>
+                <view class="rewardN">第一关</view>
+                <image src="{{count>=2?'/static/qb-2.png':'/static/qb-1.png'}}" class="reward" />
+            </view>
+        </view>
+        <!-- 第二关 -->
+        <view class="row ">
+            <view class="line"></view>
+            <view class="numBox" wx:for="{{3}}" wx:key="index">
+                <view class="num">邀{{index+3}}人</view>
+                <image src="{{count>=index+3?'/static/lock-2.png':'/static/lock-1.png'}}" class="icon" />
+            </view>
+            <view class="numBox {{count>=5?'qualify':''}}">
+                <view class="rewardNum">VIP15天</view>
+                <view class="rewardN">第二关</view>
+                <image src="{{count>=5?'/static/qb-2.png':'/static/qb-1.png'}}" class="reward" />
+            </view>
+        </view>
+        <!-- 第三关 -->
+        <view class="row ">
+            <view class="line"></view>
+            <view class="numBox">
+                <view class="num">邀6人</view>
+                <image src="/static/lock-2.png" class="icon" />
+            </view>
+            <view class="numBox">
+                <view class="num">邀7人</view>
+                <image src="/static/lock-1.png" class="icon" />
+            </view>
+            <view class="numBox">
+                <view class="num">邀8人</view>
+                <image src="/static/lock-1.png" class="icon" />
+            </view>
+            <view class="numBox">
+                <view class="num">邀9人</view>
+                <image src="/static/lock-1.png" class="icon" />
+            </view>
+            <view class="numBox">
+                <view class="num">邀10人</view>
+                <image src="/static/lock-1.png" class="icon" />
+            </view>
+            <view class="numBox">
+                <view class="rewardNum">VIP1个月</view>
+                <view class="rewardN">第三关</view>
+                <image src="/static/qb-2.png" class="reward" />
+            </view>
+        </view>
+    </view>
+</view>

+ 79 - 0
pages/invite/index.wxss

@@ -0,0 +1,79 @@
+.invite {
+  width: 100%;
+  padding: 0 24rpx;
+  box-sizing: border-box;
+  min-height: 100vh;
+  background-color: #291068;
+}
+.invite .headerBg {
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 811rpx;
+}
+.invite .progressBox {
+  position: relative;
+  top: 380rpx;
+  z-index: 2;
+  padding: 20rpx;
+  box-sizing: border-box;
+  border: 20rpx solid #6B39D8;
+  background-color: #2D1F64;
+  border-radius: 42rpx;
+}
+.invite .progressBox .row {
+  position: relative;
+  width: 100%;
+  height: 110rpx;
+  margin-bottom: 80rpx;
+  display: flex;
+  align-items: flex-end;
+  justify-content: space-between;
+}
+.invite .progressBox .row .line {
+  position: absolute;
+  top: 80rpx;
+  left: 50%;
+  transform: translateX(-50%);
+  width: 90%;
+  height: 8rpx;
+  background-color: #FFD67B;
+}
+.invite .progressBox .row .numBox {
+  position: relative;
+  z-index: 2;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+.invite .progressBox .row .numBox .num {
+  margin-bottom: 6rpx;
+  font-size: 22rpx;
+  color: #FFFFFF;
+}
+.invite .progressBox .row .numBox .icon {
+  width: 60rpx;
+  height: 60rpx;
+}
+.invite .progressBox .row .numBox .rewardNum {
+  position: absolute;
+  bottom: 24rpx;
+  font-weight: bold;
+  font-size: 24rpx;
+  color: #626262;
+}
+.invite .progressBox .row .numBox .rewardN {
+  position: absolute;
+  bottom: 8rpx;
+  font-size: 14rpx;
+  color: #626262;
+}
+.invite .progressBox .row .numBox .reward {
+  width: 144rpx;
+  height: 109rpx;
+}
+.invite .progressBox .row .qualify .rewardNum,
+.invite .progressBox .row .qualify .rewardN {
+  color: #962304;
+}

BIN
static/yxbg.png