From 78252f8407345ffceed8157a1c1685c09cdec029 Mon Sep 17 00:00:00 2001 From: yangan <yangan0921@163.com> Date: 星期五, 02 八月 2024 09:16:52 +0800 Subject: [PATCH] docs:再生体验版发布 --- pages/customer-page/addTo-freightForwarder-driver/addTo-freightForwarder-driver.vue | 33 ++++++++++++++++++++++++--------- 1 files changed, 24 insertions(+), 9 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 20b85db..8b402c9 100644 --- a/pages/customer-page/addTo-freightForwarder-driver/addTo-freightForwarder-driver.vue +++ b/pages/customer-page/addTo-freightForwarder-driver/addTo-freightForwarder-driver.vue @@ -5,12 +5,14 @@ <u--form labelPosition="top" ref="form1"> <u-form-item labelWidth="20%" label="濮撳悕" ref="item1"><u--input v-model="name" :customStyle="{ border: '1px solid #dddddd' }"></u--input></u-form-item> <u-form-item labelWidth="25%" label="鎵嬫満鍙�" ref="item1"><u--input v-model="phone" :customStyle="{ border: '1px solid #dddddd' }"></u--input></u-form-item> - <u-form-item labelWidth="25%" label="姹借溅杞︾墝鍙�" ref="item1" v-if="role == 2"> - <u--input v-model="carNo" :customStyle="{ border: '1px solid #dddddd' }"></u--input> - </u-form-item> +<!-- <u-form-item labelWidth="25%" label="姹借溅杞︾墝鍙�" ref="item1" v-if="role == 2"> + <u--input v-model="carNo" :customStyle="{ border: '1px solid #dddddd' }"></u--input> + </u-form-item>--> </u--form> </view> - <view class="addBtn"><u-button text="閭�璇�" type="primary" @click="addToHuoDaiOrDriver"></u-button></view> + <view class="addBtn"> + <u-button text="閭�璇�" :loading="yaoqingLoading" type="primary" @click="addToHuoDaiOrDriver"></u-button> + </view> </view> </template> @@ -31,7 +33,8 @@ name: '', phone: '', carNo: '', - customerId + customerId, + yaoqingLoading: false, //閭�璇穕oading }; }, methods: { @@ -51,7 +54,7 @@ } break; case '2': - if (this.name == '' || this.phone == '' || this.carNo == '') { + if (this.name == '' || this.phone == '') { uni.showToast({ title: '璇疯鑼冭緭鍏ワ紒', icon: 'error', @@ -66,9 +69,11 @@ }, // 閭�璇疯揣浠� bindHuoDai() { + this.yaoqingLoading = true // this.$reqPost('bindHuoDai', { customerId: this.customerId, name: this.name, phone: this.phone }, 'params').then(res => { this.$reqPost('bindHuoDai', { name: this.name, phone: this.phone }, 'params').then(res => { if (res.code == 0) { + this.yaoqingLoading = false this.$u.toast('娣诲姞鎴愬姛'); setTimeout(() => { uni.navigateBack({ @@ -78,13 +83,19 @@ } else { this.$u.toast(res.msg ? res.msg : '鏈垚鍔熸坊鍔�'); } - }); + }).catch(() => { + this.yaoqingLoading = false + }).finally(() => { + this.yaoqingLoading = false + }); }, // 閭�璇峰徃鏈� bindUserFleet() { + this.yaoqingLoading = true 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.yaoqingLoading = false this.$u.toast(res.msg ? res.msg : '鎿嶄綔鎴愬姛'); this.$reqGet('GetUserFleet', { fleetId: this.fleetId }).then(response => { this.lengthchange(response.data.length); @@ -94,12 +105,16 @@ }); } else { uni.showToast({ - title: res.msg, + title: res.msg ? res.msg : '鎿嶄綔澶辫触', icon: 'null', duration: 2000 }); } - }); + }).catch(() => { + this.yaoqingLoading = false + }).finally(() => { + this.yaoqingLoading = false + }); } } }; -- Gitblit v1.9.1