forked from zhongyuanhaiju/uniapp
68 lines
1.4 KiB
JavaScript
68 lines
1.4 KiB
JavaScript
export default {
|
|
data() {
|
|
return {
|
|
isIphoneX: false,
|
|
orderCreateData: {
|
|
buyer_message: '',
|
|
futures_id: '',
|
|
},
|
|
orderPaymentData: {},
|
|
isSub: false,
|
|
tempData: null,
|
|
canLocalDelicery: true,
|
|
// 选择自提、配送防重判断
|
|
judge:true,
|
|
goodsOpen: true,
|
|
min:1,
|
|
modifyFlag: false,
|
|
};
|
|
},
|
|
methods: {
|
|
// 订单创建
|
|
orderCreate() {
|
|
if (this.verify()) {
|
|
if (this.isSub) return;
|
|
this.isSub = true;
|
|
var data = this.$util.deepClone(this.orderCreateData);
|
|
this.$api.sendRequest({
|
|
url: '/futures/api/ordercreate/create',
|
|
data,
|
|
success: res => {
|
|
uni.hideLoading();
|
|
if (res.code >= 0) {
|
|
|
|
// if (parseFloat(this.orderPaymentData.pay_money) > 0) {
|
|
// let orderCreateData = uni.getStorageSync('giftcardOrderCreateData');
|
|
// orderCreateData.out_trade_no = res.data;
|
|
// uni.setStorageSync('giftcardOrderCreateData', orderCreateData);
|
|
// this.$refs.choosePaymentPopup.getPayInfo(res.data);
|
|
// this.isSub = false;
|
|
// } else {
|
|
|
|
// }
|
|
} else {
|
|
this.$util.showToast({
|
|
title: res.message
|
|
});
|
|
}
|
|
},
|
|
fail: res => {
|
|
uni.hideLoading();
|
|
this.isSub = false;
|
|
}
|
|
})
|
|
}
|
|
},
|
|
// 订单验证
|
|
verify() {
|
|
return true;
|
|
}
|
|
},
|
|
filters: {
|
|
// 金额格式化输出
|
|
moneyFormat(money) {
|
|
return parseFloat(money).toFixed(2);
|
|
}
|
|
}
|
|
}
|