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