index.vue 19 KB

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