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 | 30 +++++++++++++++++++-----------
1 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/mobile/pages/plus/business/index.vue b/mobile/pages/plus/business/index.vue
index 11518c5..c57ae12 100644
--- a/mobile/pages/plus/business/index.vue
+++ b/mobile/pages/plus/business/index.vue
@@ -3,7 +3,8 @@
<!-- 名片展示区域 -->
<view class="content">
<view class="business-card">
- <image style="width: 100%;" @tap="viewPicture(businessImage)" mode="widthFix" :src="businessImage"></image>
+ <image style="width: 100%;" @tap="viewPicture(businessImage)" mode="widthFix" :src="businessImage">
+ </image>
</view>
<!-- 名片操作按钮 -->
@@ -48,7 +49,7 @@
</view>
<!-- 切换名片弹窗 -->
- <Popup :show="popupShow" type="bottom" :mask-click="false">
+ <Popup :show="popupShow" type="bottom" :width="screenWidth" :mask-click="false">
<view class="popup-content">
<view class="popup-header">
<text class="title">选择名片</text>
@@ -58,8 +59,7 @@
<view class="card-item" v-for="(card, index) in businessList" :key="index"
:class="{active: index === current}" @click="selectCard(index)">
<view class="card-preview">
- <view class="card-name">{{card.real_name}}</view>
- <view class="card-company">{{card.company_name}}</view>
+ <image style="width: 650rpx;" :src="card.mp" mode="widthFix"></image>
</view>
<text v-if="index === current" class="icon iconfont icon-check"></text>
</view>
@@ -91,6 +91,7 @@
search: '',
businessImage: '',
height: 0,
+ screenWidth: 0, // 屏幕宽度
popupShow: false
};
},
@@ -118,10 +119,14 @@
this.getbusinessList();
//this.getStatistics();
this.getVisitorList();
+ const systemInfo = uni.getSystemInfoSync()
+ this.screenWidth = systemInfo.screenWidth * 2 - 70;
},
getbusinessList() {
let _this = this;
- _this._post('plus.business.business/getList', {}, 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)
@@ -138,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) {
@@ -193,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() {
@@ -208,7 +216,7 @@
menus: ['shareAppMessage', 'shareTimeline'],
title: `${this.businessList[this.current].name}的电子名片`,
path: `/pages/plus/business/detail?business_card_id=${this.businessList[this.current].business_card_id}&referee_id=${this.getUserId()}`,
- complete:function(res){
+ complete: function(res) {
console.log(res);
}
});
--
Gitblit v1.9.2