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

376 lines
8.8 KiB
Vue
Raw Normal View History

2025-03-21 14:49:01 +08:00
<template>
<view>
<view class="d-b-c search-data border-b f26 mb20" @click="openPop()">
<view class="flex-1 gray9">{{ $t('w_0352') }}</view>
<picker disabled mode="date" :value="form.startCreateDate" :start="startCreateDate" :end="endCreateDate"
@change="bindDateChange1">
<view class="picker-item-data">{{ form.startCreateDate || $t('CK_KS_3') }}</view>
</picker>
<view style="margin: 0 60rpx;">{{ $t('w_0139') }}</view>
<picker disabled mode="date" :value="form.endCreateDate" :start="startCreateDate" :end="endCreateDate"
@change="bindDateChange2">
<view class="picker-item-data">{{ form.endCreateDate || $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-b-c">
<view class="items-title-name">{{item.typeVal}}</view>
<view :class="`status${item.status}`">{{item.statusVal}}</view>
</view>
<view class="f26 p-20-0 line-h-15">
<view class="gray3 mb20">{{$t('MY_CK_10')}}:</view>
<u-read-more text-indent="0" show-height="78rpx" toggle>
<view class="gray9 f26">
{{item.content}}
<!-- {{pop_content}} -->
</view>
</u-read-more>
</view>
<view class="items-bottom d-b-c">
<view>{{$t('fn_123')}}{{item.creationTime}}</view>
<view v-if="item.status == 3 && item.rejectInfo" @click="openContent(item.rejectInfo)">{{$t('fn_122')}}</view>
</view>
</view>
</view>
<button class="normal-sub-btn" @click="gotoPage('/pages/user/personalServices/apply')">{{$t('fn_124')}}</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('MN_F_9') }}</view>
<view class="checkbox-list">
<view v-for="(item, index) in types" :key="index" class="checkbox-item"
:class="{ active: form.type == item.value }" @click="bindTypes(item)">
{{ item.label }}
</view>
</view>
<view class="right-item-title">{{ $t('fn_120') }}</view>
<view class="checkbox-list">
<view v-for="(item, index) in status" :key="index" class="checkbox-item"
:class="{ active: form.status == item.value }" @click="bindStatus(item)">
{{ item.label }}
</view>
</view>
<view class="right-item-title">{{ $t('w_0352') }}</view>
<view class="d-c-c">
<picker mode="date" :value="date1" :start="startCreateDate" :end="endCreateDate"
@change="bindDateChange1">
<view class="data-input">{{ form.startCreateDate || $t('CK_KS_3') }}</view>
</picker>
<view style="width: 30rpx;height: 1rpx;background-color: #333;margin: 0 24rpx;"></view>
<picker mode="date" :value="date2" :start="startCreateDate" :end="endCreateDate"
@change="bindDateChange2">
<view class="data-input">{{ form.endCreateDate || $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,
startCreateDate: '',
endCreateDate: '',
status:'',
type: ''
},
total: 0,
showPop: false,
isPop: false,
date1: '',
date2: '',
status: [{
label:this.$t('fn_130'),
value: 1
},
{
label: this.$t('fn_129'),
value: 2
},
{
label: this.$t('ENU_APPROVE_S_4'),
value: 3
},
],
types: [],
pop_content: ''
};
},
onShow() {
/*获取数据*/
this.listData = [];
this.form.pageNum = 1;
this.getData();
this.getType();
},
onReachBottom() {
let self = this;
if (self.form.pageNum * self.form.pageSize < self.total) {
self.form.pageNum++;
self.getData();
}
self.no_more = true;
},
computed: {
/*加载中状态*/
loadingType() {
if (this.loading) {
return 1;
} else {
if (this.listData.length != 0 && this.no_more) {
return 2;
} else {
return 0;
}
}
},
startCreateDate() {
return this.getDate('start');
},
endCreateDate() {
return this.getDate('end');
},
},
methods: {
getType(){
let self = this;
self._get('system/pub/enums/personal-type',{},res=>{
self.types = res.data;
})
},
bindStatus: function(e) {
console.log(e);
this.form.status = e.value;
// console.log(e);
},
bindTypes: function(e) {
console.log(e);
this.form.type = 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;
},
getData() {
let self = this;
self.loading = true;
var formdata = self.form;
self._get(
'member/api/personal/list',
formdata,
function(res) {
self.listData = res.rows;
// 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.startCreateDate = e.detail.value;
},
bindDateChange2: function(e) {
this.form.endCreateDate = e.detail.value;
},
resetSubmit: function() {
this.form.status = '';
this.form.type = '';
this.form.startCreateDate = '';
this.form.endCreateDate = '';
},
searchSubmit: function() {
/*获取数据*/
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;
}
.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>