From 169e9b4d59bdd763bb5bd1b5a9b092a1200e327b Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期一, 17 四月 2023 17:37:18 +0800
Subject: [PATCH] 增加原发信息,修复bug

---
 pages/customer-page/customer-my/customer-my.vue |   68 ++++++++++++++++++++++-----------
 1 files changed, 45 insertions(+), 23 deletions(-)

diff --git a/pages/customer-page/customer-my/customer-my.vue b/pages/customer-page/customer-my/customer-my.vue
index 67fdd6b..4558572 100644
--- a/pages/customer-page/customer-my/customer-my.vue
+++ b/pages/customer-page/customer-my/customer-my.vue
@@ -9,8 +9,8 @@
 			<view class="huodai-list">
 				<u-swipe-action>
 					<u-cell-group :border="false">
-						<u-swipe-action-item :options="options1" v-for="(item, index) in huoDaiData" :index="index" :name="item.id" :key="index" @click="deleteHuoDaiClick">
-							<u-cell :title="item.name" value="璇︽儏" @click="toFreightForwarderDetails(item.id)"></u-cell>
+						<u-swipe-action-item :options="options1" v-for="(item, index) in huoDaiData" :index="index" :name="item.userId" :key="index" @click="deleteHuoDaiClick">
+							<u-cell :title="item.name" value="璇︽儏" @click="toFreightForwarderDetails(item.userId)"></u-cell>
 						</u-swipe-action-item>
 					</u-cell-group>
 				</u-swipe-action>
@@ -26,13 +26,14 @@
 				<u-swipe-action>
 					<u-cell-group :border="false">
 						<u-swipe-action-item :options="options1" v-for="(item, index) in fleetData" :index="index" :name="item.id" :key="index" @click="deleteFleetClick">
-							<u-cell :title="item.name" value="25杈�" @click="tofleetDetails(item.id)"></u-cell>
+							<u-cell :title="item.name" :value="item.userSijisum + '杈�'" @click="tofleetDetails(item.id)"></u-cell>
 						</u-swipe-action-item>
 					</u-cell-group>
 				</u-swipe-action>
 			</view>
 		</view>
 
+		<view class="statistics"><u-button text="鍙戣繍缁熻" type="primary" @click="statistics"></u-button></view>
 		<view class="logout"><u-button text="閫�鍑虹櫥褰�" type="primary" @click="logout()"></u-button></view>
 
 		<!-- 鏂板缓杞﹂槦寮瑰嚭妗� -->
@@ -90,7 +91,7 @@
 
 <script>
 import combinedTitle from '@/components/combined-title/combined-title.vue';
-import { customerId ,redirectLogin} from '@/utils/status';
+import { customerId, redirectLogin } from '@/utils/status';
 export default {
 	components: {
 		combinedTitle
@@ -131,25 +132,27 @@
 	},
 	methods: {
 		init() {
-			uni.showLoading({
-				title: '鍔犺浇涓�...'
-			});
 			this.getAllHuoDaiByCustomerId();
 			this.getFleet();
-			uni.hideLoading();
 		},
 		// 鑾峰彇璐т唬鍒楄〃
 		getAllHuoDaiByCustomerId() {
-			this.$reqGet('getAllHuoDaiByCustomerId', { customerId }).then(res => {
+			uni.showLoading({
+				title: '鍔犺浇涓�...'
+			});
+			this.$reqGet('getAllHuoDaiByCustomerId').then(res => {
+				uni.hideLoading();
 				this.huoDaiData = res.data;
-				console.log('璐т唬鍒楄〃', res);
 			});
 		},
 		// 鑾峰彇杞﹂槦鍒楄〃
 		getFleet() {
-			this.$reqGet('getFleet', { customerId }).then(res => {
+			uni.showLoading({
+				title: '鍔犺浇涓�...'
+			});
+			this.$reqGet('getFleet').then(res => {
+				uni.hideLoading();
 				this.fleetData = res.data;
-				console.log('杞﹂槦鍒楄〃', res);
 			});
 		},
 		// 娣诲姞璐т唬
@@ -160,7 +163,6 @@
 		},
 		// 娣诲姞杞﹂槦
 		addFleet() {
-			console.log('娣诲姞杞﹂槦');
 			this.updateGroupShow = true;
 		},
 		addNewFleetPopupClose() {
@@ -177,19 +179,23 @@
 			// 鏂板缓杞﹂槦
 			this.$reqPost('saveFleet', this.addGroupForm, 'params').then(res => {
 				uni.hideLoading();
-				console.log('鏂板缓杞﹂槦', res);
-				this.getFleet();
+				if (res.code == 0) {
+					this.$u.toast('娣诲姞鎴愬姛');
+					this.getFleet();
+				} else {
+					this.$u.toast(res.msg ? res.msg : '娣诲姞澶辫触');
+				}
 			});
 			this.updateGroupShow = false;
 		},
 		// 鍒犻櫎璐т唬
 		deleteHuoDaiClick(args) {
-			console.log(args.name, '璐т唬id');
+			console.log(args, '璐т唬id');
 			this.deleteHuoDaiId = args.name;
 			this.deleteHuoDaiShow = true;
 			this.huoDaiData.forEach(item => {
-				if (item.id == this.deleteHuoDaiId) {
-					this.deleteHuoDaiContent = '纭鍒犻櫎璐т唬' + item.huoDaiName;
+				if (item.userId == this.deleteHuoDaiId) {
+					this.deleteHuoDaiContent = '纭鍒犻櫎璐т唬' + item.name + '鍚楋紵';
 				}
 			});
 		},
@@ -207,9 +213,13 @@
 			this.$reqPost('deleteHuoDai', { id: this.deleteHuoDaiId }, 'params').then(res => {
 				uni.hideLoading();
 				if (res.code == 0) {
-					this.$u.toast('鍒犻櫎鎴愬姛');
+					if (res.data) {
+						this.$u.toast('鍒犻櫎鎴愬姛');
+						this.getAllHuoDaiByCustomerId();
+					} else {
+						this.$u.toast('鍒犻櫎澶辫触');
+					}
 				}
-				this.getAllHuoDaiByCustomerId();
 			});
 		},
 		// 鍒犻櫎杞﹂槦
@@ -238,15 +248,17 @@
 				console.log('鍒犻櫎杞﹂槦', res);
 				if (res.code == 0) {
 					this.$u.toast('鍒犻櫎鎴愬姛');
+				} else {
+					this.$u.toast(res.msg ? res.msg : '鍒犻櫎澶辫触');
 				}
 				uni.hideLoading();
 				this.getFleet();
 			});
 		},
 		// 璐т唬璇︽儏
-		toFreightForwarderDetails(id) {
+		toFreightForwarderDetails(userId) {
 			uni.navigateTo({
-				url: `/pages/customer-page/freight-forwarder-details/freight-forwarder-details?huoDaiId=${id}`
+				url: `/pages/customer-page/freight-forwarder-details/freight-forwarder-details?userId=${userId}`
 			});
 		},
 		// 杞﹂槦璇︽儏
@@ -259,16 +271,26 @@
 			this.logoutShow = true;
 		},
 		logoutConfirm() {
-			redirectLogin()
+			redirectLogin();
 		},
 		logoutCancel() {
 			this.logoutShow = false;
+		},
+		// 璺宠浆鍙戣繍缁熻椤甸潰
+		statistics() {
+			uni.navigateTo({
+				url: '/pages/customer-page/customer-my/faYunstatistics/faYunstatistics'
+			});
 		}
 	}
 };
 </script>
 
 <style lang="scss" scoped>
+.statistics {
+	margin-top: vww(10);
+	margin-bottom: vww(10);
+}
 ::v-deep.customer-my {
 	width: 94%;
 	margin: 0 auto;

--
Gitblit v1.9.1