Explorar el Código

开发资源分类

bayi hace 1 año
padre
commit
324a864b0d
Se han modificado 4 ficheros con 39 adiciones y 38 borrados
  1. 10 0
      pages/resource/index.js
  2. 13 18
      pages/resource/index.less
  3. 7 5
      pages/resource/index.wxml
  4. 9 15
      pages/resource/index.wxss

+ 10 - 0
pages/resource/index.js

@@ -69,6 +69,16 @@ Page({
             url: `/pages/childClassify/index?type=class&title=${firstInfo.title}&${params}`,
         })
     },
+    showTips() {
+        wx.showModal({
+            title: '新栏目更新中',
+            content: '敬请期待….',
+            showCancel: false,
+            confirmColor:'#333333',
+            success(res) {
+            }
+        })
+    },
     onUnload() {
         this.storeBindings.destroyStoreBindings()
     },

+ 13 - 18
pages/resource/index.less

@@ -5,29 +5,24 @@
 .firstClassify {
     position: fixed;
     top: 0;
-    z-index: 2;
-    padding: 20rpx 0rpx;
     width: 100%;
-    margin: 0 auto 30rpx;
-    left: 0;
-    right: 0;
-    overflow: hidden;
-    white-space: nowrap;
+    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;
 
-    .firstBox {
-        text-align: center;
-        display: inline-block;
-        padding: 0 17rpx;
-        font-size: 0;
-
-        .icon {
-            width: 176rpx;
-            height: 231rpx;
-        }
+    .icon {
+        width: 25%;
+        height: 195rpx;
     }
+
 }
-.resourceBox{
+
+.resourceBox {
     padding-top: 170rpx;
 }

+ 7 - 5
pages/resource/index.wxml

@@ -1,10 +1,12 @@
 <navigationBar bind:reload='requestAgain'></navigationBar>
 <view class="resourceBox">
-    <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>
+    <view class="firstClassify" style="top:{{navBarHeight}}px">
+        <!--  <view class="firstBox" wx:for="{{categoryList}}" wx:key="id" data-item='{{item}}' bindtap="jumpChildClassify"> -->
+        <image wx:for="{{categoryList}}" wx:key="id" data-item='{{item}}' bindtap="jumpChildClassify" class="icon"
+            src="{{item.icon}}" />
+        <!-- </view> -->
+        <image bindtap="showTips" class="icon" src="http://reader-wx.ai160.com/images/reader/v3/readIcon/LD00103052006.jpg" />
+    </view>
     <view class="resourceBox">
         <authority wx:if="{{listOptions.sortList[0]=='recommendReadList'}}"
             worksList="{{listOptions.recommendReadList}}" />

+ 9 - 15
pages/resource/index.wxss

@@ -4,26 +4,20 @@
 .firstClassify {
   position: fixed;
   top: 0;
-  z-index: 2;
-  padding: 20rpx 0rpx;
   width: 100%;
-  margin: 0 auto 30rpx;
-  left: 0;
-  right: 0;
-  overflow: hidden;
-  white-space: nowrap;
+  box-sizing: border-box;
   background-color: white;
   box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(0, 0, 0, 0.07);
-}
-.firstClassify .firstBox {
+  display: flex;
+  flex-wrap: wrap;
+  align-items: center;
+  justify-content: space-between;
   text-align: center;
-  display: inline-block;
-  padding: 0 17rpx;
-  font-size: 0;
+  z-index: 2;
 }
-.firstClassify .firstBox .icon {
-  width: 176rpx;
-  height: 231rpx;
+.firstClassify .icon {
+  width: 25%;
+  height: 195rpx;
 }
 .resourceBox {
   padding-top: 170rpx;