card-preview.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  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. <image class="avatar" src="/static/avatar-default.png" mode="aspectFill" />
  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. .avatar {
  208. width: 120rpx;
  209. height: 120rpx;
  210. border-radius: 50%;
  211. border: 4rpx solid rgba(255, 255, 255, 0.3);
  212. }
  213. }
  214. .user-details {
  215. flex: 1;
  216. .name-row {
  217. display: flex;
  218. align-items: center;
  219. margin-bottom: 12rpx;
  220. .user-name {
  221. font-size: 36rpx;
  222. font-weight: 600;
  223. color: #ffffff;
  224. }
  225. .user-role {
  226. font-size: 22rpx;
  227. color: rgba(255, 255, 255, 0.9);
  228. background: rgba(255, 255, 255, 0.2);
  229. padding: 4rpx 12rpx;
  230. border-radius: 20rpx;
  231. margin-left: 12rpx;
  232. }
  233. }
  234. .company-name {
  235. font-size: 26rpx;
  236. color: rgba(255, 255, 255, 0.9);
  237. display: block;
  238. margin-bottom: 16rpx;
  239. }
  240. .contact-row {
  241. display: flex;
  242. align-items: center;
  243. margin-bottom: 8rpx;
  244. .contact-icon {
  245. font-size: 24rpx;
  246. margin-right: 8rpx;
  247. }
  248. .contact-text {
  249. font-size: 22rpx;
  250. color: rgba(255, 255, 255, 0.85);
  251. }
  252. }
  253. }
  254. }
  255. }
  256. // 二维码区域
  257. .qr-code-section {
  258. padding: 40rpx;
  259. display: flex;
  260. justify-content: center;
  261. .qr-code-wrapper {
  262. width: 300rpx;
  263. height: 300rpx;
  264. background: #f5f6f8;
  265. border-radius: 16rpx;
  266. padding: 20rpx;
  267. .qr-code {
  268. width: 100%;
  269. height: 100%;
  270. }
  271. }
  272. }
  273. // 操作按钮
  274. .action-buttons {
  275. display: flex;
  276. padding: 0 40rpx 32rpx;
  277. gap: 24rpx;
  278. .btn {
  279. flex: 1;
  280. display: flex;
  281. align-items: center;
  282. justify-content: center;
  283. padding: 24rpx;
  284. border-radius: 32rpx;
  285. font-size: 28rpx;
  286. .btn-icon {
  287. margin-right: 8rpx;
  288. font-size: 32rpx;
  289. }
  290. }
  291. .share-btn {
  292. background: linear-gradient(135deg, #f0f4ff 0%, #e6ecff 100%);
  293. color: #667eea;
  294. }
  295. .save-btn {
  296. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  297. color: #ffffff;
  298. }
  299. }
  300. // 标签页切换
  301. .tab-bar {
  302. display: flex;
  303. border-bottom: 2rpx solid #f0f0f0;
  304. .tab-item {
  305. flex: 1;
  306. display: flex;
  307. align-items: center;
  308. justify-content: center;
  309. padding: 28rpx 0;
  310. font-size: 28rpx;
  311. color: #999999;
  312. position: relative;
  313. .tab-icon {
  314. margin: 0 8rpx;
  315. font-size: 32rpx;
  316. }
  317. &.active {
  318. color: #667eea;
  319. font-weight: 600;
  320. &::after {
  321. content: '';
  322. position: absolute;
  323. bottom: 0;
  324. left: 50%;
  325. transform: translateX(-50%);
  326. width: 60rpx;
  327. height: 6rpx;
  328. background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  329. border-radius: 3rpx;
  330. }
  331. }
  332. }
  333. }
  334. // 内容区域
  335. .content-area {
  336. padding: 32rpx;
  337. min-height: 400rpx;
  338. overflow-y: auto;
  339. }
  340. // 产品列表
  341. .product-list {
  342. .product-item {
  343. display: flex;
  344. padding: 24rpx;
  345. background: #f8f9fa;
  346. border-radius: 16rpx;
  347. margin-bottom: 20rpx;
  348. .product-image {
  349. width: 160rpx;
  350. height: 160rpx;
  351. border-radius: 12rpx;
  352. background: #ffffff;
  353. margin-right: 24rpx;
  354. flex-shrink: 0;
  355. image {
  356. width: 100%;
  357. height: 100%;
  358. border-radius: 12rpx;
  359. }
  360. }
  361. .product-info {
  362. flex: 1;
  363. display: flex;
  364. flex-direction: column;
  365. justify-content: center;
  366. .product-name {
  367. font-size: 28rpx;
  368. color: #333333;
  369. font-weight: 500;
  370. margin-bottom: 12rpx;
  371. line-height: 1.5;
  372. }
  373. .product-desc {
  374. font-size: 24rpx;
  375. color: #999999;
  376. }
  377. }
  378. }
  379. }
  380. // 企业简介
  381. .company-intro {
  382. .intro-text {
  383. display: block;
  384. font-size: 28rpx;
  385. color: #666666;
  386. line-height: 1.8;
  387. margin-bottom: 24rpx;
  388. text-align: justify;
  389. }
  390. }
  391. // 退出按钮
  392. .exit-btn {
  393. display: flex;
  394. align-items: center;
  395. justify-content: center;
  396. padding: 32rpx;
  397. margin: 0 40rpx 40rpx;
  398. background: #f8f9fa;
  399. border-radius: 32rpx;
  400. font-size: 28rpx;
  401. color: #666666;
  402. }
  403. </style>