index.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <view class="control-card">
  3. <button class="item" open-type="share"> 发名片 </button>
  4. </view>
  5. </template>
  6. <script setup>
  7. import {
  8. onShareAppMessage
  9. } from '@dcloudio/uni-app';
  10. import {
  11. useUserStore
  12. } from '@/store/modules/user.js'
  13. import {
  14. storeToRefs
  15. } from 'pinia'
  16. const userStore = useUserStore()
  17. const {
  18. cardInfo,
  19. cardImage
  20. } = storeToRefs(userStore)
  21. onShareAppMessage(() => {
  22. return {
  23. userName: '小程序',
  24. path: 'pages/splash/splash?userId=' + cardInfo.value.userId,
  25. imageUrl: cardImage.value
  26. };
  27. });
  28. </script>
  29. <style lang="scss" scoped>
  30. .control-card {
  31. background-color: #fff;
  32. border-radius: 0 0 24rpx 24rpx;
  33. position: relative;
  34. z-index: 1;
  35. bottom: 24rpx;
  36. display: flex;
  37. align-items: center;
  38. justify-content: space-around;
  39. padding: 48rpx 40rpx 24rpx;
  40. .item {
  41. display: flex;
  42. width: 100%;
  43. flex-direction: column;
  44. align-items: center;
  45. justify-content: center;
  46. gap: 4rpx;
  47. background-color: #155DFC;
  48. font-size: 28rpx !important;
  49. border-radius: 40rpx;
  50. height: 80rpx;
  51. color: #fff;
  52. }
  53. }
  54. </style>