You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong_qianduan/pages/news/user/report.vue

509 lines
12 KiB

9 months ago
<template>
10 months ago
<view class="report">
<view class="report-tab">
9 months ago
<u-tabs :list="list" height="110" font-size="32" active-color="#F34A40" inactive-color="#686868"
:is-scroll="false" v-model="tabIndex"></u-tabs>
10 months ago
</view>
<view class="report-bd" v-if="tabIndex == 0">
<view class="module1">
<view class="title">订单数据</view>
9 months ago
<view class="info" v-if=" orderData">
10 months ago
<view class="item">
9 months ago
订单金额<text>¥{{ orderData.orderMoney}}</text>
10 months ago
</view>
<view class="item">
9 months ago
订单数<text>{{ orderData.orderCount}}</text>
10 months ago
</view>
<view class="item">
订单人数<text>{{ orderData.orderPayUser}}</text>
10 months ago
</view>
<view class="item">
9 months ago
总成本金额<text>¥{{ orderData.orderCostMoney}}</text>
10 months ago
</view>
<view class="item">
9 months ago
预估利益<text>¥{{ orderData.orderInterest}}</text>
10 months ago
</view>
<view class="item">
9 months ago
付费会员数<text>{{ orderData.payMemberCount}}</text>
10 months ago
</view>
<view class="item">
9 months ago
付费分销数<text>{{ orderData.payDealerCount}}</text>
10 months ago
</view>
</view>
</view>
<view class="module2">
<view class="title">退款数据</view>
9 months ago
<view class="info" v-if=" refundData">
10 months ago
<view class="item">
9 months ago
退款单数<text>{{ refundData.refundCount}}</text>
10 months ago
</view>
<view class="item">
9 months ago
退款金额<text>¥{{ refundData.refundTotalMoney}}</text>
10 months ago
</view>
</view>
</view>
<view class="module3">
<view class="title">用户数据</view>
9 months ago
<view class="info" v-if=" userData">
10 months ago
<view class="item">
9 months ago
访客数<text>{{ userData.visitorCount}}</text>
10 months ago
</view>
<view class="item">
9 months ago
浏览量<text>{{ userData.viewCount}}</text>
10 months ago
</view>
<view class="item">
9 months ago
新增用户数<text>{{ userData.newUserCount}}</text>
10 months ago
</view>
</view>
</view>
</view>
<view class="export" v-if="tabIndex == 1">
<view class="a">
9 months ago
<view @click="activeTab(index)" class="item" :class="dateIndex==index?'itemActive':''"
v-for="(item,index) in dateList" :key="index">{{item}}
</view>
10 months ago
</view>
<view class="b">
9 months ago
<view class="start timer" @click="isShow=true">{{startTime?startTime:'开始时间'}}</view>
10 months ago
<view class="or">-</view>
9 months ago
<view class="end timer" @click="isShow=true">{{endTime?endTime:'结束时间'}}</view>
10 months ago
</view>
9 months ago
<view class="rest">
9 months ago
<view class="c" @click="quantityReset"
style="border:1rpx solid #E5E5E5;background: #fff;color:#3B3B3B ;">重置</view>
9 months ago
<view class="c" :style="{'opacity': (startTime||dateIndex>-1)?1:0.6 }" @click="quantityFilter">确认</view>
</view>
10 months ago
</view>
<u-calendar v-model="isShow" mode="range" @change="getTime" range-color='#FF6257' range-bg-color='#FFBDBA'
active-bg-color='#FF6257'></u-calendar>
10 months ago
<view class="report-bd" v-if="tabIndex == 1">
<view class="module1">
<view class="title">订单数据</view>
9 months ago
<view class="info" v-if=" orderData">
10 months ago
<view class="item">
9 months ago
订单金额<text>¥{{ orderData.orderMoney}}</text>
10 months ago
</view>
<view class="item">
9 months ago
订单数<text>{{ orderData.orderCount}}</text>
10 months ago
</view>
<view class="item">
订单人数<text>{{ orderData.orderPayUser}}</text>
10 months ago
</view>
<view class="item">
9 months ago
总成本金额<text>¥{{ orderData.orderCostMoney}}</text>
10 months ago
</view>
<view class="item">
9 months ago
预估利益<text>¥{{ orderData.orderInterest}}</text>
10 months ago
</view>
<view class="item">
9 months ago
付费会员数<text>{{ orderData.payMemberCount}}</text>
10 months ago
</view>
<view class="item">
9 months ago
付费分销数<text>{{ orderData.payDealerCount}}</text>
10 months ago
</view>
</view>
</view>
<view class="module2">
<view class="title">退款数据</view>
9 months ago
<view class="info" v-if=" refundData">
10 months ago
<view class="item">
9 months ago
退款单数<text>{{ refundData.refundCount}}</text>
10 months ago
</view>
<view class="item">
9 months ago
退款金额<text>¥{{ refundData.refundTotalMoney}}</text>
10 months ago
</view>
</view>
</view>
<view class="module3">
<view class="title">用户数据</view>
9 months ago
<view class="info" v-if=" userData">
10 months ago
<view class="item">
9 months ago
访客数<text>{{ userData.visitorCount}}</text>
10 months ago
</view>
<view class="item">
9 months ago
浏览量<text>{{ userData.viewCount}}</text>
10 months ago
</view>
<view class="item">
9 months ago
新增用户数<text>{{ userData.newUserCount}}</text>
10 months ago
</view>
</view>
</view>
<view class="module4">
<view class="title">佣金数据</view>
9 months ago
<view class="info" v-if=" commissionData">
10 months ago
<view class="item">
9 months ago
累计佣金已结算金额<text>{{ commissionData.settleTotalMoney}}</text>
10 months ago
</view>
<view class="item">
9 months ago
累计佣金结算金额<text>{{ commissionData.noSettleTotalMoney}}</text>
10 months ago
</view>
</view>
</view>
</view>
9 months ago
</view>
</template>
<script>
import * as newFunApi from '@/api/newFun'
export default {
data() {
10 months ago
return {
9 months ago
dateList: ['昨日', '近7日', '近15日', '近30日'],
dateIndex: -1,
list: [{
name: '今日数据'
}, {
name: '历史数据'
10 months ago
}],
9 months ago
tabIndex: 0,
isShow: false,
startTime: '',
endTime: '',
recentDate: '',
9 months ago
orderData: {},
refundData: {},
userData: {},
commissionData: {}
10 months ago
}
9 months ago
},
onLoad() {
this.getNumberPages()
},
10 months ago
methods: {
9 months ago
activeTab(index) {
this.dateIndex = index;
let day = ''
if (this.dateIndex == 0) {
day = -1
}
if (this.dateIndex == 1) {
day = -7
}
if (this.dateIndex == 2) {
day = -15
}
if (this.dateIndex == 3) {
day = -30
}
9 months ago
this.startTime = this.getDay(day);
this.endTime = this.getDay(0)
},
9 months ago
quantityReset() {
this.startTime = '';
this.endTime = '';
9 months ago
this.dateIndex = -1
this.getNumberPages()
},
9 months ago
quantityFilter() {
this.getNumberPages()
9 months ago
},
getTime(e) {
this.startTime = e.startDate;
this.endTime = e.endDate;
},
tabItem(index) {
this.dateIndex = -1;
this.startTime = '';
this.endTime = '';
10 months ago
this.tabIndex = index
},
9 months ago
getNumberPages() {
const that = this
return new Promise((resolve, reject) => {
9 months ago
newFunApi.statistics({
startDate: this.startTime,
endDate: this.endTime
9 months ago
})
.then(result => {
9 months ago
this.orderData = result.data.orderData;
this.refundData = result.data.refundData;
this.userData = result.data.userData;
this.commissionData = result.data.commissionData;
9 months ago
})
.catch(reject)
})
10 months ago
},
9 months ago
getDay(day) {
var today = new Date();
var targetday_milliseconds = today.getTime() + 1000 * 60 * 60 * 24 * day;
today.setTime(targetday_milliseconds); //注意,这行是关键代码
var tYear = today.getFullYear();
var tMonth = today.getMonth();
var tDate = today.getDate();
tMonth = this.doHandleMonth(tMonth + 1);
tDate = this.doHandleMonth(tDate);
return tYear + "-" + tMonth + "-" + tDate;
10 months ago
},
9 months ago
doHandleMonth(month) {
var m = month;
if (month.toString().length == 1) {
m = "0" + month;
10 months ago
}
9 months ago
return m;
},
10 months ago
}
}
9 months ago
</script>
<style lang="scss" scoped>
::v-deep .u-btn--primary {
background-color: #FF6257 !important;
border-color: #FF6257;
9 months ago
}
.report {
10 months ago
overflow: hidden;
9 months ago
&-tab {
margin-top: 20rpx;
overflow: hidden;
}
.export {
10 months ago
width: 100%;
9 months ago
height: 312rpx;
background: #FFFFFF;
margin-top: 20rpx;
padding: 0 40rpx;
10 months ago
box-sizing: border-box;
9 months ago
.a {
overflow: hidden;
.item {
width: 156rpx;
line-height: 64rpx;
background: #FFF6F5;
border-radius: 4rpx;
text-align: center;
font-size: 28rpx;
font-weight: 400;
color: #3B3B3B;
float: left;
margin-top: 20rpx;
margin-left: 15rpx;
&:first-child {
margin-left: 0;
}
}
.itemActive {
color: #fff;
background: #FF6F5F;
9 months ago
border-radius: 6rpx;
9 months ago
}
10 months ago
}
9 months ago
.b {
overflow: hidden;
.timer {
width: 288rpx;
line-height: 64rpx;
background: #FFF6F5;
9 months ago
border-radius: 6rpx;
9 months ago
text-align: center;
font-size: 28rpx;
font-weight: 400;
10 months ago
color: #3B3B3B;
9 months ago
float: left;
10 months ago
margin-top: 20rpx;
9 months ago
height: 64rpx;
}
.or {
width: 93rpx;
height: 64rpx;
display: flex;
margin-top: 20rpx;
align-items: center;
justify-content: center;
float: left;
text-align: center;
font-size: 60rpx;
10 months ago
}
}
9 months ago
9 months ago
.rest {
display: flex;
margin: 0 20rpx 20rpx 20rpx;
align-items: center;
justify-content: space-between;
}
9 months ago
.c {
9 months ago
width: 300rpx;
9 months ago
line-height: 88rpx;
background: #FF6257;
9 months ago
border-radius: 88rpx;
10 months ago
font-size: 28rpx;
font-weight: 500;
9 months ago
color: #FFFFFF;
margin-top: 26rpx;
10 months ago
text-align: center;
}
}
9 months ago
&-bd {
padding: 0 20rpx 20rpx;
overflow: hidden;
10 months ago
margin-top: 20rpx;
9 months ago
.module1 {
width: 100%;
height: 504rpx;
background: linear-gradient(180deg, #FEF4F3 0%, #FFFFFF 20%);
9 months ago
border-radius: 10rpx;
padding: 25rpx 20rpx;
box-sizing: border-box;
.title {
position: relative;
font-size: 28rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #3B3B3B;
border-left: 3px solid #FF6257;
padding-left: 30rpx;
}
.item {
width: 33.3%;
float: left;
padding: 25rpx 0;
text-align: center;
font-size: 24rpx;
font-weight: 400;
color: #ABABAB;
text {
display: block;
font-size: 32rpx;
font-weight: 500;
color: #3B3B3B;
margin-top: 20rpx;
}
}
10 months ago
}
9 months ago
.module2 {
width: 100%;
height: 246rpx;
margin-top: 20rpx;
background: linear-gradient(180deg, #FEF4F3 0%, #FFFFFF 30%);
9 months ago
border-radius: 10rpx;
padding: 25rpx 20rpx;
box-sizing: border-box;
.title {
position: relative;
font-size: 28rpx;
font-family: PingFang SC, PingFang SC;
10 months ago
font-weight: 500;
color: #3B3B3B;
9 months ago
border-left: 3px solid #FF6257;
padding-left: 30rpx;
}
.item {
width: 33.3%;
float: left;
padding: 25rpx 0;
text-align: center;
font-size: 24rpx;
font-weight: 400;
color: #ABABAB;
text {
display: block;
font-size: 32rpx;
font-weight: 500;
color: #3B3B3B;
margin-top: 20rpx;
}
10 months ago
}
}
9 months ago
.module3 {
width: 100%;
height: 246rpx;
margin-top: 20rpx;
background: linear-gradient(180deg, #FEF4F3 0%, #FFFFFF 30%);
9 months ago
border-radius: 10rpx;
padding: 25rpx 20rpx;
box-sizing: border-box;
.title {
position: relative;
font-size: 28rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #3B3B3B;
border-left: 3px solid #FF6257;
padding-left: 30rpx;
}
.item {
width: 33.3%;
float: left;
padding: 25rpx 0;
text-align: center;
font-size: 24rpx;
font-weight: 400;
color: #ABABAB;
text {
display: block;
font-size: 32rpx;
font-weight: 500;
color: #3B3B3B;
margin-top: 20rpx;
}
}
10 months ago
}
9 months ago
.module4 {
width: 100%;
height: 246rpx;
margin-top: 20rpx;
background: linear-gradient(180deg, #FEF4F3 0%, #FFFFFF 30%);
9 months ago
border-radius: 10rpx;
padding: 25rpx 20rpx;
box-sizing: border-box;
.title {
position: relative;
font-size: 28rpx;
font-family: PingFang SC, PingFang SC;
10 months ago
font-weight: 500;
color: #3B3B3B;
9 months ago
border-left: 3px solid #FF6257;
padding-left: 30rpx;
}
.item {
width: 33.3%;
float: left;
padding: 25rpx 0;
text-align: center;
font-size: 24rpx;
font-weight: 400;
color: #ABABAB;
text {
display: block;
font-size: 32rpx;
font-weight: 500;
color: #3B3B3B;
margin-top: 20rpx;
}
10 months ago
}
}
}
}
</style>