bayi 1 anno fa
parent
commit
44e57915d1

+ 2 - 3
app.js

@@ -31,9 +31,8 @@ App({
             scene,
             query
         } = wx.getEnterOptionsSync()
-
-        let types = [1047, 1048]
-        if (query.scene && types.includes(scene) && path == 'pages/index/index') {
+        //判断是不是扫海报进入
+        if (query.scene && [1047, 1048].includes(scene) && path == 'pages/index/index') {
             let params = decodeURIComponent(query.scene).split('&')
             if (params.length == 1) {
                 this.login(params[0])

+ 0 - 1
components/banner/index.js

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

+ 4 - 17
pages/resource/index.js

@@ -1,3 +1,5 @@
+const app = getApp()
+
 import {
     createStoreBindings
 } from 'mobx-miniprogram-bindings'
@@ -12,11 +14,11 @@ import {
     store
 } from '~/store/index'
 Page({
-    behaviors: [reachBottom, share,event],
+    behaviors: [reachBottom, share, event],
     data: {
+        navBarHeight: app.globalData.navBarHeight,
         categoryList: [],
         listOptions: {},
-        isFixed: false
     },
     onShow() {
         if (typeof this.getTabBar === 'function') {
@@ -48,7 +50,6 @@ Page({
         this.setData({
             listOptions: data,
         })
-        console.log(data, );
     },
     async getCategoryList() {
         let grade = this.data.userInfo.grade
@@ -83,18 +84,4 @@ Page({
     onUnload() {
         this.storeBindings.destroyStoreBindings()
     },
-    /**
-     * 监听页面滚动事件
-     */
-    onPageScroll(e) {
-        if (e.scrollTop >= 6 && !this.data.isFixed) {
-            this.setData({
-                isFixed: true
-            })
-        } else if (e.scrollTop < 6 && this.data.isFixed) {
-            this.setData({
-                isFixed: false
-            })
-        }
-    },
 })

+ 6 - 29
pages/resource/index.less

@@ -3,6 +3,9 @@
 }
 
 .firstClassify {
+    position: fixed;
+    top: 0;
+    z-index: 2;
     padding: 42rpx 0rpx;
     width: 100%;
     margin: 0 auto 30rpx;
@@ -25,32 +28,6 @@
         }
     }
 }
-
-/* .firstClassify {
-    padding: 26rpx 0rpx 24rpx;
-    width: 100%;
-    margin: 0 auto 30rpx;
-    left: 0;
-    right: 0;
-    overflow: hidden;
-    white-space: nowrap;
-    background-color: white;
-
-    .firstBox {
-        text-align: center;
-        display: inline-block;
-        width: 98rpx;
-        padding: 0rpx 20rpx;
-        font-size: 0;
-
-        .icon {
-            width: 84rpx;
-            height: 84rpx;
-        }
-
-        .name {
-            font-weight: bold;
-            font-size: 28rpx;
-        }
-    }
-} */
+.resourceBox{
+    margin-top: 470rpx;
+}

+ 8 - 12
pages/resource/index.wxml

@@ -1,19 +1,15 @@
 <navigationBar bind:reload='requestAgain'></navigationBar>
 <view class="resourceBox">
-    <!--     <scroll-view class="firstClassify {{isFixed?'isFixed isFixed2':''}}" scroll-x="true" enhanced
-        show-scrollbar="{{false}}">
-        <view class="firstBox" wx:for="{{categoryList}}" wx:key="id" data-item='{{item}}' bindtap="jumpChildClassify">
-            <image class="icon" src="{{item.icon}}" />
-            <view class="name">{{item.title}}</view>
-        </view>
-    </scroll-view> -->
-    <scroll-view class="firstClassify {{isFixed?'isFixed isFixed2':''}}" scroll-x="true" enhanced
-        show-scrollbar="{{false}}">
+    <scroll-view class="firstClassify" style="top:{{navBarHeight}}px" scroll-x="true" enhanced show-scrollbar="{{false}}">
         <view class="firstBox" wx:for="{{categoryList}}" wx:key="id" data-item='{{item}}' bindtap="jumpChildClassify">
             <image class="icon" src="{{item.icon}}" />
         </view>
     </scroll-view>
-    <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 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>

+ 6 - 28
pages/resource/index.wxss

@@ -2,6 +2,9 @@
   padding-bottom: calc(140rpx + env(safe-area-inset-bottom)) !important;
 }
 .firstClassify {
+  position: fixed;
+  top: 0;
+  z-index: 2;
   padding: 42rpx 0rpx;
   width: 100%;
   margin: 0 auto 30rpx;
@@ -22,31 +25,6 @@
   width: 160rpx;
   height: 210rpx;
 }
-/* .firstClassify {
-    padding: 26rpx 0rpx 24rpx;
-    width: 100%;
-    margin: 0 auto 30rpx;
-    left: 0;
-    right: 0;
-    overflow: hidden;
-    white-space: nowrap;
-    background-color: white;
-
-    .firstBox {
-        text-align: center;
-        display: inline-block;
-        width: 98rpx;
-        padding: 0rpx 20rpx;
-        font-size: 0;
-
-        .icon {
-            width: 84rpx;
-            height: 84rpx;
-        }
-
-        .name {
-            font-weight: bold;
-            font-size: 28rpx;
-        }
-    }
-} */
+.resourceBox {
+  margin-top: 470rpx;
+}

+ 4 - 4
utils/request.js

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