|
@@ -104,7 +104,10 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="btn gray" v-if="orderTotalCredit&&userTotalCredit<orderTotalCredit">积分不够</view>
|
|
<view class="btn gray" v-if="orderTotalCredit&&userTotalCredit<orderTotalCredit">积分不够</view>
|
|
- <view class="btn" v-else @click="submitOrder">去结算</view>
|
|
|
|
|
|
+ <view class="" v-else>
|
|
|
|
+ <view class="btn" v-if="cansubmit" @click="submitOrder">去结算</view>
|
|
|
|
+ <view class="btn gray" v-else>去结算</view>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -113,6 +116,7 @@
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ cansubmit:true,
|
|
fromPage:'',
|
|
fromPage:'',
|
|
useIntegral:false,
|
|
useIntegral:false,
|
|
dataList:[],
|
|
dataList:[],
|
|
@@ -132,12 +136,15 @@
|
|
// console.log('page',page);
|
|
// console.log('page',page);
|
|
// console.log('this.creditGoods',this.creditGoods);
|
|
// console.log('this.creditGoods',this.creditGoods);
|
|
this.fromPage = page.fromPage;
|
|
this.fromPage = page.fromPage;
|
|
- if(this.cartGoods>0&&this.fromPage!='creditOrder'){
|
|
|
|
- this.orderInfo.goodsList = this.cartGoods;
|
|
|
|
- }
|
|
|
|
- if(this.creditGoods.length>0&&this.fromPage=='creditOrder'){
|
|
|
|
- this.orderInfo.goodsList = this.creditGoods;
|
|
|
|
- }
|
|
|
|
|
|
+ // if(this.cartGoods>0&&this.fromPage!='cart'){
|
|
|
|
+ // console.log('fromPagecart',this.fromPage);
|
|
|
|
+ // this.orderInfo.goodsList = this.cartGoods;
|
|
|
|
+ // }
|
|
|
|
+ // if(this.creditGoods.length>0&&this.fromPage=='creditOrder'){
|
|
|
|
+ // console.log('fromPagecreditOrder',this.fromPage);
|
|
|
|
+ // this.orderInfo.goodsList = this.creditGoods;
|
|
|
|
+ // }
|
|
|
|
+ this.orderInfo.goodsList = this.cartGoods;
|
|
this.settlement();
|
|
this.settlement();
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
@@ -199,10 +206,15 @@
|
|
|
|
|
|
},
|
|
},
|
|
settlement(){
|
|
settlement(){
|
|
|
|
+ let orderType = 1;
|
|
// console.log('settlement',this.selectGoods);
|
|
// console.log('settlement',this.selectGoods);
|
|
let param = {
|
|
let param = {
|
|
receiveId:this.receive.id
|
|
receiveId:this.receive.id
|
|
};
|
|
};
|
|
|
|
+ if(this.fromPage == 'creditOrder'){
|
|
|
|
+ orderType = 2
|
|
|
|
+ }
|
|
|
|
+ param.orderType = orderType;
|
|
param.goodsList = this.orderInfo.goodsList.map(item=>{
|
|
param.goodsList = this.orderInfo.goodsList.map(item=>{
|
|
return {goodsId:item.id||item.goodsId,quantity:item.quantity}
|
|
return {goodsId:item.id||item.goodsId,quantity:item.quantity}
|
|
});
|
|
});
|
|
@@ -244,10 +256,16 @@
|
|
},
|
|
},
|
|
submitOrder(){
|
|
submitOrder(){
|
|
let that = this;
|
|
let that = this;
|
|
|
|
+ this.cansubmit = false;
|
|
|
|
+ let orderType = 1;
|
|
let param = {
|
|
let param = {
|
|
receiveId:this.receive.id,
|
|
receiveId:this.receive.id,
|
|
distribution:this.distribution,
|
|
distribution:this.distribution,
|
|
};
|
|
};
|
|
|
|
+ if(this.fromPage == 'creditOrder'){
|
|
|
|
+ orderType = 2
|
|
|
|
+ }
|
|
|
|
+ param.orderType = orderType;
|
|
param.goodsList = this.orderInfo.goodsList.map(item=>{
|
|
param.goodsList = this.orderInfo.goodsList.map(item=>{
|
|
return {goodsId:item.id,quantity:item.quantity}
|
|
return {goodsId:item.id,quantity:item.quantity}
|
|
})
|
|
})
|
|
@@ -259,12 +277,14 @@
|
|
param.longitude = res.longitude;
|
|
param.longitude = res.longitude;
|
|
that.$u.api.submitOrder(param).then(res=>{
|
|
that.$u.api.submitOrder(param).then(res=>{
|
|
console.log('res',res.data);
|
|
console.log('res',res.data);
|
|
|
|
+ that.cansubmit = true;
|
|
uni.$u.route('/shopping/pay', {
|
|
uni.$u.route('/shopping/pay', {
|
|
orderId: res.data.orderId,
|
|
orderId: res.data.orderId,
|
|
- // openid: that.vuex_wechatOpenid,
|
|
|
|
|
|
+ fromPage:this.fromPage,
|
|
payAmount:res.data.payAmount
|
|
payAmount:res.data.payAmount
|
|
});
|
|
});
|
|
}).catch(err=>{
|
|
}).catch(err=>{
|
|
|
|
+ that.cansubmit = true;
|
|
console.log('submitOrder',err);
|
|
console.log('submitOrder',err);
|
|
})
|
|
})
|
|
},
|
|
},
|