index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view @touchmove.stop.prevent="moveHandle">
  3. <u-popup :show="show" :round="10">
  4. <view class="content">
  5. <view class="title">
  6. <text>分享</text>
  7. <u-icon name="close" @click="close"></u-icon>
  8. </view>
  9. <view class="shareType">
  10. <view>
  11. <!-- <view class="iconBox" @click="shareToWechart">
  12. <i class="t-icon custom-t-icon-wechart"></i>
  13. </view> -->
  14. <button type="default" class="iconBox" open-type="share">
  15. <i class="t-icon custom-t-icon-wechart"></i>
  16. </button>
  17. <text>微信好友</text>
  18. </view>
  19. <view>
  20. <view class="iconBox" @click="shareToMoments">
  21. <i class="t-icon custom-t-icon-moments"></i>
  22. </view>
  23. <text>朋友圈</text>
  24. </view>
  25. <view>
  26. <view class="iconBox" @click="shareLink">
  27. <i class="t-icon custom-t-icon-link"></i>
  28. </view>
  29. <text>复制链接</text>
  30. </view>
  31. </view>
  32. <button type="default">
  33. <i class="t-icon custom-t-icon-wechart"></i>
  34. </button>
  35. </view>
  36. </u-popup>
  37. </view>
  38. </template>
  39. <script>
  40. export default {
  41. props: {
  42. // 弹出层是否展示
  43. show: {
  44. type: Boolean,
  45. default: false
  46. },
  47. },
  48. options: {
  49. styleIsolation: "shared", // 解除组件样式隔离
  50. },
  51. data() {
  52. return {
  53. };
  54. },
  55. methods: {
  56. // 关闭分享弹窗
  57. close() {
  58. this.$emit('close')
  59. },
  60. // 禁止外层容器滚动
  61. moveHandle() {},
  62. // 分享给微信好友
  63. shareToWechart(){
  64. console.log(11)
  65. },
  66. // 分享到朋友圈
  67. shareToMoments(){
  68. console.log(22)
  69. },
  70. // 分享链接
  71. shareLink(){
  72. console.log(33)
  73. },
  74. }
  75. }
  76. </script>
  77. <style lang="scss" scoped>
  78. ::v-deep .u-popup {
  79. .content {
  80. height: 600rpx;
  81. padding: 40rpx;
  82. }
  83. .title {
  84. display: flex;
  85. justify-content: space-between;
  86. font-size: 50rpx;
  87. font-weight: 900;
  88. }
  89. .shareType {
  90. display: flex;
  91. align-items: center;
  92. text-align: center;
  93. margin-top: 50rpx;
  94. >view {
  95. margin-right: 20rpx;
  96. }
  97. .iconBox {
  98. // width: 120rpx;
  99. // height: 120rpx;
  100. width: 60px;
  101. height: 60px;
  102. border: 2rpx solid #ccc;
  103. border-radius: 20rpx;
  104. margin-bottom: 20rpx;
  105. display: flex;
  106. align-items: center;
  107. justify-content: center;
  108. .t-icon {
  109. width: 50rpx;
  110. height: 50rpx;
  111. }
  112. }
  113. }
  114. }
  115. </style>