From f226d5fe6327e31bb471a96b7370cf94689c6608 Mon Sep 17 00:00:00 2001
From: quanwei <419654421@qq.com>
Date: Fri, 31 Oct 2025 16:54:48 +0800
Subject: [PATCH] 名片设置 名片置顶 名片分享

---
 mobile/pages/plus/business/detail.vue |   81 +++++++++++++++++++++++++---------------
 1 files changed, 50 insertions(+), 31 deletions(-)

diff --git a/mobile/pages/plus/business/detail.vue b/mobile/pages/plus/business/detail.vue
index b51d445..1accef6 100644
--- a/mobile/pages/plus/business/detail.vue
+++ b/mobile/pages/plus/business/detail.vue
@@ -1,10 +1,9 @@
 <template>
 	<view>
-		<header-bar title="名片详情" :isBack="true" @click="back"></header-bar>
 		<scroll-view scroll-y="true" class="scroll-view">
 			<view class="card-container" v-if="businessInfo">
 				<!-- 名片主体 -->
-				<view class="business-card">
+				<view class="business-card" @click="viewCard">
 					<image class="card-image" :src="businessInfo.mp" mode="widthFix"></image>
 				</view>
 
@@ -22,10 +21,10 @@
 						<text class="btn-icon">📍</text>
 						<text class="btn-text">导航地址</text>
 					</view>
-					<view class="action-btn" @click="shareCard">
+					<button open-type="share" class="action-btn">
 						<text class="btn-icon">➤</text>
 						<text class="btn-text">分享名片</text>
-					</view>
+					</button>
 				</view>
 
 				<!-- 名片简介 -->
@@ -41,12 +40,12 @@
 				</view>
 
 				<!-- 数字资产卡片 -->
-				<view class="asset-cards" @click="goToPlatform">
-					<view class="asset-card">
-						<image class="asset-img" src="/static/background_top.png" mode="aspectFill"></image>
+				<view class="asset-cards">
+					<view class="asset-card" @click="goToPlatform">
+						<image class="asset-img" :src="background.digital_asset_1" mode="aspectFill"></image>
 					</view>
 					<view class="asset-card" @click="goToShop">
-						<image class="asset-img" src="/static/haggle.png" mode="aspectFill"></image>
+						<image class="asset-img" :src="background.digital_asset_2" mode="aspectFill"></image>
 					</view>
 				</view>
 
@@ -75,18 +74,6 @@
 						v-if="businessInfo.duties && businessInfo.duties.length > 0">{{ businessInfo.duties[0] }}</text>
 					<text class="price">¥{{ businessInfo.grade.price }}</text>
 				</view>
-				<!-- <view class="payment-methods">
-					<view class="method-item" :class="{ active: paymentMethod === 'balance' }"
-						@tap="selectPaymentMethod('balance')">
-						<text class="method-name">联盟币支付</text>
-						<text class="iconfont icon-check" v-if="paymentMethod === 'balance'"></text>
-					</view>
-					<view class="method-item" :class="{ active: paymentMethod === 'wechat' }"
-						@tap="selectPaymentMethod('wechat')">
-						<text class="method-name">微信支付</text>
-						<text class="iconfont icon-check" v-if="paymentMethod === 'wechat'"></text>
-					</view>
-				</view> -->
 				<view class="modal-footer">
 					<view class="cancel-btn" @tap="closePaymentModal">取消</view>
 					<view class="confirm-btn" @tap="confirmPayment">确认</view>
@@ -106,7 +93,8 @@
 				// 支付相关
 				showPayment: false,
 				selectedGrade: {},
-				paymentMethod: 'balance'
+				paymentMethod: 'balance',
+				background: {}
 			};
 		},
 		onLoad(options) {
@@ -116,10 +104,27 @@
 				// 记录访问日志
 				this.recordVisit();
 			}
+			this.getSettingBackground()
 		},
 		methods: {
 			back() {
 				uni.navigateBack();
+			},
+			viewCard() {
+				let _this = this
+				// 预览图片
+				uni.previewImage({
+					urls: [_this.businessInfo.mp],
+					complete: function(res) {
+						console.log(res);
+					}
+				})
+			},
+			getSettingBackground() {
+				let _this = this;
+				_this._post('plus.business.setting/getBackground', {}, function(res) {
+					_this.background = res.data
+				})
 			},
 			// 获取名片详情
 			getBusinessDetail() {
@@ -130,7 +135,6 @@
 				}, function(res) {
 					_this.businessInfo = res.data;
 					_this.loading = false;
-
 					// 设置默认选中的等级
 					if (_this.businessInfo.grade && _this.businessInfo.grade.length > 0) {
 						_this.selectedGrade = _this.businessInfo.grade;
@@ -174,16 +178,17 @@
 			},
 			// 打开地图
 			openLocation(businessInfo) {
-				let address = businessInfo.region.province + ' ' + businessInfo.region.city + ' ' + businessInfo.region.region + ' ' + businessInfo.address
+				let address = businessInfo.region.province + ' ' + businessInfo.region.city + ' ' + businessInfo.region
+					.region + ' ' + businessInfo.address
 				if (!address) {
 					this.showError('暂无地址信息');
 					return;
 				}
-				
+
 				// 使用腾讯地图API进行地理编码
 				const apiKey = 'LS7BZ-NHSWK-CWOJQ-AJC7Y-H5HE2-UGBWR';
 				const url = `https://apis.map.qq.com/ws/geocoder/v1/?address=${encodeURIComponent(address)}&key=${apiKey}`;
-				
+
 				uni.request({
 					url: url,
 					success: (res) => {
@@ -229,19 +234,31 @@
 			// 跳转到平台
 			goToPlatform() {
 				uni.navigateTo({
-					url: '/pages/plus/business/platform'
+					url: '/pages/shop/shop?shop_supplier_id=1'
 				});
 			},
 			// 跳转到店铺
 			goToShop() {
-				uni.navigateTo({
-					url: '/pages/plus/business/shop'
+				let _this = this;
+				_this._post('store.store/getUserStore', {
+					user_id: _this.businessInfo.user_id
+				}, function(res) {
+					if (res.data.list) {
+						uni.navigateTo({
+							url: '/pages/shop/shop?shop_supplier_id=' + res.data.list.shop_supplier_id
+						});
+					} else {
+						_this.showError('该用户暂无店铺')
+					}
+					/* uni.navigateTo({
+						url: '/pages/shop/shop?shop_supplier_id=1'
+					}); */
 				});
 			},
 			// 新建数字名片
 			createNewCard() {
 				uni.navigateTo({
-					url: '/pages/plus/business/create'
+					url: '/pages/plus/business/add'
 				});
 			},
 			// 购买名片
@@ -284,7 +301,7 @@
 		onShareAppMessage() {
 			if (this.businessInfo) {
 				return {
-					title: `${this.businessInfo.real_name}的电子名片`,
+					title: `${this.businessInfo.name}的电子名片`,
 					path: `/pages/plus/business/detail?business_card_id=${this.business_card_id}&referee_id=${this.getUserId()}`
 				};
 			}
@@ -296,7 +313,7 @@
 		onShareTimeline() {
 			if (this.businessInfo) {
 				return {
-					title: `${this.businessInfo.real_name}的电子名片`,
+					title: `${this.businessInfo.name}的电子名片`,
 					path: `/pages/plus/business/detail?business_card_id=${this.business_card_id}&referee_id=${this.getUserId()}`
 				};
 			}
@@ -420,6 +437,8 @@
 			flex-direction: column;
 			align-items: center;
 			flex: 1;
+			line-height: normal;
+			background: #ffffff00;
 
 			.btn-icon {
 				font-size: 56rpx;

--
Gitblit v1.9.2