cyywl_server/yudao-ui-app/pages/member_record/index.vue

93 lines
2.5 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<view class="box">
<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>
<view class="item-text">
<text>充值档次{{item.grade}}</text>
<text>日期{{item.stringCreateTime}}</text>
</view>
</view>
</view>
</template>
<script>
import {
memberOrderInfo
} from '@/api/member.js';
import { Debounce } from '@/utils/validate.js'
export default {
name: "member_record",
data() {
return {
keyword:'',
memberData:[]
};
},
async onLoad() {
const res = await memberOrderInfo()
this.memberData = res.data
},
watch:{
keyword :Debounce (function (){
this.memberData.sort((a,b) =>{
let aIndex = this.keyword.indexOf(a.userPhone)
let bIndex = this.keyword.indexOf(b.userPhone)
console.log(aIndex,bIndex)
if(aIndex > bIndex) return -1
if(aIndex < bIndex) return 1
if(a.userPhone == b.userPhone){
return a.stringCreateTime - b.stringCreateTime
}else{
if(a.stringCreateTime<b.stringCreateTime) return -1
if(a.stringCreateTime>b.stringCreateTime) return 1
return 0
}
})
},1000)
},
methods: {
}
};
</script>
<style lang="scss" scoped>
.box {
padding: 45rpx 40rpx;
.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-phone{
display: flex;
align-items: center;
font-size: 30rpx;
color: #E91D51;
view{
border-radius: 3rpx;
margin-right: 10rpx;
width: 5rpx;
height: 12rpx;
background: #E91D51;
}
}
.item-text{
padding: 34rpx 12rpx;
background: #fff;
margin-top: 20rpx;
display: flex;
justify-content: space-between;
font-size: 30rpx;
}
}
}
</style>