瀏覽代碼

朗读赛banner

bayi 2 年之前
父節點
當前提交
986159e2be
共有 6 個文件被更改,包括 20 次插入20 次删除
  1. 1 1
      components/banner/index.js
  2. 1 1
      pages/index/index.js
  3. 6 6
      pages/match/index.js
  4. 0 1
      pages/match/index.json
  5. 9 8
      pages/match/index.wxml
  6. 3 3
      utils/request.js

+ 1 - 1
components/banner/index.js

@@ -9,7 +9,7 @@ Component({
         })
       }
     }
-    // banner的classify是:1:官方推荐;2:作品展播;3:官方活动;4:关注作品;5:我的作品;
+    // banner的classify是:1:官方推荐;2:作品展播;3:官方活动;4:关注作品;5:我的作品 6:收藏作品
   },
   data: {
     bannerList: [],

+ 1 - 1
pages/index/index.js

@@ -20,7 +20,7 @@ Page({
   data: {
     navBarHeight: app.globalData.navBarHeight,
     background: ['demo-text-1', 'demo-text-2', 'demo-text-3'],
-    currentType: '2',
+    currentType: '1',
     // 控制一级分类是否固定
     isFixed: false,
     desktopTips: app.globalData.desktopTips,

+ 6 - 6
pages/match/index.js

@@ -26,9 +26,8 @@ Page({
     // true是人气榜,false是参赛作品
     currentType: true,
     activityUserList: [],
-    bannerList: [],
+    modelList: [],
     myActivityUser: {},
-    explain: '',
     activityId: '',
     bannerList: []
   },
@@ -36,7 +35,6 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
-    console.log(options);
     this.setData({
       activityId: options.activityId
     })
@@ -68,12 +66,13 @@ Page({
   },
   // 获取范文
   async getModelTexts() {
-    let bannerList = await getModelTexts({
+    let modelList = await getModelTexts({
       grade: this.data.userInfo.grade,
       activityId: this.data.activityId
     })
+    console.log(modelList);
     this.setData({
-      bannerList
+      modelList
     })
   },
   async getReadRanking() {
@@ -84,10 +83,11 @@ Page({
     } = await getReadRanking({
       activityId: this.data.activityId
     })
+    console.log(activity);
     this.setData({
       activityUserList,
       myActivityUser,
-      explain: activity.explain
+      bannerList: activity.bannerList
     })
   },
   async getSelfReadRanking() {

+ 0 - 1
pages/match/index.json

@@ -1,7 +1,6 @@
 {
   "usingComponents": {
     "worksList": "/components/worksList/index",
-    "banner": "/components/banner/index",
     "navigationBar": "/components/navigationBar/index"
   },
   "navigationBarTitleText": "朗读比赛"

+ 9 - 8
pages/match/index.wxml

@@ -1,9 +1,12 @@
 <wxs src="../../utils/filter.wxs" module="filters" />
 <navigationBar bind:reload='reload' showNav="{{false}}"></navigationBar>
 <view class="matchBox">
-  <image src="{{explain}}" class="headerImg" />
-  <!-- <banner bannerList="{{bannerList}}" /> -->
-
+  <swiper class="swiper" autoplay circular indicator-dots="{{bannerList.length>1}}" indicator-active-color="#fff"
+    indicator-color='#ecececa1'>
+    <swiper-item wx:for="{{bannerList}}" wx:key="id">
+      <image src="{{item.icon}}" class="headerImg" />
+    </swiper-item>
+  </swiper>
   <view class="modelText">
     <view class="header">
       <image src="/static/modelBg.png" class="bg" />
@@ -11,11 +14,9 @@
     </view>
     <swiper class="swiper" autoplay circular indicator-dots previous-margin='40px' next-margin='20px'
       indicator-active-color="#7ACAFF" indicator-color='#BABABA'>
-      <block wx:for="{{bannerList}}" wx:key="id">
-        <swiper-item>
-          <image src="{{item.coverImg}}" class="swiper-item" bindtap='bannelEvent' data-id='{{item.exampleId}}' />
-        </swiper-item>
-      </block>
+      <swiper-item wx:for="{{modelList}}" wx:key="id">
+        <image src="{{item.coverImg}}" class="swiper-item" bindtap='bannelEvent' data-id='{{item.exampleId}}' />
+      </swiper-item>
     </swiper>
   </view>
   <view class="rankList">

+ 3 - 3
utils/request.js

@@ -6,13 +6,13 @@ const {
     envVersion
   }
 } = wx.getAccountInfoSync();
-/* if (envVersion == 'develop') {
+if (envVersion == 'develop') {
   baseUrl = 'https://reader-api.efunbox.cn/wx'
   oldUrl = 'https://reader-api.efunbox.cn'
-} else { */
+} else {
   baseUrl = 'https://reader-api.ai160.com/wx'
   oldUrl = 'https://reader-api.ai160.com'
-// }
+}
 
 function request(url, method, data, oldBaseUrl = false) {
   let header = {