Browse Source

小程序:样式

panyong 2 years ago
parent
commit
9400d2f60d

+ 1 - 2
htmldev/wxMini/app.wxss

@@ -117,7 +117,6 @@ view.footer-fixed-bottom button[type='default'] {
 
 .app_nav-wrap {
   width: 100%;
-  padding-left: 22rpx;
   border-bottom: 1rpx solid rgba(189, 189, 189, 1);
   white-space: nowrap;
 }
@@ -146,7 +145,7 @@ view.footer-fixed-bottom button[type='default'] {
   left: 50%;
   bottom: 0;
   content: '';
-  width: 100%;
+  width: 88%;
   height: 12rpx;
   border-radius: 10rpx 10rpx 0 0;
   background: rgba(145, 179, 121, 1);

+ 3 - 1
htmldev/wxMini/pages/business/business.js

@@ -30,6 +30,7 @@ Page({
       }
     ],
     currentCategory: '1',
+    navScrollLeft: -1,
     pagenum: 0,
     pagesize: 20,
     finished: false, // 所有数据是否加载完
@@ -101,7 +102,8 @@ Page({
     } = e.currentTarget.dataset
 
     this.setData({
-      currentCategory: item.id
+      currentCategory: item.id,
+      navScrollLeft: 0
     })
   },
   jumpBusinessDetail(e) {

+ 1 - 1
htmldev/wxMini/pages/business/business.wxml

@@ -10,7 +10,7 @@
   class="app_nav-wrap"
   scroll-x="{{true}}"
   scroll-with-animation="{{true}}"
-  scroll-into-view="item-{{currentCategory * 1 < 4 ? 0 : currentCategory * 1 - 3}}">
+  scroll-into-view="item-{{currentCategory * 1 < 4 ? navScrollLeft : currentCategory * 1 - 3}}">
   <view
     class="nav {{currentCategory === item.id ? 'active' : ''}}"
     wx:for="{{category}}"

+ 3 - 1
htmldev/wxMini/pages/guide/guide.js

@@ -31,6 +31,7 @@ Page({
       }
     ],
     currentCategory: '1',
+    navScrollLeft: -1,
     pagenum: 0,
     pagesize: 20,
     finished: false, // 所有数据是否加载完
@@ -107,7 +108,8 @@ Page({
     } = e.currentTarget.dataset
 
     this.setData({
-      currentCategory: item.id
+      currentCategory: item.id,
+      navScrollLeft: 0
     })
   }
 })

+ 2 - 2
htmldev/wxMini/pages/guide/guide.wxml

@@ -1,5 +1,5 @@
 <view class="wrapper">
-  <view class="app_page-header-search">
+  <view class="app_page-header-search page-header-search">
     <view class="app_page-header-search-warp">
       <label for="header-search">
         <image src=""></image>
@@ -14,7 +14,7 @@
     class="app_nav-wrap"
     scroll-x="{{true}}"
     scroll-with-animation="{{true}}"
-    scroll-into-view="item-{{currentCategory * 1 < 4 ? 0 : currentCategory * 1 - 3}}">
+    scroll-into-view="item-{{currentCategory * 1 < 4 ? navScrollLeft : currentCategory * 1 - 3}}">
     <view
       class="nav {{currentCategory === item.id ? 'active' : ''}}"
       wx:for="{{category}}"

+ 4 - 0
htmldev/wxMini/pages/guide/guide.wxss

@@ -1,3 +1,7 @@
+.page-header-search {
+  padding: 20rpx 0 28rpx;
+}
+
 .shopping-car {
   position: relative;
   left: 0;