2023-05-17 15:25:16 +08:00
|
|
|
|
<template>
|
|
|
|
|
<view class="box">
|
2023-05-18 18:03:06 +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>
|
|
|
|
|
<view class="list-item" v-for="(item,index) in memberData" :key="index">
|
|
|
|
|
<view class="item-phone">
|
|
|
|
|
<view></view>
|
|
|
|
|
<text>充值号码:{{item.userPhone}}</text>
|
|
|
|
|
</view>
|
2023-05-17 15:25:16 +08:00
|
|
|
|
<view class="item-text">
|
2023-05-18 18:03:06 +08:00
|
|
|
|
<text>充值档次:{{item.grade}}</text>
|
2023-05-19 11:34:07 +08:00
|
|
|
|
<text>日期:{{item.stringCreateTime}}</text>
|
2023-05-17 15:25:16 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2023-05-18 18:03:06 +08:00
|
|
|
|
import {
|
|
|
|
|
memberOrderInfo
|
|
|
|
|
} from '@/api/member.js';
|
|
|
|
|
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 {
|
|
|
|
|
keyword:'',
|
2023-05-18 18:03:06 +08:00
|
|
|
|
memberData:[]
|
2023-05-17 15:25:16 +08:00
|
|
|
|
};
|
|
|
|
|
},
|
2023-05-18 18:03:06 +08:00
|
|
|
|
async onLoad() {
|
|
|
|
|
const res = await memberOrderInfo()
|
|
|
|
|
this.memberData = res.data
|
2023-05-17 15:25:16 +08:00
|
|
|
|
},
|
2023-05-18 18:03:06 +08:00
|
|
|
|
watch:{
|
|
|
|
|
keyword :Debounce (function (){
|
|
|
|
|
this.memberData.sort((a,b) =>{
|
|
|
|
|
let aIndex = this.keyword.indexOf(a.userPhone)
|
|
|
|
|
let bIndex = this.keyword.indexOf(b.userPhone)
|
2023-05-19 11:34:07 +08:00
|
|
|
|
console.log(aIndex,bIndex)
|
2023-05-18 18:03:06 +08:00
|
|
|
|
if(aIndex > bIndex) return -1
|
|
|
|
|
if(aIndex < bIndex) return 1
|
|
|
|
|
if(a.userPhone == b.userPhone){
|
2023-05-19 11:34:07 +08:00
|
|
|
|
return a.stringCreateTime - b.stringCreateTime
|
2023-05-18 18:03:06 +08:00
|
|
|
|
}else{
|
2023-05-19 11:34:07 +08:00
|
|
|
|
if(a.stringCreateTime<b.stringCreateTime) return -1
|
|
|
|
|
if(a.stringCreateTime>b.stringCreateTime) return 1
|
2023-05-18 18:03:06 +08:00
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},1000)
|
|
|
|
|
},
|
2023-05-17 15:25:16 +08:00
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.box {
|
2023-05-18 18:03:06 +08:00
|
|
|
|
padding: 45rpx 40rpx;
|
2023-05-17 15:25:16 +08:00
|
|
|
|
.list-item{
|
2023-05-18 18:03:06 +08:00
|
|
|
|
margin-bottom: 26rpx;
|
|
|
|
|
padding: 30rpx 16rpx 25rpx 16rpx;
|
|
|
|
|
background: #FDF0F1;
|
2023-05-17 15:25:16 +08:00
|
|
|
|
border-radius: 20rpx;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
.item-phone{
|
2023-05-18 18:03:06 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
font-size: 30rpx;
|
|
|
|
|
color: #E91D51;
|
|
|
|
|
view{
|
|
|
|
|
border-radius: 3rpx;
|
|
|
|
|
margin-right: 10rpx;
|
|
|
|
|
width: 5rpx;
|
|
|
|
|
height: 12rpx;
|
|
|
|
|
background: #E91D51;
|
|
|
|
|
}
|
2023-05-17 15:25:16 +08:00
|
|
|
|
}
|
|
|
|
|
.item-text{
|
2023-05-18 18:03:06 +08:00
|
|
|
|
padding: 34rpx 12rpx;
|
|
|
|
|
background: #fff;
|
2023-05-17 15:25:16 +08:00
|
|
|
|
margin-top: 20rpx;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
2023-05-18 18:03:06 +08:00
|
|
|
|
font-size: 30rpx;
|
2023-05-17 15:25:16 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|