Browse Source

建立活动页面

bayi 1 year ago
parent
commit
b635b895ff

+ 0 - 1
README.md

@@ -10,7 +10,6 @@
 - pages/commission/index 佣金规则
 - pages/index/index 推荐页面
 - pages/message/index 消息页面
-- pages/resource/index 资源页面
 - pages/my/index 我的页面
 - pages/works/index 作品页面
 - pages/like/index 点赞记录页面

+ 4 - 4
app.json

@@ -1,8 +1,8 @@
 {
     "pages": [
         "pages/index/index",
+        "pages/activity/index",
         "pages/message/index",
-        "pages/resource/index",
         "pages/my/index",
         "pages/works/index",
         "pages/like/index",
@@ -47,12 +47,12 @@
     "tabBar": {
         "custom": true,
         "list": [{
+            "pagePath": "pages/activity/index",
+            "text": "活动"
+        }, {
             "pagePath": "pages/works/index",
             "text": "作品"
         }, {
-            "pagePath": "pages/resource/index",
-            "text": "资源"
-        }, {
             "pagePath": "pages/index/index",
             "text": "推荐"
         }, {

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

@@ -25,8 +25,8 @@ Component({
         selectedColor: "#32CA69",
         mask: false,
         listTab: [{
-            "pagePath": "/pages/resource/index",
-            "text": "资源",
+            "pagePath": "/pages/activity/index",
+            "text": "活动",
             "iconPath": "/static/activity.png",
             "selectedIconPath": "/static/activity2.png"
         }, {

+ 15 - 0
pages/activity/index.js

@@ -0,0 +1,15 @@
+Page({
+    data: {
+
+    },
+    onLoad(options) {
+
+    },
+    onShow() {
+        if (typeof this.getTabBar === 'function') {
+            this.getTabBar().setData({
+                selected: 0
+            })
+        }
+    },
+})

+ 3 - 0
pages/activity/index.json

@@ -0,0 +1,3 @@
+{
+    "usingComponents": {}
+}

+ 0 - 0
pages/activity/index.less


+ 1 - 0
pages/activity/index.wxml

@@ -0,0 +1 @@
+<view class="activityBox"></view>

+ 0 - 0
pages/activity/index.wxss


+ 0 - 94
pages/resource/index.js

@@ -1,94 +0,0 @@
-const app = getApp()
-import {
-    createStoreBindings
-} from 'mobx-miniprogram-bindings'
-import {
-    getCategoryList,
-    getResourceList
-} from "~/api/works"
-import share from '~/mixins/share'
-import event from '~/mixins/event'
-import reachBottom from '~/mixins/reachBottom'
-import {
-    store
-} from '~/store/index'
-Page({
-    behaviors: [reachBottom, share, event],
-    data: {
-        navBarHeight: app.globalData.navBarHeight,
-        categoryList: [],
-        listOptions: {},
-    },
-    onShow() {
-        if (typeof this.getTabBar === 'function') {
-            this.getTabBar().setData({
-                selected: 0
-            })
-        }
-        this.getLocUserInfo()
-        if (Object.keys(this.data.userInfo).length > 0) {
-            this.requestAgain()
-        } else {
-            getApp().callBack = (res) => {
-                this.getLocUserInfo()
-                this.requestAgain()
-            }
-        }
-    },
-    requestAgain() {
-        this.resetData()
-        this.getCategoryList()
-    },
-    async loadMore() {
-        if (!this.data.userInfo.grade) {
-            return
-        }
-        let data = await getResourceList({
-            grade: this.data.userInfo.grade
-        })
-        this.setData({
-            listOptions: data,
-        })
-    },
-    async getCategoryList() {
-        let grade = this.data.userInfo.grade
-        let categoryList = await getCategoryList({
-            grade
-        })
-        this.setData({
-            categoryList
-        })
-    },
-    jumpChildClassify({
-        currentTarget
-    }) {
-        let firstInfo = currentTarget.dataset.item
-        wx.navigateTo({
-            url: `/pages/childClassify/index?type=class&title=${firstInfo.title}&id=${firstInfo.id}`,
-        })
-    },
-    showTips() {
-        wx.showModal({
-            title: '新栏目更新中',
-            content: '敬请期待….',
-            showCancel: false,
-            confirmColor: '#333333',
-            success(res) {}
-        })
-    },
-    onUnload() {
-        this.storeBindings.destroyStoreBindings()
-    },
-    async getLocUserInfo() {
-        this.storeBindings = createStoreBindings(this, {
-            store,
-            fields: {
-                userInfo: 'userInfo'
-            },
-        })
-        this.storeBindings.updateStoreBindings()
-    },
-    onUnload() {
-        this.storeBindings.destroyStoreBindings()
-    },
-})

+ 0 - 9
pages/resource/index.json

@@ -1,9 +0,0 @@
-{
-    "usingComponents": {
-        "activityList": "/components/activityList/index",
-        "authority": "/components/authority/index",
-        "navigationBar": "/components/navigationBar/index"
-    },
-    "navigationStyle": "custom",
-    "enablePullDownRefresh": false
-}

+ 0 - 28
pages/resource/index.less

@@ -1,28 +0,0 @@
-.resourceBox {
-    padding-bottom: calc(60rpx + env(safe-area-inset-bottom)) !important;
-}
-
-.firstClassify {
-    position: fixed;
-    top: 0;
-    width: 100%;
-    box-sizing: border-box;
-    background-color: white;
-    box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(0, 0, 0, 0.07);
-    display: flex;
-    flex-wrap: wrap;
-    align-items: center;
-    justify-content: space-between;
-    text-align: center;
-    z-index: 2;
-
-    .icon {
-        width: 25%;
-        height: 195rpx;
-    }
-
-}
-
-.resourceBox {
-    padding-top: 218rpx;
-}

+ 0 - 15
pages/resource/index.wxml

@@ -1,15 +0,0 @@
-<navigationBar bind:reload='requestAgain'></navigationBar>
-<view class="resourceBox">
-    <view class="firstClassify" style="top:{{navBarHeight}}px">
-        <image wx:for="{{categoryList}}" wx:key="id" data-item='{{item}}' bindtap="jumpChildClassify" class="icon"
-            src="{{item.icon}}" />
-        <image bindtap="showTips" class="icon" src="/static/future.png" />
-    </view>
-    <view class="resourceBox">
-        <authority wx:if="{{listOptions.sortList[0]=='recommendReadList'}}"
-            worksList="{{listOptions.recommendReadList}}" />
-        <activityList classify='3' dataList='{{listOptions.activityList}}' />
-        <authority wx:if="{{listOptions.sortList[1]=='recommendReadList'}}"
-            worksList="{{listOptions.recommendReadList}}" />
-    </view>
-</view>

+ 0 - 24
pages/resource/index.wxss

@@ -1,24 +0,0 @@
-.resourceBox {
-  padding-bottom: calc(60rpx + env(safe-area-inset-bottom)) !important;
-}
-.firstClassify {
-  position: fixed;
-  top: 0;
-  width: 100%;
-  box-sizing: border-box;
-  background-color: white;
-  box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(0, 0, 0, 0.07);
-  display: flex;
-  flex-wrap: wrap;
-  align-items: center;
-  justify-content: space-between;
-  text-align: center;
-  z-index: 2;
-}
-.firstClassify .icon {
-  width: 25%;
-  height: 195rpx;
-}
-.resourceBox {
-  padding-top: 218rpx;
-}

BIN
static/activity.png


BIN
static/activity2.png


BIN
static/zp.png


BIN
static/zp2.png