card-preview.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450
  1. <template>
  2. <view v-if="visible" class="card-preview-modal" @click="closeModal">
  3. <view class="modal-mask"></view>
  4. <view class="modal-content" @click.stop>
  5. <!-- 顶部用户信息卡片 -->
  6. <view class="user-card-header">
  7. <view class="user-info">
  8. <view class="avatar-wrapper">
  9. <UserAvatar src="" name="赵建平" :size="120" />
  10. </view>
  11. <view class="user-details">
  12. <view class="name-row">
  13. <text class="user-name">赵建平</text>
  14. <text class="user-role">销售经理</text>
  15. </view>
  16. <text class="company-name">杭州臻迹网络技术有限公司</text>
  17. <view class="contact-row" @click="makeCall">
  18. <text class="contact-icon">📞</text>
  19. <text class="contact-text">138-0000-0000 (点击拨打电话)</text>
  20. </view>
  21. <view class="contact-row">
  22. <text class="contact-icon">✉️</text>
  23. <text class="contact-text">zhao.jp@subote.com</text>
  24. </view>
  25. <view class="contact-row">
  26. <text class="contact-icon">📍</text>
  27. <text class="contact-text">上海市静安区江宁路 168 号</text>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <!-- 二维码区域 -->
  33. <view class="qr-code-section">
  34. <view class="qr-code-wrapper">
  35. <image class="qr-code" src="/static/qr-code-default.png" mode="aspectFill" />
  36. </view>
  37. </view>
  38. <!-- 操作按钮 -->
  39. <view class="action-buttons">
  40. <view class="btn share-btn" @click="shareCard">
  41. <text class="btn-icon">🔗</text>
  42. <text class="btn-text">分享名片</text>
  43. </view>
  44. <view class="btn save-btn" @click="saveCard">
  45. <text class="btn-icon">⬇️</text>
  46. <text class="btn-text">保存名片</text>
  47. </view>
  48. </view>
  49. <!-- 标签页切换 -->
  50. <view class="tab-bar">
  51. <view
  52. class="tab-item"
  53. :class="{ active: activeTab === 'products' }"
  54. @click="switchTab('products')"
  55. >
  56. <text class="tab-icon">📦</text>
  57. <text class="tab-text">产品列表</text>
  58. </view>
  59. <view
  60. class="tab-item"
  61. :class="{ active: activeTab === 'company' }"
  62. @click="switchTab('company')"
  63. >
  64. <text class="tab-text">企业简介</text>
  65. <text class="tab-icon">🏢</text>
  66. </view>
  67. </view>
  68. <!-- 内容区域 -->
  69. <scroll-view class="content-area" scroll-y>
  70. <!-- 产品列表 -->
  71. <view v-if="activeTab === 'products'" class="product-list">
  72. <view class="product-item" v-for="(item, index) in products" :key="index">
  73. <view class="product-image">
  74. <image :src="item.image" mode="aspectFill" />
  75. </view>
  76. <view class="product-info">
  77. <text class="product-name">{{ item.name }}</text>
  78. <text class="product-desc">{{ item.category }} | {{ item.brand }}</text>
  79. </view>
  80. </view>
  81. </view>
  82. <!-- 企业简介 -->
  83. <view v-if="activeTab === 'company'" class="company-intro">
  84. <text class="intro-text">
  85. 杭州臻迹膜技术有限公司 成立于 2015 年,是一家致力于为废水资源循环利用提供更高效、更经济、更简单的特种膜产品及其工艺技术的国家高新技术企业,集研发、设计、生产、销售、服务为一体。
  86. </text>
  87. <text class="intro-text">
  88. 通过国际合作及自主研发结合的模式,现有主营产品 DTRO、STRO、TUF 管式软化膜、CTUF 半软化膜等多种特种膜组件及其撬装设备,推出了垃圾渗滤液 3.0 工艺、工业循环排污水 4.0 工艺等技术包,广泛应用于垃圾渗滤液、矿井废水、电镀废水、工业循环冷却水、半导体废水等行业。
  89. </text>
  90. </view>
  91. </scroll-view>
  92. <!-- 退出按钮 -->
  93. <view class="exit-btn" @click="closeModal">
  94. <text>退出预览</text>
  95. </view>
  96. </view>
  97. </view>
  98. </template>
  99. <script setup>
  100. import { ref, reactive } from 'vue'
  101. // Props
  102. defineProps({
  103. visible: {
  104. type: Boolean,
  105. default: false
  106. }
  107. })
  108. // Emits
  109. const emit = defineEmits(['close', 'share', 'save'])
  110. // 当前激活的标签页
  111. const activeTab = ref('products')
  112. // 产品列表
  113. const products = reactive([
  114. {
  115. name: '惠普黑白激光打印机 选配小白盒巴',
  116. category: '打印机',
  117. brand: '惠普',
  118. image: '/static/product-printer.png'
  119. },
  120. {
  121. name: '惠普黑白激光打印机 选配小白盒巴',
  122. category: '打印机',
  123. brand: '惠普',
  124. image: '/static/product-printer.png'
  125. },
  126. {
  127. name: '惠普黑白激光打印机 选配小白盒巴',
  128. category: '打印机',
  129. brand: '惠普',
  130. image: '/static/product-printer.png'
  131. }
  132. ])
  133. // 切换标签页
  134. const switchTab = (tab) => {
  135. activeTab.value = tab
  136. }
  137. // 关闭弹窗
  138. const closeModal = () => {
  139. emit('close')
  140. }
  141. // 拨打电话
  142. const makeCall = () => {
  143. uni.makePhoneCall({
  144. phoneNumber: '13800000000'
  145. })
  146. }
  147. // 分享名片
  148. const shareCard = () => {
  149. emit('share')
  150. }
  151. // 保存名片
  152. const saveCard = () => {
  153. uni.showToast({
  154. title: '已保存到手机相册',
  155. icon: 'success'
  156. })
  157. emit('save')
  158. }
  159. </script>
  160. <style lang="scss" scoped>
  161. .card-preview-modal {
  162. position: fixed;
  163. top: 0;
  164. left: 0;
  165. right: 0;
  166. bottom: 0;
  167. z-index: 9999;
  168. .modal-mask {
  169. position: absolute;
  170. top: 0;
  171. left: 0;
  172. right: 0;
  173. bottom: 0;
  174. background: rgba(0, 0, 0, 0.5);
  175. }
  176. .modal-content {
  177. position: absolute;
  178. bottom: 0;
  179. left: 0;
  180. right: 0;
  181. background: #ffffff;
  182. border-radius: 32rpx 32rpx 0 0;
  183. max-height: 85vh;
  184. overflow-y: auto;
  185. animation: slideUp 0.3s ease-out;
  186. }
  187. }
  188. @keyframes slideUp {
  189. from {
  190. transform: translateY(100%);
  191. }
  192. to {
  193. transform: translateY(0);
  194. }
  195. }
  196. // 用户信息卡片头部
  197. .user-card-header {
  198. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  199. padding: 40rpx;
  200. border-radius: 32rpx 32rpx 0 0;
  201. .user-info {
  202. display: flex;
  203. align-items: flex-start;
  204. .avatar-wrapper {
  205. flex-shrink: 0;
  206. margin-right: 24rpx;
  207. }
  208. .user-details {
  209. flex: 1;
  210. .name-row {
  211. display: flex;
  212. align-items: center;
  213. margin-bottom: 12rpx;
  214. .user-name {
  215. font-size: 36rpx;
  216. font-weight: 600;
  217. color: #ffffff;
  218. }
  219. .user-role {
  220. font-size: 22rpx;
  221. color: rgba(255, 255, 255, 0.9);
  222. background: rgba(255, 255, 255, 0.2);
  223. padding: 4rpx 12rpx;
  224. border-radius: 20rpx;
  225. margin-left: 12rpx;
  226. }
  227. }
  228. .company-name {
  229. font-size: 26rpx;
  230. color: rgba(255, 255, 255, 0.9);
  231. display: block;
  232. margin-bottom: 16rpx;
  233. }
  234. .contact-row {
  235. display: flex;
  236. align-items: center;
  237. margin-bottom: 8rpx;
  238. .contact-icon {
  239. font-size: 24rpx;
  240. margin-right: 8rpx;
  241. }
  242. .contact-text {
  243. font-size: 22rpx;
  244. color: rgba(255, 255, 255, 0.85);
  245. }
  246. }
  247. }
  248. }
  249. }
  250. // 二维码区域
  251. .qr-code-section {
  252. padding: 40rpx;
  253. display: flex;
  254. justify-content: center;
  255. .qr-code-wrapper {
  256. width: 300rpx;
  257. height: 300rpx;
  258. background: #f5f6f8;
  259. border-radius: 16rpx;
  260. padding: 20rpx;
  261. .qr-code {
  262. width: 100%;
  263. height: 100%;
  264. }
  265. }
  266. }
  267. // 操作按钮
  268. .action-buttons {
  269. display: flex;
  270. padding: 0 40rpx 32rpx;
  271. gap: 24rpx;
  272. .btn {
  273. flex: 1;
  274. display: flex;
  275. align-items: center;
  276. justify-content: center;
  277. padding: 24rpx;
  278. border-radius: 32rpx;
  279. font-size: 28rpx;
  280. .btn-icon {
  281. margin-right: 8rpx;
  282. font-size: 32rpx;
  283. }
  284. }
  285. .share-btn {
  286. background: linear-gradient(135deg, #f0f4ff 0%, #e6ecff 100%);
  287. color: #667eea;
  288. }
  289. .save-btn {
  290. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  291. color: #ffffff;
  292. }
  293. }
  294. // 标签页切换
  295. .tab-bar {
  296. display: flex;
  297. border-bottom: 2rpx solid #f0f0f0;
  298. .tab-item {
  299. flex: 1;
  300. display: flex;
  301. align-items: center;
  302. justify-content: center;
  303. padding: 28rpx 0;
  304. font-size: 28rpx;
  305. color: #999999;
  306. position: relative;
  307. .tab-icon {
  308. margin: 0 8rpx;
  309. font-size: 32rpx;
  310. }
  311. &.active {
  312. color: #667eea;
  313. font-weight: 600;
  314. &::after {
  315. content: '';
  316. position: absolute;
  317. bottom: 0;
  318. left: 50%;
  319. transform: translateX(-50%);
  320. width: 60rpx;
  321. height: 6rpx;
  322. background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  323. border-radius: 3rpx;
  324. }
  325. }
  326. }
  327. }
  328. // 内容区域
  329. .content-area {
  330. padding: 32rpx;
  331. min-height: 400rpx;
  332. overflow-y: auto;
  333. }
  334. // 产品列表
  335. .product-list {
  336. .product-item {
  337. display: flex;
  338. padding: 24rpx;
  339. background: #f8f9fa;
  340. border-radius: 16rpx;
  341. margin-bottom: 20rpx;
  342. .product-image {
  343. width: 160rpx;
  344. height: 160rpx;
  345. border-radius: 12rpx;
  346. background: #ffffff;
  347. margin-right: 24rpx;
  348. flex-shrink: 0;
  349. image {
  350. width: 100%;
  351. height: 100%;
  352. border-radius: 12rpx;
  353. }
  354. }
  355. .product-info {
  356. flex: 1;
  357. display: flex;
  358. flex-direction: column;
  359. justify-content: center;
  360. .product-name {
  361. font-size: 28rpx;
  362. color: #333333;
  363. font-weight: 500;
  364. margin-bottom: 12rpx;
  365. line-height: 1.5;
  366. }
  367. .product-desc {
  368. font-size: 24rpx;
  369. color: #999999;
  370. }
  371. }
  372. }
  373. }
  374. // 企业简介
  375. .company-intro {
  376. .intro-text {
  377. display: block;
  378. font-size: 28rpx;
  379. color: #666666;
  380. line-height: 1.8;
  381. margin-bottom: 24rpx;
  382. text-align: justify;
  383. }
  384. }
  385. // 退出按钮
  386. .exit-btn {
  387. display: flex;
  388. align-items: center;
  389. justify-content: center;
  390. padding: 32rpx;
  391. margin: 0 40rpx 40rpx;
  392. background: #f8f9fa;
  393. border-radius: 32rpx;
  394. font-size: 28rpx;
  395. color: #666666;
  396. }
  397. </style>