소스 검색

1.支持按年级显示活动2.删除无用文件

bayi 2 년 전
부모
커밋
f03070777a

+ 16 - 2
components/activityList/index.js

@@ -2,7 +2,20 @@ const app = getApp()
 import {
   getActivities
 } from '~/api/global'
+import {
+  storeBindingsBehavior
+} from 'mobx-miniprogram-bindings'
+import {
+  store
+} from '~/store/index'
 Component({
+  behaviors: [storeBindingsBehavior],
+  storeBindings: {
+    store,
+    fields: {
+      userInfo: 'userInfo'
+    },
+  },
   properties: {
     classify: {
       type: Number,
@@ -38,10 +51,11 @@ Component({
         clearInterval(item)
       })
       let activityList = await getActivities({
-        classify: this.properties.classify
+        classify: this.properties.classify,
+        grade: this.data.userInfo.grade
       })
       this.setData({
-        activityList
+        activityList,
       })
       activityList.forEach((item, index) => {
         if (item.bannerType == 4 && item.voucherType) {

+ 12 - 1
pages/activity/index.js

@@ -1,12 +1,23 @@
 Page({
   data: {
-
+    activityList: true
   },
   onShow() {
     if (typeof this.getTabBar === 'function') {
       this.getTabBar().setData({
         selected: 1
       })
+      this.setData({
+        activityList: true
+      })
     }
   },
+  onHide() {
+    this.setData({
+      activityList: false
+    })
+  },
+  resetData() {
+    this.selectComponent('#activityList').getActivities()
+  }
 })

+ 2 - 2
pages/activity/index.wxml

@@ -1,5 +1,5 @@
-<navigationBar></navigationBar>
+<navigationBar bind:reload='resetData'></navigationBar>
 <view class="activityBox">
   <banner classify='3' />
-  <activityList class="activityList" />
+  <activityList id="activityList" class="activityList" wx:if="{{activityList}}"/>
 </view>

+ 0 - 18
pages/collection/index.js

@@ -1,18 +0,0 @@
-import {
-  getFavoritesList
-} from "~/api/user"
-import reachBottom from '~/mixins/reachBottom'
-import share from '~/mixins/share'
-Page({
-  behaviors: [reachBottom,share],
-  data: {},
-  onShow() {
-    this.resetData()
-  },
-  async loadMore() {
-    this.getData(getFavoritesList, {})
-  },
-  onReachBottom() {
-    this.loadMore()
-  },
-})

+ 0 - 7
pages/collection/index.json

@@ -1,7 +0,0 @@
-{
-  "usingComponents": {
-    "worksList": "/components/worksList/index",
-    "emptyBg": "/components/empty/index"
-  },
-  "navigationBarTitleText": "我的收藏"
-}

+ 0 - 2
pages/collection/index.less

@@ -1,2 +0,0 @@
-.collection {
-}

+ 0 - 5
pages/collection/index.wxml

@@ -1,5 +0,0 @@
-<view class="collection">
-  <worksList id="worksList" videoType='collection' worksList="{{list}}" autoPlay="{{false}}" />
-  <emptyBg wx:if="{{nullList}}" message="您没有收藏的作品"></emptyBg>
-  <canvas id='share' type="2d"> </canvas>
-</view>

+ 0 - 0
pages/collection/index.wxss


+ 0 - 5
pages/match/index.js

@@ -111,11 +111,6 @@ Page({
       url: `/pages/personal/index?uid=${currentTarget.dataset.uid}`,
     })
   },
-  jumpIntro() {
-    wx.navigateTo({
-      url: `/pages/rankIntro/index?title=活动规则&img=${this.data.explain}`,
-    })
-  },
   selectType({
     target
   }) {

+ 1 - 1
pages/match/index.wxml

@@ -1,7 +1,7 @@
 <wxs src="../../utils/filter.wxs" module="filters" />
 <navigationBar bind:reload='reload' showNav="{{false}}"></navigationBar>
 <view class="matchBox">
-  <image src="http://reader-wx.ai160.com/images/reader/v3/enter_banner.jpg" class="headerImg" bindtap="jumpIntro"/>
+  <image src="http://reader-wx.ai160.com/images/reader/v3/enter_banner.jpg" class="headerImg" />
   <view class="modelText">
     <view class="header">
       <image src="/static/modelBg.png" class="bg" />