|
|
@@ -2,53 +2,20 @@
|
|
|
<scroll-view class="card-container" scroll-y @scroll="onScroll" :scroll-top="0">
|
|
|
|
|
|
<!-- 顶部背景 -->
|
|
|
- <image class="top-bg" src="/static/image/home/top-bg.png" />
|
|
|
-
|
|
|
- <NavBar :title="'首页'" :show_back="false" :color="'#fff'" :fixed="true" :bgImg="'/static/image/home/top-bg.png'" :bg="'transparent'">
|
|
|
+
|
|
|
+ <NavBar :title="'首页'" :show_back="false" :color="'#fff'" :fixed="true" :bgImg="'/static/image/home/top-bg.png'"
|
|
|
+ :bg="'transparent'">
|
|
|
<template #left>
|
|
|
<!-- <view class="left-title">{{appName}}</view> -->
|
|
|
</template>
|
|
|
</NavBar>
|
|
|
- <!-- 名片卡片 -->
|
|
|
- <view class="page-top">
|
|
|
- <view class="user-card" id="user-card">
|
|
|
- <!-- 背景图 -->
|
|
|
- <image class="user-card-bg" src="/static/image/home/usecard-bg.png" />
|
|
|
-
|
|
|
- <!-- 左上:姓名 + 职位 -->
|
|
|
- <view class="user-header">
|
|
|
- <view class="name-row">
|
|
|
- <text class="user-name">{{ cardInfo.nickName || '用户' }}</text>
|
|
|
- <text class="user-role">{{ cardInfo.postName || '职位' }}</text>
|
|
|
- </view>
|
|
|
- <text class="company-name">{{ cardInfo.companyName || '公司名称' }}</text>
|
|
|
- </view>
|
|
|
-
|
|
|
- <!-- 右上:头像 -->
|
|
|
- <view class="avatar-wrapper">
|
|
|
- <UserAvatar :src="cardInfo.avatar" :name="cardInfo.nickName" :size="142"
|
|
|
- :badge-src="'/static/image/public/badge-icon.png'" :badge-size="56" />
|
|
|
- </view>
|
|
|
-
|
|
|
- <!-- 左下:联系方式 -->
|
|
|
- <view class="user-contact">
|
|
|
- <view class="contact-row" @click="makeCall">
|
|
|
- <uni-icons type="phone" :size="18" color="#666666"></uni-icons>
|
|
|
- <text class="contact-text">{{ cardInfo.phonenumber || '暂无电话' }}</text>
|
|
|
- </view>
|
|
|
- <view class="contact-row">
|
|
|
- <uni-icons type="email" :size="18" color="#666666"></uni-icons>
|
|
|
- <text class="contact-text">{{ cardInfo.email || '暂无邮箱' }}</text>
|
|
|
- </view>
|
|
|
- <view class="contact-row">
|
|
|
- <uni-icons type="location" :size="18" color="#666666"></uni-icons>
|
|
|
- <text class="contact-text">{{ cardInfo.companyAddress || '暂无地址' }}</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ <image class="top-bg" src="/static/image/home/top-bg.png" />
|
|
|
+ <!-- 名片卡片:果冻弹入 -->
|
|
|
+ <view class="page-top" :style="cardStyle">
|
|
|
+ <UserCard :info="cardInfo" @call="makeCall" />
|
|
|
<ShareButton />
|
|
|
</view>
|
|
|
- <view class="card-content">
|
|
|
+ <view class="card-content" :style="contentCardStyle">
|
|
|
<!-- 企业简介 -->
|
|
|
<CompanyIntroduce></CompanyIntroduce>
|
|
|
</view>
|
|
|
@@ -66,6 +33,7 @@
|
|
|
<script setup>
|
|
|
import {
|
|
|
ref,
|
|
|
+ computed,
|
|
|
onMounted
|
|
|
} from 'vue'
|
|
|
import {
|
|
|
@@ -76,6 +44,7 @@
|
|
|
import EmptyState from '@/components/empty-state/index.vue'
|
|
|
import ShareButton from '@/components/shareButton/index.vue'
|
|
|
import CompanyIntroduce from '@/components/companyIntroduce/index.vue'
|
|
|
+ import UserCard from '@/components/user-card/index.vue'
|
|
|
import {
|
|
|
useUserStore
|
|
|
} from '@/store/modules/user.js'
|
|
|
@@ -91,6 +60,36 @@
|
|
|
cardImage
|
|
|
} = storeToRefs(userStore)
|
|
|
let appName = ref('')
|
|
|
+
|
|
|
+ // 入场动画状态
|
|
|
+ const pageReady = ref(false)
|
|
|
+ const contentReady = ref(false)
|
|
|
+
|
|
|
+ onMounted(() => {
|
|
|
+ // 页面挂载后立即触发名片动画
|
|
|
+ requestAnimationFrame(() => {
|
|
|
+ pageReady.value = true
|
|
|
+ })
|
|
|
+ // 名片动画快结束时触发内容动画
|
|
|
+ setTimeout(() => {
|
|
|
+ contentReady.value = true
|
|
|
+ }, 400)
|
|
|
+ })
|
|
|
+
|
|
|
+ // 名片卡片:淡入 + 轻微放大
|
|
|
+ const cardStyle = computed(() => ({
|
|
|
+ opacity: pageReady.value ? 1 : 0,
|
|
|
+ transform: pageReady.value ? 'scale(1) translateY(0)' : 'scale(0.92) translateY(-20rpx)',
|
|
|
+ transition: 'all 0.5s cubic-bezier(0.34, 1.3, 0.64, 1)',
|
|
|
+ }))
|
|
|
+
|
|
|
+ // 企业简介:从底部淡入滑入
|
|
|
+ const contentCardStyle = computed(() => ({
|
|
|
+ opacity: contentReady.value ? 1 : 0,
|
|
|
+ transform: contentReady.value ? 'translateY(0)' : 'translateY(40rpx)',
|
|
|
+ transition: 'all 0.45s ease-out',
|
|
|
+ }))
|
|
|
+
|
|
|
onShareAppMessage(() => {
|
|
|
return {
|
|
|
path: 'pages/splash/splash?userId=' + cardInfo.value.userId,
|
|
|
@@ -112,18 +111,8 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- const makeCall = () => {
|
|
|
- if (cardInfo.value.phonenumber) {
|
|
|
- uni.makePhoneCall({
|
|
|
- phoneNumber: cardInfo.value.phonenumber
|
|
|
- })
|
|
|
- } else {
|
|
|
- uni.showToast({
|
|
|
- title: '暂无电话号码',
|
|
|
- icon: 'none'
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
+ // 拨打电话交由 UserCard 组件内部处理,这里只是留空以备后续扩展
|
|
|
+ const makeCall = () => {}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
@@ -213,99 +202,8 @@
|
|
|
|
|
|
.page-top {
|
|
|
margin: 0 24rpx 24rpx;
|
|
|
-
|
|
|
- .user-card {
|
|
|
- position: relative;
|
|
|
- z-index: 2;
|
|
|
- width: 100%;
|
|
|
- height: 400rpx;
|
|
|
- box-sizing: border-box;
|
|
|
- padding: 80rpx 40rpx 32rpx;
|
|
|
- position: relative;
|
|
|
-
|
|
|
- .user-card-bg {
|
|
|
- position: absolute;
|
|
|
- top: 0;
|
|
|
- left: 0;
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- z-index: 0;
|
|
|
- }
|
|
|
-
|
|
|
- view,
|
|
|
- text {
|
|
|
- position: relative;
|
|
|
- z-index: 1;
|
|
|
- }
|
|
|
-
|
|
|
- .user-header {
|
|
|
- .name-row {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- margin-bottom: 16rpx;
|
|
|
-
|
|
|
- .user-name {
|
|
|
- font-size: 44rpx;
|
|
|
- font-weight: 700;
|
|
|
- color: #202020;
|
|
|
- line-height: 1.2;
|
|
|
- }
|
|
|
-
|
|
|
- .user-role {
|
|
|
- margin-left: 16rpx;
|
|
|
- padding: 6rpx 16rpx;
|
|
|
- background: rgba(68, 110, 255, 0.10);
|
|
|
- border-radius: 8rpx;
|
|
|
- font-size: 24rpx;
|
|
|
- font-weight: 500;
|
|
|
- color: #446eff;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .company-name {
|
|
|
- font-size: 28rpx;
|
|
|
- font-weight: 500;
|
|
|
- color: #666666;
|
|
|
- line-height: 1.4;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .avatar-wrapper {
|
|
|
- position: absolute;
|
|
|
- top: 74rpx;
|
|
|
- right: 36rpx;
|
|
|
- z-index: 2;
|
|
|
- }
|
|
|
-
|
|
|
- .user-contact {
|
|
|
- margin-top: 32rpx;
|
|
|
-
|
|
|
- .contact-row {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- margin-bottom: 16rpx;
|
|
|
-
|
|
|
-
|
|
|
- /* 溢出部分用省略号代替 */
|
|
|
- uni-icons {
|
|
|
- margin-right: 12rpx;
|
|
|
- flex-shrink: 0;
|
|
|
- }
|
|
|
-
|
|
|
- .contact-text {
|
|
|
- font-size: 26rpx;
|
|
|
- color: #666666;
|
|
|
- overflow: hidden;
|
|
|
- /* 隐藏溢出的内容 */
|
|
|
- white-space: nowrap;
|
|
|
- /* 强制文本在一行内显示 */
|
|
|
- text-overflow: ellipsis;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
+ position: relative;
|
|
|
+ z-index: 2;
|
|
|
}
|
|
|
|
|
|
// 名片内容区域
|