增加:运营中心 - 角色账单缴费

This commit is contained in:
wuhui_zzw 2024-07-11 14:50:44 +08:00
parent 5355df0b77
commit 899ed893b2
6 changed files with 350 additions and 10 deletions

View File

@ -86,8 +86,18 @@ export function contractAgainSign(data) {
} }
// 缴费账单 - 账单信息获取
export function agentPayRecordInfo(data) {
return request.get(`agent/pay_record/get_info`, data);
}
// 缴费账单 - 生成缴费订单
export function agentPayRecordCreateOrder(data) {
return request.post(`agent/pay_record/pay`, data);
}
// 缴费账单 - 申请退款
export function agentPayRecordApplyRefund(data) {
return request.post(`agent/pay_record/refund`, data);
}

View File

@ -148,7 +148,7 @@ export default {
} }
let that = this; let that = this;
let type = '' let type = ''
if (paytype == 'wechat') { if (paytype == 'wechat' || paytype == 'weixin') {
// #ifdef H5 // #ifdef H5
type = this.$wechat.isWeixin() ? 'weixin' : 'h5'; type = this.$wechat.isWeixin() ? 'weixin' : 'h5';
// #endif // #endif

View File

@ -1485,13 +1485,13 @@
{ {
"path": "delivery/payment", "path": "delivery/payment",
"style": { "style": {
"navigationBarTitleText": "资金缴费" "navigationBarTitleText": "货款缴费"
} }
}, },
{ {
"path": "delivery/payment_record", "path": "delivery/payment_record",
"style": { "style": {
"navigationBarTitleText": "缴费记录" "navigationBarTitleText": "货款记录"
} }
}, },
{ {
@ -1499,8 +1499,13 @@
"style": { "style": {
"navigationBarTitleText": "合作协议" "navigationBarTitleText": "合作协议"
} }
},
{
"path": "user/pay_record",
"style": {
"navigationBarTitleText": "缴费账单"
}
} }
] ]
}, },
{ {

View File

@ -109,7 +109,7 @@ import {roleAndCorrelationRole} from "@/api/agent";
import {storeLoginSimulation} from "@/api/store"; import {storeLoginSimulation} from "@/api/store";
export default { export default {
name: 'business', name: 'agentV2',
components: { components: {
authorize, authorize,
qrCode qrCode
@ -154,13 +154,13 @@ export default {
icon: 'icon-ziti', icon: 'icon-ziti',
}); });
menuList.push({ menuList.push({
title: '资金缴费', title: '货款缴费',
type: 'link', type: 'link',
url: '/pages/agent/delivery/payment', url: '/pages/agent/delivery/payment',
icon: 'icon-yue2', icon: 'icon-yue2',
}); });
menuList.push({ menuList.push({
title: '缴费记录', title: '货款记录',
type: 'link', type: 'link',
url: '/pages/agent/delivery/payment_record', url: '/pages/agent/delivery/payment_record',
icon: 'icon-dingdan-xuanzhong', icon: 'icon-dingdan-xuanzhong',
@ -191,6 +191,12 @@ export default {
url: '/pages/agent/contract/index?role_type='+ agentType +'&role_id=' + agentId, url: '/pages/agent/contract/index?role_type='+ agentType +'&role_id=' + agentId,
icon: 'icon-bianji4', icon: 'icon-bianji4',
}); });
menuList.push({
title: '缴费账单',
type: 'link',
url: '/pages/agent/user/pay_record',
icon: 'icon-dingdan-xuanzhong',
});

View File

@ -48,7 +48,6 @@ import emptyPage from '@/components/emptyPage.vue';
import {agentApplyRecord} from "@/api/agent"; import {agentApplyRecord} from "@/api/agent";
import authorize from '@/components/Authorize'; import authorize from '@/components/Authorize';
import payment from '@/components/payment'; import payment from '@/components/payment';
import {getUserInfo} from "@/api/user";
export default { export default {
components: { components: {

View File

@ -0,0 +1,320 @@
<template>
<view class="page-content">
<!--主要内容-->
<view class="main-content">
<view class="block" v-for="(item,index) in list" :kye="index">
<view class="left" v-if="index === 'deposit'">定金</view>
<view class="left" v-if="index === 'arrears'">尾款</view>
<view class="left" v-if="index === 'earnest_money'">保证金</view>
<view class="right">
<view class="top">
<view class="line">
<view class="line-label">支付状态</view>
<view class="line-text">{{ item.pay_status | payStatusText }}</view>
</view>
<view class="line">
<view class="line-label">付款金额</view>
<view class="line-text line-price">¥{{ item.money }}</view>
</view>
</view>
<view class="bottom">
<!--未支付-->
<template v-if="Number(item.pay_status) === 0 && Number(item.money) > 0">
<view class="time"></view>
<view class="bottom-btn pay-btn" @click="goToPay(item)">去支付</view>
</template>
<!--已支付-->
<template v-if="Number(item.pay_status) === 1 && Number(item.money) > 0">
<view class="time">支付时间{{ item.pay_time }}</view>
<view class="bottom-btn refund-btn" @click="applyRefund(item)">申请退款</view>
</template>
<!--退款审核中-->
<template v-if="Number(item.pay_status) === 2">
<view class="time"></view>
<view class="bottom-btn">审核中</view>
</template>
<!--已退款-->
<template v-if="Number(item.pay_status) === 3">
<view class="time">退款时间{{ item.refund_time }}</view>
<view class="bottom-btn"></view>
</template>
</view>
</view>
</view>
</view>
<!-- 授权登录 -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authClose"></authorize>
<!-- 支付弹框 -->
<payment
:pay_close="pay_close"
@onChangeFun='onChangeFun'
:order_id="pay_order_id"
:totalPrice='totalPrice'
:returnUrl="'/pages/agent/user/pay_record?agent_id=' + agent_id">
</payment>
</view>
</template>
<script>
import {mapGetters} from "vuex";
import authorize from '@/components/Authorize';
import {agentPayRecordApplyRefund, agentPayRecordCreateOrder, agentPayRecordInfo} from "../../../api/agent";
import payment from '@/components/payment';
export default {
name: 'agentPayRecord',
components: {
authorize,
payment
},
computed: {
...mapGetters(['isLogin', 'uid', 'userInfo', 'viewColor'])
},
data() {
return {
//
isAuto: false, //
isShowAuth: false,//
//
agent_id: 0,
list: {},
//
pay_close: false,
pay_order_id: '',
totalPrice: 0,
}
},
filters: {
//
payStatusText(value) {
// 0=1=2=退
value = Number(value) || 0;
if(Number(value) === 0) return '未交费';
else if(Number(value) === 1) return '已缴费';
else if(Number(value) === 2) return '退款审核中';
else if(Number(value) === 3) return '已退款';
return '';
}
},
onLoad(options) {
//
this.agent_id = options.agent_id || 0;
if(this.agent_id <= 0){
uni.showModal({
title: '提示',
content: '非法访问,参数错误!',
success: function success(res) {
uni.navigateBack();
}
});
}
//
if (!this.isLogin) {
//
this.isAuto = true;
this.isShowAuth = true
}else{
//
this.init();
}
},
methods: {
//
onLoadFun() {
if(this.isLogin){
this.isShowAuth = false;
this.init();
}
},
//
authClose(e) {
this.isShowAuth = e
},
//
init () {
this.getInfo();
},
//
getInfo(){
let _this = this;
agentPayRecordInfo({ agent_id: _this.agent_id}).then(res=>{
if(Number(res.status) === 200){
_this.list = res.data || {};
}else{
_this.$util.Tips({title: res.message});
}
})
},
// -
goToPay(item){
let _this = this;
agentPayRecordCreateOrder({ id: item.id }).then(res=>{
if(Number(res.status) === 200){
let data = res.data || {};
_this.$set(_this, 'pay_close', true);
_this.order_id = data.group_order_id;
_this.pay_order_id = data.group_order_id.toString()
_this.$set(_this, 'totalPrice', data.pay_price);
}else{
_this.$util.Tips({title: res.message});
}
})
},
// -
onChangeFun(e) {
let opt = e;
let action = opt.action || null;
let value = opt.value != undefined ? opt.value : null;
(action && this[action]) && this[action](value);
},
// -
payClose() {
this.pay_close = false;
},
// 退 - 退
applyRefund(item){
let _this = this;
let options = {
title: '提示',//
content: '该操作不可逆,请确认是否申请退款!',//
confirmText: '申请',//
showCancel: true, //
cancelText: '取消', //
}
_this.$util.tips(options, function () {
agentPayRecordApplyRefund({ id: item.id }).then(res=>{
if(Number(res.status) === 200){
_this.getInfo();
}else{
_this.$util.Tips({title: res.message});
}
})
});
}
}
}
</script>
<style scoped lang="scss">
.page-content{
width: 100vw;
min-height: 100vh;
background-color: #f6f6f6;// #f6f6f6
.main-content{
padding: 0 20rpx;
.block{
width: 100%;
border-radius: 30rpx;
margin-top: 30rpx;
background: #ffffff;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
height: 230rpx;
overflow: hidden;
.left{
width: 60rpx;
height: 100%;
writing-mode: vertical-rl; /* 文字从上到下竖排,从右到左 */
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
font-size: 30rpx;
color: #ffffff;
letter-spacing: 20rpx;
padding-top: 20rpx;
}
.right{
width: calc(100% - 70rpx);
.top{
padding: 0 20rpx;
width: 100%;
height: 130rpx;
border-bottom: 2rpx solid #f4f5f7;
display: inline-flex;
flex-direction: column;
flex-wrap: nowrap;
justify-content: space-evenly;
align-items: center;
.line{
width: 100%;
font-size: 28rpx;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
.line-label{
width: 130rpx;
color: #757b92;
}
.line-text{
text-align: left;
}
.line-price{
color: #d60001;
}
}
}
.bottom{
height: calc(230rpx - 130rpx);
width: 100%;
padding: 0 20rpx;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
align-items: center;
.time{}
.bottom-btn{
border-radius: 10rpx;
height: 46rpx;
line-height: 46rpx;
font-size: 26rpx;
padding: 0 20rpx;
text-align: center;
background: #d2d2d2;
color: #787878;
}
.pay-btn{
background: #d60000!important;
color: #ffffff!important;
}
.refund-btn{
background: #e6a23c!important;
color: #ffffff!important;
}
}
}
}
.block:nth-child(1){
.left{
background: #ff6253;
}
}
.block:nth-child(2){
.left{
background: #83c887;
}
}
.block:nth-child(3){
.left{
background: #ffb830;
}
}
}
}
</style>