Ver código fonte

fix:修改购物车样式问题、修改订单确认页任务队列问题

徐志豪 5 anos atrás
pai
commit
088cf33c39
2 arquivos alterados com 10 adições e 17 exclusões
  1. 0 1
      pages/cart/cart.wxss
  2. 10 16
      pages/shopping/checkout/checkout.js

+ 0 - 1
pages/cart/cart.wxss

@@ -96,7 +96,6 @@ page{
     height: auto;
     width: 100%;
     overflow: hidden;
-    padding-bottom: 180rpx;
 }
 
 .cart-view .group-item{

+ 10 - 16
pages/shopping/checkout/checkout.js

@@ -41,7 +41,7 @@ Router({
     let that = this;
     var url = api.CartCheckout
     let buyType = this.data.isBuy ? 'buy' : 'cart'
-    util.request(url, { addressId: that.data.addressId, couponId: that.data.couponId, type: buyType }).then(function (res) {
+    return util.request(url, { addressId: that.data.addressId, couponId: that.data.couponId, type: buyType }).then(function (res) {
       if (res.errno === 0) {
         that.setData({
           checkedGoodsList: res.data.checkedGoodsList,
@@ -95,21 +95,15 @@ Router({
     wx.showLoading({
       title: '加载中...',
     })
-    this.getCheckoutInfo(); 
-    try {
-      setTimeout(()=>{
-        var addressId = wx.getStorageSync('addressId');
-        if (addressId) {
-          this.setData({
-            'addressId': addressId
-          });
-        }
-        this.getAddressDetail(addressId)
-      })
-    } catch (e) {
-      // Do something when catch error
-    }
-
+    this.getCheckoutInfo().then(res => {
+      var addressId = wx.getStorageSync('addressId');
+      if (addressId) {
+        this.setData({
+          'addressId': addressId
+        });
+      }
+      this.getAddressDetail(addressId)
+    })
   },
 
   /**