index.vue 20 KB

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