card.vue 20 KB

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