bayi před 1 rokem
rodič
revize
30f9fd9d4b

+ 3 - 1
pages/activity/index.json

@@ -1,3 +1,5 @@
 {
-    "usingComponents": {}
+    "usingComponents": {
+        "activityList": "/components/activityList/index"
+    }
 }

+ 5 - 0
pages/activity/index.less

@@ -0,0 +1,5 @@
+.activityBox {
+    position: relative;
+    padding-top: 30rpx;
+    padding-bottom: calc(140rpx + env(safe-area-inset-bottom)) !important;
+}

+ 3 - 1
pages/activity/index.wxml

@@ -1 +1,3 @@
-<view class="activityBox"></view>
+<view class="activityBox">
+    <activityList id="activityList" classify='{{4}}' />
+</view>

+ 5 - 0
pages/activity/index.wxss

@@ -0,0 +1,5 @@
+.activityBox {
+  position: relative;
+  padding-top: 30rpx;
+  padding-bottom: calc(140rpx + env(safe-area-inset-bottom)) !important;
+}

+ 0 - 150
pages/index/index copy.js

@@ -1,150 +0,0 @@
-const app = getApp()
-import {
-    getHotrecommendList,
-} from "~/api/works"
-import {
-    getBannerList
-} from '~/api/global'
-import reachBottom from '~/mixins/reachBottom'
-import event from '~/mixins/event'
-import share from '~/mixins/share'
-import {
-    createStoreBindings
-} from 'mobx-miniprogram-bindings'
-import {
-    store
-} from '~/store/index'
-Page({
-    behaviors: [reachBottom, share,event],
-    data: {
-        navBarHeight: app.globalData.navBarHeight,
-        background: ['demo-text-1', 'demo-text-2', 'demo-text-3'],
-        currentType: '3',
-        // 控制一级分类是否固定
-        isFixed: false,
-        desktopTips: app.globalData.desktopTips,
-        bannerList: []
-    },
-    onLoad(options) {
-        this.getLocUserInfo()
-        if (Object.keys(this.data.userInfo).length > 0) {
-            this.requestAgain()
-        } else {
-            getApp().callBack = (res) => {
-                this.getLocUserInfo()
-                this.requestAgain()
-            }
-        }
-        let {
-            desktopTips
-        } = app.globalData
-        if (desktopTips) {
-            setTimeout(() => {
-                this.setData({
-                    desktopTips: false
-                })
-                wx.setStorage({
-                    key: "preDesktopTime",
-                    data: new Date()
-                })
-            }, 6000)
-        }
-    },
-    onShow() {
-        if (typeof this.getTabBar === 'function') {
-            this.getTabBar().setData({
-                selected: 2
-            })
-        }
-    },
-    onUnload() {
-        this.storeBindings.destroyStoreBindings()
-    },
-    onReachBottom() {
-        this.loadMore()
-    },
-    async getLocUserInfo() {
-        this.storeBindings = createStoreBindings(this, {
-            store,
-            fields: {
-                userInfo: 'userInfo'
-            },
-        })
-        this.storeBindings.updateStoreBindings()
-    },
-    async loadMore() {
-        if (!this.data.userInfo.grade) {
-            return
-        }
-        if (this.data.currentType == '3') {
-            this.localGetData(getHotrecommendList, {
-                grade: this.data.userInfo.grade
-            })
-        }
-    },
-    jumpSearch() {
-        wx.navigateTo({
-            url: '/pages/childClassify/index?type=search',
-        })
-    },
-    /**
-     * 监听页面滚动事件
-     */
-    onPageScroll(e) {
-        if (e.scrollTop >= 103 && !this.data.isFixed) {
-            this.setData({
-                isFixed: true
-            })
-        } else if (e.scrollTop < 103 && this.data.isFixed) {
-            this.setData({
-                isFixed: false
-            })
-        }
-    },
-
-    closeDesktop() {
-        this.setData({
-            desktopTips: false
-        })
-        wx.setStorage({
-            key: "preDesktopTime",
-            data: new Date()
-        })
-    },
-    async getBannerList() {
-        let bannerList = await getBannerList({
-            grade: this.data.userInfo.grade,
-        })
-        this.setData({
-            bannerList,
-        })
-    },
-    requestAgain() {
-        this.resetData()
-        this.getBannerList()
-        if (this.data.currentType != 3) {
-            this.selectComponent('#activityList').getActivities()
-        }
-    },
-    selectType({
-        target
-    }) {
-        if (target.dataset.type) {
-            if (this.selectComponent('#worksList')) {
-                this.selectComponent('#worksList').resetAudio()
-            }
-            this.setData({
-                currentType: target.dataset.type,
-            })
-            if (target.dataset.type != 3) {
-                this.selectComponent('#activityList').getActivities()
-            }
-            if (target.dataset.type == '3') {
-                this.resetData()
-            }
-        }
-    },
-    onUnload() {
-        this.storeBindings.destroyStoreBindings()
-    },
-})

+ 0 - 70
pages/index/index copy.less

@@ -1,70 +0,0 @@
-.recommend {
-  position: relative;
-  padding-bottom: calc(140rpx + env(safe-area-inset-bottom)) !important;
-
-  .desktopTips {
-    position: fixed;
-    z-index: 999;
-    right: 0rpx;
-
-    .triangle {
-      position: absolute;
-      right: 124rpx;
-      top: -26rpx;
-      border: 20rpx solid #F9F9FF;
-      border-top-color: transparent;
-      border-left-color: transparent;
-      border-right-color: transparent;
-    }
-
-    .tipsImg {
-      width: 530rpx;
-      height: 176rpx;
-    }
-  }
-
-  .scrollBox {
-    width: 100%;
-
-  
-  }
-
-  .selectType {
-    padding: 30rpx 15rpx 30rpx 26rpx;
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
-
-    .type {
-      padding: 14rpx 0rpx;
-      width: 200rpx;
-      box-sizing: border-box;
-      text-align: center;
-      border: 1rpx solid #9f9f9fa4;
-      border-radius: 50rpx;
-      color: #1A1A1A;
-      font-size: 28rpx;
-    }
-
-    .currentType {
-      color: white;
-      box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 6px -1px, rgba(0, 0, 0, 0.06) 0px 2px 4px -1px;
-      background-color: #00C657;
-      border-color: #00C657;
-      font-weight: bold;
-    }
-
-    .search {
-      font-size: 0rpx;
-      padding: 14rpx 14rpx;
-      text-align: center;
-      border: 1rpx solid #9f9f9fa4;
-      border-radius: 50rpx;
-
-      .searchImg {
-        width: 26rpx;
-        height: 26rpx;
-      }
-    }
-  }
-}

+ 0 - 30
pages/index/index copy.wxml

@@ -1,30 +0,0 @@
-<navigationBar bind:reload='requestAgain'></navigationBar>
-<view class="recommend">
-    <banner bannerList="{{bannerList}}" userInfo="{{userInfo}}" />
-    <!-- 加桌提示 -->
-    <view class=" desktopTips" wx:if="{{desktopTips}}" style="top:{{navBarHeight+3}}px" bindtap="closeDesktop">
-        <view class="triangle"></view>
-        <image src="http://reader-wx.ai160.com/images/reader/v3/desktop-android.png" class="tipsImg" />
-    </view>
-    <!-- 滚动定位 -->
-    <view class="scrollBox {{isFixed?'isFixed':''}}" style="top:{{navBarHeight}}px;">
-        <!-- 展示类型选择 -->
-        <view class="selectType {{isFixed?'isFixed2':''}}" bindtap="selectType">
-            <view class="type {{currentType=='2'?'currentType':''}}" data-type='2'>排行榜</view>
-            <view class="type {{currentType=='3'?'currentType':''}}" data-type='3'>作品展播</view>
-            <view class="type {{currentType=='4'?'currentType':''}}" data-type='4'>官方活动</view>
-            <view class="search" bindtap="jumpSearch">
-                <image src="/static/search.png" class="searchImg" />
-            </view>
-        </view>
-    </view>
-    <!-- 当一级分类固定定位时占位用的元素 -->
-    <view class="{{isFixed?'brace':''}}" />
-    <!-- 优秀作品展播及官方推荐列表组件 -->
-    <worksList id="worksList" wx:if="{{currentType=='3'}}" worksList="{{list}}" videoType="public" tabBarPadding='true'
-        autoPlay='{{false}}' />
-    <view hidden="{{currentType=='3'}}">
-        <activityList id="activityList" classify='{{currentType}}' />
-    </view>
-</view>
-<canvas id='share' type="2d"> </canvas>