Parcourir la source

fix:修改和优化部分样式

徐志豪 il y a 5 ans
Parent
commit
64dd300136

+ 1 - 0
pages/catalog/catalog.wxml

@@ -24,6 +24,7 @@
                 <image class="icon" src="{{item.wap_banner_url}}"></image>
                 <text class="txt">{{item.name}}</text>
             </navigator>
+            <view class="no-data" wx-if="{{currentCategory.subCategoryList && !currentCategory.subCategoryList.length}}">暂无商品</view>
         </view>
     </scroll-view>
   </view>

+ 5 - 0
pages/catalog/catalog.wxss

@@ -174,3 +174,8 @@ page {
   height: 72rpx;
   width: 160rpx;
 }
+
+.no-data {
+  text-align: center;
+  padding-top: 100rpx;
+}

+ 1 - 1
pages/category/category.js

@@ -43,7 +43,7 @@ Page({
     let that = this;
     util.request(api.GoodsCategory, { id: this.data.id })
       .then(function (res) {
-
+        
         if (res.errno == 0) {
           that.setData({
             navList: res.data.brotherCategory,

+ 2 - 1
pages/category/category.wxml

@@ -10,11 +10,12 @@
 
     <view class="cate-item">
         <view class="b">
-            <navigator hover-class="none" class="item {{(iindex + 1) % 2 == 0 ? 'item-b' : ''}}"   url="/pages/goods/goods?id={{iitem.id}}" wx:for="{{goodsList}}" wx:for-item="iitem" wx:for-index="iindex" >
+            <navigator hover-class="none" class="item {{(iindex + 1) % 2 == 0 ? 'item-b' : ''}}"   url="/pages/goods/goods?id={{iitem.id}}" wx:for="{{ goodsList }}" wx:for-item="iitem" wx:for-index="iindex" >
                 <image mode="aspectFit" class="img" src="{{iitem.list_pic_url}}" background-size="cover"></image>
                 <text class="name">{{iitem.name}}</text>
                 <text class="price">¥{{iitem.retail_price}}</text>
             </navigator>
+            <view class="no-data" wx-if="{{goodsList && !goodsList.length}}">暂无商品</view>
         </view>
     </view>
 

+ 4 - 0
pages/category/category.wxss

@@ -132,6 +132,10 @@
 .loadmore text {
   color: #999;
 }
+.no-data {
+  text-align: center;
+  padding-top: 100rpx;
+}
 
 @keyframes loading {
   0% {transform: rotate(0deg)}

+ 2 - 2
pages/goods/goods.wxss

@@ -684,11 +684,11 @@
     display: inline-block;
     height: 62rpx;
     padding: 0 35rpx;
-    line-height: 56rpx;
+    line-height: 60rpx;
     text-align: center;
     margin-right: 25rpx;
     margin-bottom: 16.5rpx;
-    border: 1px solid #333;
+    border: 1px solid #ccc;
     font-size: 25rpx;
     color: #333;
 }