web-africa-h5/pages/user/rechargeMatch/index.vue

511 lines
13 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view>
<view class="d-b-c search-data border-b f26 mb20" @click="openPop()">
<view class="flex-1 gray9">{{ $t("fn_134") }}</view>
<picker
disabled
mode="date"
:value="form.startDate"
:start="startDate"
:end="endDate"
@change="bindDateChange1"
>
<view class="picker-item-data">{{
form.startDate || $t("fn_134")
}}</view>
</picker>
<view style="margin: 0 60rpx"></view>
<view style="margin: 0 60rpx"></view>
<!-- <view style="margin: 0 60rpx;">{{ $t('w_0139') }}</view>
<picker disabled mode="date" :value="form.endDate" :start="startDate" :end="endDate"
@change="bindDateChange2">
<view class="picker-item-data">{{ form.endDate || $t('CK_KS_9') }}</view>
</picker> -->
<view class="search-radio"
><text class="icon iconfont icon-sousuo"></text
></view>
</view>
<view class="wallet-list">
<view class="bonus-item" v-for="(item, index) in listData" :key="index">
<!-- <view class="items-title d-e-c">
<view class="items-title-name">{{item.memberCode}}</view>
<view :class="`status${item.applicationStatus}`">{{item.applicationStatusVal}}</view>
</view> -->
<!-- <view class="f26 d-b-c p-20-0 line-h-15">
<view>{{$t('MN_T_1')}}</view>
<view class="flex-1 tr">{{item.memberCode}}</view>
</view> -->
<view class="f26 d-b-c p-20-0 line-h-15">
<view>{{ $t("fn_132") }}</view>
<view class="flex-1 tr" style="white-space: pre">{{
item.remitter
}}</view>
</view>
<view class="f26 d-b-c p-20-0 line-h-15">
<view>{{ $t("fn_133") }}</view>
<view class="flex-1 tr">{{ item.remittanceAmount }}</view>
</view>
<view class="f26 d-b-c p-20-0 line-h-15">
<view>{{ $t("CK_KS_41") }}</view>
<view class="flex-1 tr">{{ item.bankName }}</view>
</view>
<view class="f26 d-b-c p-20-0 line-h-15">
<view>{{ $t("fn_158") }}</view>
<view class="flex-1 tr">{{ item.voucherNumber }}</view>
</view>
<view class="f26 p-20-0 line-h-15">
<view class="gray3 mb20">{{ $t("fn_135") }}:</view>
<u-read-more text-indent="0" show-height="78rpx" toggle>
<view class="gray9 f26">
{{ item.remarks }}
<!-- {{pop_content}} -->
</view>
</u-read-more>
</view>
<view class="items-bottom d-b-c">
<view>{{ $t("fn_134") }}{{ item.remittanceDate }}</view>
<view @click="confirmReceipt(item.pkId)">
<button style="background-color: #fb3024; color: white">
{{ $t("ENU_P_TYPE4") }}
</button>
</view>
</view>
</view>
<view class="d-c-c p30" v-if="listData.length == 0 && !loading">
<text class="iconfont icon-wushuju"></text>
<text class="cont">{{ $t("w_0309") }}</text>
</view>
<uni-load-more v-else :loadingType="loadingType"></uni-load-more>
</view>
<!-- <button class="normal-sub-btn"
@click="gotoPage('/pages/user/rechargeApplication/apply')">{{$t('fn_139')}}</button> -->
<template v-if="isPop">
<view class="pop-bg" @click.stop="isPop = false"></view>
<view class="pop-content2" @click.stop="isPop = false">
<view class="pop-content-box" @click.stop="isPop = true">
<view class="d-e-c">
<view @click.stop="isPop = false"
><u-icon name="close" size="28rpx" color="#999999"></u-icon>
</view>
</view>
<view class="tc fb f32 p20 border-b pt0">{{ $t("fn_121") }}</view>
<view class="pop-list">
<u-parse :content="pop_content"></u-parse>
</view>
</view>
</view>
</template>
<!-- 筛选 -->
<u-popup :show="showPop" mode="right" @close="closePop" @open="openPop">
<view class="pop-content rightpop">
<view class="pop-title d-b-c">
<view class="f28 gray3">{{ $t("MY_ORD_50") }}</view>
<view class="f28 domation" @click="closePop">{{
$t("N_I_241")
}}</view>
</view>
<view class="right-item-title">{{ $t("fn_132") }}</view>
<view style="padding: 0 24rpx">
<view class="search-box">
<u-icon name="search" size="36rpx" color="#999"></u-icon>
<input
v-model="form.remitter"
minlength="4"
class="search-input"
type="text"
value=""
:placeholder="$t('S_C_70')"
/>
</view>
</view>
<view class="right-item-title">{{ $t("fn_133") }}</view>
<view style="padding: 0 24rpx">
<view class="search-box">
<u-icon name="search" size="36rpx" color="#999"></u-icon>
<input
v-model="form.remittanceAmount"
class="search-input"
type="text"
value=""
:placeholder="$t('S_C_70')"
/>
</view>
</view>
<view class="right-item-title">{{ $t("fn_158") }}</view>
<view style="padding: 0 24rpx">
<view class="search-box">
<u-icon name="search" size="36rpx" color="#999"></u-icon>
<input
v-model="form.voucherNumber"
class="search-input"
type="text"
value=""
:placeholder="$t('S_C_70')"
/>
</view>
</view>
<!-- <view class="checkbox-list">
<view v-for="(item, index) in status" :key="index" class="checkbox-item"
:class="{ active: form.applicationStatus == item.value }" @click="bindStatus(item)">
{{ item.label }}
</view>
</view> -->
<view class="right-item-title">{{ $t("fn_134") }}</view>
<view>
<picker
mode="date"
:value="date1"
:start="startDate"
:end="endDate"
@change="bindDateChange1"
>
<view class="data-input">{{ form.startDate || $t("fn_134") }}</view>
</picker>
<!-- <view style="width: 30rpx;height: 1rpx;background-color: #333;margin: 0 24rpx;"></view>
<picker mode="date" :value="date2" :start="startDate" :end="endDate" @change="bindDateChange2">
<view class="data-input">{{ form.endDate || $t('MN_T_7') }}</view>
</picker> -->
</view>
<view class="pop-btns">
<view class="pop-left-btn" @click="resetSubmit()">{{
$t("w_0257")
}}</view>
<view class="pop-right-btn" @click="searchSubmit()">{{
$t("w_0035")
}}</view>
</view>
</view>
</u-popup>
</view>
</template>
<script>
import uniLoadMore from "@/components/uni-load-more.vue";
export default {
components: {
uniLoadMore,
},
data() {
const currentDate = this.getDate({
format: true,
});
return {
/*有没有等多*/
no_more: false,
/*是否正在加载*/
loading: true,
listData: [],
form: {
pageNum: 1,
pageSize: 10,
startDate: "",
endDate: "",
applicationStatus: "",
},
total: 0,
showPop: false,
isPop: false,
date1: "",
date2: "",
status: [],
pop_content: "",
};
},
onShow() {
/*获取数据*/
this.listData = [];
// this.form.pageNum = 1;
this.getData();
this.getType();
},
computed: {
/*加载中状态*/
loadingType() {
if (this.loading) {
return 1;
} else {
if (this.listData.length != 0 && this.no_more) {
return 2;
} else {
return 0;
}
}
},
startDate() {
return this.getDate("start");
},
endDate() {
return this.getDate("end");
},
},
onReachBottom() {
let self = this;
if (self.form.pageNum * self.form.pageSize < self.total) {
self.form.pageNum++;
self.getData();
}
self.no_more = true;
},
methods: {
bindStatus: function (e) {
console.log(e);
if (this.form.applicationStatus == e.value) {
this.form.applicationStatus = "";
} else {
this.form.applicationStatus = e.value;
}
// console.log(e);
},
getDate(type) {
const date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
if (type === "start") {
year = year - 60;
} else if (type === "end") {
year = year + 2;
}
month = month > 9 ? month : "0" + month;
day = day > 9 ? day : "0" + day;
return `${year}-${month}-${day}`;
},
openContent(e) {
this.pop_content = e;
this.isPop = true;
},
closePop() {
this.showPop = false;
},
openPop() {
this.showPop = true;
},
confirmReceipt(id) {
let self = this;
uni.showModal({
title: this.$t("w_0034"),
content: this.$t("fn_162"),
success(o) {
if (o.confirm) {
self._get(
"member/api/recharge/match/confirm",
{ pkId: id },
(res) => {
/*获取数据*/
self.listData = [];
self.form.pageNum = 1;
self.getData();
uni.showToast({
title: res.msg,
icon: "none",
});
}
);
}
},
});
},
getType() {
let self = this;
// self.loading = true;
self._get(
"system/pub/enums/personal-status",
{},
function (res) {
self.status = res.data;
// self.total = res.total;
// if (self.total < self.form.pageNum * self.form.pageSize) {
// self.no_more = true;
// }
},
{},
() => {
// self.loading = false;
}
);
},
getData() {
let self = this;
self.loading = true;
var formdata = self.form;
self._post(
"member/api/recharge/match/list?pageNum=" +
self.form.pageNum +
"&pageSize=" +
self.form.pageSize,
formdata,
function (res) {
self.loading = false;
if (res.data) {
self.listData = self.listData.concat(res.data);
}
self.total = res.total;
if (self.total < self.form.pageNum * self.form.pageSize) {
self.no_more = true;
}
},
{},
() => {
self.loading = false;
}
);
},
bindDateChange1: function (e) {
this.form.startDate = e.detail.value;
},
bindDateChange2: function (e) {
this.form.endDate = e.detail.value;
},
resetSubmit: function () {
this.form.applicationStatus = "";
this.form.startDate = "";
this.form.endDate = "";
this.form.remitter = "";
this.form.remittanceAmount = "";
this.form.voucherNumber = "";
},
searchSubmit: function () {
if (this.form.remitter.length < 4) {
// 如果输入的字符数少于4个阻止搜索提交并向用户显示消息
uni.showToast({
title: this.$t("fn_132") + this.$t("fn_163"),
icon: "none",
});
return; // 阻止搜索提交
}
/*获取数据*/
this.listData = [];
// this.form.pageNum = 1;
this.showPop = false;
this.getData();
},
},
};
</script>
<style lang="scss">
.tips-box {
padding: 30rpx 20rpx;
background-color: #fff;
border-bottom: 1rpx solid #eee;
}
.bonus-item {
padding: 20rpx 25rpx 20rpx 23rpx;
background-color: #fff;
margin-bottom: 20rpx;
}
.items-title {
padding: 20rpx 0;
border-bottom: 1px solid #eee;
}
.items-title-name {
font-size: 28rpx;
font-weight: bold;
}
.items-bottom {
color: #999;
padding: 20rpx 0;
border-top: 1px solid #eee;
}
.bonus-item {
padding-top: 0;
padding-bottom: 0;
}
.status1 {
color: #ffae36;
}
.status2 {
color: #1aa90e;
}
.status3 {
color: #fb3024;
}
.pop-bg {
z-index: 101;
}
.pop-content2 {
position: fixed;
display: flex;
justify-content: center;
align-items: center;
z-index: 102;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
.pop-content-box {
width: 90%;
background-color: #ffffff;
border-radius: 15rpx;
padding: 20rpx;
box-sizing: border-box;
min-height: 400rpx;
}
.pop-list {
padding-top: 20rpx;
box-sizing: border-box;
max-height: 60vh;
overflow-y: auto;
}
.pt0 {
padding-top: 0;
}
.rightpop.pop-content {
padding-top: 0;
}
.search-box {
flex: 1;
height: 65rpx;
background: #f5f6f8;
border-radius: 33rpx;
padding: 0 52rpx;
box-sizing: border-box;
display: flex;
justify-content: center;
align-items: center;
.search-input {
font-size: 26rpx;
color: #333;
margin-left: 14rpx;
flex: 1;
}
}
.wallet-list {
padding-bottom: 120rpx;
}
.normal-sub-btn {
position: fixed;
width: 690rpx;
bottom: 20rpx;
left: 30rpx;
height: 90rpx;
line-height: 1.5;
display: flex;
justify-content: center;
align-items: center;
word-break: break-all;
}
</style>