From ae1aad66a165ee7253bed2127a3b53baa40c2361 Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期三, 17 五月 2023 08:35:33 +0800
Subject: [PATCH] 修复错误,增加验证

---
 pages/customer-page/customer-my/customer-my.vue |   72 +++++++++++++++++++++---------------
 1 files changed, 42 insertions(+), 30 deletions(-)

diff --git a/pages/customer-page/customer-my/customer-my.vue b/pages/customer-page/customer-my/customer-my.vue
index 9c4b348..af45c40 100644
--- a/pages/customer-page/customer-my/customer-my.vue
+++ b/pages/customer-page/customer-my/customer-my.vue
@@ -16,12 +16,14 @@
 									<u-swipe-action-item
 										:options="options1"
 										v-for="(item, index) in huoDaiData"
-										:index="index"
+										:index="item.userId"
 										:name="item.userId"
 										:key="index"
 										@click="deleteHuoDaiClick"
 									>
-										<u-cell :title="item.name" value="璇︽儏" @click="toFreightForwarderDetails(item.userId)"></u-cell>
+										<u-cell :title="item.name" value="璇︽儏" @click="toFreightForwarderDetails(item.userId)">
+											<u-icon name="arrow-right" color="#999999" size="30" slot="right-icon"></u-icon>
+										</u-cell>
 									</u-swipe-action-item>
 								</u-cell-group>
 							</u-swipe-action>
@@ -43,12 +45,14 @@
 									<u-swipe-action-item
 										:options="options1"
 										v-for="(item, index) in fleetData"
-										:index="index"
+										:index="item.id"
 										:name="item.id"
 										:key="index"
 										@click="deleteFleetClick"
 									>
-										<u-cell :title="item.name" :value="item.userSijisum + '杈�'" @click="tofleetDetails(item.id)"></u-cell>
+										<u-cell :title="item.name" :value="item.userSijisum + '杈�'" @click="tofleetDetails(item.id)">
+											<u-icon name="arrow-right" color="#999999" size="30" slot="right-icon"></u-icon>
+										</u-cell>
 									</u-swipe-action-item>
 								</u-cell-group>
 							</u-swipe-action>
@@ -218,15 +222,19 @@
 				title: '鍔犺浇涓�...'
 			});
 			// 鏂板缓杞﹂槦
-			this.$reqPost('saveFleet', this.addGroupForm, 'params').then(res => {
-				uni.hideLoading();
-				if (res.code == 0) {
-					this.$u.toast('娣诲姞鎴愬姛');
+			this.$reqPost('saveFleet', this.addGroupForm, 'params')
+				.then(res => {
+					uni.hideLoading();
+					console.log(res, '鏂板缓杞﹂槦');
+					if (res.code == 0) {
+						this.$u.toast('娣诲姞鎴愬姛');
+					} else {
+						this.$u.toast(res.msg ? res.msg : '娣诲姞澶辫触');
+					}
+				})
+				.then(r => {
 					this.getFleet();
-				} else {
-					this.$u.toast(res.msg ? res.msg : '娣诲姞澶辫触');
-				}
-			});
+				});
 			this.updateGroupShow = false;
 		},
 		// 鍒犻櫎璐т唬
@@ -251,17 +259,18 @@
 			uni.showLoading({
 				title: '鍔犺浇涓�...'
 			});
-			this.$reqPost('deleteHuoDai', { id: this.deleteHuoDaiId }, 'params').then(res => {
-				uni.hideLoading();
-				if (res.code == 0) {
-					if (res.data) {
+			this.$reqPost('deleteHuoDai', { id: this.deleteHuoDaiId }, 'params')
+				.then(res => {
+					uni.hideLoading();
+					if (res.code == 0) {
 						this.$u.toast('鍒犻櫎鎴愬姛');
-						this.getAllHuoDaiByCustomerId();
 					} else {
-						this.$u.toast('鍒犻櫎澶辫触');
+						this.$u.toast(res.msg ? res.msg : '鍒犻櫎澶辫触');
 					}
-				}
-			});
+				})
+				.then(r => {
+					this.getAllHuoDaiByCustomerId();
+				});
 		},
 		// 鍒犻櫎杞﹂槦
 		deleteFleetClick(args) {
@@ -285,16 +294,19 @@
 			uni.showLoading({
 				title: '鍔犺浇涓�...'
 			});
-			this.$reqPost('deleteFleet', { id: this.deleteFleetId }, 'params').then(res => {
-				console.log('鍒犻櫎杞﹂槦', res);
-				if (res.code == 0) {
-					this.$u.toast('鍒犻櫎鎴愬姛');
-				} else {
-					this.$u.toast(res.msg ? res.msg : '鍒犻櫎澶辫触');
-				}
-				uni.hideLoading();
-				this.getFleet();
-			});
+			this.$reqPost('deleteFleet', { id: this.deleteFleetId }, 'params')
+				.then(res => {
+					console.log('鍒犻櫎杞﹂槦', res);
+					if (res.code == 0) {
+						this.$u.toast('鍒犻櫎鎴愬姛');
+					} else {
+						this.$u.toast(res.msg ? res.msg : '鍒犻櫎澶辫触');
+					}
+					uni.hideLoading();
+				})
+				.then(() => {
+					this.getFleet();
+				});
 		},
 		// 璐т唬璇︽儏
 		toFreightForwarderDetails(userId) {

--
Gitblit v1.9.1