From 7406be32979e90a730b5a2ac8d392892f71835d2 Mon Sep 17 00:00:00 2001 From: qingyiay <2386314947@qq.com> Date: 星期一, 10 四月 2023 14:53:17 +0800 Subject: [PATCH] 修复称重不显示问题,优化信息提示 --- pages/customer-page/addTo-freightForwarder-driver/addTo-freightForwarder-driver.vue | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-) diff --git a/pages/customer-page/addTo-freightForwarder-driver/addTo-freightForwarder-driver.vue b/pages/customer-page/addTo-freightForwarder-driver/addTo-freightForwarder-driver.vue index ab4c21c..4bf211f 100644 --- a/pages/customer-page/addTo-freightForwarder-driver/addTo-freightForwarder-driver.vue +++ b/pages/customer-page/addTo-freightForwarder-driver/addTo-freightForwarder-driver.vue @@ -16,6 +16,7 @@ <script> import { customerId } from '@/utils/status.js'; +import { mapMutations } from 'vuex'; export default { onLoad(params) { this.role = params.role; @@ -34,6 +35,7 @@ }; }, methods: { + ...mapMutations(['lengthchange']), init() {}, addToHuoDaiOrDriver() { switch (this.role) { @@ -63,18 +65,19 @@ } }, // 閭�璇疯揣浠� - bindHuoDai() { + bindHuoDai() { // this.$reqPost('bindHuoDai', { customerId: this.customerId, name: this.name, phone: this.phone }, 'params').then(res => { - this.$reqPost('bindHuoDai', { name: this.name, phone: this.phone }).then(res => { + this.$reqPost('bindHuoDai', { name: this.name, phone: this.phone }, 'params').then(res => { if (res.code == 0) { - this.$u.toast(res.msg ? res.msg : res.data); + this.$u.toast('娣诲姞鎴愬姛'); setTimeout(() => { uni.navigateBack({ delta: 1 }); }, 1000); + } else { + this.$u.toast(res.msg ? res.msg : '鏈垚鍔熸坊鍔�'); } - console.log('閭�璇疯揣浠�', res); }); }, // 閭�璇峰徃鏈� @@ -82,13 +85,16 @@ this.$reqPost('bindUserFleet', { fleetId: this.fleetId, name: this.name, phone: this.phone, carNo: this.carNo }, 'params').then(res => { console.log('閭�璇峰徃鏈�', res); if (res.code == 0) { - this.$u.toast(res.data?res.data:'鎿嶄綔鎴愬姛'); + this.$u.toast(res.msg ? res.msg : '鎿嶄綔鎴愬姛'); + this.$reqGet('GetUserFleet', { fleetId: this.fleetId }).then(response => { + this.lengthchange(response.data.length); + }); uni.navigateBack({ delta: 1 }); } else { uni.showToast({ - title: res.msg, + title: res.msg ? res.msg : '鎿嶄綔澶辫触', icon: 'null', duration: 2000 }); -- Gitblit v1.9.1