Commit 0a2b8eb2 by zhangzhen

功能优化

parent 545b9f01
import http from "@/common/vmeitime-http/index.js"
export const getStoreManageList=(data)=>{
let url=`/store/manageList`
return http.get(url,data)
}
export const getDataStatistics=(data)=>{
let url=`/order/statistics`
return http.post(url,data)
}
\ No newline at end of file
......@@ -67,4 +67,5 @@ export const noLoginGetOrderInfo=(orderNo)=>{
export const orderCancelPay=(data)=>{
let url=`/order/cancelPay?orderNo=${data.orderNo}`
return http.post(url)
}
\ No newline at end of file
}
......@@ -232,6 +232,14 @@
"navigationBarTitleText": "会员等级详情",
"enablePullDownRefresh" : false
}
},
{
"path" : "dataStatistics/index",
"style": {
"navigationBarTitleText": "门店数据统计",
"navigationStyle": "custom",
"enablePullDownRefresh" : false
}
}
]
}
......
......@@ -304,6 +304,14 @@
<text class="text-gray">设备控制</text>
</view>
</view>
<view v-if="userInfo.isManage" class="item-box" @tap="onNavByPath('dataStatistics')">
<view class="icon-img">
<image :src="assetsPath+'/user/tool_3.png'" mode="scaleToFill"></image>
</view>
<view class="text-box">
<text class="text-gray">数据统计</text>
</view>
</view>
</view>
</view>
</view>
......@@ -461,7 +469,8 @@
cleanRecord:"/pages/cleanRecord/index",
couponList:"/pages/couponList/index",
equityDetail:"/setting/rule/rule?keyData=user_equity_details",
levelDetail:"/setting/levelDetail/index"
levelDetail:"/setting/levelDetail/index",
dataStatistics: "/setting/dataStatistics/index"
},
list:'',
consumerMemberStatus:false,
......
......@@ -172,7 +172,7 @@
</template>
<script>
import {login} from "@/api/index.js";
import {login,dictList} from "@/api/index.js";
import {getDictItem} from "@/utils/tools.js"
import fNavbar from '@/components/module/f-navbar/f-navbar';
import {getOrderInfoByNo,orderRefund,openDoor,noLoginOpenDoor,noLoginGetOrderInfo} from "@/api/order.js"
......
<template>
<view class="data-statistics">
<view class="header-content" :style="{paddingTop:statusBarHeight+'px' }">
<image class="logo-bg" :src="assetsPath +'/logo_v1.png'" mode="widthFix"></image>
</view>
<view class="container-box" :style="{top: statusBarHeight+'px'}">
<view class="store-name-box">
<view class="flex-row">
<text class="cuIcon-back text-white text-bold" @tap="onBack"></text>
<text v-if="storeList.length" class="text-white text-lg text-bold margin-left-sm">凑角·{{storeList[index].name}}</text>
<text v-else class="text-white text-lg text-bold margin-left-sm">凑角</text>
</view>
<picker mode="selector" :range="storeList" range-key="name" @change="onChange">
<view class="store-box">
<view class="flex-row-center btn">
<text class="cuIcon-write icon"></text>
<text class="text-sm">切换门店</text>
</view>
</view>
</picker>
</view>
<view class="data-statistics-content">
<view class="statistics">
<view class="date-list">
<view class="date-list-item" @tap="onTabChange(3)">
<button class="cu-btn sm" :class="dateIndex === 3?'bg-pink':'bg-white'">近30天</button>
</view>
<view class="date-list-item" @tap="onTabChange(4)">
<button class="cu-btn sm" :class="dateIndex === 4?'bg-pink':'bg-white'">日期筛选</button>
</view>
<view class="date-list-item">
<view v-if="dateIndex === 4" class="flex-row date-list-item-2 bg-gray">
<text>{{faultDate.startTime}}</text>
<text>-</text>
<text>{{faultDate.endTime}}</text>
</view>
</view>
</view>
<view class="date-list">
<view v-for="(item,i) in dateList" :key="i" v-if="i < 3" class="date-list-item" @tap="onTabChange(i)">
<button class="cu-btn sm" :class="dateIndex === i?'bg-pink':'bg-white'">{{item.label}}</button>
</view>
</view>
<view class="flex-between part-1">
<view class="flex-1 flex-col">
<text class="text-pink text-xxl text-bold">{{statisticsData.totalFee || 0}}</text>
<text class="text-black text-bold">累计流水</text>
</view>
<view class="flex-1 flex-col">
<text class="text-pink text-xxl text-bold">{{statisticsData.actualFee || 0}}</text>
<text class="text-black text-bold">实际收入</text>
</view>
</view>
<view class="part-2">
<view class="flex-col">
<text class="text-black text-bold">门店交易</text>
<text class="text-black text-xl text-bold">{{statisticsData.storeFee || 0}}</text>
<view class="flex-row-center">
<text class="text-black">退款</text>
<text class="text-pink text-lg">{{statisticsData.storeRefundFee || 0}}</text>
</view>
</view>
<view class="flex-col">
<text class="text-black text-bold">美团团购</text>
<text class="text-black text-xl text-bold">{{statisticsData.groupFee || 0}}</text>
<view class="flex-row-center">
<text class="text-black">退款</text>
<text class="text-pink text-lg">{{statisticsData.groupRefundFee || 0}}</text>
</view>
</view>
<view class="flex-col">
<text class="text-black text-bold">平台支付</text>
<text class="text-black text-xl text-bold">{{statisticsData.platformFee || 0}}</text>
<view class="flex-row-center">
<text class="text-black">退款</text>
<text class="text-pink text-lg">{{statisticsData.platformRefundFee || 0}}</text>
</view>
</view>
<view class="flex-col">
<text class="text-black text-bold">用户充值</text>
<text class="text-black text-xl text-bold">{{statisticsData.rechargeFee || 0}}</text>
<view class="flex-row-center">
<text class="text-black">退款</text>
<text class="text-pink text-lg">{{statisticsData.rechargeRefundFee || 0}}</text>
</view>
</view>
<view class="flex-col">
<text class="text-black text-bold">充值余额支付</text>
<text class="text-black text-xl text-bold">{{statisticsData.rechargeBalance || 0}}</text>
<view class="flex-row-center">
<text class="text-black">退款</text>
<text class="text-pink text-lg">{{statisticsData.rechargeBalanceRefundFee || 0}}</text>
</view>
</view>
<view class="flex-col">
<text class="text-black text-bold">其他消费</text>
<text class="text-black text-xl text-bold">{{statisticsData.otherFee || 0}}</text>
<view class="flex-row-center">
<text class="text-black">退款</text>
<text class="text-pink text-lg">{{statisticsData.otherRefundFee || 0}}</text>
</view>
</view>
<view class="flex-col">
<text class="text-black text-bold">美团团购金额</text>
<text class="text-black text-xl text-bold">{{statisticsData.meituanFee || 0}}</text>
<view class="flex-row-center">
<text class="text-black">退款</text>
<text class="text-pink text-lg">{{statisticsData.meituanRefundFee || 0}}</text>
</view>
</view>
<view class="flex-col">
<text class="text-black text-bold">抖音团购金额</text>
<text class="text-black text-xl text-bold">{{statisticsData.douyinFee || 0}}</text>
<view class="flex-row-center">
<text class="text-black">退款</text>
<text class="text-pink text-lg">{{statisticsData.douyinRefundFee || 0}}</text>
</view>
</view>
<view class="flex-col">
<text class="text-black text-bold">积分消费</text>
<text class="text-black text-xl text-bold">{{statisticsData.integralFee || 0}}</text>
<view class="flex-row-center">
<text class="text-black">退费</text>
<text class="text-pink text-lg">{{statisticsData.integralRefundFee || 0}}</text>
</view>
</view>
</view>
</view>
<view v-if="statisticsData.orderVoList && statisticsData.orderVoList.length" class="record">
<view v-for="(item,k) in statisticsData.orderVoList" :key="k" class="record-item">
<view class="flex-between part-top">
<view class="flex-row-center">
<view class="avatar-bg">
<image class="img" :src="item.avatar? item.avatar : assetsPath+'/logo_icon.png'" mode="scaleToFill"></image>
</view>
<text class="text-black text-lg text-bold">{{item.nickName|| '凑角用户'}}_{{item.consumerPhone|setPhone}}</text>
</view>
<view class="flex-row-center text-pink text-bold text-xl">
<text></text>
<text>{{item.payPrice || item.couponPayPrice || 0}}</text>
</view>
</view>
<view class="part-content">
<text>预定{{item.storeName}}{{item.roomName}}成功,{{Number(item.timeLong)}}小时时长</text>
<text v-if="item.couponCode">{{platformTypeEnum[item.platformType]}}团购券码{{item.couponCode}}</text>
</view>
<view class="flex-between part-bottom">
<view class="">
</view>
<view class="">
<text>{{item.createTime}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
<u-calendar :show="show" :minDate="minDate" :maxDate="maxDate" mode="range" :defaultDate="defaultDate" :monthNum='13' @confirm="onConfirm" @close="onCancel" ></u-calendar>
</view>
</template>
<script>
import {dictList} from "@/api/index.js";
import {getDictItem} from "@/utils/tools.js"
import moment from "@/common/moment.js"
import config from "@/config/index.config"
import fNavbar from '@/components/module/f-navbar/f-navbar';
import {getStoreManageList,getDataStatistics} from "@/api/dataStatistics.js"
export default {
components: {
fNavbar
},
data(){
return {
show:false,
statisticsData:{},
list:[],
assetsPath:config.assetsPath,
statusBarHeight: this.statusBarHeight,
storeList:[],
index:0,
dateList:[
{
label:"今天",
startTime: moment().format("YYYY-MM-DD 00:00:00"),
endTime: moment().format("YYYY-MM-DD 23:59:59"),
},
{
label:"昨天",
startTime: moment().subtract(1,'d').format("YYYY-MM-DD 00:00:00"),
endTime: moment().subtract(1,'d').format("YYYY-MM-DD 23:59:59"),
},
{
label:"近7天",
startTime: moment().subtract(7,'d').format("YYYY-MM-DD 00:00:00"),
endTime: moment().subtract(1,'d').format("YYYY-MM-DD 23:59:59"),
},
{
label:"近30天",
startTime: moment().format("YYYY-MM-01 00:00:00"),
endTime: moment().format("YYYY-MM-DD 23:59:59"),
},
{
label:"全部",
startTime: moment().subtract(29,'d').format("YYYY-MM-DD 00:00:00"),
endTime: moment().format("YYYY-MM-DD 23:59:59"),
},
],
dateIndex:3,
minDate: moment().subtract(1,'y').format("YYYY-MM-DD"),
maxDate: moment().format("YYYY-MM-DD 23:59:59"),
defaultDate:[
moment().subtract(6,'M').format("YYYY-MM-DD"),
moment().format("YYYY-MM-DD")
],
faultDate:{
startTime:"",
endTime:""
},
platformTypeEnum:{}
}
},
onLoad() {
this.onGetDicts();
},
filters:{
setPhone(val){
return val.substring(val.length-4)
}
},
methods:{
onGetDicts() {
let dicts = []
if (uni.getStorageSync('dicts')) {
dicts = JSON.parse(uni.getStorageSync('dicts'))
this.platformTypeEnum = getDictItem(dicts, "store_platform_type");
} else {
dictList().then(res => {
dicts = res.data.data;
uni.setStorageSync('dicts', JSON.stringify(res.data.data))
this.platformTypeEnum = getDictItem(dicts, "store_platform_type");
})
}
this.onLoading();
},
onConfirm(e){
console.log(e);
this.faultDate.startTime = moment(e[0]).format("YYYY/MM/DD");
this.faultDate.endTime = moment(e[e.length-1]).format("YYYY/MM/DD");
this.dateList[4].startTime = moment(e[0]).format("YYYY-MM-DD 00:00:00");
this.dateList[4].endTime = moment(e[e.length-1]).format("YYYY-MM-DD 23:59:59");
this.dateIndex = 4;
this.onOrderDataStatistics();
this.onCancel();
},
onCancel(){
this.show = false;
},
onBack(){
uni.navigateBack();
},
onOrderDataStatistics(){
getDataStatistics({
storeId: this.storeList[this.index].id,
startTime: this.dateList[this.dateIndex].startTime,
endTime: this.dateList[this.dateIndex].endTime
}).then(res=>{
console.log(res,99999)
this.statisticsData = res.data.data
})
},
onLoading(){
getStoreManageList().then(res => {
console.log(res,99999)
if(res.data.code == 200 && res.data.data){
this.storeList = res.data.data;
this.onOrderDataStatistics();
}
})
},
onChange(e){
console.log(e,99999)
let num = Number(e.target.value);
if(this.index === num) return
this.index = num;
},
onTabChange(i){
if(this.dateIndex === i) return;
if(i===4){
this.show = true;
}else{
this.dateIndex = i;
this.onOrderDataStatistics();
}
}
}
}
</script>
<style>
page {
background-color: #f1f1f1;
}
</style>
<style lang="scss" scoped>
.data-statistics{
position: relative;
display: flex;
flex-direction: column;
width: 100%;
.header-content {
position: fixed;
top: 0;
left: 0;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
min-height: 392upx;
background: linear-gradient(to right, #FB406F,#E40583);
.logo-bg{
width: 460upx;
max-height: 280upx;
}
}
.container-box{
position: absolute;
left: 0;
width: 100%;
min-height: 90vh;
}
}
.store-name-box{
display: flex;
flex-direction: row;
align-items: center;
height: 40px;
.flex-row{
display: flex;
flex-direction: row;
align-items: center;
margin-left: 10upx;
.cuIcon-back{
font-size: 42upx;
}
.margin-left-sm{
margin-left: 10upx;
}
}
}
.store-box{
display: flex;
flex-direction: row;
align-items: center;
.btn{
background-color: rgba(245, 207, 177, 1);
margin-left: 24upx;
border-radius: 8upx;
padding: 4upx 12upx 4upx 8upx;
color: rgba(92, 49, 14, 1);
.icon{
margin-bottom: -4upx;
}
}
}
.data-statistics-content{
display: flex;
flex-direction: column;
width: 100%;
.statistics{
padding-top: 32upx;
width: 96%;
margin: 0 auto;
background-color: #ffffff;
.date-list{
display: flex;
flex-direction: row;
padding: 10upx 0;
margin: 0 20upx;
.date-list-item{
display: flex;
flex: 1;
max-width: 33.33%;
padding: 0 10upx;
.cu-btn{
width: 100%;
font-size: 24upx;
}
.bg-white{
box-shadow: 0 0 8upx rgba(0, 0, 0, 0.34);
}
}
.date-list-item-2{
display: flex;
justify-content: center;
align-items: center;
border: 1px solid #999999;
border-radius: 8upx;
font-size: 18upx;
width: 100%;
padding: 0 6upx;
}
}
.part-1{
width: 90%;
border-bottom: 1upx solid #e5e5e5;
margin: 36upx auto;
padding: 0 0 36upx;
.flex-col{
justify-content: center;
align-items: center;
}
}
.part-2{
display: flex;
flex-wrap: wrap;
width: 100%;
margin-bottom: 6upx;
.flex-col{
width: 33.33%;
justify-content: center;
align-items: center;
padding-bottom: 36upx;
.text-xl{
margin: 8upx 0;
}
.flex-row-center{
.text-pink{
margin-left: 6upx;
}
}
}
}
}
}
.record{
display: flex;
flex-direction: column;
width: 100%;
.record-item{
display: flex;
flex-direction: column;
width: 96%;
margin: 12upx auto;
background-color: #ffffff;
border-radius: 12upx;
padding: 12upx 0;
.part-top{
padding: 0 12upx 12upx;
border-bottom: 1px solid #e5e5e5;
.avatar-bg{
width: 60upx;
height: 60upx;
background-color: #999999;
border-radius: 6upx;
margin-right: 6upx;
overflow: hidden;
.img{
width: 100%;
height: 100%;
}
}
}
.part-content{
display: flex;
flex-direction: column;
padding: 20upx;
}
.part-bottom{
padding: 4upx 20upx;
}
}
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment