fix:调整换电调度页面及对接数据

This commit is contained in:
5g0Wp7Zy 2025-06-05 18:01:31 +08:00
parent 4bf261df57
commit 13784f269e
5 changed files with 130 additions and 39 deletions

View File

@ -0,0 +1,77 @@
<!-- components/empty/empty.vue -->
<template>
<view class="empty-container">
<view class="empty-content">
<!-- 图标 -->
<view class="empty-icon" v-if="showIcon">
<image :src="icon" mode="aspectFit" class="empty-image" />
</view>
<!-- 描述 -->
<text class="empty-description">{{ description }}</text>
</view>
</view>
</template>
<script setup>
import { computed } from 'vue';
import staticIcon from "./static_icon.js"
const props = defineProps({
// 'default' | 'error'
type: {
type: String,
default: 'default'
},
//
icon: {
type: String,
default: staticIcon.base64Empty
},
//
description: {
type: String,
default: '这里还没有任何内容'
},
//
showIcon: {
type: Boolean,
default: true
}
});
</script>
<style lang="scss" scoped>
.empty-container {
width: 100%;
height: 100vh;
padding: 60rpx 0;
display: flex;
justify-content: center;
align-items: center;
.empty-content {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
.empty-icon {
width: 240rpx;
height: 240rpx;
margin-bottom: 30rpx;
.empty-image {
width: 100%;
height: 100%;
}
}
.empty-description {
font-size: 28rpx;
color: #999;
}
}
}
</style>

File diff suppressed because one or more lines are too long

View File

@ -172,7 +172,7 @@
"pages": [{ "pages": [{
"path": "takeOrders", "path": "takeOrders",
"style": { "style": {
"navigationBarTitleText": "调度接单" "navigationBarTitleText": "换电接单"
} }
}] }]
}, },

View File

@ -1,60 +1,67 @@
<template> <template>
<view>
<view class="content_wrapper"> <view class="content_wrapper">
<view <view
class="box" class="box"
v-for="(item,index) of 10" v-for="(it,id) of orderList"
:key="index" :key="id"
> >
<!-- 车辆编号 --> <!-- 车辆编号 -->
<view class="row"> <view class="row">
<text class="label">车辆编号</text> <text class="label">车辆编号</text>
<view class="value"> <view class="value">
<text style="margin-right: 30rpx;">100757</text> <text style="margin-right: 30rpx;">{{ it?.bikeCode || '-' }}</text>
<uni-icons type="sound" size="25" style="position: relative;top: 6rpx;" color="blue"></uni-icons> <uni-icons type="sound" size="25" style="position: relative;top: 6rpx;" color="blue"></uni-icons>
</view> </view>
</view> </view>
<!-- 接单原因 --> <!-- 最新电量 -->
<view class="row">
<text class="label">接单原因</text>
<text class="value">23123123123231231231232312312312323123123123231231231232312312312323123123123</text>
</view>
<!-- 中控品牌 -->
<view class="row"> <view class="row">
<text class="label">中控品牌</text> <text class="label">最新电量</text>
<text class="value">-</text> <text class="value">{{ it?.soc || '-' }}</text>
</view> </view>
<!-- 最后骑行时间 -->
<view class="row">
<text class="label">最后骑行时间</text>
<text class="value">{{ it?.latestTimestamep || '-' }}</text>
</view>
<!-- 电量刷新时间 -->
<view class="row">
<text class="label">电量刷新时间</text>
<text class="value">{{ it?.refreshTimestamp || '-' }}</text>
</view>
<!-- 设备位置 --> <!-- 设备位置 -->
<view class="row"> <view class="row">
<text class="label">设备位置</text> <text class="label">设备位置</text>
<view> <view>
<view>查看地图</view> <view>查看地图</view>
<view style="color: darkgrey;font-size: 28rpx;">110.41,123123.11</view> <view style="color: darkgrey;font-size: 28rpx;">{{ (it?.longitude || '-') + ',' + (it?.latitude || '-')}}</view>
</view> </view>
<uni-icons type="right" size="20" class="arrows" color="grey"></uni-icons> <uni-icons type="right" size="20" class="arrows" color="grey"></uni-icons>
</view>
<!-- 设备位置 -->
<view class="row">
<text class="label">设备距离</text>
<text class="value">100757m</text>
</view> </view>
<!-- 删除 --> <!-- 删除 -->
<uni-icons type="trash" size="25" class="deleteBtn" color="orange"></uni-icons> <uni-icons type="trash" size="25" class="deleteBtn" color="orange"></uni-icons>
</view> </view>
<view style="width: 100%;height: 100rpx;"></view> <view style="width: 100%;height: 100rpx;"></view>
<!-- 确认接单按钮 --> <!-- 确认接单按钮 -->
<view class="btn_wrapper"> <view class="btn_wrapper" v-if="orderList.length > 0" >
<button class="btn_style">确认接单</button> <button class="btn_style">确认接单</button>
</view> </view>
</view> </view>
<empty-component v-if="orderList.length === 0" description="无可接单数据"/>
</view>
</template> </template>
<script setup> <script setup>
import { ref } from 'vue'; import { ref } from 'vue';
import { onLoad } from '@dcloudio/uni-app'; import { onLoad } from '@dcloudio/uni-app';
import navigator from '@/utils/navigator.js'; import navigator from '@/utils/navigator.js';
import EmptyComponent from '@/components/empty-component/empty-component.vue';
const orderList = ref([]);
onLoad((options) => { onLoad((options) => {
//TODO: const {changeBatteryArr} = navigator.getParams(options) || [];
orderList.value = changeBatteryArr
}); });
</script> </script>
@ -90,7 +97,7 @@ onLoad((options) => {
} }
.label{ .label{
width: 150rpx; width: 200rpx;
color: gray; color: gray;
} }
@ -134,5 +141,4 @@ onLoad((options) => {
} }
} }
</style> </style>

View File

@ -25,7 +25,9 @@
border-radius: 15px; border-radius: 15px;
background-color: #35374dc2; background-color: #35374dc2;
color: white;" color: white;"
@click="navigator.to('/pages/devops/takeOrders/takeOrders')" @click="navigator.to('/pages/devops/takeOrders/takeOrders',{
changeBatteryArr,
})"
> >
当前范围内可接单车辆 当前范围内可接单车辆
<label style="margin-left: 5px;">{{orderCount}}</label> <label style="margin-left: 5px;">{{orderCount}}</label>
@ -297,6 +299,7 @@
}) })
const showDD = ref(false); const showDD = ref(false);
const changeBatteryArr = ref([]) //
const showDD_LX = ref(1); // 1 2 const showDD_LX = ref(1); // 1 2
const showDD_LX_Max = ref(7); const showDD_LX_Max = ref(7);
const dd_count = ref({ const dd_count = ref({
@ -510,7 +513,6 @@
title: '加载中' title: '加载中'
}); });
map.getOperation(zoneId, (res) => { map.getOperation(zoneId, (res) => {
uni.hideLoading(); uni.hideLoading();
if (!res) return; if (!res) return;
@ -670,7 +672,6 @@
changeArea(selArea, true); changeArea(selArea, true);
} }
// //
function onZoom(lx) { function onZoom(lx) {
switch (lx) { switch (lx) {
@ -718,8 +719,6 @@
}; };
} }
// //
function openChangebatteries() { function openChangebatteries() {
uni.navigateTo({ uni.navigateTo({
@ -750,7 +749,6 @@
showMarker(); showMarker();
} }
// //
function colseBikeInfo() { function colseBikeInfo() {
const { const {
@ -886,9 +884,11 @@
} }
orderCount.value=oData.ordercnt; orderCount.value=oData.ordercnt;
markers.value=oData.arrPoints; markers.value=oData.arrPoints;
} }
const {icnt_2,icnt_0,icnt_1}=oData const {icnt_2,icnt_0,icnt_1,changeBattery}=oData;
console.log(changeBattery);
changeBatteryArr.value=changeBattery;
return {icnt_2,icnt_0,icnt_1}; return {icnt_2,icnt_0,icnt_1};
} }
@ -899,6 +899,7 @@
let showCount=0; let showCount=0;
let arrPoints=[]; let arrPoints=[];
let ordercnt=0; let ordercnt=0;
let changeBattery = [];
arrMakers.map((item,index) => { arrMakers.map((item,index) => {
item = { item = {
...item, ...item,
@ -918,7 +919,10 @@
icnt_2++; icnt_2++;
} }
if(!(lng<=maxLng&&lng>=minLng&&lat<=maxLat&&lat>=minLat) ||soc>quantityCount.value) return; if(!(lng<=maxLng&&lng>=minLng&&lat<=maxLat&&lat>=minLat) ||soc>quantityCount.value) return;
if(soc<=20) ordercnt++; if(soc<=20) {
ordercnt++;
changeBattery.push(item)
};
showCount++; showCount++;
arrPoints.push(map.addMarker_Q(index, item,showCount>maxcnt,lx)); arrPoints.push(map.addMarker_Q(index, item,showCount>maxcnt,lx));
}); });
@ -927,7 +931,7 @@
arrPoints[i]={...arrPoints[i],joinCluster:true} arrPoints[i]={...arrPoints[i],joinCluster:true}
} }
} }
return {icnt_2,icnt_0,icnt_1,showCount,ordercnt,arrPoints}; return {icnt_2,icnt_0,icnt_1,showCount,ordercnt,arrPoints,changeBattery};
} }
function showMarker_DD(lx,maxcnt){ function showMarker_DD(lx,maxcnt){