card.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. <template>
  2. <view class="card-container">
  3. <!-- 顶部背景 -->
  4. <image class="top-bg" src="/static/image/home/top-bg.png" />
  5. <NavBar title="我的名片" color="#FFFFFF" :fixed="true" :bg="'transparent'"></NavBar>
  6. <!-- 名片卡片 -->
  7. <view class="page-top">
  8. <view class="user-card">
  9. <!-- 背景图 -->
  10. <image class="user-card-bg" src="/static/image/home/usecard-bg.png" />
  11. <!-- 左上:姓名 + 职位 -->
  12. <view class="user-header">
  13. <view class="name-row">
  14. <text class="user-name">赵建平</text>
  15. <text class="user-role">销售经理</text>
  16. </view>
  17. <text class="company-name">杭州碟滤膜技术有限公司</text>
  18. </view>
  19. <!-- 右上:头像 -->
  20. <view class="avatar-wrapper">
  21. <image class="avatar" src="/static/image/public/avatar-default.png" />
  22. <image class="badge-icon" src="/static/image/public/badge-icon.png" />
  23. </view>
  24. <!-- 左下:联系方式 -->
  25. <view class="user-contact">
  26. <view class="contact-row" @click="makeCall">
  27. <uni-icons type="phone" :size="18" color="#666666"></uni-icons>
  28. <text class="contact-text">138-0000-0000</text>
  29. </view>
  30. <view class="contact-row">
  31. <uni-icons type="email" :size="18" color="#666666"></uni-icons>
  32. <text class="contact-text">zhao.jp@subote.com</text>
  33. </view>
  34. <view class="contact-row">
  35. <uni-icons type="location" :size="18" color="#666666"></uni-icons>
  36. <text class="contact-text">上海市静安区江宁路 168 号</text>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="control-card">
  41. <view class="item">
  42. <image src="/static/image/public/card-sharing.png"></image>
  43. <text>分享名片</text>
  44. </view>
  45. <view class="item">
  46. <image src="/static/image/public/card-save.png"></image>
  47. <text>保存名片</text>
  48. </view>
  49. <view class="item">
  50. <image src="/static/image/public/card-qr.png"></image>
  51. <text>名片码</text>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="card-content">
  56. <!-- Tab 切换 -->
  57. <view class="tab-section">
  58. <view class="tab-wrapper">
  59. <view class="tab-item" :class="{ active: currentTab === 'products' }"
  60. @click="switchTab('products')">
  61. <text class="tab-text">产品列表</text>
  62. <view class="tab-indicator" v-if="currentTab === 'products'"></view>
  63. </view>
  64. <view class="tab-item" :class="{ active: currentTab === 'company' }" @click="switchTab('company')">
  65. <text class="tab-text">企业简介</text>
  66. <view class="tab-indicator" v-if="currentTab === 'company'"></view>
  67. </view>
  68. </view>
  69. </view>
  70. <!-- 产品列表 -->
  71. <view class="product-list" v-if="currentTab === 'products'">
  72. <view class="product-item" v-for="(item, index) in productList" :key="index">
  73. <image class="product-image" :src="item.image" mode="aspectFill" />
  74. <view class="product-info">
  75. <text class="product-title">{{ item.title }}</text>
  76. <text class="product-desc">{{ item.description }}</text>
  77. </view>
  78. </view>
  79. </view>
  80. <!-- 企业简介 -->
  81. <view class="company-section" v-if="currentTab === 'company'">
  82. <view class="company-content">
  83. <text class="company-text">
  84. 杭州碟滤膜技术有限公司是一家专注于膜技术研发、生产和销售的高新技术企业。公司主要产品包括各种规格的滤膜、过滤器及相关设备,广泛应用于医药、化工、食品、环保等领域。
  85. </text>
  86. <text class="company-text">
  87. 公司拥有一支专业的研发团队和先进的生产设备,始终坚持"质量第一、客户至上"的经营理念,为客户提供优质的产品和服务。
  88. </text>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. </template>
  94. <script setup>
  95. import {
  96. ref
  97. } from 'vue'
  98. import NavBar from '@/components/nav-bar/index.vue'
  99. const currentTab = ref('products')
  100. const productList = ref([{
  101. id: 1,
  102. title: '惠普黑白激光打印机 选配小白盒巴',
  103. description: '打印机 | 惠普',
  104. image: '/static/image/product/product-1.png'
  105. },
  106. ])
  107. const goBack = () => {
  108. uni.navigateBack()
  109. }
  110. const shareCard = () => {
  111. uni.showToast({
  112. title: '分享名片',
  113. icon: 'none'
  114. })
  115. }
  116. const saveCard = () => {
  117. uni.showToast({
  118. title: '保存名片',
  119. icon: 'none'
  120. })
  121. }
  122. const showQRCode = () => {
  123. uni.showToast({
  124. title: '名片码',
  125. icon: 'none'
  126. })
  127. }
  128. const switchTab = (tab) => {
  129. currentTab.value = tab
  130. }
  131. </script>
  132. <style lang="scss" scoped>
  133. .card-container {
  134. background: #f5f6f8;
  135. }
  136. .top-bg {
  137. width: 750rpx;
  138. height: 634rpx;
  139. position: fixed;
  140. top: 0;
  141. left: 0;
  142. z-index: 1;
  143. }
  144. // 顶部背景区域
  145. .header-bg {
  146. background: linear-gradient(135deg, #4A90E2 0%, #6FB3F2 50%, #87CEEB 100%);
  147. padding: 0 40rpx;
  148. padding-top: calc(var(--status-bar-height) + 20rpx);
  149. padding-bottom: 60rpx;
  150. position: relative;
  151. overflow: hidden;
  152. // 背景光效
  153. &::before {
  154. content: '';
  155. position: absolute;
  156. top: -100rpx;
  157. right: -100rpx;
  158. width: 500rpx;
  159. height: 500rpx;
  160. background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
  161. border-radius: 50%;
  162. }
  163. // 导航栏
  164. .nav-bar {
  165. display: flex;
  166. align-items: center;
  167. justify-content: space-between;
  168. height: 88rpx;
  169. position: relative;
  170. z-index: 10;
  171. .nav-back {
  172. width: 60rpx;
  173. height: 60rpx;
  174. display: flex;
  175. align-items: center;
  176. justify-content: center;
  177. }
  178. .nav-title {
  179. font-size: 32rpx;
  180. font-weight: 600;
  181. color: #ffffff;
  182. text-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  183. }
  184. .nav-right {
  185. display: flex;
  186. align-items: center;
  187. .more-btn,
  188. .refresh-btn {
  189. width: 64rpx;
  190. height: 64rpx;
  191. border-radius: 50%;
  192. background: rgba(255, 255, 255, 0.15);
  193. display: flex;
  194. align-items: center;
  195. justify-content: center;
  196. margin-left: 16rpx;
  197. }
  198. }
  199. }
  200. }
  201. /* 用户信息卡片 */
  202. .page-top {
  203. margin: 0 24rpx 24rpx;
  204. .user-card {
  205. position: relative;
  206. z-index: 2;
  207. width: 100%;
  208. height: 400rpx;
  209. box-sizing: border-box;
  210. padding: 80rpx 40rpx 32rpx;
  211. position: relative;
  212. .user-card-bg {
  213. position: absolute;
  214. top: 0;
  215. left: 0;
  216. width: 100%;
  217. height: 100%;
  218. z-index: 0;
  219. }
  220. view,
  221. text {
  222. position: relative;
  223. z-index: 1;
  224. }
  225. .user-header {
  226. .name-row {
  227. display: flex;
  228. align-items: center;
  229. margin-bottom: 16rpx;
  230. .user-name {
  231. font-size: 44rpx;
  232. font-weight: 700;
  233. color: #202020;
  234. line-height: 1.2;
  235. }
  236. .user-role {
  237. margin-left: 16rpx;
  238. padding: 6rpx 16rpx;
  239. background: rgba(68, 110, 255, 0.10);
  240. border-radius: 8rpx;
  241. font-size: 24rpx;
  242. font-weight: 500;
  243. color: #446eff;
  244. }
  245. }
  246. .company-name {
  247. font-size: 28rpx;
  248. font-weight: 500;
  249. color: #666666;
  250. line-height: 1.4;
  251. }
  252. }
  253. .avatar-wrapper {
  254. position: absolute;
  255. top: 32rpx;
  256. right: 40rpx;
  257. width: 140rpx;
  258. height: 140rpx;
  259. border-radius: 50%;
  260. box-shadow: 0rpx 0rpx 4rpx 0rpx rgba(21, 93, 252, 0.20);
  261. .avatar {
  262. width: 100%;
  263. height: 100%;
  264. }
  265. .badge-icon {
  266. width: 64rpx;
  267. height: 64rpx;
  268. position: absolute;
  269. bottom: 0;
  270. right: 0;
  271. transform: translate(50% 50%);
  272. z-index: 1;
  273. }
  274. }
  275. .user-contact {
  276. margin-top: 32rpx;
  277. .contact-row {
  278. display: flex;
  279. align-items: center;
  280. margin-bottom: 16rpx;
  281. uni-icons {
  282. margin-right: 12rpx;
  283. flex-shrink: 0;
  284. }
  285. .contact-text {
  286. font-size: 26rpx;
  287. color: #666666;
  288. }
  289. }
  290. }
  291. }
  292. .control-card{
  293. background-color: #fff;
  294. border-radius: 0 0 24rpx 24rpx;
  295. position: relative;
  296. z-index: 1;
  297. bottom: 24rpx;
  298. display: flex;
  299. align-items: center;
  300. justify-content: space-around;
  301. padding-top: 48rpx;
  302. padding-bottom: 24rpx;
  303. .item{
  304. display: flex;
  305. flex-direction: column;
  306. align-items: center;
  307. justify-content: center;
  308. gap: 4rpx;
  309. image{
  310. width: 64rpx;
  311. height: 64rpx;
  312. }
  313. text{
  314. font-size: 26rpx;
  315. color: #202020;
  316. }
  317. }
  318. }
  319. }
  320. // 名片内容区域
  321. .card-content {
  322. margin: 0 24rpx;
  323. padding: 0 24rpx ;
  324. border-radius: 24rpx;
  325. background: #ffffff;
  326. box-shadow: 0 -2rpx 12rpx rgba(0, 0, 0, 0.04);
  327. position: relative;
  328. bottom: 24rpx;
  329. z-index: 2;
  330. }
  331. // Tab 切换区域
  332. .tab-section {
  333. border-radius: 24rpx 24rpx 0 0;
  334. padding: 0 40rpx;
  335. .tab-wrapper {
  336. display: flex;
  337. border-bottom: 1rpx solid #f0f0f0;
  338. .tab-item {
  339. flex: 1;
  340. display: flex;
  341. flex-direction: column;
  342. align-items: center;
  343. padding: 32rpx 0;
  344. position: relative;
  345. .tab-text {
  346. font-size: 28rpx;
  347. color: #999999;
  348. font-weight: 500;
  349. }
  350. &.active .tab-text {
  351. color: #333333;
  352. font-weight: 600;
  353. }
  354. .tab-indicator {
  355. position: absolute;
  356. bottom: 0;
  357. width: 60rpx;
  358. height: 4rpx;
  359. background: linear-gradient(90deg, #4A90E2 0%, #6FB3F2 100%);
  360. border-radius: 2rpx;
  361. }
  362. }
  363. }
  364. }
  365. // 产品列表
  366. .product-list {
  367. padding: 24rpx 40rpx;
  368. .product-item {
  369. display: flex;
  370. padding: 24rpx 0;
  371. border-bottom: 1rpx solid #f0f0f0;
  372. &:last-child {
  373. border-bottom: none;
  374. }
  375. .product-image {
  376. width: 160rpx;
  377. height: 160rpx;
  378. border-radius: 12rpx;
  379. background: #f5f5f5;
  380. flex-shrink: 0;
  381. margin-right: 24rpx;
  382. }
  383. .product-info {
  384. flex: 1;
  385. display: flex;
  386. flex-direction: column;
  387. justify-content: center;
  388. .product-title {
  389. font-size: 28rpx;
  390. color: #333333;
  391. margin-bottom: 12rpx;
  392. line-height: 1.5;
  393. }
  394. .product-desc {
  395. font-size: 24rpx;
  396. color: #999999;
  397. }
  398. }
  399. }
  400. }
  401. // 企业简介
  402. .company-section {
  403. background: #ffffff;
  404. padding: 40rpx;
  405. .company-content {
  406. .company-text {
  407. display: block;
  408. font-size: 28rpx;
  409. color: #666666;
  410. line-height: 1.8;
  411. margin-bottom: 24rpx;
  412. text-align: justify;
  413. &:last-child {
  414. margin-bottom: 0;
  415. }
  416. }
  417. }
  418. }
  419. </style>