界面以及功能更改

This commit is contained in:
jia 2023-09-25 09:28:22 +08:00
parent 4c01652089
commit f040461730
37 changed files with 947 additions and 0 deletions

View File

@ -0,0 +1,64 @@
<template>
<view class="returnbom">
<view class="z-bootm">
<view class="z-bootm-img">
<image src="@/static/tabbar_icon/a-a.png" mode="aspectFit"></image>
</view>
<view class="" @click="returnbom">返回首页</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
returnbom() {
uni.reLaunch({
url:'/pages/index/index'
})
}
}
}
</script>
<style lang="scss">
.returnbom {
height: 130rpx;
background: #FFFFFF;
border-radius: 32rpx 32rpx 0px 0px;
padding-top: 50rpx;
}
.z-bootm {
width: 180rpx;
margin: 0 auto;
display: flex;
.z-bootm-img {
width: 46rpx;
height: 46rpx;
image {
width: 100%;
height: 100%;
}
}
font-size: 30rpx;
font-family: PingFang SC-Regular,
PingFang SC;
font-weight: 400;
color: #333333;
}
</style>

View File

@ -0,0 +1,90 @@
<template>
<view class="contentgb">
<view class="return_top">
<view class="z-bootm-img1" @click="returnbom()">
<image src="@/static/images/fb1.png" mode="aspectFit"></image>
</view>
<view class="z-bootm-l"></view>
<view class="z-bootm-img2" @click="returnbom()">
<image src="@/static/images/fb2.png" mode="aspectFit"></image>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
returnbom() {
uni.sendHostEvent('closeApp', (ret) => {
//
console.log('关闭应用' + JSON.stringify(ret));
});
}
}
}
</script>
<style lang="scss" scoped>
.contentgb {
width: 166rpx;
height: 56rpx;
.return_top {
width: 166rpx;
height: 56rpx;
background: rgba(255, 255, 255, 0.6);
border-radius: 44rpx 44rpx;
position: relative;
.z-bootm-img1 {
width: 41rpx;
height: 13rpx;
position: absolute;
top: 5rpx;
left: 25rpx;
image {
width: 100%;
height: 100%;
}
}
.z-bootm-l {
width: 1px;
height: 32rpx;
background: rgba(0, 0, 0, 0.2);
margin: auto 0;
position: absolute;
top: 10rpx;
left: 85rpx;
}
.z-bootm-img2 {
width: 38rpx;
height: 34rpx;
margin-top: -15rpx;
margin-left: -15rpx;
position: absolute;
right: 25rpx;
top: 25rpx;
image {
width: 100%;
height: 100%;
}
}
}
}
</style>

View File

@ -0,0 +1,793 @@
<template>
<view class="statistical-page" ref="container">
<view v-show="isShowBox">
<view class="navs">
<view class="list">
<view class="item" :class="time == 'today' ? 'on' : ''" @click="setTime('today')">
今天
</view>
<view class="item" :class="time == 'yesterday' ? 'on' : ''" @click="setTime('yesterday')">
昨天
</view>
<view class="item" :class="time == 'seven' ? 'on' : ''" @click="setTime('seven')">
最近7天
</view>
<view class="item" :class="time == 'month' ? 'on' : ''" @click="setTime('month')">
本月
</view>
<view class="item" :class="time == 'date' ? 'on' : ''" @click="dateTitle">
<!-- <span class="iconfont icon-xiangxia"></span>
<span v-for="(value, index) in renderValues" :key="index">
{{ value }}</span
> -->
自定义
</view>
</view>
</view>
<view class="wrapper">
<view v-if="where.type == 1" class="money">{{ time_price }}</view>
<view v-else class="money">{{ time_price }}</view>
<view class="title">
{{ title }}{{ where.type == 1 ? "营业额(元)" : "订单量(份)" }}
</view>
<view class="increase acea-row row-between-wrapper">
<view class="orderno">
<view class="orderno-one">
<image src="@/static/images/tj1.png" mode='aspectFit'>
</view>
<view class="orderno-two">
<view class="orderno-two-title">{{ title }}增长率</view>
<span
:class="increase_time_status === 1 ? 'red' : 'green'">{{ increase_time_status === 1 ? "" : "-" }}{{ growth_rate }}%
</span>
</view>
</view>
<view class="orderno">
<view class="orderno-one">
<image src="@/static/images/tj1.png" mode='aspectFit'>
</view>
<view class="orderno-two">
<view class="orderno-two-title">{{ title }}增长</view>
<span
:class="increase_time_status === 1 ? 'red' : 'green'">{{ increase_time_status === 1 ? "" : "-" }}{{ increase_time }}
</span>
</view>
</view>
</view>
</view>
<view class="chart" v-if="showChart">
<view class="chart-title">
单位{{where.type == 1?'元':'份'}}
</view>
<canvas canvas-id="canvasLineA" id="canvasLineA" class="charts" disable-scroll=true
@touchstart="touchLineA" @touchmove="moveLineA" @touchend="touchEndLineA"></canvas>
</view>
<view class="public-wrapper">
<view class="title">
<span class="iconfont icon-xiangxishuju"></span>详细数据
</view>
<view class="nav acea-row row-between-wrapper">
<view class="data">日期</view>
<view class="browse">订单量</view>
<view class="turnover">成交额</view>
</view>
<view class="conter" v-if=" list.length>0">
<view class="item acea-row row-between-wrapper" v-for="(item, index) in list" :key="index">
<view class="data">{{ item.day }}</view>
<view class="browse">{{ item.total }}</view>
<view class="turnover">{{ item.pay_price }}</view>
</view>
</view>
<view class="conter-img" v-else>
<image src="@/static/images/noCart.png" mode="aspectFit"></image>
</view>
</view>
</view>
<conBotm/>
<uni-calendar ref="calendar" :date="info.date" :insert="info.insert" :lunar="info.lunar"
:startDate="info.startDate" :endDate="info.endDate" :range="info.range" @confirm="confirm"
:showMonth="info.showMonth" @close="close" />
<view class="mask" @touchmove.prevent v-show="current === true" @click="close"></view>
<!-- <Loading :loaded="loaded" :loading="loading"></Loading> -->
</view>
</template>
<script>
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEBCRMEB
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import uCharts from '@/components/ucharts/ucharts'
import uniCalendar from '@/components/uni-calendar/uni-calendar.vue'
import conBotm from '@/components/content-bootom/index.vue'
var canvaLineA = null;
// import Calendar from 'mpvue-calendar'
// #ifdef MP-WEIXIN
// import 'mpvue-calendar/src/style.css
// #endif
// #ifdef H5
// import 'mpvue-calendar/src/browser-style.css'
// #endif
import {
orderPrice,
orderNumberStatistics,
turnoverStatistics
} from "@/api/admin";
// import Loading from "@components/Loading";
const year = new Date().getFullYear();
const month = new Date().getMonth() + 1;
const day = new Date().getDate();
export default {
name: "Statistics",
components: {
// Calendar,
// uCharts
uniCalendar,
conBotm
},
props: {
merid: {
type: String | Number
},
type: {
type: String
},
timetype: {
type: String
},
},
data: function() {
return {
isShowBox: true,
showChart: false,
value: [
[year, month, day - 1],
[year, month, day]
],
isrange: true,
weekSwitch: false,
ismulti: false,
monFirst: true,
clean: false, //
lunar: false, //
renderValues: [],
monthRange: [],
current: false,
where: {
start: "",
stop: "",
type: ""
},
types: "", //|order=|price=
time: "", //|today=|yesterday=|month=
title: "", //|today=|yesterday=|month=
growth_rate: "", //
increase_time: "", //
increase_time_status: "", //
time_price: "", //
order_num: "", //
loaded: false,
loading: false,
filter: {
page: 1,
limit: 10,
start: "",
stop: ""
},
list: [],
// charts
cWidth: '',
cHeight: '',
pixelRatio: 1,
textarea: '',
"LineA": {
"categories": ["2012", "2013", "2014", "2015", "2016", "2017"],
"series": [{
"data": [35, 8, 25, 37, 4, 20]
}]
},
info: {
startDate: '',
endDate: '',
lunar: false,
range: true,
insert: false,
selected: [],
showMonth: false
},
merId: ''
};
},
watch: {
"$route.params": function(newVal) {
var that = this;
if (newVal != undefined) {
that.setType(newVal.type);
that.setTime(newVal.time);
that.getIndex();
}
}
},
onLoad: function(options) {
this.merId = options.merId;
this.setType(options.type);
this.setTime(options.time);
this.cWidth = uni.upx2px(690);
this.cHeight = uni.upx2px(500);
// this.handelRenderValues();
// this.getIndex();
this.getInfo();
// this.$scroll(this.$refs.container, () => {
// !this.loading && this.getInfo();
// });
},
mounted() {
// console.log(this.merid,'1111111111111')
},
computed: {
monthRangeText() {
return this.monthRange.length ? "固定" : "指定范围";
}
},
methods: {
timelist() {
this.merId = this.merid;
this.setType(this.type);
this.setTime(this.timetype);
this.cWidth = uni.upx2px(690);
this.cHeight = uni.upx2px(500);
},
getIndex: function() {
let tempDay = []
let tempNum = []
var that = this;
that.where.type == 1 ?
turnoverStatistics(that.where, that.merId).then(
res => {
var _info = res.data.chart,
day = [],
num = [];
_info.forEach(function(item) {
day.push(item.time);
num.push(item.num);
});
that.growth_rate = res.data.growth_rate;
that.increase_time = res.data.increase_time;
that.increase_time_status = res.data.increase_time_status;
that.time_price = res.data.time;
res.data.chart.forEach((item, index) => {
tempDay.push(item.time)
tempNum.push(item.num)
})
that.LineA.categories = tempDay
that.LineA.series[0].data = tempNum
that.showLineA("canvasLineA", that.LineA);
},
error => {
that.$dialog.error(error.msg);
}
) : orderNumberStatistics(that.where, this.merId).then(
res => {
var _info = res.data.chart,
day = [],
num = [];
_info.forEach(function(item) {
day.push(item.time);
num.push(item.num);
});
that.growth_rate = res.data.growth_rate;
that.increase_time = res.data.increase_time;
that.increase_time_status = res.data.increase_time_status;
that.time_price = res.data.time;
res.data.chart.forEach((item, index) => {
tempDay.push(item.time)
tempNum.push(item.num)
})
that.LineA.categories = tempDay
that.LineA.series[0].data = tempNum
that.showLineA("canvasLineA", that.LineA);
},
error => {
that.$dialog.error(error.msg);
}
)
},
setTime: function(time) {
let self = this
this.time = time;
this.showChart = true;
var year = new Date().getFullYear(),
month = new Date().getMonth() + 1,
day = new Date().getDate();
this.list = [];
this.filter.page = 1;
this.loaded = false;
this.loading = false;
switch (time) {
case "today":
this.showChart = false;
this.where.start =
new Date(Date.parse(year + "/" + month + "/" + day)).getTime() /
1000;
this.where.stop =
new Date(Date.parse(year + "/" + month + "/" + day)).getTime() /
1000 +
24 * 60 * 60 -
1;
this.where.month = 0
this.title = "今日";
this.getIndex();
this.getInfo();
break;
case "yesterday":
this.showChart = false;
this.where.start =
new Date(Date.parse(year + "/" + month + "/" + day)).getTime() /
1000 -
24 * 60 * 60;
this.where.stop =
new Date(Date.parse(year + "/" + month + "/" + day)).getTime() /
1000 -
1;
this.where.month = 0
this.title = "昨日";
this.getIndex();
this.getInfo();
break;
case "month":
this.where.start =
new Date(year, new Date().getMonth(), 1).getTime() / 1000;
this.where.stop = new Date(year, month, 1).getTime() / 1000 - 1;
this.title = "本月";
this.where.month = 1
this.getIndex();
this.getInfo();
break;
case "seven":
this.where.start =
new Date(Date.parse(year + "/" + month + "/" + day)).getTime() /
1000 +
24 * 60 * 60 -
7 * 3600 * 24;
this.where.stop =
new Date(Date.parse(year + "/" + month + "/" + day)).getTime() /
1000 +
24 * 60 * 60 -
1;
this.title = "七日";
this.where.month = 0
this.getIndex();
this.getInfo();
break;
}
},
setType: function(type) {
switch (type) {
case "price":
this.where.type = 1;
break;
case "order":
this.where.type = 2;
break;
}
},
dateTitle: function() {
this.isShowBox = false
this.$refs.calendar.open()
this.time = 'date'
this.title = "自定义";
this.where.month = 0;
// this.current = true;
},
close: function() {
this.current = false;
this.isShowBox = true
},
getInfo: function() {
var that = this;
if (that.loading || that.loaded) return;
that.loading = true;
that.filter.start = that.where.start;
that.filter.stop = that.where.stop;
orderPrice(that.filter, this.merId).then(
res => {
that.loading = false;
that.loaded = res.data.length < that.filter.limit;
that.list.push.apply(that.list, res.data);
that.filter.page = that.filter.page + 1;
},
error => {
that.$dialog.message(error.msg);
}
)
},
// charts
showLineA(canvasId, chartData) {
let _self = this
canvaLineA = new uCharts({
$this: _self,
canvasId: canvasId,
type: 'line',
fontSize: 11,
padding: [15, 15, 0, 15],
legend: {
show: false,
padding: 5,
lineHeight: 11,
margin: 5,
},
dataLabel: true,
dataPointShape: true,
dataPointShapeType: 'hollow',
background: '#FFFFFF',
pixelRatio: _self.pixelRatio,
categories: chartData.categories,
series: chartData.series,
animation: true,
enableScroll: true, //
xAxis: {
disableGrid: false,
type: 'grid',
gridType: 'dash',
itemCount: 4,
scrollShow: true,
scrollAlign: 'left'
},
yAxis: {
//disabled:true
gridType: 'dash',
splitNumber: 8,
min: 0,
max: 30,
format: (val) => {
return val.toFixed(0)
} //Y
},
width: _self.cWidth * _self.pixelRatio,
height: _self.cHeight * _self.pixelRatio,
extra: {
line: {
type: 'straight'
}
},
});
},
// charts
touchLineA(e) {
canvaLineA.scrollStart(e);
},
moveLineA(e) {
canvaLineA.scroll(e);
},
touchEndLineA(e) {
canvaLineA.scrollEnd(e);
},
//
confirm(e) {
let self = this
if (e.range.after && e.range.before) {
// let star = e.range.after ? new Date(e.range.after).getTime()/1000 : new Date(e.fulldate).getTime()/1000
// let stop = e.range.before ? new Date(e.range.before).getTime()/1000 : new Date(e.fulldate).getTime()/1000
let star = new Date(e.range.after + ' 00:00:00').getTime() / 1000
let stop = new Date(e.range.before + ' 00:00:00').getTime() / 1000
self.where.start = star < stop ? star : stop
self.where.stop = (stop > star ? stop : star) - 1 + 86400
self.where.month = 0
self.list = [];
self.filter.page = 1;
self.loaded = false;
self.loading = false;
self.isShowBox = true
Promise.all([self.getIndex(), self.getInfo()]);
}
},
},
onReachBottom() {
this.getInfo();
}
};
</script>
<style>
/*交易额统计*/
.statistical-page .navs {
width: 100%;
overflow: hidden;
line-height: 60upx;
margin-bottom: 49rpx;
}
.orderno {
display: flex;
}
.orderno-one {
width: 58upx;
height: 58upx;
margin-top: 30rpx;
margin-right: 30rpx;
}
.orderno-one image {
width: 58rpx;
height: 58rpx;
}
.orderno-two {
font-size: 37rpx;
font-family: PingFang SC-Semibold, PingFang SC;
font-weight: 600;
color: #333333;
line-height: 29px;
}
.orderno-two-title {
font-size: 26rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
}
.statistical-page .navs .list {
overflow-y: hidden;
overflow-x: auto;
white-space: nowrap;
-webkit-overflow-scrolling: touch;
width: 100%;
}
.statistical-page .navs .item {
font-size: 32upx;
color: #282828;
margin-left: 60upx;
display: inline-block;
}
.statistical-page .navs .item.on {
/* color: #2291f8; */
border-bottom: 5rpx solid #F84221;
}
.statistical-page .navs .item .iconfont {
font-size: 25upx;
margin-left: 13upx;
}
.statistical-page .wrapper {
width: 725upx;
background-color: #fff;
border-radius: 10upx;
/* margin: 119upx auto 0 auto; */
margin: 0 auto;
padding: 50upx 60upx;
}
.statistical-page .wrapper .title {
font-size: 30upx;
color: #999;
text-align: center;
}
.statistical-page .wrapper .money {
font-size: 72upx;
/* color: #fba02a; */
color: #F84221;
font-weight: 600;
text-align: center;
margin-top: 10upx;
}
.statistical-page .wrapper .increase {
font-size: 28upx;
color: #999;
margin-top: 20upx;
}
.statistical-page .wrapper .increase .red {
color: #ff6969;
}
.statistical-page .wrapper .increase .green {
color: #1abb1d;
}
.statistical-page .wrapper .increase .iconfont {
font-size: 23upx;
margin-left: 15upx;
}
.statistical-page .chart {
width: 725upx;
background-color: #fff;
border-radius: 10upx;
margin: 23upx auto 0 auto;
/* padding: 25upx 22upx 0 22upx; */
}
.statistical-page .chart .chart-title {
padding: 20upx 20upx 10upx;
font-size: 26upx;
color: #999;
}
.statistical-page .chart canvas {
width: 100%;
height: 530rpx;
}
.statistical-page .chart .company {
font-size: 26upx;
color: #999;
}
.yd-confirm {
background-color: #fff;
font-size: unset;
width: 540upx;
height: 250upx;
border-radius: 40upx;
}
.yd-confirm-hd {
text-align: center;
}
.yd-confirm-title {
color: #030303;
font-weight: bold;
font-size: 36upx;
}
.yd-confirm-bd {
text-align: center;
font-size: 28upx;
color: #333333;
}
.yd-confirm-ft {
line-height: 90upx;
margin-top: 14px;
border-top: 1upx solid #eee;
}
.yd-confirm-ft>a {
color: #e93323;
}
.yd-confirm-ft>a.primary {
border-left: 1upx solid #eee;
color: #e93323;
}
.echarts {
width: 100%;
height: 550upx;
}
.calendar-wrapper {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
z-index: 777;
transform: translate3d(0, 100%, 0);
transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
}
.calendar-wrapper.on {
transform: translate3d(0, 0, 0);
}
.statistical-page .wrapper .increase {
font-size: 26upx;
}
.statistical-page .wrapper .increase .iconfont {
margin-left: 0;
}
.public-wrapper .title {
font-size: 30upx;
color: #282828;
padding: 0 30upx;
margin-bottom: 20upx;
}
.public-wrapper .title .iconfont {
color: #2291f8;
font-size: 40upx;
margin-right: 13upx;
vertical-align: middle;
}
.public-wrapper {
margin: 18upx auto 18upx auto;
width: 725upx;
background-color: #fff;
border-radius: 10upx;
padding-top: 25upx;
}
.public-wrapper .nav {
padding: 0 30upx;
height: 70upx;
line-height: 70upx;
font-size: 24upx;
color: #999;
}
.public-wrapper .data {
width: 210upx;
text-align: left;
}
.public-wrapper .browse {
width: 192upx;
text-align: center;
}
.public-wrapper .turnover {
width: 227upx;
text-align: right;
}
.public-wrapper .conter {
padding: 0 30upx;
}
.public-wrapper .conter .item {
border-bottom: 1px solid #f7f7f7;
height: 70upx;
font-size: 24upx;
}
.conter-img {
width: 650rpx;
height: 400rpx;
margin: 0 auto;
margin-top: 30rpx;
}
.conter-img image {
width: 100%;
height: 100%;
}
.public-wrapper .conter .item .turnover {
color: #d84242;
}
</style>

BIN
static/images/SFFF.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/images/SFZZ.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
static/images/YHKF.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/images/YHKZ.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
static/images/de1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 938 B

BIN
static/images/de2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 997 B

BIN
static/images/de3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 956 B

BIN
static/images/dp1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
static/images/dp2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 737 B

BIN
static/images/dz.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 875 B

BIN
static/images/fb1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 B

BIN
static/images/fb2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
static/images/gz.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
static/images/gz1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
static/images/index1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

BIN
static/images/index10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

BIN
static/images/index11.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

BIN
static/images/index12.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
static/images/index13.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

BIN
static/images/index14.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

BIN
static/images/index15.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

BIN
static/images/index16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
static/images/index18.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

BIN
static/images/index2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
static/images/index20.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

BIN
static/images/index3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

BIN
static/images/index4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
static/images/index5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
static/images/index6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

BIN
static/images/index7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
static/images/index8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

BIN
static/images/index9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

BIN
static/images/tj1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
static/images/zb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB