2023-05-17 15:25:16 +08:00
|
|
|
|
<template>
|
|
|
|
|
<view class="box">
|
2023-05-19 16:09:25 +08:00
|
|
|
|
<view class="box-seach">
|
2023-06-20 15:58:35 +08:00
|
|
|
|
<u-search placeholder="按手机号搜索查询" v-model="keyword" border-color="#F94B78" height="70" margin="0 0 35rpx 0"
|
|
|
|
|
placeholder-color="#9C9C9C" bg-color="#fff" :show-action="false"></u-search>
|
2023-05-19 16:09:25 +08:00
|
|
|
|
</view>
|
2023-05-24 19:59:44 +08:00
|
|
|
|
<view class="list-item" v-for="(item,index) in memberData" :key="index" @click.stop="handleBack(item)">
|
2023-05-19 16:09:25 +08:00
|
|
|
|
<view class="item-title">
|
|
|
|
|
<view class="item-phone">
|
|
|
|
|
<view></view>
|
|
|
|
|
<text>充值号码:{{item.userPhone}}</text>
|
|
|
|
|
</view>
|
2023-05-25 14:33:27 +08:00
|
|
|
|
<button v-show="item.bool && item.refundStatus == 0" @click.stop="handleService(item)">申请退款</button>
|
2023-05-29 20:41:44 +08:00
|
|
|
|
<view v-show="item.refundStatus != 0">{{list[item.refundStatus]}}</view>
|
2023-05-18 18:03:06 +08:00
|
|
|
|
</view>
|
2023-06-20 15:58:35 +08:00
|
|
|
|
<view class="item-text">
|
2023-06-01 11:24:27 +08:00
|
|
|
|
<text>日期:{{$util.timestampToTime(item.stringCreateTime)}}</text>
|
2023-06-01 14:16:20 +08:00
|
|
|
|
<text>充值档次:{{item.grade}}</text>
|
2023-06-20 15:58:35 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<u-modal :show="serviceShow" @confirm="confirm" @cancel="serviceShow = false" title="申请退款" show-cancel-button
|
|
|
|
|
confirm-text="确认退款" cancel-text="取消退款">
|
|
|
|
|
<view class="slot-content">
|
|
|
|
|
<u--form :model="form" ref="uForm" :rules="rules" label-width="120">
|
2023-06-20 18:03:44 +08:00
|
|
|
|
<u-form-item label="退款类型" prop="refundName" @click="show = true;">
|
|
|
|
|
<u--input v-model="form.refundName" disabled disabledColor="#ffffff" placeholder='请选择退款类型'></u--input>
|
2023-06-20 15:58:35 +08:00
|
|
|
|
<u-icon slot="right" name="arrow-right"></u-icon>
|
|
|
|
|
</u-form-item>
|
2023-06-20 18:03:44 +08:00
|
|
|
|
<u-form-item label="退款理由" prop="memberReason"><u--textarea v-model="form.memberReason" maxlength="100"
|
2023-06-20 15:58:35 +08:00
|
|
|
|
placeholder='请输入退款理由' count autoHeight /></u-form-item>
|
|
|
|
|
</u--form>
|
|
|
|
|
</view>
|
|
|
|
|
</u-modal>
|
|
|
|
|
<u-empty v-show="!memberData.length" text="暂无数据" mode="list"></u-empty>
|
|
|
|
|
<u-navbar autoBack title="购买记录"></u-navbar>
|
|
|
|
|
<u-action-sheet :show="show" :actions="actionSheetList" title="请选择退款类型" @close="show = false"
|
|
|
|
|
@select="handleSelect">
|
|
|
|
|
</u-action-sheet>
|
2023-05-17 15:25:16 +08:00
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2023-05-18 18:03:06 +08:00
|
|
|
|
import {
|
2023-06-20 15:58:35 +08:00
|
|
|
|
memberOrderInfo,
|
|
|
|
|
memberApplyRefund,
|
|
|
|
|
memberOrderInfoByPhone
|
2023-05-18 18:03:06 +08:00
|
|
|
|
} from '@/api/member.js';
|
2023-06-20 15:58:35 +08:00
|
|
|
|
import {
|
|
|
|
|
Debounce
|
|
|
|
|
} from '@/utils/validate.js'
|
2023-05-17 15:25:16 +08:00
|
|
|
|
export default {
|
2023-05-18 18:03:06 +08:00
|
|
|
|
name: "member_record",
|
2023-05-17 15:25:16 +08:00
|
|
|
|
data() {
|
|
|
|
|
return {
|
2023-06-20 15:58:35 +08:00
|
|
|
|
rules: {
|
2023-06-20 18:03:44 +08:00
|
|
|
|
refundName: [{
|
2023-06-20 15:58:35 +08:00
|
|
|
|
required: true,
|
|
|
|
|
message: '请选择退款类型',
|
|
|
|
|
// 可以单个或者同时写两个触发验证方式
|
|
|
|
|
trigger: ['change', 'blur'],
|
|
|
|
|
}],
|
|
|
|
|
refundType: [{
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请选择退款类型',
|
|
|
|
|
// 可以单个或者同时写两个触发验证方式
|
|
|
|
|
trigger: ['change', 'blur'],
|
|
|
|
|
}],
|
2023-06-20 18:03:44 +08:00
|
|
|
|
memberReason: [{
|
2023-06-20 15:58:35 +08:00
|
|
|
|
required: true,
|
|
|
|
|
message: '请输入退款理由',
|
|
|
|
|
trigger: ['change', 'blur'],
|
|
|
|
|
}]
|
|
|
|
|
},
|
|
|
|
|
show: false,
|
|
|
|
|
serviceShow: false,
|
|
|
|
|
keyword: '',
|
|
|
|
|
memberData: [],
|
|
|
|
|
form: {
|
2023-06-20 18:03:44 +08:00
|
|
|
|
refundName: '',
|
2023-06-20 15:58:35 +08:00
|
|
|
|
refundType: '',
|
2023-06-20 18:03:44 +08:00
|
|
|
|
memberReason:''
|
2023-06-20 15:58:35 +08:00
|
|
|
|
},
|
|
|
|
|
list: ['未退款', '退款申请中', '已退款', '退款中'],
|
|
|
|
|
actionSheetList: [{
|
|
|
|
|
name: '对活动理解有误',
|
|
|
|
|
value: 1,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '同一充值账户',
|
|
|
|
|
value: 2
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '改套餐/转网/销户',
|
|
|
|
|
value: 3
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '下单信息有误',
|
|
|
|
|
value: 4
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '业绩归属错误',
|
|
|
|
|
value: 5
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '重复订单',
|
|
|
|
|
value: 6
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '号码充值失败',
|
|
|
|
|
value: 7
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '等待时间过长',
|
|
|
|
|
value: 8
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '其它原因',
|
|
|
|
|
value: 9
|
|
|
|
|
}
|
|
|
|
|
],
|
2023-05-17 15:25:16 +08:00
|
|
|
|
};
|
|
|
|
|
},
|
2023-05-18 18:03:06 +08:00
|
|
|
|
async onLoad() {
|
2023-05-24 19:59:44 +08:00
|
|
|
|
await this.getList()
|
2023-05-17 15:25:16 +08:00
|
|
|
|
},
|
2023-06-20 15:58:35 +08:00
|
|
|
|
watch: {
|
|
|
|
|
keyword: Debounce(async function() {
|
|
|
|
|
if (this.keyword == '') {
|
|
|
|
|
await this.getList()
|
|
|
|
|
} else {
|
|
|
|
|
await this.searchList()
|
2023-05-25 14:33:27 +08:00
|
|
|
|
}
|
2023-06-20 15:58:35 +08:00
|
|
|
|
}, 1000)
|
|
|
|
|
},
|
2023-05-17 15:25:16 +08:00
|
|
|
|
methods: {
|
2023-06-20 15:58:35 +08:00
|
|
|
|
handleSelect(e) {
|
2023-06-20 18:03:44 +08:00
|
|
|
|
this.form.refundType = e.value
|
|
|
|
|
this.form.refundName = e.name
|
2023-06-20 15:58:35 +08:00
|
|
|
|
},
|
|
|
|
|
handleBack(item) {
|
2023-05-24 19:59:44 +08:00
|
|
|
|
uni.navigateTo({
|
2023-06-20 15:58:35 +08:00
|
|
|
|
url: `/pages/member_back/index?userPhone=${item.userPhone}&grade=${item.grade}`
|
2023-05-24 19:59:44 +08:00
|
|
|
|
})
|
|
|
|
|
},
|
2023-06-20 15:58:35 +08:00
|
|
|
|
async searchList() {
|
|
|
|
|
let milliseconds = 2 * 3600 * 1000 // 7200000 毫秒
|
|
|
|
|
let timestamp = new Date().getTime()
|
|
|
|
|
const res = await memberOrderInfoByPhone(this.keyword)
|
|
|
|
|
if (res.data) {
|
|
|
|
|
const arr = res.data.map((item) => {
|
|
|
|
|
return {
|
|
|
|
|
...item,
|
|
|
|
|
bool: item.createTime + milliseconds > timestamp
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.memberData = arr
|
|
|
|
|
} else {
|
|
|
|
|
this.memberData = []
|
|
|
|
|
}
|
2023-05-25 14:33:27 +08:00
|
|
|
|
},
|
2023-06-20 15:58:35 +08:00
|
|
|
|
async getList() {
|
|
|
|
|
let milliseconds = 2 * 3600 * 1000 // 7200000 毫秒
|
|
|
|
|
let timestamp = new Date().getTime()
|
|
|
|
|
const res = await memberOrderInfo()
|
|
|
|
|
if (res.data) {
|
2023-05-25 14:33:27 +08:00
|
|
|
|
const arr = res.data.map((item) => {
|
2023-06-20 15:58:35 +08:00
|
|
|
|
return {
|
|
|
|
|
...item,
|
|
|
|
|
bool: item.createTime + milliseconds > timestamp
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.memberData = arr
|
|
|
|
|
} else {
|
2023-05-25 14:33:27 +08:00
|
|
|
|
this.memberData = []
|
|
|
|
|
}
|
2023-05-24 19:59:44 +08:00
|
|
|
|
},
|
2023-06-20 15:58:35 +08:00
|
|
|
|
async confirm() {
|
|
|
|
|
this.$refs.uForm.validate().then(async res => {
|
|
|
|
|
await memberApplyRefund(this.form)
|
|
|
|
|
this.$util.Tips({
|
|
|
|
|
title: '申请成功'
|
|
|
|
|
});
|
|
|
|
|
this.serviceShow = false
|
|
|
|
|
await this.getList()
|
|
|
|
|
}).catch(errors => {
|
|
|
|
|
uni.$u.toast('校验失败')
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
async handleService(item) {
|
|
|
|
|
this.serviceShow = true
|
|
|
|
|
this.form = {
|
|
|
|
|
orderId: item.id,
|
|
|
|
|
type: 3
|
|
|
|
|
}
|
2023-05-19 16:09:25 +08:00
|
|
|
|
}
|
2023-05-17 15:25:16 +08:00
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2023-06-21 17:36:10 +08:00
|
|
|
|
::v-deep .u-textarea__count{
|
|
|
|
|
bottom: -26rpx;
|
|
|
|
|
}
|
2023-05-17 15:25:16 +08:00
|
|
|
|
.box {
|
2023-05-19 16:09:25 +08:00
|
|
|
|
margin-top: 10%;
|
2023-06-20 15:58:35 +08:00
|
|
|
|
padding: 20% 40rpx;
|
|
|
|
|
background: url(../../static/images/memberBg.png);
|
|
|
|
|
background-size: cover;
|
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
background-attachment: fixed;
|
|
|
|
|
|
|
|
|
|
.u-empty {
|
|
|
|
|
margin-top: 20% !important;
|
|
|
|
|
|
|
|
|
|
::v-deep .u-icon__icon {
|
|
|
|
|
font-size: 140rpx !important;
|
2023-05-25 17:25:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-06-20 15:58:35 +08:00
|
|
|
|
::v-deep .u-empty__text {
|
|
|
|
|
font-size: 30rpx !important;
|
2023-05-19 16:09:25 +08:00
|
|
|
|
}
|
2023-06-20 15:58:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.box-seach {
|
|
|
|
|
z-index: 999;
|
|
|
|
|
padding: 0 40rpx;
|
|
|
|
|
width: 100%;
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 8%;
|
|
|
|
|
left: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.list-item {
|
|
|
|
|
margin-bottom: 26rpx;
|
|
|
|
|
padding: 30rpx 16rpx 25rpx 16rpx;
|
|
|
|
|
background: #FDF0F1;
|
|
|
|
|
border-radius: 20rpx;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
|
|
|
|
.item-title {
|
2023-05-17 15:25:16 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
2023-06-20 15:58:35 +08:00
|
|
|
|
|
|
|
|
|
.item-phone {
|
2023-05-18 18:03:06 +08:00
|
|
|
|
display: flex;
|
2023-06-20 15:58:35 +08:00
|
|
|
|
align-items: center;
|
|
|
|
|
font-size: 30rpx;
|
|
|
|
|
color: #E91D51;
|
|
|
|
|
|
|
|
|
|
view {
|
|
|
|
|
border-radius: 3rpx;
|
|
|
|
|
margin-right: 10rpx;
|
|
|
|
|
width: 5rpx;
|
|
|
|
|
height: 12rpx;
|
|
|
|
|
background: #E91D51;
|
2023-05-18 18:03:06 +08:00
|
|
|
|
}
|
2023-05-17 15:25:16 +08:00
|
|
|
|
}
|
2023-05-19 16:09:25 +08:00
|
|
|
|
|
2023-06-20 15:58:35 +08:00
|
|
|
|
button {
|
|
|
|
|
padding: 6rpx;
|
|
|
|
|
font-size: 26rpx;
|
|
|
|
|
background: rgb(22, 155, 213);
|
|
|
|
|
color: #fff;
|
2023-05-17 15:25:16 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-06-20 15:58:35 +08:00
|
|
|
|
|
|
|
|
|
.item-text {
|
|
|
|
|
padding: 20rpx 12rpx;
|
|
|
|
|
background: #fff;
|
|
|
|
|
margin-top: 20rpx;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
font-size: 30rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-05-17 15:25:16 +08:00
|
|
|
|
}
|
|
|
|
|
</style>
|