From 204b4cb1fcf1234010f722e0c9d4e88d10e654b1 Mon Sep 17 00:00:00 2001
From: quanwei <419654421@qq.com>
Date: Thu, 30 Oct 2025 19:03:39 +0800
Subject: [PATCH] 切换默认名片

---
 mobile/pages/plus/business/index.vue |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/mobile/pages/plus/business/index.vue b/mobile/pages/plus/business/index.vue
index 5c84f96..c57ae12 100644
--- a/mobile/pages/plus/business/index.vue
+++ b/mobile/pages/plus/business/index.vue
@@ -120,11 +120,13 @@
 				//this.getStatistics();
 				this.getVisitorList();
 				const systemInfo = uni.getSystemInfoSync()
-				this.screenWidth=systemInfo.screenWidth*2-70;
+				this.screenWidth = systemInfo.screenWidth * 2 - 70;
 			},
 			getbusinessList() {
 				let _this = this;
-				_this._post('plus.business.business/getList', {user_id:uni.removeStorageSync('user_id')}, function(res) {
+				_this._post('plus.business.business/getList', {
+					user_id: uni.removeStorageSync('user_id')
+				}, function(res) {
 					_this.businessList = res.data.data;
 					if (_this.businessList.length > 0) {
 						_this.getbusiness(_this.businessList[_this.current].user_id)
@@ -141,11 +143,14 @@
 				});
 			},
 
-			getStatistics() {
-				// 获取统计数据
+			getStatistics(business_card_id) {
+				// 默认名片
 				let _this = this;
-				_this._post('plus.business.business/getStatistics', {}, function(res) {
-					_this.statistics = res.data;
+				_this._post('plus.business.business/editDefault', {
+					business_card_id: business_card_id
+				}, function(res) {
+					_this.getbusinessList();
+					_this.getVisitorList();
 				});
 			},
 			getbusiness(user_id) {
@@ -196,7 +201,7 @@
 			},
 			selectCard(index) {
 				this.current = index;
-				this.getCardStatistics(this.businessList[this.current].business_card_id);
+				this.getStatistics(this.businessList[this.current].business_card_id);
 				this.closePopup();
 			},
 			addNewCard() {

--
Gitblit v1.9.2