|
@@ -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)
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
/**
|