index.vue 1.2 KB

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