card.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871
  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" id="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">{{ cardInfo.nickName || '用户' }}</text>
  15. <text class="user-role">{{ cardInfo.postName || '职位' }}</text>
  16. </view>
  17. <text class="company-name">{{ cardInfo.companyName || '公司名称' }}</text>
  18. </view>
  19. <!-- 右上:头像 -->
  20. <view class="avatar-wrapper">
  21. <UserAvatar :src="cardInfo.avatar" :name="cardInfo.nickName" :size="130" :badge-src="'/static/image/public/badge-icon.png'" :badge-size="56" />
  22. </view>
  23. <!-- 左下:联系方式 -->
  24. <view class="user-contact">
  25. <view class="contact-row" @click="makeCall">
  26. <uni-icons type="phone" :size="18" color="#666666"></uni-icons>
  27. <text class="contact-text">{{ cardInfo.phonenumber || '暂无电话' }}</text>
  28. </view>
  29. <view class="contact-row">
  30. <uni-icons type="email" :size="18" color="#666666"></uni-icons>
  31. <text class="contact-text">{{ cardInfo.email || '暂无邮箱' }}</text>
  32. </view>
  33. <view class="contact-row">
  34. <uni-icons type="location" :size="18" color="#666666"></uni-icons>
  35. <text class="contact-text">{{ cardInfo.companyAddress || '暂无地址' }}</text>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="control-card">
  40. <view class="item" @click="shareUserCard">
  41. <image src="/static/image/public/card-sharing.png"></image>
  42. <text class="text">分享名片</text>
  43. </view>
  44. <view class="item" @click="saveCard">
  45. <image src="/static/image/public/card-save.png"></image>
  46. <text class="text">保存名片</text>
  47. </view>
  48. <view class="item" @click="showQRCode">
  49. <image src="/static/image/public/card-qr.png"></image>
  50. <text class="text">名片码</text>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="card-content">
  55. <!-- Tab 切换 -->
  56. <view class="tab-section">
  57. <view class="tab-wrapper">
  58. <view class="tab-item" :class="{ active: currentTab === 'products' }"
  59. @click="switchTab('products')">
  60. <text class="tab-text">产品列表</text>
  61. <view class="tab-indicator" v-if="currentTab === 'products'"></view>
  62. </view>
  63. <view class="tab-item" :class="{ active: currentTab === 'company' }" @click="switchTab('company')">
  64. <text class="tab-text">企业简介</text>
  65. <view class="tab-indicator" v-if="currentTab === 'company'"></view>
  66. </view>
  67. </view>
  68. </view>
  69. <!-- 产品列表 -->
  70. <view class="product-list" v-if="currentTab === 'products'">
  71. <EmptyState
  72. v-if="productList.length === 0"
  73. text="暂无产品"
  74. sub-text="还没有添加产品信息"
  75. icon="gift"
  76. />
  77. <view class="product-item" v-for="(item, index) in productList" :key="index">
  78. <image class="product-image" :src="item.image" mode="aspectFill" />
  79. <view class="product-info">
  80. <text class="product-title">{{ item.title }}</text>
  81. <text class="product-desc">{{ item.description }}</text>
  82. </view>
  83. </view>
  84. </view>
  85. <!-- 企业简介 -->
  86. <view class="company-section" v-if="currentTab === 'company'">
  87. <view class="company-content">
  88. <rich-text class="company-text" :nodes="companyInfo.introduce"></rich-text>
  89. </view>
  90. </view>
  91. </view>
  92. <!-- 隐藏的 Canvas 用于生成名片快照 -->
  93. <canvas id="posterCanvas" type="2d"
  94. style="position: fixed; left: -9999px; top: -9999px; width: 750px; height: 800px;"></canvas>
  95. <!-- 隐藏的 Canvas 用于生成二维码海报 -->
  96. <view class="hidden-canvas-box">
  97. <canvas id="qrPosterCanvas" type="2d" style="width: 600px; height: 700px;"></canvas>
  98. </view>
  99. <!-- 名片分享弹窗 -->
  100. <uni-popup ref="cardPopup" type="center">
  101. <view class="card-popup">
  102. <!-- 顶部装饰条 -->
  103. <view class="popup-decor">
  104. <view class="decor-line"></view>
  105. </view>
  106. <!-- 标题 -->
  107. <view class="popup-title-box">
  108. <text class="popup-title">我的名片</text>
  109. <text class="popup-desc">分享给朋友或保存到相册</text>
  110. </view>
  111. <!-- 名片卡片 -->
  112. <view class="card-box">
  113. <view class="user-card">
  114. <!-- 背景图 -->
  115. <image class="user-card-bg" src="/static/image/home/usecard-bg.png" mode="aspectFill" />
  116. <!-- 左上:姓名 + 职位 -->
  117. <view class="user-header">
  118. <view class="name-row">
  119. <text class="user-name">{{ cardInfo.nickName || '用户' }}</text>
  120. <text class="user-role">{{ cardInfo.postName || '职位' }}</text>
  121. </view>
  122. <text class="company-name">{{ cardInfo.companyName || '公司名称' }}</text>
  123. </view>
  124. <!-- 右上:头像 -->
  125. <view class="user-avatar-box">
  126. <UserAvatar :src="cardInfo.avatar" :name="cardInfo.nickName" :size="120" :badge-src="'/static/image/public/badge-icon.png'" :badge-size="50" />
  127. </view>
  128. <!-- 左下:联系方式 -->
  129. <view class="user-contact">
  130. <view class="contact-row" @click="makeCall">
  131. <view class="contact-icon">
  132. <uni-icons type="phone" :size="16" color="#4080FF"></uni-icons>
  133. </view>
  134. <text class="contact-text">{{ cardInfo.phonenumber || '暂无电话' }}</text>
  135. </view>
  136. <view class="contact-row">
  137. <view class="contact-icon">
  138. <uni-icons type="email" :size="16" color="#4080FF"></uni-icons>
  139. </view>
  140. <text class="contact-text">{{ cardInfo.email || '暂无邮箱' }}</text>
  141. </view>
  142. <view class="contact-row">
  143. <view class="contact-icon">
  144. <uni-icons type="location" :size="16" color="#4080FF"></uni-icons>
  145. </view>
  146. <text class="contact-text">{{ cardInfo.companyAddress || '暂无地址' }}</text>
  147. </view>
  148. </view>
  149. </view>
  150. </view>
  151. <!-- 操作按钮 -->
  152. <view class="popup-btns">
  153. <view class="btn btn-cancel" @click="closeCardPopup">
  154. <text class="btn-text">取消</text>
  155. </view>
  156. <view class="btn btn-confirm" @click="shareCardConfirm">
  157. <text class="btn-text">分享名片</text>
  158. </view>
  159. </view>
  160. <!-- 底部全宽按钮 -->
  161. <view class="popup-footer">
  162. <view class="btn btn-full" @click="shareCardConfirm">
  163. <uni-icons type="paperplane" size="22" color="#ffffff"></uni-icons>
  164. <text class="btn-text">立即分享名片给朋友</text>
  165. </view>
  166. </view>
  167. </view>
  168. </uni-popup>
  169. <!-- 二维码弹窗 -->
  170. <uni-popup ref="qrPopup" type="top">
  171. <NavBar title="" color="#FFFFFF" :fixed="true" :bg="'transparent'"></NavBar>
  172. <view class="qr-popup">
  173. <view class="qr-header">
  174. <text class="qr-title">名片二维码</text>
  175. <text class="qr-subtitle">扫一扫查看我的名片信息</text>
  176. </view>
  177. <view class="qr-content">
  178. <image v-if="qrInfo && qrInfo.image"
  179. :src="qrInfo.image.startsWith('data:') ? qrInfo.image : 'data:image/png;base64,' + qrInfo.image"
  180. class="qr-image" mode="aspectFit" />
  181. <view v-else class="qr-loading">
  182. <text>加载中...</text>
  183. </view>
  184. </view>
  185. <view class="qr-actions">
  186. <view class="action-btn" @click="saveQRCode">
  187. <uni-icons type="download" size="24" color="#4080FF"></uni-icons>
  188. <text class="action-text">保存到相册</text>
  189. </view>
  190. <view class="action-btn" @click="handleShare">
  191. <uni-icons type="paperplane" size="24" color="#4080FF"></uni-icons>
  192. <!-- <button open-type="share" class="action-text">分享给好友</button> -->
  193. <text class="action-text">分享给好友</text>
  194. </view>
  195. </view>
  196. </view>
  197. </uni-popup>
  198. </view>
  199. </template>
  200. <script setup>
  201. import {
  202. ref,
  203. onMounted
  204. } from 'vue'
  205. import {
  206. onShareAppMessage
  207. } from '@dcloudio/uni-app';
  208. import NavBar from '@/components/nav-bar/index.vue'
  209. import UserAvatar from '@/components/user-avatar/index.vue'
  210. import EmptyState from '@/components/empty-state/index.vue'
  211. import {
  212. useUserStore
  213. } from '@/store/modules/user.js'
  214. import {
  215. storeToRefs
  216. } from 'pinia'
  217. import {
  218. generateCardPoster,
  219. savePosterToAlbum,
  220. } from '@/utils/poster.js'
  221. // 使用 Pinia 管理用户状态
  222. const userStore = useUserStore()
  223. const {
  224. cardInfo,
  225. companyInfo,
  226. qrInfo,
  227. } = storeToRefs(userStore)
  228. const currentTab = ref('products')
  229. // 名片快照图片路径
  230. const cardSnapshot = ref('')
  231. // 二维码海报图片路径
  232. const qrCodePoster = ref('')
  233. // 二维码弹窗引用
  234. const qrPopup = ref(null)
  235. const cardPopup = ref(null)
  236. const productList = ref([])
  237. onShareAppMessage(() => {
  238. return {
  239. userName: '小程序',
  240. path: 'pages/splash/splash?userId=' + cardInfo.value.userId,
  241. };
  242. });
  243. onMounted(async () => {
  244. // 如果没有数据,重新获取
  245. if (!cardInfo.value.nickName) {
  246. await userStore.queryCardInfo()
  247. }
  248. if (!companyInfo.value.name) {
  249. await userStore.queryCompanyInfo()
  250. }
  251. })
  252. const makeCall = () => {
  253. if (cardInfo.value.phonenumber) {
  254. uni.makePhoneCall({
  255. phoneNumber: cardInfo.value.phonenumber
  256. })
  257. } else {
  258. uni.showToast({
  259. title: '暂无电话号码',
  260. icon: 'none'
  261. })
  262. }
  263. }
  264. // 生成名片快照并保存
  265. const saveCard = async () => {
  266. uni.showLoading({
  267. title: '生成快照中...',
  268. mask: true
  269. })
  270. try {
  271. // 生成名片快照
  272. const snapshotPath = await generateCardPoster(cardInfo.value)
  273. console.log(snapshotPath, "snapshotPathsnapshotPathsnapshotPath");
  274. // 用属性接收快照路径
  275. cardSnapshot.value = snapshotPath
  276. console.log('名片快照路径:', cardSnapshot.value)
  277. // 保存到相册
  278. await savePosterToAlbum(snapshotPath)
  279. uni.hideLoading()
  280. uni.showToast({
  281. title: '已保存到相册',
  282. icon: 'success'
  283. })
  284. } catch (error) {
  285. console.error('保存失败:', error)
  286. uni.hideLoading()
  287. uni.showToast({
  288. title: '保存失败,请重试',
  289. icon: 'none'
  290. })
  291. }
  292. }
  293. // 显示二维码
  294. const showQRCode = async () => {
  295. // 打开弹窗
  296. qrPopup.value.open()
  297. }
  298. const close = async () => {
  299. cardPopup.value.close()
  300. }
  301. const shareUserCard = async () => {
  302. const snapshotPath = await generateCardPoster(cardInfo.value)
  303. wx.showShareImageMenu({
  304. path: snapshotPath,
  305. entrancePath:'pages/splash/splash?userId=' + cardInfo.value.userId,
  306. success: () => {
  307. console.log('分享菜单已调起');
  308. },
  309. fail: (err) => {
  310. console.error('调起分享菜单失败', err);
  311. }
  312. });
  313. }
  314. const base64ToImage = async (base64Data) => {
  315. return new Promise((resolve, reject) => {
  316. try {
  317. const filePath = `${wx.env.USER_DATA_PATH}/temp_image.png`;
  318. let pureBase64Data = base64Data
  319. if (pureBase64Data.startsWith('data:image')) {
  320. pureBase64Data = pureBase64Data.replace(/^data:image\/\w+;base64,/, '');
  321. }
  322. const fs = wx.getFileSystemManager();
  323. fs.writeFile({
  324. filePath: filePath,
  325. data: pureBase64Data,
  326. encoding: 'base64',
  327. success: (res) => {
  328. console.log("resresweresresresres", res);
  329. resolve(filePath)
  330. },
  331. fail: (err) => {
  332. console.error('写入临时文件失败', err);
  333. }
  334. });
  335. } catch (error) {
  336. console.error('base64 转换异常:', error)
  337. reject(error)
  338. }
  339. })
  340. }
  341. const handleShare = async () => {
  342. const qrFilePath = await base64ToTempFile(qrInfo.value.image)
  343. wx.showShareImageMenu({
  344. path: qrFilePath,
  345. entrancePath:'pages/splash/splash?userId=' + cardInfo.value.userId,
  346. success: () => {
  347. console.log('分享菜单已调起');
  348. },
  349. fail: (err) => {
  350. console.error('调起分享菜单失败', err);
  351. }
  352. });
  353. }
  354. // 保存二维码到相册
  355. const saveQRCode = async () => {
  356. if (!qrInfo.value.image) {
  357. uni.showToast({
  358. title: '二维码图片不存在',
  359. icon: 'none'
  360. })
  361. return
  362. }
  363. try {
  364. // 将 base64 转换为临时文件
  365. const qrFilePath = await base64ToTempFile(qrInfo.value.image)
  366. // 保存到相册
  367. await savePosterToAlbum(qrFilePath)
  368. uni.showToast({
  369. title: '已保存到相册',
  370. icon: 'success'
  371. })
  372. } catch (error) {
  373. console.error('保存失败:', error)
  374. uni.showToast({
  375. title: '保存失败,请重试',
  376. icon: 'none'
  377. })
  378. }
  379. }
  380. const switchTab = (tab) => {
  381. currentTab.value = tab
  382. }
  383. // 将 base64 转换为临时文件路径
  384. const base64ToTempFile = async (base64Data) => {
  385. return new Promise((resolve, reject) => {
  386. try {
  387. // 移除 data:image/png;base64, 前缀(如果有)
  388. const pureBase64 = base64Data.replace(/^data:image\/\w+;base64,/, '')
  389. const fileName = `${Date.now()}_qrcode.png`
  390. const filePath = `${wx.env.USER_DATA_PATH}/${fileName}`
  391. const fs = uni.getFileSystemManager()
  392. fs.writeFile({
  393. filePath: filePath,
  394. data: pureBase64,
  395. encoding: 'base64',
  396. success: () => {
  397. console.log('base64 转文件成功:', filePath)
  398. resolve(filePath)
  399. },
  400. fail: (err) => {
  401. console.error('base64 转文件失败:', err)
  402. reject(err)
  403. }
  404. })
  405. } catch (error) {
  406. console.error('base64 转换异常:', error)
  407. reject(error)
  408. }
  409. })
  410. }
  411. </script>
  412. <style lang="scss" scoped>
  413. .card-container {
  414. background: #f5f6f8;
  415. }
  416. .top-bg {
  417. width: 750rpx;
  418. height: 634rpx;
  419. position: fixed;
  420. top: 0;
  421. left: 0;
  422. z-index: 1;
  423. }
  424. // 顶部背景区域
  425. .header-bg {
  426. background: linear-gradient(135deg, #4A90E2 0%, #6FB3F2 50%, #87CEEB 100%);
  427. padding: 0 40rpx;
  428. padding-top: calc(var(--status-bar-height) + 20rpx);
  429. padding-bottom: 60rpx;
  430. position: relative;
  431. overflow: hidden;
  432. // 背景光效
  433. &::before {
  434. content: '';
  435. position: absolute;
  436. top: -100rpx;
  437. right: -100rpx;
  438. width: 500rpx;
  439. height: 500rpx;
  440. background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
  441. border-radius: 50%;
  442. }
  443. // 导航栏
  444. .nav-bar {
  445. display: flex;
  446. align-items: center;
  447. justify-content: space-between;
  448. height: 88rpx;
  449. position: relative;
  450. z-index: 10;
  451. .nav-back {
  452. width: 60rpx;
  453. height: 60rpx;
  454. display: flex;
  455. align-items: center;
  456. justify-content: center;
  457. }
  458. .nav-title {
  459. font-size: 32rpx;
  460. font-weight: 600;
  461. color: #ffffff;
  462. text-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  463. }
  464. .nav-right {
  465. display: flex;
  466. align-items: center;
  467. .more-btn,
  468. .refresh-btn {
  469. width: 64rpx;
  470. height: 64rpx;
  471. border-radius: 50%;
  472. background: rgba(255, 255, 255, 0.15);
  473. display: flex;
  474. align-items: center;
  475. justify-content: center;
  476. margin-left: 16rpx;
  477. }
  478. }
  479. }
  480. }
  481. .user-card {
  482. position: relative;
  483. z-index: 2;
  484. width: 100%;
  485. height: 400rpx;
  486. box-sizing: border-box;
  487. padding: 80rpx 40rpx 32rpx;
  488. position: relative;
  489. .user-card-bg {
  490. position: absolute;
  491. top: 0;
  492. left: 0;
  493. width: 100%;
  494. height: 100%;
  495. z-index: 0;
  496. }
  497. view,
  498. text {
  499. position: relative;
  500. z-index: 1;
  501. }
  502. .user-header {
  503. .name-row {
  504. display: flex;
  505. align-items: center;
  506. margin-bottom: 16rpx;
  507. .user-name {
  508. font-size: 44rpx;
  509. font-weight: 700;
  510. color: #202020;
  511. line-height: 1.2;
  512. }
  513. .user-role {
  514. margin-left: 16rpx;
  515. padding: 6rpx 16rpx;
  516. background: rgba(68, 110, 255, 0.10);
  517. border-radius: 8rpx;
  518. font-size: 24rpx;
  519. font-weight: 500;
  520. color: #446eff;
  521. }
  522. }
  523. .company-name {
  524. font-size: 28rpx;
  525. font-weight: 500;
  526. color: #666666;
  527. line-height: 1.4;
  528. }
  529. }
  530. .avatar-wrapper {
  531. position: absolute;
  532. top: 32rpx;
  533. right: 36rpx;
  534. z-index: 2;
  535. }
  536. .user-contact {
  537. margin-top: 32rpx;
  538. .contact-row {
  539. display: flex;
  540. align-items: center;
  541. margin-bottom: 16rpx;
  542. uni-icons {
  543. margin-right: 12rpx;
  544. flex-shrink: 0;
  545. }
  546. .contact-text {
  547. font-size: 26rpx;
  548. color: #666666;
  549. }
  550. }
  551. }
  552. }
  553. /* 用户信息卡片 */
  554. .page-top {
  555. margin: 0 24rpx 24rpx;
  556. .control-card {
  557. background-color: #fff;
  558. border-radius: 0 0 24rpx 24rpx;
  559. position: relative;
  560. z-index: 1;
  561. bottom: 24rpx;
  562. display: flex;
  563. align-items: center;
  564. justify-content: space-around;
  565. padding-top: 48rpx;
  566. padding-bottom: 24rpx;
  567. .item {
  568. display: flex;
  569. flex-direction: column;
  570. align-items: center;
  571. justify-content: center;
  572. gap: 4rpx;
  573. image {
  574. width: 64rpx;
  575. height: 64rpx;
  576. }
  577. .text {
  578. font-size: 26rpx !important;
  579. color: #202020;
  580. }
  581. }
  582. }
  583. }
  584. // 名片内容区域
  585. .card-content {
  586. margin: 0 24rpx;
  587. padding: 0 24rpx;
  588. border-radius: 24rpx;
  589. background: #ffffff;
  590. box-shadow: 0 -2rpx 12rpx rgba(0, 0, 0, 0.04);
  591. position: relative;
  592. bottom: 24rpx;
  593. z-index: 2;
  594. }
  595. // Tab 切换区域
  596. .tab-section {
  597. border-radius: 24rpx 24rpx 0 0;
  598. padding: 0 40rpx;
  599. .tab-wrapper {
  600. display: flex;
  601. border-bottom: 1rpx solid #f0f0f0;
  602. .tab-item {
  603. flex: 1;
  604. display: flex;
  605. flex-direction: column;
  606. align-items: center;
  607. padding: 32rpx 0;
  608. position: relative;
  609. .tab-text {
  610. font-size: 28rpx;
  611. color: #999999;
  612. font-weight: 500;
  613. }
  614. &.active .tab-text {
  615. color: #333333;
  616. font-weight: 600;
  617. }
  618. .tab-indicator {
  619. position: absolute;
  620. bottom: 0;
  621. width: 60rpx;
  622. height: 4rpx;
  623. background: linear-gradient(90deg, #4A90E2 0%, #6FB3F2 100%);
  624. border-radius: 2rpx;
  625. }
  626. }
  627. }
  628. }
  629. // 产品列表
  630. .product-list {
  631. padding: 24rpx 40rpx;
  632. .product-item {
  633. display: flex;
  634. padding: 24rpx 0;
  635. border-bottom: 1rpx solid #f0f0f0;
  636. &:last-child {
  637. border-bottom: none;
  638. }
  639. .product-image {
  640. width: 160rpx;
  641. height: 160rpx;
  642. border-radius: 12rpx;
  643. background: #f5f5f5;
  644. flex-shrink: 0;
  645. margin-right: 24rpx;
  646. }
  647. .product-info {
  648. flex: 1;
  649. display: flex;
  650. flex-direction: column;
  651. justify-content: center;
  652. .product-title {
  653. font-size: 28rpx;
  654. color: #333333;
  655. margin-bottom: 12rpx;
  656. line-height: 1.5;
  657. }
  658. .product-desc {
  659. font-size: 24rpx;
  660. color: #999999;
  661. }
  662. }
  663. }
  664. }
  665. // 企业简介
  666. .company-section {
  667. background: #ffffff;
  668. padding: 40rpx;
  669. .company-content {
  670. .company-text {
  671. display: block;
  672. font-size: 28rpx;
  673. color: #666666;
  674. line-height: 1.8;
  675. margin-bottom: 24rpx;
  676. ::v-deep img {
  677. max-width: 100% !important;
  678. }
  679. &:last-child {
  680. margin-bottom: 0;
  681. }
  682. }
  683. }
  684. }
  685. // 隐藏的 canvas 容器
  686. .hidden-canvas-box {
  687. position: fixed;
  688. left: -9999px;
  689. top: -9999px;
  690. width: 1px;
  691. height: 1px;
  692. overflow: hidden;
  693. }
  694. // 二维码弹窗样式
  695. .qr-popup {
  696. margin: 100rpx auto;
  697. width: 600rpx;
  698. background: #ffffff;
  699. border-radius: 24rpx;
  700. padding: 40rpx;
  701. box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.15);
  702. .qr-header {
  703. text-align: center;
  704. margin-bottom: 40rpx;
  705. .qr-title {
  706. display: block;
  707. font-size: 36rpx;
  708. font-weight: 600;
  709. color: #202020;
  710. margin-bottom: 12rpx;
  711. }
  712. .qr-subtitle {
  713. display: block;
  714. font-size: 26rpx;
  715. color: #999999;
  716. }
  717. }
  718. .qr-content {
  719. display: flex;
  720. justify-content: center;
  721. align-items: center;
  722. min-height: 400rpx;
  723. margin-bottom: 40rpx;
  724. .qr-image {
  725. width: 400rpx;
  726. height: 400rpx;
  727. border-radius: 16rpx;
  728. box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
  729. }
  730. .qr-loading {
  731. display: flex;
  732. justify-content: center;
  733. align-items: center;
  734. }
  735. }
  736. .qr-actions {
  737. display: flex;
  738. justify-content: space-around;
  739. .action-btn {
  740. display: flex;
  741. flex-direction: column;
  742. align-items: center;
  743. gap: 12rpx;
  744. padding: 20rpx 40rpx;
  745. border-radius: 16rpx;
  746. background: rgba(64, 128, 255, 0.08);
  747. .action-text {
  748. &::after {
  749. border: none;
  750. }
  751. line-height: 1;
  752. background-color: transparent;
  753. font-size: 26rpx;
  754. color: #4080FF;
  755. font-weight: 500;
  756. }
  757. }
  758. }
  759. }
  760. .resetButton {
  761. background-color: transparent !important;
  762. border: none !important;
  763. display: inline !important;
  764. &::after {
  765. border: none !important;
  766. }
  767. }
  768. </style>