增加:运营中心 - 角色账单缴费
This commit is contained in:
parent
5355df0b77
commit
899ed893b2
14
api/agent.js
14
api/agent.js
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ export default {
|
|||
}
|
||||
let that = this;
|
||||
let type = ''
|
||||
if (paytype == 'wechat') {
|
||||
if (paytype == 'wechat' || paytype == 'weixin') {
|
||||
// #ifdef H5
|
||||
type = this.$wechat.isWeixin() ? 'weixin' : 'h5';
|
||||
// #endif
|
||||
|
|
|
|||
11
pages.json
11
pages.json
|
|
@ -1485,13 +1485,13 @@
|
|||
{
|
||||
"path": "delivery/payment",
|
||||
"style": {
|
||||
"navigationBarTitleText": "资金缴费"
|
||||
"navigationBarTitleText": "货款缴费"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "delivery/payment_record",
|
||||
"style": {
|
||||
"navigationBarTitleText": "缴费记录"
|
||||
"navigationBarTitleText": "货款记录"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -1499,8 +1499,13 @@
|
|||
"style": {
|
||||
"navigationBarTitleText": "合作协议"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "user/pay_record",
|
||||
"style": {
|
||||
"navigationBarTitleText": "缴费账单"
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ import {roleAndCorrelationRole} from "@/api/agent";
|
|||
import {storeLoginSimulation} from "@/api/store";
|
||||
|
||||
export default {
|
||||
name: 'business',
|
||||
name: 'agentV2',
|
||||
components: {
|
||||
authorize,
|
||||
qrCode
|
||||
|
|
@ -154,13 +154,13 @@ export default {
|
|||
icon: 'icon-ziti',
|
||||
});
|
||||
menuList.push({
|
||||
title: '资金缴费',
|
||||
title: '货款缴费',
|
||||
type: 'link',
|
||||
url: '/pages/agent/delivery/payment',
|
||||
icon: 'icon-yue2',
|
||||
});
|
||||
menuList.push({
|
||||
title: '缴费记录',
|
||||
title: '货款记录',
|
||||
type: 'link',
|
||||
url: '/pages/agent/delivery/payment_record',
|
||||
icon: 'icon-dingdan-xuanzhong',
|
||||
|
|
@ -191,6 +191,12 @@ export default {
|
|||
url: '/pages/agent/contract/index?role_type='+ agentType +'&role_id=' + agentId,
|
||||
icon: 'icon-bianji4',
|
||||
});
|
||||
menuList.push({
|
||||
title: '缴费账单',
|
||||
type: 'link',
|
||||
url: '/pages/agent/user/pay_record',
|
||||
icon: 'icon-dingdan-xuanzhong',
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ import emptyPage from '@/components/emptyPage.vue';
|
|||
import {agentApplyRecord} from "@/api/agent";
|
||||
import authorize from '@/components/Authorize';
|
||||
import payment from '@/components/payment';
|
||||
import {getUserInfo} from "@/api/user";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
Loading…
Reference in New Issue