From 788fdb8360f9ccdde4f91f1fff92ac050f5dfdc2 Mon Sep 17 00:00:00 2001
From: tx <2622874537@qq.com>
Date: Fri, 25 Oct 2024 18:05:34 +0800
Subject: [PATCH] 11
---
page_Merchant/order.vue | 16 +-
page_Merchant/order_Detail.vue | 23 +--
pages/index/index.vue | 304 +++++++++++++++++++++------------
pages/login/login.vue | 13 +-
pages_withdraw/withdraw.vue | 2 +-
5 files changed, 233 insertions(+), 125 deletions(-)
diff --git a/page_Merchant/order.vue b/page_Merchant/order.vue
index c592797..3698bf5 100644
--- a/page_Merchant/order.vue
+++ b/page_Merchant/order.vue
@@ -59,6 +59,18 @@
+
+
+ 取车方式:自行前往门店
+
+
+ 取车方式:免费送车上门
+
+
+ 取车方式:收费送车上门
+
+
+
取车时间:{{item.pickupTime}}
@@ -84,7 +96,7 @@
- 换车方式:{{returnType(item.returnMethod) }}
+ 还车方式:{{returnType(item.returnMethod) }}
@@ -98,7 +110,7 @@
{{item.payFee}}元
-
+
确认还车
diff --git a/page_Merchant/order_Detail.vue b/page_Merchant/order_Detail.vue
index 7e6024f..d107ba7 100644
--- a/page_Merchant/order_Detail.vue
+++ b/page_Merchant/order_Detail.vue
@@ -382,18 +382,21 @@
-
-
- 立即接单
-
-
- 立即配送
-
-
- 配送完成
+
+
+
+ 立即接单
+
+
+ 立即配送
+
+
+ 配送完成
+
-
+
+
确认还车
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 07f205c..cb3c8c4 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -6,7 +6,7 @@
运营概览
-
+
+
+
+
- 1359.00
+ {{info.todayIncome}}
- 今日订单数(单)
+ 今日订单数(单)
- 较昨日 40
+ 较昨日
+ {{ formatIncome(info.comparedYesterdayOrderNum) }}
+
+
+
+
+
-
+
车辆统计
@@ -86,25 +100,25 @@
车辆总数
- 390
+ {{info.deviceVO.total}}
- 车辆总数
+ 空闲中
- 390
+ {{info.deviceVO.idle}}
- 车辆总数
+ 出租中
- 390
+ {{info.deviceVO.rent}}
@@ -112,14 +126,20 @@
更多功能
-
-
-
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
@@ -151,8 +171,8 @@
chartday: [], // 保存日期的数组
chartData1: [], // 保存温度数据的数组
chartData2: [120, 90, 150, 80, 130, 110, 160],
- info:{},
- AccountInfo:{},
+ info: {},
+ AccountInfo: {},
time1: false,
time2: false,
lasTime: '',
@@ -169,56 +189,88 @@
}
},
onLoad() {
- this.generateMockData()
+ // this.generateMockData()
+ // this.generateMockData();
+
+ // 获取当前日期
+ const currentDate = new Date();
+
+ // 获取一周前的日期
+ const oneWeekAgoDate = new Date();
+ oneWeekAgoDate.setDate(currentDate.getDate() - 7);
+
+ // 格式化日期为 'YYYY-MM-DD'
+ const formatDate = (date) => {
+ const year = date.getFullYear();
+ const month = (date.getMonth() + 1).toString().padStart(2, '0');
+ const day = date.getDate().toString().padStart(2, '0');
+ return `${year}-${month}-${day}`;
+ };
+
+ // 设置 this.firstTime 和 this.lastTime
+ this.firsTime = formatDate(oneWeekAgoDate);
+ this.lasTime = formatDate(currentDate);
+
+ console.log(this.firstTime); // 输出一周前的日期
+ console.log(this.lastTime); // 输出当前日期
},
computed: {
},
onShow() {
- this.$refs.canvas1.init(this.initChart)
+
this.getIndexInfo()
this.getAccountInfo()
},
watch: {
},
-
+
methods: {
- topages(num ){
- if(this.AccountInfo.userId){
- if(num==0){
+ formatIncome(value) {
+ if (value > 0) {
+ // 如果是正数,返回带加号的数值
+ return `+${value}`;
+ } else {
+ // 如果是负数,直接返回数值
+ return value;
+ }
+ },
+ topages(num) {
+ if (this.AccountInfo.userId) {
+ if (num == 0) {
+ uni.navigateTo({
+ url: '/page_Operator/deviceMgmt'
+ })
+ } else if (num == 1) {
+ uni.navigateTo({
+ url: '/page_Operator/CarModel'
+ })
+ } else if (num == 2) {
+ uni.navigateTo({
+ url: '/page_Operator/order'
+ })
+ }
+ } else {
uni.navigateTo({
- url:'/page_Operator/deviceMgmt'
- })
- }else if(num==1){
- uni.navigateTo({
- url:'/page_Operator/CarModel'
- })
- }else if(num==2){
- uni.navigateTo({
- url:'/page_Operator/order'
+ url: '/pages/login/login'
})
}
- }else{
- uni.navigateTo({
- url:'/pages/login/login'
- })
- }
-
+
},
callPhone(phone) {
uni.makePhoneCall({
phoneNumber: phone
- })
-
+ })
+
},
- getAccountInfo(){
+ getAccountInfo() {
this.$u.get(`appAdmin/myAccountInfo`).then((res) => {
if (res.code === 200) {
- this.AccountInfo=res.data
- if(this.AccountInfo.userType=='04'){
+ this.AccountInfo = res.data
+ if (this.AccountInfo.userType == '04') {
uni.redirectTo({
- url:'/page_Delivery/orerList'
+ url: '/page_Delivery/orerList'
})
}
} else {
@@ -230,18 +282,18 @@
}
});
},
- topage(num){
- if(num==0){
+ topage(num) {
+ if (num == 0) {
uni.navigateTo({
- url:'/page_Merchant/deviceMgmt'
+ url: '/page_Merchant/deviceMgmt'
})
- }else if(num==1){
+ } else if (num == 1) {
uni.navigateTo({
- url:'/page_Merchant/StoreManagement'
+ url: '/page_Merchant/StoreManagement'
})
- }else if(num==2){
+ } else if (num == 2) {
uni.navigateTo({
- url:'/page_Merchant/order'
+ url: '/page_Merchant/order'
})
}
},
@@ -251,7 +303,7 @@
if (this.firsTime != '' && this.lasTime != '') {
this.getIndexInfo()
}
-
+
},
confirm2(e) {
this.lasTime = e.year + '-' + e.month + '-' + e.day
@@ -259,15 +311,19 @@
if (this.firsTime != '' && this.lasTime != '') {
this.getIndexInfo()
}
-
-
-
+
+
+
},
- getIndexInfo(){
- this.$u.get(`appAdmin/index`).then((res) => {
+ getIndexInfo() {
+ let data = {
+ startTime: this.firsTime,
+ endTime: this.lasTime
+ }
+ this.$u.get(`appAdmin/index?`, data).then((res) => {
if (res.code === 200) {
- this.info=res.data
-
+ this.info = res.data
+ this.generateMockData()
} else {
uni.showToast({
title: res.msg,
@@ -279,19 +335,28 @@
},
generateMockData() {
// 生成 7 天的日期
- let days = 7
- let today = new Date()
- for (let i = 0; i < days; i++) {
- let day = new Date(today)
- day.setDate(today.getDate() - (days - i - 1))
- let month = day.getMonth() + 1
- let date = day.getDate()
- this.chartday.push(`${month}-${date}`)
+ this.chartday = [];
+ this.chartData1 = [];
+ this.chartData2 = [];
- // 生成随机温度数据,假设范围为20℃到35℃
- let temp = (Math.random() * 15 + 20).toFixed(2)
- this.chartData1.push(temp)
+ // 遍历真实数据 incomeVoList 并填充 chartday, chartData1, chartData2
+ if (this.info && this.info.incomeVoList) {
+ this.info.incomeVoList.forEach(item => {
+ // 取出 day, orderFee, orderNum
+ const day = new Date(item.day);
+ const month = day.getMonth() + 1;
+ const date = day.getDate();
+ // 格式化日期为 MM-DD
+ this.chartday.push(`${month}-${date}`);
+
+ // 填充 orderFee (营收)
+ this.chartData1.push(item.orderFee);
+
+ // 填充 orderNum (订单单数)
+ this.chartData2.push(item.orderNum);
+ });
}
+ this.$refs.canvas1.init(this.initChart)
},
initChart(canvas, width, height, canvasDpr) {
let that = this
@@ -460,7 +525,8 @@
.page {
width: 100%;
padding-bottom: 200rpx;
- .info_cont{
+
+ .info_cont {
display: flex;
flex-wrap: nowrap;
align-items: center;
@@ -471,51 +537,63 @@
// height: 172rpx;
padding: 40rpx 0rpx;
background: #FFFFFF;
- box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(42,130,228,0.1);
+ box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(42, 130, 228, 0.1);
border-radius: 24rpx 24rpx 24rpx 24rpx;
- .li{
+
+ .li {
width: 110rpx;
display: flex;
flex-wrap: wrap;
justify-content: center;
- .top{
+
+ .top {
+ width: 100%;
+ text-align: center;
font-weight: 400;
font-size: 24rpx;
color: #3D3D3D;
}
- .bot{
+
+ .bot {
+ width: 100%;
+ text-align: center;
font-weight: 600;
font-size: 40rpx;
color: #3D3D3D;
}
}
- .line{
+
+ .line {
width: 2rpx;
height: 74rpx;
background: #C7C7C7;
border-radius: 0rpx 0rpx 0rpx 0rpx;
}
}
- .feature{
+
+ .feature {
margin: 0 auto;
margin-top: 24rpx;
width: 658rpx;
padding: 30rpx 40rpx;
background: #FFFFFF;
border-radius: 24rpx 24rpx 24rpx 24rpx;
- image{
+
+ image {
margin-right: 66rpx;
width: 96rpx;
height: 98rpx;
}
}
- .tits{
+
+ .tits {
margin-top: 40rpx;
margin-left: 44rpx;
font-weight: 600;
font-size: 36rpx;
color: #3D3D3D;
}
+
.info_box {
margin: 0 auto;
padding: 30rpx 22rpx;
@@ -524,21 +602,22 @@
background: #FFFFFF;
box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(42, 130, 228, 0.1);
border-radius: 24rpx 24rpx 24rpx 24rpx;
+
.top_box {
-
+
display: flex;
flex-wrap: nowrap;
align-items: center;
// padding: 28rpx 30rpx;
// padding: 20rpx 0;
-
+
margin: 0 auto;
// width: 672rpx;
height: 100rpx;
background: #FFFFFF;
// box-shadow: 0rpx 4rpx 22rpx 0rpx rgba(0, 0, 0, 0.07);
border-radius: 10rpx 10rpx 10rpx 10rpx;
-
+
.left_text {
display: flex;
flex-wrap: nowrap;
@@ -547,19 +626,19 @@
font-weight: 400;
font-size: 32rpx;
color: #3D3D3D;
-
+
.icon-xiangxia1 {
font-size: 26rpx;
}
}
-
+
.timebox {
width: 75%;
display: flex;
flex-wrap: nowrap;
align-items: center;
margin-left: 34rpx;
-
+
.left_time {
text-align: center;
margin-right: 6rpx;
@@ -571,7 +650,7 @@
font-size: 32rpx;
color: #979797;
}
-
+
.right_time {
text-align: center;
margin-left: 6rpx;
@@ -585,9 +664,9 @@
}
}
}
-
-
- .info_boxs{
+
+
+ .info_boxs {
margin-top: 26rpx;
width: 636rpx;
padding: 24rpx 0;
@@ -595,23 +674,26 @@
border-radius: 24rpx 24rpx 24rpx 24rpx;
display: flex;
flex-wrap: nowrap;
- .info_li:first-child{
- border-right: 1rpx solid #D8D8D8;
+
+ .info_li:first-child {
+ border-right: 1rpx solid #D8D8D8;
}
- .info_li{
- padding: 0 40rpx;
+
+ .info_li {
+ padding: 0 40rpx;
display: flex;
flex-wrap: wrap;
width: 50%;
-
- .tit{
+
+ .tit {
text-align: left;
width: 100%;
font-weight: 600;
font-size: 24rpx;
color: #3D3D3D;
}
- .txt{
+
+ .txt {
margin-top: 10rpx;
width: 100%;
display: flex;
@@ -619,36 +701,42 @@
font-weight: 400;
font-size: 24rpx;
color: #3D3D3D;
- span{
+
+ span {
font-size: 600;
}
- image{
+
+ image {
width: 32rpx;
height: 32rpx;
}
}
}
}
- .log_box{
+
+ .log_box {
display: flex;
flex-wrap: nowrap;
justify-content: space-around;
- .log_li{
+
+ .log_li {
font-weight: 400;
font-size: 24rpx;
color: #3D3D3D;
- image{
+
+ image {
margin-right: 8rpx;
width: 76rpx;
- height:18rpx ;
+ height: 18rpx;
}
}
}
+
.echarts {
width: 650rpx;
height: 500rpx;
}
-
+
.tit_box {
margin-top: 40rpx;
margin-bottom: 30rpx;
diff --git a/pages/login/login.vue b/pages/login/login.vue
index 58a2eb2..2edc85c 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -641,10 +641,15 @@
async ceshi() {
this.$u.get("/getInfo").then((res) => {
console.log('进入跳转',res);
- uni.navigateTo({
- url: '/pages/index/index'
- })
-
+ if(res.data.deptId){
+ uni.navigateTo({
+ url: '/pages/index/index'
+ })
+
+ }else{
+ this.showpart=true
+ }
+
});
},
}
diff --git a/pages_withdraw/withdraw.vue b/pages_withdraw/withdraw.vue
index 6adfa47..267a61b 100644
--- a/pages_withdraw/withdraw.vue
+++ b/pages_withdraw/withdraw.vue
@@ -150,7 +150,7 @@
});
setTimeout(()=>{
uni.navigateTo({
- url:'/pages_withdraw/addcode'
+ url:'/pages_withdraw/addcode?id='+this.checkInfo.userChannelId
})
},1100)
}else{