zbb 5 ساعت پیش
والد
کامیت
2caf1eb5a8
7فایلهای تغییر یافته به همراه49 افزوده شده و 37 حذف شده
  1. 2 3
      components/shareButton/index.vue
  2. 10 3
      components/user-card/index.vue
  3. 1 1
      config/index.js
  4. 8 7
      pages/index/index.vue
  5. 14 15
      pages/mine/card.vue
  6. 2 2
      pages/mine/userCard.vue
  7. 12 6
      pages/splash/splash.vue

+ 2 - 3
components/shareButton/index.vue

@@ -23,7 +23,7 @@
 	} = storeToRefs(userStore)
 	onShareAppMessage(() => {
 		return {
-			path: `pages/splash/splash?userId=${cardInfo.value.userId}&currentIndex=${currentIndex.value}`,
+			path: `pages/splash/splash?userId=${cardInfo.value.userId}&currentId=${cardInfo.value.companyDTO.id}`,
 			userName: '小程序',
 			imageUrl: cardImage.value
 		};
@@ -33,7 +33,7 @@
 <style lang="scss" scoped>
 	.control-card {
 		background-color: #fff;
-		border-radius: 0 0 24rpx 24rpx;
+		border-radius: 0 24rpx 24rpx 24rpx;
 		position: relative;
 		z-index: 1;
 		bottom: 24rpx;
@@ -41,7 +41,6 @@
 		align-items: center;
 		justify-content: space-around;
 		padding: 48rpx 40rpx 24rpx;
-
 		.item {
 			display: flex;
 			width: 100%;

+ 10 - 3
components/user-card/index.vue

@@ -21,9 +21,8 @@
 		<!-- 左下:联系方式 -->
 		<view class="user-contact">
 			<view class="contact-row" @click="onCall">
-				<uni-icons type="phone" :size="18" color="#666666"></uni-icons>
-				<text style="flex: none;" class="contact-text">{{ info.phonenumber || '暂无电话' }}</text>
-				<text v-if="info.phonenumber" class="call-btn">拨打</text>
+				<uni-icons type="phone" :size="18" :color="isCall ? '#155DFC' : '#666666'"></uni-icons>
+				<text style="flex: none;" class="contact-text" :class="{'call-highlight': isCall}">{{ info.phonenumber || '暂无电话' }}</text>
 			</view>
 			<view class="contact-row">
 				<uni-icons type="email" :size="18" color="#666666"></uni-icons>
@@ -44,6 +43,10 @@
 		info: {
 			type: Object,
 			default: () => ({})
+		},
+		isCall:{
+			type: Boolean,
+			default: false
 		}
 	})
 
@@ -158,6 +161,10 @@
 					border-radius: 20rpx;
 					line-height: 1.6;
 				}
+
+				.call-highlight {
+					color: #155DFC;
+				}
 			}
 		}
 

+ 1 - 1
config/index.js

@@ -4,7 +4,7 @@
  */
 
 // 手动修改此处切换环境:development | test | production
-const CURRENT_ENV = 'development'
+const CURRENT_ENV = 'production'
 
 // 同步导入所有环境配置
 import developmentConfig from './env.development.js'

+ 8 - 7
pages/index/index.vue

@@ -13,11 +13,11 @@
 
 		<!-- 名片轮播 -->
 		<view class="page-top" :class="{activeCard:pageIn}">
-			<swiper class="card-swiper" :current="currentIndex" @change="onSwiperChange" circular
-				:indicator-dots="false" :autoplay="false">
+			<swiper class="card-swiper" :current="currentIndex" @change="onSwiperChange" :indicator-dots="false"
+				:autoplay="false" :next-margin="'12rpx'">
 				<swiper-item v-for="(card, idx) in cardList" :key="card.userId || idx">
-					<view class="swiper-item-wrapper">
-						<UserCard :info="card" @call="makeCall" />
+					<view class="swiper-item-wrapper" :style="{'padding-right':cardList.length - 1 == currentIndex ? 0: '10rpx'}">
+						<UserCard :info="card" @call="makeCall" :isCall="false" />
 					</view>
 				</swiper-item>
 			</swiper>
@@ -80,13 +80,13 @@
 	})
 	const loading = ref(false)
 
-	const onSwiperChange =  (e) => {
+	const onSwiperChange = (e) => {
 		userStore.setCurrentIndex(e.detail.current)
 	}
 
 	onShareAppMessage(() => {
 		return {
-			path: `pages/splash/splash?userId=${cardInfo.value.userId}&currentIndex=${currentIndex.value}`,
+			path: `pages/splash/splash?userId=${cardInfo.value.userId}&currentId=${cardInfo.value.companyDTO.id}`,
 			imageUrl: cardImage.value,
 			title: `${cardInfo.value.nickName} 向你分享了名片`
 		};
@@ -204,7 +204,8 @@
 
 	// 名片轮播
 	.card-swiper {
-		height: 392rpx;
+		height: 400rpx;
+		overflow: visible;
 		position: relative;
 		z-index: 2;
 	}

+ 14 - 15
pages/mine/card.vue

@@ -10,21 +10,16 @@
 		</NavBar>
 		<!-- 名片轮播 -->
 		<view class="page-top" :class="{activeCard:pageIn}">
-			<swiper
-				class="card-swiper"
-				:current="currentIndex"
-				@change="onSwiperChange"
-				circular
-				:indicator-dots="false"
-				:autoplay="false"
-			>
+			<swiper class="card-swiper" :current="currentIndex" @change="onSwiperChange" :indicator-dots="false"
+				:autoplay="false" :next-margin="'12rpx'">
 				<swiper-item v-for="(card, idx) in cardList" :key="card.userId || idx">
-					<view class="swiper-item-wrapper">
-						<UserCard :info="card" @call="makeCall" />
-						<ShareButton />
+					<view class="swiper-item-wrapper"
+						:style="{'padding-right':cardList.length - 1 == currentIndex ? 0: '10rpx'}">
+						<UserCard :info="card" @call="makeCall" :isCall="false"/>
 					</view>
 				</swiper-item>
 			</swiper>
+			<ShareButton />
 		</view>
 		<view class="card-content" :class="{activeCard:pageIn}">
 			<!-- 企业简介 -->
@@ -64,9 +59,9 @@
 
 	onShareAppMessage(() => {
 		return {
-			path: `pages/splash/splash?userId=${cardInfo.value.userId}&currentIndex=${currentIndex.value}`,
+			path: `pages/splash/splash?userId=${cardInfo.value.userId}&currentId=${cardInfo.value.companyDTO.id}`,
 			imageUrl: cardImage.value,
-			title:`${cardInfo.value.nickName} 向你分享了名片`
+			title: `${cardInfo.value.nickName} 向你分享了名片`
 		};
 	});
 
@@ -101,6 +96,7 @@
 	.card-container {
 		background: #f5f6f8;
 	}
+
 	.left-title {
 		font-size: 44rpx;
 		font-weight: bold;
@@ -189,7 +185,10 @@
 
 	// 名片轮播
 	.card-swiper {
-		height: 550rpx;
+		height: 400rpx;
+		overflow: visible;
+		position: relative;
+		z-index: 2;
 	}
 
 	// 轮播索引指示器
@@ -233,4 +232,4 @@
 		transform: none !important;
 		transition: all 0.3s cubic-bezier(.68, -0.55, .265, 1.55);
 	}
-</style>
+</style>

+ 2 - 2
pages/mine/userCard.vue

@@ -10,7 +10,7 @@
 		</NavBar>
 		<!-- 名片卡片 -->
 		<view class="page-top" :class="{activeCard:pageIn}">
-			<UserCard :info="cardInfo" @call="makeCall" />
+			<UserCard :info="cardInfo" @call="makeCall" :isCall="true"/>
 		</view>
 		<view class="card-content" :class="{activeCard:pageIn}">
 			<!-- 企业简介 -->
@@ -66,7 +66,7 @@
 	onShareAppMessage(() => {
 		return {
 			userName: '小程序',
-			path: `pages/splash/splash?userId=${cardInfo.value.userId}&currentIndex=${currentIndex.value}`,
+			path: `pages/splash/splash?userId=${cardInfo.value.userId}&currentId=${cardInfo.value.companyDTO.id}`,
 			imageUrl: cardImage.value
 		};
 	});

+ 12 - 6
pages/splash/splash.vue

@@ -47,13 +47,13 @@
 	})
 
 	onLoad((options) => {
-		initApp(options?.userId, options?.currentIndex)
+		initApp(options?.userId, options?.currentId)
 	})
 
 	/**
 	 * 初始化应用
 	 */
-	const initApp = async (userId = null, currentIndex=0) => {
+	const initApp = async (userId = null, currentId = null) => {
 		try {
 			const loginToggle = isLogin() || !!userId
 			if (!loginToggle) {
@@ -64,10 +64,16 @@
 				return
 			}
 			if (loginToggle) {
-				await userStore.queryCardInfo(userId)
-				// 如果有 currentIndex 参数,在数据加载完成后设置索引
-				if (currentIndex !== undefined) {
-					userStore.setCurrentIndex(Number(currentIndex))
+				let userList = await userStore.queryCardInfo(userId)
+				// 如果有 currentId 参数,在数据加载完成后设置索引
+				if (!!currentId) {
+					let num = 0
+					try {
+						num = userList.findLastIndex(item => item.companyDTO.id == currentId) || 0
+					} catch (err) {
+						num = 0
+					}
+					userStore.setCurrentIndex(num)
 				}
 				await userStore.queryCardPoster()
 				uni.reLaunch({