1
0
Quellcode durchsuchen

小程序前端优化

hyq vor 6 Jahren
Ursprung
Commit
c5ce990a52

+ 9 - 0
wx-mall/pages/cart/cart.js

@@ -373,6 +373,10 @@ Page({
           });
 
           if (checkedGoods.length <= 0) {
+            wx.showToast({
+              title: '请选择要购买的商品',
+              icon: 'none'
+            })
             return false;
           }
           wx.navigateTo({
@@ -426,6 +430,11 @@ Page({
       openAttr: !this.data.openAttr
     })
   },
+  hideSwitchAttrPop: function () {
+    this.setData({
+      openAttr: false
+    })
+  },
   clickSkuValue: function(event) {
     let that = this;
     let specValueId = event.currentTarget.dataset.valueId;

+ 4 - 4
wx-mall/pages/cart/cart.wxml

@@ -1,6 +1,6 @@
 <view class="container">
   <view class="activity">
-    <view class="activity-box" bindtap="switchAttrPop">
+    <view class="activity-box" bindtap="hideSwitchAttrPop">
       <view class="item {{checkCart == '00' ? 'active' : ''}}" bindtap="openSortFilter" id="defaultActivity">
         <view class="unpay-num" wx:if="{{total00>0}}">{{total00}}</view>
         <text class="txt">保税直营</text>
@@ -12,13 +12,13 @@
     </view>
   </view>
 
-  <view class="service-policy" bindtap="switchAttrPop">
+  <view class="service-policy" bindtap="hideSwitchAttrPop">
     <!-- <view class="item">30分钟速达</view>
     <view class="item">每日优选生鲜</view>
     <view class="item">满88元免配送费</view> -->
     <view class="item">新用户可领取5元优惠券</view>
   </view> 
-  <view class="no-cart" wx:if="{{cartGoods.length <= 0}}" bindtap="switchAttrPop">
+  <view class="no-cart" wx:if="{{cartGoods.length <= 0}}" bindtap="hideSwitchAttrPop">
     <view class="c">
       <view class="title-box">
         购物车空空如也~
@@ -37,7 +37,7 @@
         </navigator>
       </view>
     </view> -->
-    <view class="list" bindtap="switchAttrPop">
+    <view class="list" bindtap="hideSwitchAttrPop">
       <view class="group-item">
         <view class="goods">
           <view wx:if="{{cartGoods00.length != 0}}" class="checkbox-biz-type {{checkedTypeStatus00 ? 'checked' : ''}}" bindtap="checkedAllGoodType" data-goods-Biz-Type="00">

+ 5 - 1
wx-mall/pages/cart/cart.wxss

@@ -198,10 +198,14 @@ page {
 
 .cart-view .item .goods-do {
   position: absolute;
-  right: 20rpx;
+  right: 0;
   top: 20rpx;
+  margin-right:-32rpx;
 }
 
+.cart-view .item .goods-do .price {
+  font-size: 26rpx;
+}
 .cart-view .item .goods-do .org-price {
   color: #999;
   font-size: 23rpx;

+ 1 - 1
wx-mall/pages/goods/goods.js

@@ -268,7 +268,7 @@ Page({
     this.setData({
       openAttr: !this.data.openAttr
     })
-  },  
+  },
   hideSwitchAttrPop: function() {
     this.setData({
       openAttr: false