|
@@ -3,9 +3,9 @@
|
|
|
|
|
|
|
|
<!-- 顶部背景 -->
|
|
<!-- 顶部背景 -->
|
|
|
<image class="top-bg" src="/static/image/home/top-bg.png" />
|
|
<image class="top-bg" src="/static/image/home/top-bg.png" />
|
|
|
- <NavBar title="" color="#020202" :fixed="true" :bg="'transparent'">
|
|
|
|
|
|
|
+ <NavBar :title="'我的名片'" :show_back="false" color="#fff" :fixed="true" :bg="'transparent'">
|
|
|
<template #left>
|
|
<template #left>
|
|
|
- <view class="left-title">{{appName}}</view>
|
|
|
|
|
|
|
+ <!-- <view class="left-title">{{appName}}</view> -->
|
|
|
</template>
|
|
</template>
|
|
|
</NavBar>
|
|
</NavBar>
|
|
|
<!-- 名片卡片 -->
|
|
<!-- 名片卡片 -->
|
|
@@ -48,51 +48,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
<view class="control-card">
|
|
<view class="control-card">
|
|
|
- <view class="item" @click="shareUserCard">
|
|
|
|
|
- <image src="/static/image/public/card-sharing.png"></image>
|
|
|
|
|
- <text class="text">分享名片</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="item" @click="saveCard">
|
|
|
|
|
- <image src="/static/image/public/card-save.png"></image>
|
|
|
|
|
- <text class="text">保存名片</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="item" @click="showQRCode">
|
|
|
|
|
- <image src="/static/image/public/card-qr.png"></image>
|
|
|
|
|
- <text class="text">名片码</text>
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ <view class="item" @click="shareUserCard">发名片</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="card-content">
|
|
<view class="card-content">
|
|
|
- <!-- Tab 切换 -->
|
|
|
|
|
- <view class="tab-section">
|
|
|
|
|
- <view class="tab-wrapper">
|
|
|
|
|
- <!-- <view class="tab-item" :class="{ active: currentTab === 'products' }"
|
|
|
|
|
- @click="switchTab('products')">
|
|
|
|
|
- <text class="tab-text">产品列表</text>
|
|
|
|
|
- <view class="tab-indicator" v-if="currentTab === 'products'"></view>
|
|
|
|
|
- </view> -->
|
|
|
|
|
- <!-- <view class="tab-item" :class="{ active: currentTab === 'company' }" @click="switchTab('company')">
|
|
|
|
|
- <text class="tab-text">企业简介</text>
|
|
|
|
|
- <view class="tab-indicator" v-if="currentTab === 'company'"></view>
|
|
|
|
|
- </view> -->
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <!-- 产品列表 -->
|
|
|
|
|
- <view class="product-list" v-if="currentTab === 'products'">
|
|
|
|
|
- <EmptyState v-if="productList.length === 0" text="暂无产品" sub-text="还没有添加产品信息" icon="gift" />
|
|
|
|
|
- <view class="product-item" v-for="(item, index) in productList" :key="index">
|
|
|
|
|
- <image class="product-image" :src="item.image" mode="aspectFill" />
|
|
|
|
|
- <view class="product-info">
|
|
|
|
|
- <text class="product-title">{{ item.title }}</text>
|
|
|
|
|
- <text class="product-desc">{{ item.description }}</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
<!-- 企业简介 -->
|
|
<!-- 企业简介 -->
|
|
|
- <view class="company-section" v-if="currentTab === 'company'">
|
|
|
|
|
- <view class="company-content">
|
|
|
|
|
- <rich-text class="company-text" :nodes="companyInfo.introduce"></rich-text>
|
|
|
|
|
|
|
+ <view class="company-section">
|
|
|
|
|
+ <view class="company-title">
|
|
|
|
|
+ 企业简介
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <rich-text class="company-text" :nodes="companyInfo.introduce"></rich-text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -236,7 +201,7 @@
|
|
|
generateCardPoster,
|
|
generateCardPoster,
|
|
|
savePosterToAlbum,
|
|
savePosterToAlbum,
|
|
|
} from '@/utils/poster.js'
|
|
} from '@/utils/poster.js'
|
|
|
-import {
|
|
|
|
|
|
|
+ import {
|
|
|
getCurrentConfig
|
|
getCurrentConfig
|
|
|
} from '@/config/index.js'
|
|
} from '@/config/index.js'
|
|
|
// 使用 Pinia 管理用户状态
|
|
// 使用 Pinia 管理用户状态
|
|
@@ -257,16 +222,18 @@ import {
|
|
|
const cardPopup = ref(null)
|
|
const cardPopup = ref(null)
|
|
|
|
|
|
|
|
const productList = ref([])
|
|
const productList = ref([])
|
|
|
|
|
+ let imageUrl = ref('')
|
|
|
onShareAppMessage(() => {
|
|
onShareAppMessage(() => {
|
|
|
return {
|
|
return {
|
|
|
userName: '小程序',
|
|
userName: '小程序',
|
|
|
path: 'pages/splash/splash?userId=' + cardInfo.value.userId,
|
|
path: 'pages/splash/splash?userId=' + cardInfo.value.userId,
|
|
|
|
|
+ imageUrl: imageUrl.value
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
|
- let appName = ref('')
|
|
|
|
|
|
|
+ let appName = ref('')
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
|
- const config = await getCurrentConfig()
|
|
|
|
|
- appName.value = config.appName
|
|
|
|
|
|
|
+ const config = await getCurrentConfig()
|
|
|
|
|
+ appName.value = config.appName
|
|
|
// 如果没有数据,重新获取
|
|
// 如果没有数据,重新获取
|
|
|
if (!cardInfo.value.nickName) {
|
|
if (!cardInfo.value.nickName) {
|
|
|
await userStore.queryCardInfo()
|
|
await userStore.queryCardInfo()
|
|
@@ -336,16 +303,24 @@ import {
|
|
|
|
|
|
|
|
const shareUserCard = async () => {
|
|
const shareUserCard = async () => {
|
|
|
const snapshotPath = await generateCardPoster(cardInfo.value, qrInfo.value)
|
|
const snapshotPath = await generateCardPoster(cardInfo.value, qrInfo.value)
|
|
|
- wx.showShareImageMenu({
|
|
|
|
|
- path: snapshotPath,
|
|
|
|
|
- entrancePath: 'pages/splash/splash?userId=' + cardInfo.value.userId,
|
|
|
|
|
- success: () => {
|
|
|
|
|
- console.log('分享菜单已调起');
|
|
|
|
|
- },
|
|
|
|
|
- fail: (err) => {
|
|
|
|
|
- console.error('调起分享菜单失败', err);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ imageUrl.value = snapshotPath
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // wx.showShareImageMenu({
|
|
|
|
|
+ // path: snapshotPath,
|
|
|
|
|
+ // entrancePath: 'pages/splash/splash?userId=' + cardInfo.value.userId,
|
|
|
|
|
+ // success: () => {
|
|
|
|
|
+ // console.log('分享菜单已调起');
|
|
|
|
|
+ // },
|
|
|
|
|
+ // fail: (err) => {
|
|
|
|
|
+ // console.error('调起分享菜单失败', err);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -465,6 +440,7 @@ import {
|
|
|
color: #ffffff;
|
|
color: #ffffff;
|
|
|
text-shadow: 2px 2px 0 black;
|
|
text-shadow: 2px 2px 0 black;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.top-bg {
|
|
.top-bg {
|
|
|
width: 750rpx;
|
|
width: 750rpx;
|
|
|
height: 634rpx;
|
|
height: 634rpx;
|
|
@@ -638,25 +614,21 @@ import {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
justify-content: space-around;
|
|
justify-content: space-around;
|
|
|
- padding-top: 48rpx;
|
|
|
|
|
- padding-bottom: 24rpx;
|
|
|
|
|
|
|
+ padding: 48rpx 40rpx 24rpx;
|
|
|
|
|
|
|
|
.item {
|
|
.item {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
|
|
+ width: 100%;
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
justify-content: center;
|
|
|
gap: 4rpx;
|
|
gap: 4rpx;
|
|
|
|
|
+ background-color: #155DFC;
|
|
|
|
|
+ font-size: 28rpx !important;
|
|
|
|
|
+ border-radius: 40rpx;
|
|
|
|
|
+ height: 80rpx;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
|
|
|
- image {
|
|
|
|
|
- width: 64rpx;
|
|
|
|
|
- height: 64rpx;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .text {
|
|
|
|
|
- font-size: 26rpx !important;
|
|
|
|
|
- color: #202020;
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -666,13 +638,38 @@ import {
|
|
|
// 名片内容区域
|
|
// 名片内容区域
|
|
|
.card-content {
|
|
.card-content {
|
|
|
margin: 0 24rpx;
|
|
margin: 0 24rpx;
|
|
|
- padding: 0 24rpx;
|
|
|
|
|
|
|
+ padding: 20rpx 40rpx;
|
|
|
border-radius: 24rpx;
|
|
border-radius: 24rpx;
|
|
|
background: #ffffff;
|
|
background: #ffffff;
|
|
|
box-shadow: 0 -2rpx 12rpx rgba(0, 0, 0, 0.04);
|
|
box-shadow: 0 -2rpx 12rpx rgba(0, 0, 0, 0.04);
|
|
|
position: relative;
|
|
position: relative;
|
|
|
bottom: 24rpx;
|
|
bottom: 24rpx;
|
|
|
z-index: 2;
|
|
z-index: 2;
|
|
|
|
|
+ // 企业简介
|
|
|
|
|
+ .company-section {
|
|
|
|
|
+ background: #ffffff;
|
|
|
|
|
+ .company-title{
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+ font-size: 32rpx;
|
|
|
|
|
+ margin-bottom: 12rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+ .company-text {
|
|
|
|
|
+ display: block;
|
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
|
+ color: #666666;
|
|
|
|
|
+ line-height: 1.8;
|
|
|
|
|
+ margin-bottom: 24rpx;
|
|
|
|
|
+
|
|
|
|
|
+ ::v-deep img {
|
|
|
|
|
+ max-width: 100% !important;
|
|
|
|
|
+ height: auto !important;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ &:last-child {
|
|
|
|
|
+ margin-bottom: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Tab 切换区域
|
|
// Tab 切换区域
|
|
@@ -758,29 +755,6 @@ import {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 企业简介
|
|
|
|
|
- .company-section {
|
|
|
|
|
- background: #ffffff;
|
|
|
|
|
- padding: 40rpx;
|
|
|
|
|
-
|
|
|
|
|
- .company-content {
|
|
|
|
|
- .company-text {
|
|
|
|
|
- display: block;
|
|
|
|
|
- font-size: 28rpx;
|
|
|
|
|
- color: #666666;
|
|
|
|
|
- line-height: 1.8;
|
|
|
|
|
- margin-bottom: 24rpx;
|
|
|
|
|
-
|
|
|
|
|
- ::v-deep img {
|
|
|
|
|
- max-width: 100% !important;
|
|
|
|
|
- height: auto !important;
|
|
|
|
|
- }
|
|
|
|
|
- &:last-child {
|
|
|
|
|
- margin-bottom: 0;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
// 隐藏的 canvas 容器
|
|
// 隐藏的 canvas 容器
|
|
|
.hidden-canvas-box {
|
|
.hidden-canvas-box {
|