完整先货后款付款流程

This commit is contained in:
THK3121 2023-07-08 16:58:21 +08:00
parent 05ef84a30b
commit 42b860b90e
7 changed files with 417 additions and 392 deletions

View File

@ -41,7 +41,7 @@ export function postconfirm(merId, data) {
return request.post("admin/" + merId + "/confirm" , data, { login: true });
}
/**
* 同意先货后款
* 先货后款订单结算
*/
export function postsettle(merId, data) {
return request.post("admin/" + merId + "/settle" , data, { login: true });

View File

@ -107,7 +107,7 @@ export function orderDel(id) {
}
/**
* 订单详情
* 已付款订单详情
* @param string uni
*/
export function getOrderDetail(uni) {
@ -115,11 +115,11 @@ export function getOrderDetail(uni) {
}
/**
* 订单详情
* 未付款订单详情
* @param string uni
*/
export function groupOrderDetail(uni) {
return request.get('order/group_order_detail/' + uni);
export function groupOrderDetail(uni,product_type) {
return request.get('order/group_order_detail/' + uni+'?product_type=' + product_type);
}
// 支付状态订单

View File

@ -266,8 +266,8 @@
type:number
}
this.$nextTick(()=>{
this.where.is_verify = 1;
delete this.where.status;
this.where.status = 2;
delete this.where.is_verify;
this.init();
})
postconfirm(this.merId,data).then(res=>{
@ -276,7 +276,7 @@
},
handleSearch() {
this.loaded = false;
this.where.page = 1;
this.where.page = 3;
this.list = [];
this.getIndex();
},

View File

@ -270,7 +270,8 @@
add: false,
},
show:false,
credit_buy:''
credit_buy:'',
product_type:0
};
},
watch: {
@ -285,6 +286,7 @@
mapGetters(['isLogin','uid','viewColor','keyColor'])),
onLoad: function(options) {
this.credit_buy=options.credit_buy
if(options.product_type)this.product_type=options.product_type
if (options.order_id) {
this.$set(this, 'order_id', options.order_id);
}
@ -440,7 +442,7 @@
uni.showLoading({
title: "正在加载中"
});
groupOrderDetail(this.order_id).then(res => {
groupOrderDetail(this.order_id,this.product_type).then(res => {
let _type = 0;
uni.hideLoading();
that.$set(that, 'orderInfo', res.data);

View File

@ -537,7 +537,7 @@
"name": "先货后款",
"icon": "tan-a-lujing17324",
value: 'creditBuy',
title: `结算周期:30天 日利率0.05%`,
title: `结算周期:${this.settle_cycle}天 日利率:${this.interest_rate}%`,
payStatus: '',
},
],
@ -653,7 +653,9 @@
order_key: '',
is_take: '',
domain: HTTP_REQUEST_URL,
product_type:''
product_type:'',
interest_rate:'',//
settle_cycle:'',//
};
},
computed: {
@ -1024,6 +1026,7 @@
use_integral: that.use_integral
}).then(res => {
//
console.log(res);
that.is_take = false
res.data.order.forEach(el => {
if (el.order.isTake == 1) that.is_take = true
@ -1074,6 +1077,9 @@
that.allow_address = res.data.allow_address
that.deliveryName = res.data.order_model == 0 ? '快递配送' : '虚拟发货'
that.order_key = res.data.key
that.interest_rate = res.data.order[0].interest_rate
that.settle_cycle = res.data.order[0].settle_cycle
console.log(that.settle_cycle);
if(res.data.order[0].credit_buy == 1){
this.cartArr[4].payStatus = 1
}else{
@ -1116,7 +1122,9 @@
phone: res.data.phone
}
console.log(that.addressId);
this.$nextTick(()=>{
this.getConfirm(that.addressId);
})
})
} else {
getAddressList().then(res => {

View File

@ -21,7 +21,7 @@
<view>全部</view>
<view class='num'>{{orderData.all || 0}}</view>
</view>
<view class='item' :class='orderStatus==20 ? "on": ""' @click="statusClick(20)">
<view class='item' :class='orderStatus==0 ? "on": ""' @click="statusClick(0)">
<view>待付款</view>
<view class='num'>{{orderData.noPay || 0}}</view>
</view>
@ -61,7 +61,7 @@
<view v-if="orderList.length > 0">
<block v-if="orderStatus == 0">
<view class='item' v-for="(item,index) in orderList" :key="index">
<view @click='goOrderDetails(item.group_order_id)'>
<view @click='goOrderDetails(item.group_order_id,item.orderList[0].activity_type)'>
<view class='title acea-row row-between-wrapper'>
<view class="acea-row row-middle left-wrapper">
{{item.group_order_sn}}
@ -141,6 +141,12 @@
{{item.total_num || 0}}件商品总金额
<text class='money p-color'>{{item.pay_price}}</text>
</view>
<view class='totalPrice' v-else>{{item.orderNum || 0}}件商品总金额
<text class='money p-color'>{{item.pay_price}}</text>
</view>
<view class="totalPrice" >
{{item.total_num || 0}}件商品结算周期到期后付款{{item.pay_price}}
</view>
<view class='bottom acea-row row-right row-middle'>
<view class='bnt b-color' @click.stop='goPay(item.pay_price,item.group_order_id)'>
立即付款</view>
@ -238,13 +244,6 @@
<view class='totalPrice' v-if="item.activity_type == 2">{{item.orderNum || 0}}件商品总金额
<text class='money p-color'>{{item.presell_price}}</text>
</view>
<view class='totalPrice' v-else>{{item.orderNum || 0}}件商品总金额
<text class='money p-color'>{{item.pay_price}}</text>
</view>
<view class="totalPrice" v-if="item.pay_type == 8 && item.status == 12">
共1件商品结算周期到期后付款100
</view>
</view>
<view class='bottom acea-row row-right row-middle'>
<view v-if="!item.receipt && item.status != -1" class='bnt cancelBnt'
@ -509,7 +508,7 @@
getOrderData: function() {
let that = this;
orderData({
product_type:that.product_type
product_type:this.product_type
}).then(res => {
that.$set(that, 'orderData', res.data);
})
@ -544,10 +543,13 @@
*
*/
goPay: function(pay_price, order_id) {
this.$set(this, 'pay_close', true);
this.order_id = order_id;
this.pay_order_id = order_id.toString()
this.$set(this, 'totalPrice', pay_price);
uni.navigateTo({
url: '/pages/users/payment/payment?order_id=' + order_id + '&product_type=' + this.product_type
});
// this.$set(this, 'pay_close', true);
// this.order_id = order_id;
// this.pay_order_id = order_id.toString()
// this.$set(this, 'totalPrice', pay_price);
},
/**
* 支付成功回调
@ -573,7 +575,7 @@
/**
* 去订单详情
*/
goOrderDetails: function(order_id) {
goOrderDetails: function(order_id,product_type) {
let self = this
if (!order_id) return that.$util.Tips({
title: '缺少订单号无法查看订单详情'
@ -586,7 +588,7 @@
uni.hideLoading();
if (self.orderStatus == 0) {
uni.navigateTo({
url: '/pages/order_details/stay?order_id=' + order_id
url: '/pages/order_details/stay?order_id=' + order_id + '&product_type=' + product_type
})
} else {
uni.navigateTo({
@ -600,7 +602,7 @@
// #ifndef MP
if (self.orderStatus == 0) {
uni.navigateTo({
url: '/pages/order_details/stay?order_id=' + order_id
url: '/pages/order_details/stay?order_id=' + order_id + '&product_type=' + product_type
})
} else {
uni.navigateTo({
@ -663,7 +665,7 @@
that.loadTitle = "加载更多";
if (that.isReady) {
that.isReady = false
if (that.orderStatus == 20) {
if (that.orderStatus == 0) {
groupOrderList({
page: that.page,
limit: that.limit,
@ -766,27 +768,6 @@
this.show = true
this.shouhuo.id = item.order_id
this.shouhuo.index = index
// uni.showModal({
// title: '',
// content: '',
// success: function(res) {
// if (res.confirm) {
// orderTake(item.order_id).then(res => {
// return that.$util.Tips({
// title: '',
// icon: 'success'
// }, function() {
// that.orderList.splice(index, 1);
// that.getOrderData();
// });
// }).catch(err => {
// return that.$util.Tips({
// title: err
// });
// })
// }
// }
// })
},
queding() {
let that = this;

View File

@ -85,6 +85,9 @@
groupOrderDetail,
orderPay
} from '@/api/order.js'
import {
postsettle,
} from '@/api/admin.js'
export default {
data() {
return {
@ -134,12 +137,16 @@
order_id: '',
},
],
order_id: ''
order_id: '',
product_type: 0,
mer_id:''
};
},
onLoad(options) {
this.order_id = options.order_id
this.getOrderInfo(this.order_id)
if (options.product_type) { this.product_type = options.product_type }
console.log(this.product_type);
this.getOrderInfo()
this.getUserInfo()
},
methods: {
@ -157,15 +164,40 @@
getUserInfo() {
getUserInfo().then(res => {
this.userInfo = res.data
this.mer_id = res.data.service.mer_id
})
},
getOrderInfo(order_id) {
groupOrderDetail(order_id).then(res => {
getOrderInfo() {
groupOrderDetail(this.order_id, this.product_type).then(res => {
this.couponData = res.data
console.log(res);
})
},
SubOrder() {
if (this.product_type == 98) {
postsettle(
this.mer_id, {
id:this.order_id,
pay_type: this.payType
}
).then(res => {
if(res.message == 'success'){
uni.showToast({
title: '付款成功'
})
setTimeout(() => {
uni.navigateBack({
delta: 1
})
}, 1000)
}
console.log(res);
}).catch(err=>{
uni.showToast({
title: err.message
})
})
} else {
orderPay(this.order_id, {
type: this.payType
}).then(res => {
@ -182,6 +214,8 @@
}
}
}
}
</script>