From f3288edb3b2f0e0e89cc28d719a1f83462459f33 Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期三, 26 七月 2023 17:22:16 +0800
Subject: [PATCH] 修改发运统计错误
---
pages/driver-page/drvier-my/drvier-my.vue | 14 ++++++++++----
pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue | 32 +++++++++++++++++++++-----------
2 files changed, 31 insertions(+), 15 deletions(-)
diff --git a/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue b/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue
index 17f7386..546ebb2 100644
--- a/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue
+++ b/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue
@@ -10,7 +10,7 @@
<view class="content-num">鍙戣繍杞︽暟</view>
</view>
<view class="content-text">
- <view class="content-container">{{ totalTon.toFixed(2) }}</view>
+ <view class="content-container">{{totalTon}}</view>
<view class="content-num">鍙戣繍鍚ㄦ暟</view>
</view>
</view>
@@ -42,13 +42,12 @@
<view class="card-top">
<view class="left"><combined-title :title="item.condition"></combined-title></view>
<view class="card-top_num">
- {{ item.taskCoalList.length }}杞{
- item.taskCoalList
+ {{ item.taskCoalList.length }}杞�
+ {{Number(item.taskCoalList
.reduce((prev, cur) => {
+ cur.clean=cur.clean||0
return prev + cur.clean;
- }, 0)
- .toFixed(2)
- }}鍚�
+ }, 0)).toFixed(2)}}鍚�
</view>
</view>
<view class="card-main"
@@ -66,7 +65,7 @@
</view>
</view>
<view class="main-divider"></view>
- <view class="point-number">{{ value.clean.toFixed(2) || 0 }}</view>
+ <view class="point-number">{{ Number(value.clean).toFixed(2) || 0 }}</view>
</view>
<view class="first-extra">
<view class="main-information">
@@ -279,6 +278,7 @@
</template>
<script>
+ import BigNumber from "bignumber.js"
import combinedTitle from '@/components/combined-title/combined-title.vue';
import { onlineurl } from '@/api/request.js'
export default {
@@ -431,10 +431,15 @@
this.totalLength = this.filterList.map(v => v.taskCoalList.length).reduce((x, y) => x + y);
this.totalTon = this.filterList.map(v =>
v.taskCoalList.reduce((prev, cur) => {
- return cur.clean + prev;
+ const cleanvalue = cur.clean || 0
+ return cleanvalue + prev
}, 0)
);
- this.totalTon = this.totalTon.reduce((x, y) => x + y);
+ this.totalTon = this.totalTon.reduce((x, y) => {
+ let xx = new BigNumber(x)
+ let yy = new BigNumber(y)
+ return xx.plus(yy).toNumber().toFixed(2)
+ }, new BigNumber(0));
} else {
this.totalLength = 0;
this.totalTon = 0;
@@ -507,10 +512,15 @@
this.totalLength = this.filterList.map(v => v.taskCoalList.length).reduce((x, y) => x + y);
this.totalTon = this.filterList.map(v =>
v.taskCoalList.reduce((prev, cur) => {
- return cur.clean + prev;
+ const cleanvalue = cur.clean || 0
+ return cleanvalue + prev
}, 0)
);
- this.totalTon = this.totalTon.reduce((x, y) => x + y);
+ this.totalTon = this.totalTon.reduce((x, y) => {
+ let xx = new BigNumber(x)
+ let yy = new BigNumber(y)
+ return xx.plus(yy).toNumber().toFixed(2)
+ }, new BigNumber(0));
} else {
this.totalLength = 0;
this.totalTon = 0;
diff --git a/pages/driver-page/drvier-my/drvier-my.vue b/pages/driver-page/drvier-my/drvier-my.vue
index dcb8171..27c9a74 100644
--- a/pages/driver-page/drvier-my/drvier-my.vue
+++ b/pages/driver-page/drvier-my/drvier-my.vue
@@ -117,12 +117,12 @@
<view class="label-text">杞﹀ご杞﹀熬杞﹁韩鐓х墖</view>
</view>
<view class="img-container"
- v-for="item in userInfo.bodyofcarJpg?userInfo.bodyofcarJpg.split(','):[]">
+ v-for="item in userInfo.bodyCarImg">
<u--image :showLoading="true"
- :src="item.url ? item.url : ''"
+ :src="BaseUrl+item"
width="80px"
height="80px"
- @click="imageClickCarBody(item.url)">
+ @click="imageClickCarBody(item)">
<view slot="error"
style="font-size: 24rpx;">鍔犺浇澶辫触</view>
</u--image>
@@ -496,6 +496,9 @@
this.$reqGet('getUserEntity').then(res => {
uni.hideLoading();
this.editUserInfo = this.userInfo = res.data;
+ this.userInfo.bodyCarImg = this.userInfo.bodyofcarJpg ? this.userInfo.bodyofcarJpg.split(',') :
+ [];
+ console.log(this.userInfo.bodyCarImg);
this.editUserInfo.password = ""
uni.setStorageSync('carImg', this.userInfo.carImg);
uni.setStorageSync('drivingImg', this.userInfo.drivingImg);
@@ -545,6 +548,9 @@
},
imageClickCarBody(url) {
this.previewImageSrc = url;
+ this.$nextTick(() => {
+ this.previewImageShow = true;
+ });
},
beforeRead() {
this.changeisUploadimg(true);
@@ -888,7 +894,7 @@
.editDriverPopup-container {
.u-popup {
.u-transition {
- height: 75%;
+ height: 80%;
.u-popup__content {
overflow: scroll !important;
--
Gitblit v1.9.1