update
This commit is contained in:
parent
a1dbd94d25
commit
189045fd98
@ -169,22 +169,35 @@
|
||||
<view class="revenue-amount">{{ currentMoney }}</view>
|
||||
<view class="revenue-label">元</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view style="width: 100%;display: flex;align-items: center;justify-content: space-between;">
|
||||
<view class="revenue-date">{{ currentTotal }} {{ currentTotal ? '万笔' : '' }}</view>
|
||||
<view class="revenue-date">{{ $util.handleGetMonthDay(nowDay) }}/{{ howDay }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 其他实时数据 -->
|
||||
<view class="data-grid" v-if="otherRealData && otherRealData.length > 0">
|
||||
<view class="data-item" v-for="(subItem, subIndex) in otherRealData" :key="subIndex">
|
||||
<view class="data-item" v-for="(subItem, subIndex) in otherRealData" :key="subIndex"
|
||||
:style="{ marginBottom: subIndex <= 1 ? '16rpx' : '' }">
|
||||
<view class="data-item-top">
|
||||
<view class="data-icon">
|
||||
<image class="icon" :src="subItem.icon" />
|
||||
</view>
|
||||
<view class="data-info">
|
||||
<view class="data-label">{{ subItem.label || "" }}</view>
|
||||
</view>
|
||||
<view class="data-item-data">
|
||||
<view class="data-value">
|
||||
<span class="value">{{ subItem.value || "" }}</span>
|
||||
<span class="unit">/{{ subItem.unit || "" }}</span>
|
||||
</view>
|
||||
<view class="data-value">
|
||||
<span class="total">{{ subItem.totalCount || "" }}</span>
|
||||
<span class="total" style="margin-left: 4rpx;">{{
|
||||
subItem.totalCountUnit ? `/${subItem.totalCountUnit}` : "" }}</span>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -252,6 +265,7 @@ export default {
|
||||
profitSharingList: [],// 顶部圆环图右边的数据
|
||||
howDay: "", // 星期几
|
||||
currentMoney: "",// 实时营收
|
||||
currentTotal: "",// 实时营收了多少笔订单
|
||||
page: "/pages/index/index",
|
||||
otherRealData: [],// 其他的实时数据
|
||||
single: "",
|
||||
@ -572,6 +586,14 @@ export default {
|
||||
}
|
||||
this.$util.toNextRoute("navigateTo", "/pages/map/index?type=index");
|
||||
},
|
||||
// 处理一下数据 保留两位小数
|
||||
handleProcessNumber(number) {
|
||||
if (number) {
|
||||
return number.toFixed(2)
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
// 拿到云南 油水电等数据
|
||||
async handleGetYNRealData() {
|
||||
try {
|
||||
@ -588,7 +610,7 @@ export default {
|
||||
label: '油品',
|
||||
icon: 'https://eshangtech.com/cyy_DIB/oilIcon.png',
|
||||
valueKey: 'totalCount',
|
||||
unitKey: 'totalCountUnit'
|
||||
unitKey: 'totalCountUnit',
|
||||
},
|
||||
3000: {
|
||||
label: '加水',
|
||||
@ -605,24 +627,88 @@ export default {
|
||||
5000: {
|
||||
label: '充电',
|
||||
icon: 'https://eshangtech.com/cyy_DIB/chargeIcon.png',
|
||||
valueKey: 'totalTicket',
|
||||
unitKey: 'totalTicketUnit'
|
||||
valueKey: 'totalAmount',
|
||||
unitKey: 'totalAmountUnit',
|
||||
totalKey: "totalTicket",
|
||||
totalKeyUnit: "totalTicketUnit",
|
||||
}
|
||||
};
|
||||
console.log('listlistlistlist', list);
|
||||
// 去拿油品、加水、尿素的数据
|
||||
const OilData = await request.$apiPost("CommercialApi/BigData/GetEnergyRevenueInfo", {
|
||||
DataType: 2000,
|
||||
StatisticsDate: this.nowDay,
|
||||
ShowWY: true,
|
||||
ShowLargeUnit: true,
|
||||
type: "encryption"
|
||||
});
|
||||
if (OilData.Result_Data) {
|
||||
result.push({
|
||||
label: '油品',
|
||||
value: this.handleProcessNumber(Number(OilData.Result_Data.value)),
|
||||
unit: '万元',
|
||||
icon: 'https://eshangtech.com/cyy_DIB/oilIcon.png',
|
||||
totalCount: this.handleProcessNumber(Number(OilData.Result_Data.data)),
|
||||
totalCountUnit: '吨',
|
||||
});
|
||||
}
|
||||
|
||||
const addWaterData = await request.$apiPost("CommercialApi/BigData/GetEnergyRevenueInfo", {
|
||||
DataType: 3000,
|
||||
StatisticsDate: this.nowDay,
|
||||
ShowWY: true,
|
||||
ShowLargeUnit: true,
|
||||
type: "encryption"
|
||||
});
|
||||
if (addWaterData.Result_Data) {
|
||||
result.push({
|
||||
label: '加水',
|
||||
value: this.handleProcessNumber(Number(addWaterData.Result_Data.value)),
|
||||
unit: '万元',
|
||||
icon: 'https://eshangtech.com/cyy_DIB/addWaterIcon.png',
|
||||
totalCount: this.handleProcessNumber(Number(addWaterData.Result_Data.data)),
|
||||
totalCountUnit: '吨',
|
||||
});
|
||||
}
|
||||
|
||||
const UreaData = await request.$apiPost("CommercialApi/BigData/GetEnergyRevenueInfo", {
|
||||
DataType: 4000,
|
||||
StatisticsDate: this.nowDay,
|
||||
ShowWY: true,
|
||||
ShowLargeUnit: true,
|
||||
type: "encryption"
|
||||
});
|
||||
if (UreaData.Result_Data) {
|
||||
result.push({
|
||||
label: '尿素',
|
||||
value: this.handleProcessNumber(Number(UreaData.Result_Data.value)),
|
||||
unit: '万元',
|
||||
icon: 'https://eshangtech.com/cyy_DIB/chargeIcon.png',
|
||||
totalCount: this.handleProcessNumber(Number(UreaData.Result_Data.data)),
|
||||
totalCountUnit: '吨',
|
||||
});
|
||||
}
|
||||
|
||||
if (list && list.length > 0) {
|
||||
list.forEach((item) => {
|
||||
if (item.dataType === 5000) {
|
||||
const config = dataTypeMap[item.dataType];
|
||||
if (config) {
|
||||
result.push({
|
||||
label: config.label,
|
||||
value: this.$util.fmoney(item[config.valueKey]),
|
||||
unit: item[config.unitKey],
|
||||
icon: config.icon
|
||||
icon: config.icon,
|
||||
totalCount: this.$util.fmoney(item[config.totalKey]),
|
||||
totalCountUnit: item[config.totalKeyUnit],
|
||||
});
|
||||
}
|
||||
} else if (item.dataType === 1000) {
|
||||
this.currentTotal = this.handleProcessNumber(Number(item.totalTicket))
|
||||
}
|
||||
});
|
||||
}
|
||||
console.log('resultresultresult', result);
|
||||
this.otherRealData = result;
|
||||
} catch (error) {
|
||||
console.error('获取实时数据失败:', error);
|
||||
@ -930,6 +1016,7 @@ export default {
|
||||
background-image: url("https://eshangtech.com/minTestImg/pageBg.png");
|
||||
background-size: 100% 100%;
|
||||
background-repeat: no-repeat;
|
||||
overflow-y: auto;
|
||||
|
||||
.topBox {
|
||||
width: 100%;
|
||||
@ -1318,62 +1405,6 @@ export default {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.data-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 16rpx;
|
||||
margin-bottom: 24rpx;
|
||||
|
||||
.data-item {
|
||||
background: #fff;
|
||||
padding: 24rpx;
|
||||
border-radius: 16rpx;
|
||||
box-shadow: @shadow;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.data-icon {
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
background: linear-gradient(135deg, #DCE6FF, #EEF3FF);
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 16rpx;
|
||||
|
||||
.icon {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.data-info {
|
||||
flex: 1;
|
||||
|
||||
.data-label {
|
||||
font-size: 24rpx;
|
||||
color: @muted;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.data-value {
|
||||
.value {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #160002;
|
||||
}
|
||||
|
||||
.unit {
|
||||
font-size: 20rpx;
|
||||
color: #A69E9F;
|
||||
margin-left: 4rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.thingBox {
|
||||
@ -1381,23 +1412,37 @@ export default {
|
||||
box-sizing: border-box;
|
||||
padding: 0 32rpx;
|
||||
margin-top: 24rpx;
|
||||
margin-bottom: 24rpx;
|
||||
|
||||
.data-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 16rpx;
|
||||
// display: grid;
|
||||
// grid-template-columns: repeat(2, 1fr);
|
||||
// gap: 16rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.data-item {
|
||||
width: calc(50% - 8rpx);
|
||||
background: #fff;
|
||||
padding: 24rpx;
|
||||
padding: 18rpx 18rpx 18rpx 18rpx;
|
||||
border-radius: 16rpx;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
box-sizing: border-box;
|
||||
// display: flex;
|
||||
// align-items: center;
|
||||
// align-items: flex-start;
|
||||
|
||||
.data-item-top {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.data-icon {
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
background: linear-gradient(135deg, #DCE6FF, #EEF3FF);
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
@ -1411,16 +1456,26 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.data-info {
|
||||
flex: 1;
|
||||
|
||||
.data-label {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
margin-bottom: 8rpx;
|
||||
font-size: 28rpx;
|
||||
color: #160002;
|
||||
font-weight: 600;
|
||||
// margin-bottom: 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.data-item-data {
|
||||
margin-top: 8rpx;
|
||||
// display: flex;
|
||||
// align-items: center;
|
||||
// justify-content: space-between;
|
||||
|
||||
.data-value {
|
||||
// width: 50%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.value {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
@ -1428,9 +1483,16 @@ export default {
|
||||
}
|
||||
|
||||
.unit {
|
||||
font-size: 20rpx;
|
||||
color: #A69E9F;
|
||||
font-size: 24rpx;
|
||||
color: #160002;
|
||||
margin-left: 4rpx;
|
||||
font-weight: 600;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.total {
|
||||
font-size: 24rpx;
|
||||
color: #A69E9F;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1615,18 +1677,21 @@ export default {
|
||||
.funBox {
|
||||
width: calc(100% - 64rpx);
|
||||
margin-left: 32rpx;
|
||||
margin-bottom: calc(100rpx + env(safe-area-inset-bottom));
|
||||
margin-bottom: calc(80px + env(safe-area-inset-bottom));
|
||||
background: #ffffff;
|
||||
border-radius: 16rpx;
|
||||
box-sizing: border-box;
|
||||
padding: 32rpx 24rpx;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 24rpx;
|
||||
padding: 32rpx 0;
|
||||
display: flex;
|
||||
// display: grid;
|
||||
// grid-template-columns: repeat(4, 1fr);
|
||||
// gap: 24rpx;
|
||||
box-shadow: @shadow;
|
||||
|
||||
.funItem {
|
||||
width: 25%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.funItemContent {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user