<template>
|
<view class="box">
|
<view class="head">
|
<u-search
|
placeholder="搜索会员昵称/手机号"
|
:showAction="false"
|
@search="getFirstPageData()"
|
bgColor="#F8F9FB"
|
placeholderColor="#999999"
|
searchIconSize="28"
|
height="36"
|
v-model="memberInfo" />
|
<view class="head-cate">
|
<view class="head-cate-item">
|
<text class="num">{{totalAll}}</text>
|
<text class="title">会员总数</text>
|
</view>
|
<view class="head-cate-item">
|
<text class="num">{{countData.orderNum||0}}</text>
|
<text class="title">订单总数</text>
|
</view>
|
<view class="head-cate-item">
|
<view class="price">
|
<text>{{countData.saleTotalNum||0}}</text>
|
<text>{{countData.saleTotalFloat||'.00'}}</text>
|
</view>
|
<text class="title">订单金额</text>
|
</view>
|
</view>
|
</view>
|
<view class="list">
|
<view class="list-item" v-for="(item,index) in dataList">
|
<view class="tx">
|
<image :src="item.imgFullUrl?item.imgFullUrl:'/static/icon/defualt.png'" mode="widthFix"></image>
|
</view>
|
<view class="info">
|
<view class="info-a">
|
<text>{{item.name || item.nickname || ''}}</text>
|
<text>{{item.phone || ''}}</text>
|
</view>
|
<view class="info-date">关联时间:{{item.bindShopDate || ''}}</view>
|
<!-- <view class="info-num">
|
<text>订单量:3</text>
|
<text>订单金额:¥3678.00</text>
|
</view> -->
|
</view>
|
</view>
|
<view v-if="!hasNext" class="nomore">已加载全部</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import { mapState } from 'vuex'
|
export default {
|
computed: {
|
...mapState(['navHeight', 'statusbarHeight','shopInfo', 'shopToken'])
|
},
|
data() {
|
return {
|
memberInfo:'',
|
shop:{},
|
currentPage:1,
|
totalAll:0,
|
total:0,
|
hasNext:true,
|
dataList:[],
|
countData:{},
|
};
|
},
|
onShow() {
|
this.shop ={}
|
this.checkShopLogin()
|
this.shop = this.shopInfo || {}
|
this.getFirstPageData()
|
this.getCountData()
|
},
|
onReachBottom(){
|
this.getDataList( );
|
},
|
methods:{
|
async getCountData(index){
|
var that =this
|
let res = await that.$u.api.saleReport({tokenType:1 })
|
if (res.code === 200) {
|
this.active = index
|
this.countData = res.data
|
this.countData.profitTotal = (this.countData.profitTotal||0.00 ).toFixed(2)
|
this.countData.saleTotal = (this.countData.saleTotal||0.00).toFixed(2)
|
this.countData.profitTotalNum = Math.floor(this.countData.profitTotal)
|
this.countData.saleTotalNum = Math.floor( this.countData.saleTotal)
|
var t1 =(this.countData.profitTotal - this.countData.profitTotalNum).toFixed(2)
|
var t2 =(this.countData.saleTotal - this.countData.saleTotalNum).toFixed(2)
|
this.countData.profitTotalFloat =( t1+'').slice(1, 4)
|
this.countData.saleTotalFloat = ( t2+'').slice(1, 4)
|
}
|
},
|
getFirstPageData(){
|
this.currentPage = 0
|
this.hasNext=true
|
this.total=0
|
this.dataList=[]
|
this.getDataList()
|
},
|
async getDataList(){
|
if(this.loading || !this.hasNext){
|
return
|
}
|
this.loading=true
|
this.currentPage = this.currentPage+1
|
if(this.currentPage == 1){
|
this.hasNext =true
|
this.dataList=[]
|
}
|
var that =this
|
let res = await that.$u.api.myCustomer({
|
capacity:10,
|
model: {
|
memberInfo: this.memberInfo
|
},
|
page:this.currentPage
|
});
|
console.log(res)
|
if (res.code === 200 ) {
|
if(res.data && this.memberInfo ==''&&this.currentPage==1){
|
this.totalAll = res.data.total||0
|
}
|
if ( res.data && res.data.page ===this.currentPage) {
|
res.data.records = res.data.records||[]
|
that.dataList.push(...res.data.records)
|
that.total=res.data.total
|
if( this.currentPage >= res.data.pageCount||0){
|
that.hasNext=false
|
}else{
|
that.hasNext=true
|
}
|
}
|
}
|
this.loading=false
|
},
|
checkShopLogin(){
|
var that =this
|
if( this.shopInfo ==null || this.shopInfo.id==null || this.shopToken==null || this.shopToken==''){
|
uni.navigateTo({
|
url: '/pages/login/login'
|
})
|
}
|
}
|
}
|
}
|
</script>
|
|
<style>
|
page {
|
background-color: #F9F9FB;
|
}
|
</style>
|
<style lang="scss" scoped>
|
.box {
|
width: 100%;
|
.head {
|
width: 100%;
|
height: 242rpx;
|
padding: 20rpx 30rpx 0 30rpx;
|
box-sizing: border-box;
|
background: #FFFFFF;
|
position: sticky;
|
top: 0;
|
left: 0;
|
z-index: 99;
|
.head-cate {
|
width: 100%;
|
height: 150rpx;
|
|
display: flex;
|
align-items: center;
|
.head-cate-item {
|
flex: 1;
|
height: 100%;
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
justify-content: center;
|
.price {
|
display: flex;
|
align-items: baseline;
|
text {
|
&:nth-child(1) {
|
font-weight: 600;
|
font-size: 32rpx;
|
color: #E4001D;
|
&::before {
|
content: '¥';
|
font-weight: 600;
|
font-size: 24rpx;
|
color: #E4001D;
|
}
|
}
|
&:nth-child(2) {
|
font-weight: 600;
|
font-size: 24rpx;
|
color: #E4001D;
|
}
|
}
|
}
|
.num {
|
font-weight: 600;
|
font-size: 32rpx;
|
color: #222222;
|
}
|
.title {
|
font-weight: 400;
|
font-size: 26rpx;
|
color: #555555;
|
margin-top: 10rpx;
|
}
|
}
|
}
|
}
|
.list {
|
width: 100%;
|
margin-top: 20rpx;
|
background-color: #ffffff;
|
padding: 0 30rpx;
|
padding-bottom: 60rpx;
|
box-sizing: border-box;
|
.list-item {
|
width: 100%;
|
padding: 30rpx 0;
|
box-sizing: border-box;
|
border-bottom: 1rpx solid #E5E5E5;
|
display: flex;
|
align-items: flex-start;
|
.tx {
|
width: 80rpx;
|
height: 80rpx;
|
flex-shrink: 0;
|
border-radius: 50%;
|
overflow: hidden;
|
margin-right: 20rpx;
|
image {
|
width: 100%;
|
}
|
}
|
.info {
|
flex: 1;
|
display: flex;
|
flex-direction: column;
|
.info-a {
|
width: 100%;
|
display: flex;
|
align-items: center;
|
text {
|
&:nth-child(1) {
|
font-weight: 400;
|
font-size: 30rpx;
|
color: #222222;
|
margin-right: 20rpx;
|
}
|
&:nth-child(2) {
|
font-weight: 400;
|
font-size: 24rpx;
|
color: #999999;
|
}
|
}
|
}
|
.info-date {
|
font-weight: 400;
|
font-size: 24rpx;
|
color: #999999;
|
margin-top: 10rpx;
|
}
|
.info-num {
|
width: 80%;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
margin-top: 20rpx;
|
text {
|
font-weight: 400;
|
font-size: 26rpx;
|
color: #333333;
|
}
|
}
|
}
|
}
|
}
|
}
|
</style>
|