fanfan 2 months ago
commit 6596fdfa77
  1. 22
      src/api/user/recharge.js
  2. 6
      src/config/router.config.js
  3. 14
      src/views/client/h5/Setting.vue
  4. 135
      src/views/user/recharge/AuditForm.vue
  5. 198
      src/views/user/recharge/Detail.vue
  6. 46
      src/views/user/recharge/Index.vue

@ -2,7 +2,9 @@ import { axios } from '@/utils/request'
// api接口列表
const api = {
order: '/user.recharge/order'
order: '/user.recharge/order',
detail: '/user.recharge/detail',
audit: '/user.recharge/audit'
}
// 列表记录
@ -13,3 +15,21 @@ export function order (params) {
params
})
}
// 支付订单详情
export function detail (params) {
return axios({
url: api.detail,
method: 'get',
params
})
}
// 支付订单审核
export function audit (data) {
return axios({
url: api.audit,
method: 'post',
data
})
}

@ -539,6 +539,12 @@ export const asyncRouterMap = [
component: () => import(/* webpackChunkName: "content" */ '@/views/user/recharge/Index'),
meta: { title: '充值记录', keepAlive: false, permission: ['/user/recharge/index'] },
},
{
path: '/user/recharge/detail',
component: () => import(/* webpackChunkName: "content" */ '@/views/user/recharge/Detail'),
meta: { title: '充值详情', keepAlive: false, permission: ['/user/recharge/detail'] },
hidden: true,
},
{
path: '/user/balance/index',
component: () => import(/* webpackChunkName: "content" */ '@/views/user/balance/Index'),

@ -15,7 +15,9 @@
<a-form-item label="H5站点地址" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
v-decorator="['baseUrl', { rules: [{ required: true, message: '请输入H5站点地址' }] }]"
:disabled="true"
/>
<span style="color: #4680ff;position: absolute;top: -10px;right: -60px;cursor: pointer;" @click="copyLink">复制链接</span>
<div class="form-item-help">
<p class="extra">
<span>请填写H5端实际的访问地址</span>
@ -104,8 +106,16 @@ export default {
Api.update(this.key, { form: values })
.then(result => this.$message.success(result.message, 1.5))
.finally(() => this.isLoading = false)
}
},
//
copyLink () {
console.log(this.record);
if (this.record.baseUrl) {
this.$copyText(this.record.baseUrl).then(res => {
this.$message.success('复制成功', 0.8)
})
}
},
}
}
</script>

@ -0,0 +1,135 @@
<template>
<a-modal
:title="title"
:width="560"
:visible="visible"
:isLoading="isLoading"
:confirmLoading="isLoading"
:maskClosable="false"
@ok="handleSubmit"
@cancel="handleCancel"
>
<a-spin :spinning="isLoading">
<a-form v-if="visible" :form="form">
<a-form-item label="支付状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-tag>待支付</a-tag>
</a-form-item>
<a-form-item label="支付金额" :labelCol="labelCol" :wrapperCol="wrapperCol">
<span>{{ record.pay_price }}</span>
</a-form-item>
<a-form-item label="赠送金额" :labelCol="labelCol" :wrapperCol="wrapperCol">
<span>{{ record.gift_money }}</span>
</a-form-item>
<template v-if="record.platform === 'H5'">
<a-form-item label="付款人姓名" :labelCol="labelCol" :wrapperCol="wrapperCol">
<span>{{ record.payer_name }}</span>
</a-form-item>
<a-form-item label="付款人电话" :labelCol="labelCol" :wrapperCol="wrapperCol">
<span>{{ record.payer_phone }}</span>
</a-form-item>
<!-- <a-form-item label="支付凭证" :labelCol="labelCol" :wrapperCol="wrapperCol">
</a-form-item> -->
</template>
<a-form-item label="审核状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group v-decorator="['audit_status', { initialValue: 10, rules: [{ required: true }] }]">
<a-radio :value="10">同意</a-radio>
<a-radio :value="20">拒绝</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item
v-if="form.getFieldValue('audit_status') == 20"
label="拒绝理由"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
>
<Ueditor v-decorator="['refuse_desc', { rules: [{ required: true, message: '请输入拒绝理由' }] }]" />
</a-form-item>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import * as Api from '@/api/user/recharge'
import { Ueditor } from '@/components'
export default {
components: {
Ueditor,
},
data() {
return {
//
title: '支付订单审核',
//
labelCol: { span: 7 },
//
wrapperCol: { span: 13 },
// modal()
visible: false,
// modal() loading
isLoading: false,
//
form: this.$form.createForm(this),
// 退
addressList: [],
//
record: {},
}
},
methods: {
//
show(record) {
//
this.visible = true
//
this.record = record
// form
this.$nextTick(() => {
console.log( this.record)
this.$forceUpdate()
})
},
//
handleSubmit(e) {
e.preventDefault()
//
const {
form: { validateFields },
} = this
validateFields((errors, values) => {
// api
!errors && this.onFormSubmit(values)
})
},
//
handleCancel() {
this.visible = false
this.form.resetFields()
},
// api
onFormSubmit(values) {
this.isLoading = true
console.log(values);
Api.audit({ rechargeOrderId: this.record.order_id, form: values })
.then((result) => {
//
this.$message.success(result.message, 1.5)
//
this.handleCancel()
//
this.$emit('handleSubmit', values)
})
.finally(() => (this.isLoading = false))
},
},
}
</script>
<style lang="less" scoped>
.ant-form-item {
margin-bottom: 10px;
}
</style>

@ -0,0 +1,198 @@
<template>
<div>
<!-- 加载中 -->
<a-spin :spinning="isLoading" />
<!-- 售后单内容 -->
<div v-if="!isLoading" class="detail-content">
<!-- 售后单信息 -->
<a-card :bordered="false">
<!-- 订单操作 -->
<!-- <div v-if="record.pay_status !== 20" class="detail-actions">
<div class="ant-descriptions-title">充值操作</div>
<div class="actions mt-10">
<div>
<a-button type="primary" @click="handleAudit"
>充值审核</a-button
>
</div>
</div>
</div> -->
<!-- 售后单信息 -->
<a-descriptions title="会员信息">
<a-descriptions-item v-if="record.user.user_id" label="会员ID">
<span>{{ record.user.user_id }}</span>
</a-descriptions-item>
<a-descriptions-item v-if="record.user.avatar_url || record.user.avatar" label="会员头像">
<img
:src="record.user.avatar_url || record.user.avatar.preview_url"
alt="会员头像"
/>
</a-descriptions-item>
<a-descriptions-item label="名 称">
<span>{{ record.user.nick_name }}</span>
</a-descriptions-item>
<a-descriptions-item label="手机号">
<span>{{ record.user.mobile }}</span>
</a-descriptions-item>
<a-descriptions-item label="归属地">
<span>{{ JSON.parse(record.user.homelocation).prov }} {{ JSON.parse(record.user.homelocation).city }}</span>
</a-descriptions-item>
</a-descriptions>
<a-descriptions title="充值信息" :column="3">
<a-descriptions-item label="订单号">
<span
>{{ record.order_no }}</span
>
</a-descriptions-item>
<a-descriptions-item label="支付状态">
<a-tag :color="record.pay_status == 20 ? 'green' : '' ">{{ record.pay_status == 20 ? '已支付' : '待支付' }}</a-tag>
</a-descriptions-item>
<a-descriptions-item label="支付金额">
<span>{{ record.pay_price }}</span>
</a-descriptions-item>
<a-descriptions-item label="赠送金额">
<span>{{ record.gift_money }}</span>
</a-descriptions-item>
<a-descriptions-item label="付款时间">
<span>{{ record.pay_time }}</span>
</a-descriptions-item>
<a-descriptions-item label="创建时间">
<span>{{ record.create_time }}</span>
</a-descriptions-item>
<a-descriptions-item v-if="record.payer_name" label="付款人姓名" :span="1">
<span>{{ record.payer_name }}</span>
</a-descriptions-item>
<a-descriptions-item v-if="record.payer_phone" label="付款人电话" :span="2">
<span>{{ record.payer_phone }}</span>
</a-descriptions-item>
<a-descriptions-item v-if="record.upload_images.length > 0" label="支付凭证" :span="3">
<div class="image-list">
<div v-for="item in record.upload_images" :key="item.image_id" class="file-item">
<a :href="item.preview_url" target="_blank">
<div class="img-cover" :style="{ backgroundImage: `url('${item.preview_url}')` }"></div>
</a>
</div>
</div>
</a-descriptions-item>
<a-descriptions-item v-if="record.audit_status" label="审核状态">
<a-tag :color="record.audit_status == 10 ? 'green' : (record.audit_status == 20 ? 'red' : '')">{{ record.audit_status == 10 ? '审核通过' : (record.audit_status == 20 ? '拒绝' : '') }}</a-tag>
</a-descriptions-item>
</a-descriptions>
<a-divider class="o-divider" />
</a-card>
</div>
<AuditForm ref="AuditForm" @handleSubmit="handleRefresh" />
</div>
</template>
<script>
import * as Api from '@/api/user/recharge'
import AuditForm from './AuditForm.vue'
export default {
name: 'Index',
components: {
AuditForm,
},
data() {
return {
//
isLoading: true,
// ID
rechargeOrderId: null,
//
record: {},
}
},
created() {
// ID
this.rechargeOrderId = this.$route.query.rechargeOrderId
//
this.handleRefresh()
},
methods: {
//
handleRefresh() {
//
this.getDetail()
},
//
getDetail() {
const { rechargeOrderId } = this
this.isLoading = true
console.log(Api.detail, rechargeOrderId);
Api.detail({ rechargeOrderId })
.then((result) => {
//
this.record = result.data.detail
//
this.goodsList = [this.record.orderGoods]
})
.finally(() => (this.isLoading = false))
},
//
handleAudit() {
const { record } = this
this.$refs.AuditForm.show(record)
},
},
}
</script>
<style lang="less" scoped>
//
.detail-content {
margin-bottom: 70px;
/deep/.ant-descriptions-item > span {
vertical-align: middle;
}
/deep/.ant-descriptions-item-content {
padding-left: 3px;
}
.detail-actions {
margin-bottom: 20px;
}
//
.goods-list {
/deep/table {
table-layout: auto;
}
}
//
.actions {
button {
margin-right: 8px;
}
}
//
.image-list {
//
.file-item {
position: relative;
float: left;
width: 120px;
height: 120px;
position: relative;
padding: 2px;
border: 1px solid #ddd;
background: #fff;
margin-right: 12px;
.img-cover {
display: block;
width: 100%;
height: 100%;
background: no-repeat center center / 100%;
}
&:hover {
border: 1px solid #a7c3de;
}
}
}
}
</style>

@ -41,6 +41,7 @@
:columns="columns"
:data="loadData"
:pagination="pagination"
:scroll="{ x: 1450 }"
>
<!-- 会员信息 -->
<span slot="user" slot-scope="text">
@ -56,10 +57,26 @@
<a-tag>{{ RechargeTypeEnum[text].name }}</a-tag>
</span>
<!-- 状态 -->
<span slot="pay_status" slot-scope="text">
<a-tag :color="text == 20 ? 'green' : ''">{{ text == 20 ? '已支付' : '待支付' }}</a-tag>
<span slot="pay_status" slot-scope="text, item">
<a-tag :color="text == 20 ? 'green' : '' ">{{ text == 20 ? '已支付' : '待支付' }}</a-tag>
</span>
<!-- 状态 -->
<span slot="audit_status" slot-scope="text, item">
<a-tag :color="text == 10 ? 'green' : (text == 20 ? 'red' : '')">{{ text == 10 ? '审核通过' : (text == 20 ? '拒绝' : '') }}</a-tag>
</span>
<span class="actions" slot="actions" slot-scope="text, item">
<router-link
:to="{ path: '/user/recharge/detail', query: { rechargeOrderId: item.order_id } }"
>详情</router-link
>
<a
v-if="item.pay_status !== 20 && !item.audit_status"
@click="handleAudit(item)"
>审核</a
>
</span>
</s-table>
<AuditForm ref="AuditForm" @handleSubmit="handleRefresh" />
</a-card>
</template>
@ -68,12 +85,14 @@ import * as Api from '@/api/user/recharge'
import { STable, UserItem } from '@/components/Table'
import PayStatusEnum from '@/common/enum/recharge/order/PayStatus'
import RechargeTypeEnum from '@/common/enum/recharge/order/RechargeType'
import AuditForm from './AuditForm.vue';
export default {
name: 'Index',
components: {
STable,
UserItem
UserItem,
AuditForm
},
data () {
return {
@ -95,10 +114,12 @@ export default {
{
title: '会员信息',
dataIndex: 'user',
width: '250px',
scopedSlots: { customRender: 'user' }
},
{
title: '订单号',
width: '150px',
dataIndex: 'order_no'
},
{
@ -124,13 +145,25 @@ export default {
dataIndex: 'pay_status',
scopedSlots: { customRender: 'pay_status' }
},
{
title: '审核状态',
dataIndex: 'audit_status',
scopedSlots: { customRender: 'audit_status' }
},
{
title: '付款时间',
width: '150px',
dataIndex: 'pay_time'
},
{
title: '创建时间',
width: '150px',
dataIndex: 'create_time'
},
{
title: '操作',
dataIndex: 'actions',
scopedSlots: { customRender: 'actions' }
}
],
// Promise
@ -164,8 +197,11 @@ export default {
this.handleRefresh(true)
}
})
}
},
//
handleAudit(record) {
this.$refs.AuditForm.show(record)
},
}
}
</script>

Loading…
Cancel
Save