From 112e2bd2764dd96e1b81439a01882769100b92c1 Mon Sep 17 00:00:00 2001
From: 陶杰 <1378534974@qq.com>
Date: 星期五, 13 十二月 2024 11:04:00 +0800
Subject: [PATCH] 1.子账号相关修改

---
 sub_pages/supplier/sub-account/sub-account-switch-list.vue |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/sub_pages/supplier/sub-account/sub-account-switch-list.vue b/sub_pages/supplier/sub-account/sub-account-switch-list.vue
index 1b7bba3..e21c2c1 100644
--- a/sub_pages/supplier/sub-account/sub-account-switch-list.vue
+++ b/sub_pages/supplier/sub-account/sub-account-switch-list.vue
@@ -32,14 +32,15 @@
 	data() {
 		return {
 			curSubAccount:'',
-			listApi:'/api/supplierSub/sub/all',
+			listApi:'/api/supplierAccount/all',
 		};
 	},
 	onLoad(options) { 
-		this.getCurrentSubAccount()
+		// this.getCurrentSubAccount()
 	},
-	onShow() {
-		this.getList();
+	async onShow() {
+		await this.getList();
+		this.getCurrentSubAccount()
 	},
 	async onPullDownRefresh() {
 		this.getList();
@@ -48,7 +49,12 @@
 
 		getCurrentSubAccount(){
 			const currentInfo = this.$store.state.currentInfo
-			this.curSubAccount=currentInfo?.supplierSub?.id
+			if(this.currentInfo.supplierSub){
+				this.curSubAccount=currentInfo?.supplierSub?.id
+			}else{
+				this.curSubAccount=this.list[0].id
+			}
+			
 		},
 
 		async handleSwitchSubAccount(item) {

--
Gitblit v1.9.3