Browse Source

改活动和推荐页

bayi 1 year ago
parent
commit
0bc8abce53

+ 0 - 61
components/banner/index.js

@@ -1,61 +0,0 @@
-Component({
-    properties: {
-        userInfo: {
-            type: Object,
-            value: {}
-        },
-        bannerList: {
-            type: Array,
-            value: [],
-            observer() {
-                this.setData({
-                    current: 0
-                })
-            }
-        }
-        // banner的classify是:1:官方推荐;2:作品展播;3:官方活动;4:关注作品;5:我的作品 6:收藏作品;
-    },
-    data: {
-        current: 0
-    },
-    methods: {
-        bannelEvent({
-            currentTarget
-        }) {
-            //1:图片,2:邀新榜,3:热播榜,4:挑战pk榜,5,朗读赛,6,领取勋章,8跳购买页
-            let {
-                type,
-                content
-            } = currentTarget.dataset
-            if ([2, 3, 4].includes(type)) {
-                wx.navigateTo({
-                    url: `/pages/ranking/index?id=${content}&type=${type}`,
-                })
-            } else if (type == 5) {
-                wx.navigateTo({
-                    url: `/pages/match/index?activityId=${content}`,
-                })
-            } else if (type == 1) {
-                wx.navigateTo({
-                    url: `/pages/rankIntro/index?img=${content}`,
-                })
-            } else if (type == 8) {
-                this.selectComponent('#buyVip').open()
-            } else if (type == 9) {
-                wx.navigateTo({
-                    url: '/pages/invite/index',
-                })
-            } else if (type == 7) {
-                let url = ''
-                if (!this.properties.userInfo.saleUserId) {
-                    url = '/salesperson/pages/sale/index'
-                } else {
-                    url = '/salesperson/pages/saleOffice/index'
-                }
-                wx.navigateTo({
-                    url
-                })
-            }
-        },
-    }
-})

+ 0 - 6
components/banner/index.json

@@ -1,6 +0,0 @@
-{
-    "component": true,
-    "usingComponents": {
-        "buyVip": "/components/buyVip/index"
-    }
-}

+ 0 - 30
components/banner/index.less

@@ -1,30 +0,0 @@
-.header {
-    position: relative;
-    margin-bottom: 50rpx;
-
-    .headerBg {
-        position: absolute;
-        z-index: -2;
-        width: 100%;
-        height: 100%;
-        background-color: #F2F6FC;
-    }
-
-    .swiper {
-        margin: 0 auto;
-        width: 700rpx;
-        height: 250rpx;
-        border-radius: 30rpx;
-        overflow: hidden;
-        box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 6px -1px, rgba(0, 0, 0, 0.06) 0px 2px 4px -1px;
-
-        .swiper-item {
-            width: 100%;
-            height: 100%;
-            border-radius: 20rpx;
-            overflow: hidden;
-            object-fit: cover;
-        }
-
-    }
-}

+ 0 - 12
components/banner/index.wxml

@@ -1,12 +0,0 @@
-<view class="header">
-    <view class="headerBg"></view>
-    <swiper class="swiper" autoplay circular indicator-dots="{{bannerList.length>1}}" indicator-active-color="#fff"
-        indicator-color='#ecececa1' current="{{current}}">
-        <block wx:for="{{bannerList}}" wx:key="id">
-            <swiper-item bindtap='bannelEvent' data-type='{{item.type}}' data-content="{{item.content}}">
-                <image src="{{item.icon}}" class="swiper-item" mode="" />
-            </swiper-item>
-        </block>
-    </swiper>
-</view>
-<buyVip id="buyVip" bind:toBuy="toBuy" />

+ 0 - 26
components/banner/index.wxss

@@ -1,26 +0,0 @@
-.header {
-  position: relative;
-  margin-bottom: 50rpx;
-}
-.header .headerBg {
-  position: absolute;
-  z-index: -2;
-  width: 100%;
-  height: 100%;
-  background-color: #F2F6FC;
-}
-.header .swiper {
-  margin: 0 auto;
-  width: 700rpx;
-  height: 250rpx;
-  border-radius: 30rpx;
-  overflow: hidden;
-  box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 6px -1px, rgba(0, 0, 0, 0.06) 0px 2px 4px -1px;
-}
-.header .swiper .swiper-item {
-  width: 100%;
-  height: 100%;
-  border-radius: 20rpx;
-  overflow: hidden;
-  object-fit: cover;
-}

+ 1 - 1
custom-tab-bar/index.js

@@ -27,7 +27,7 @@ Component({
         mask: false,
         listTab: [{
             "pagePath": "/pages/activity/index",
-            "text": "活动",
+            "text": "排行榜",
             "iconPath": "/static/activity.png",
             "selectedIconPath": "/static/activity2.png"
         }, {

+ 4 - 13
pages/activity/index.less

@@ -24,30 +24,21 @@
                     height: 49rpx;
                 }
             }
-
-            .toAll {
-                font-size: 28rpx;
-                color: #333333;
-
-                .backIcon {
-                    width: 14rpx;
-                    height: 24rpx;
-                }
-            }
+            
         }
     }
 
     .rankList {
         .scrollView {
             display: flex;
+            flex-direction: column;
             align-items: center;
-            white-space: nowrap;
             width: 100%;
 
             .ranking-class-2 {
                 display: inline-block;
-                margin-right: 20rpx;
-                width: 630rpx;
+                margin-bottom: 40rpx;
+                width: 672rpx;
                 box-sizing: border-box;
                 border-radius: 30rpx;
                 overflow: hidden;

+ 29 - 50
pages/activity/index.wxml

@@ -6,62 +6,41 @@
                 <image src="/static/ranking-i.png" class="logo" />
                 排行榜
             </view>
-            <view class="toAll" bindtap="activityEvent" data-info="{{rankList[0]}}">查看更多
-                <image src="/static/black.png" class="backIcon" />
-            </view>
         </view>
-        <!-- #if MP -->
-        <scroll-view class="scrollView" scroll-x="true" enhanced show-scrollbar="{{false}}">
-            <!-- #endif -->
-            <view class="scrollView">
-                <block wx:for="{{rankList}}" wx:key="id">
-                    <view class="ranking-class-2 {{item.type=='2'?'yxb':item.type=='3'?'rbb':'pkb'}}">
-                        <view class="header">
-                            <view class="left">
-                                <image
-                                    src="{{item.type=='2'?'/static/yxb.png':item.type=='3'?'/static/rbb.png':'/static/pkb.png'}}"
-                                    class="icon" />
-                                <view class="title">{{item.title}}</view>
-                            </view>
-                            <view class="toAll" bindtap="activityEvent" data-info="{{item}}">查看全部
-                                <image src="/static/rbtn.png" class="backIcon" />
-                            </view>
+        <view class="scrollView" >
+            <block wx:for="{{rankList}}" wx:key="id">
+                <view class="ranking-class-2 {{item.type=='2'?'yxb':item.type=='3'?'rbb':'pkb'}}">
+                    <view class="header">
+                        <view class="left">
+                            <image
+                                src="{{item.type=='2'?'/static/yxb.png':item.type=='3'?'/static/rbb.png':'/static/pkb.png'}}"
+                                class="icon" />
+                            <view class="title">{{item.title}}</view>
                         </view>
-                        <view class="body">
-                            <view class="row" wx:for="{{3}}" wx:key="index" wx:for-item='items' bindtap="jumpUserInfo"
-                                data-uid='{{item.userList[index].uid}}'>
-                                <view class="left">
-                                    <image src="/static/{{index+1}}-1.png" class="stand" />
-                                    <image src="{{item.userList[index].avatar||'/static/nullAvatar.png'}}"
-                                        class="avatar" />
-                                    <view class="nickName textOver">
-                                        {{item.userList[index].nickName||item.userList[index].eid||'等你来占位'}}
-                                    </view>
-                                </view>
-                                <view class="right">
-                                    <image
-                                        src="{{item.type=='2'?'/static/yx.png':item.type=='3'?'/static/play.png':'/static/win.png'}}"
-                                        class="playIcon" />
-                                    <view class="num">{{item.userList[index].count}}</view>
+                        <view class="toAll" bindtap="activityEvent" data-info="{{item}}">查看全部
+                            <image src="/static/rbtn.png" class="backIcon" />
+                        </view>
+                    </view>
+                    <view class="body">
+                        <view class="row" wx:for="{{3}}" wx:key="index" wx:for-item='items' bindtap="jumpUserInfo"
+                            data-uid='{{item.userList[index].uid}}'>
+                            <view class="left">
+                                <image src="/static/{{index+1}}-1.png" class="stand" />
+                                <image src="{{item.userList[index].avatar||'/static/nullAvatar.png'}}" class="avatar" />
+                                <view class="nickName textOver">
+                                    {{item.userList[index].nickName||item.userList[index].eid||'等你来占位'}}
                                 </view>
                             </view>
+                            <view class="right">
+                                <image
+                                    src="{{item.type=='2'?'/static/yx.png':item.type=='3'?'/static/play.png':'/static/win.png'}}"
+                                    class="playIcon" />
+                                <view class="num">{{item.userList[index].count}}</view>
+                            </view>
                         </view>
                     </view>
-                </block>
-            </view>
-            <!-- #if MP -->
-    </view>
-    <!-- #endif -->
-</view>
-<!-- #if MP -->
-<view class="activeyList">
-    <view class="headline">
-        <view class="left">
-            <image src="/static/huodong-3.png" class="logo" />
-            官方活动
+                </view>
+            </block>
         </view>
     </view>
-    <activityList classify='3' dataList="{{activityList}}" />
-</view>
-<!-- #endif -->
 </view>

+ 3 - 13
pages/activity/index.wxss

@@ -26,26 +26,16 @@
   width: 49rpx;
   height: 49rpx;
 }
-.activityBox .rankList .headline .toAll,
-.activityBox .activeyList .headline .toAll {
-  font-size: 28rpx;
-  color: #333333;
-}
-.activityBox .rankList .headline .toAll .backIcon,
-.activityBox .activeyList .headline .toAll .backIcon {
-  width: 14rpx;
-  height: 24rpx;
-}
 .activityBox .rankList .scrollView {
   display: flex;
+  flex-direction: column;
   align-items: center;
-  white-space: nowrap;
   width: 100%;
 }
 .activityBox .rankList .scrollView .ranking-class-2 {
   display: inline-block;
-  margin-right: 20rpx;
-  width: 630rpx;
+  margin-bottom: 40rpx;
+  width: 672rpx;
   box-sizing: border-box;
   border-radius: 30rpx;
   overflow: hidden;

+ 0 - 11
pages/index/index.js

@@ -4,7 +4,6 @@ import {
     getResourceList
 } from "~/api/works"
 import {
-    getBannerList,
     setSubscribe,
 } from '~/api/global'
 import event from '~/mixins/event'
@@ -21,7 +20,6 @@ Page({
     data: {
         navBarHeight: app.globalData.navBarHeight,
         desktopTips: app.globalData.desktopTips,
-        bannerList: [],
         categoryList: [],
         listOptions: {},
         subscribeShow: false,
@@ -80,7 +78,6 @@ Page({
         })
     },
     requestAgain() {
-        this.getBannerList()
         this.getResource()
         this.getCategoryList()
         this.getSubscribe()
@@ -111,14 +108,6 @@ Page({
             listOptions: data,
         })
     },
-    async getBannerList() {
-        let bannerList = await getBannerList({
-            grade: this.data.userInfo.grade,
-        })
-        this.setData({
-            bannerList,
-        })
-    },
     jumpChildClassify({
         currentTarget
     }) {

+ 0 - 1
pages/index/index.json

@@ -1,7 +1,6 @@
 {
     "usingComponents": {
         "navigationBar": "/components/navigationBar/index",
-        "banner": "/components/banner/index",
         "authority": "/components/authority/index"
     },
     "navigationStyle": "custom",

+ 0 - 3
pages/index/index.wxml

@@ -1,8 +1,5 @@
 <navigationBar bind:reload='requestAgain'></navigationBar>
 <view class="recommend">
-    <!-- #if MP  -->
-    <banner bannerList="{{bannerList}}" userInfo="{{userInfo}}" />
-    <!-- #endif -->
     <!-- 一级分类 -->
     <view class="firstClassify">
         <view class="classifyBox" wx:for="{{categoryList}}" wx:key="id" data-item='{{item}}'