diff --git a/api/goods/goodsApi.js b/api/goods/goodsApi.js index d92d3c1..17056c9 100644 --- a/api/goods/goodsApi.js +++ b/api/goods/goodsApi.js @@ -152,6 +152,7 @@ export function getStoreCart(dataObj) { * @param {Object} dataObj 下单报文 */ export function goodsUnifieldOrder(dataObj) { + return new Promise( (resolve, reject) => { request({ @@ -164,7 +165,7 @@ export function goodsUnifieldOrder(dataObj) { resolve(res.data); return; } - reject(); + reject(res); }, fail: function(e) { reject(); diff --git a/pages/goodsConfirm/goodsConfirm.vue b/pages/goodsConfirm/goodsConfirm.vue index 43de48a..042e76f 100644 --- a/pages/goodsConfirm/goodsConfirm.vue +++ b/pages/goodsConfirm/goodsConfirm.vue @@ -41,7 +41,7 @@ - + 配送方式 @@ -103,7 +103,7 @@ } from '../../api/goods/goodsApi.js' import { - getCurOwner + getCurOwner,getUserAddress } from '../../api/owner/ownerApi.js' @@ -234,7 +234,7 @@ personName: that.personName, userId:that.personId, tradeType: _tradeType, - }).then(res => { + }).then((res) => { let _data = null; if (res.code == '0') { return toPay(res); @@ -244,9 +244,17 @@ title:res.msg }) return _data; + },(err)=>{ + console.log('err',err); + uni.showToast({ + icon:'none', + title:err.data + }) + + return null; }) .then((res)=>{ - console.log('res',res); + if(res == null){ return ; } @@ -265,7 +273,16 @@ }, // 初始地址 getDefaultAddress() { - + let that = this; + getUserAddress({ + userId:this.personId, + isDefault:'T', + page:1, + row:1 + }) + .then((_data) =>{ + that.address = _data.data[0] + }) }, getOwner: function() { let _that = this;