share-model.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <view class="share_content" v-if="show">
  3. <view class="share_box">
  4. <view class="box_bottom hflex acenter jbetween">
  5. <view class="vflex">
  6. <view class="bottom_left1">船百知</view>
  7. <view class="bottom_left2">船百知伴您一起扬帆起航,驶向成功彼岸。</view>
  8. </view>
  9. <image :src="data.ewm" class="bottom_right"></image>
  10. </view>
  11. </view>
  12. <view class="share_bottom">
  13. <view class="hflex acenter jbetween">
  14. <button class="vflex acenter jcenter bottom_item" open-type="share">
  15. <image src="/static/images/comment/wx.png" class="item_icon"></image>
  16. <view class="item_text">微信好友</view>
  17. </button>
  18. <button class="vflex acenter jcenter bottom_item" open-type="share">
  19. <image src="/static/images/comment/moments.png" class="item_icon"></image>
  20. <view class="item_text">朋友圈</view>
  21. </button>
  22. <view class="vflex acenter jcenter bottom_item" @click="saveImg">
  23. <image src="/static/images/comment/download.png" class="item_icon"></image>
  24. <view class="item_text">保存图片</view>
  25. </view>
  26. </view>
  27. <view class="share_cancel" @click="cancel">取消</view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import $api from '@/static/js/api.js'
  33. var that = ''
  34. export default {
  35. name:"share-model",
  36. props: {
  37. show: {
  38. type: Boolean,
  39. value: false
  40. },
  41. data: {
  42. type: Object,
  43. value: {}
  44. }
  45. },
  46. data() {
  47. return {
  48. }
  49. },
  50. onLoad() {
  51. that = this
  52. },
  53. onShareAppMessage(res) {
  54. if (res.from === 'button') {// 来自页面内分享按钮
  55. console.log(res.target)
  56. }
  57. return {
  58. title: '船百知', //分享的名称
  59. }
  60. },
  61. onShareTimeline(res) {
  62. return {
  63. title: '船百知',
  64. type: 0,
  65. summary: "",
  66. }
  67. },
  68. methods: {
  69. // 取消
  70. cancel() {
  71. this.$emit('cancel', false)
  72. },
  73. saveImg() {
  74. this.$emit('saveImg')
  75. }
  76. },
  77. }
  78. </script>
  79. <style lang="scss" scoped>
  80. .share_content::v-deep {
  81. position: absolute;
  82. top: 0;
  83. left: 0;
  84. z-index: 99;
  85. width: 100vw;
  86. height: 100vh;
  87. background: rgba(0,0,0,0.5);
  88. backdrop-filter: blur(5px);
  89. .share_box {
  90. margin: 148rpx auto;
  91. width: 650rpx;
  92. background: #FFFFFF;
  93. border-radius: 20rpx;
  94. box-sizing: border-box;
  95. padding: 0 40rpx;
  96. .box_bottom {
  97. width: 100%;
  98. padding: 34rpx 0 16rpx;
  99. border-top: 1rpx dashed #C3C3C3;
  100. .bottom_left1 {
  101. font-size: 32rpx;
  102. font-weight: 500;
  103. color: #222222;
  104. line-height: 44rpx;
  105. padding-bottom: 20rpx;
  106. }
  107. .bottom_left2 {
  108. font-size: 22rpx;
  109. font-weight: 400;
  110. color: #999999;
  111. line-height: 32rpx;
  112. }
  113. .bottom_right {
  114. width: 136rpx;
  115. height: 136rpx;
  116. }
  117. }
  118. }
  119. .share_bottom {
  120. position: fixed;
  121. bottom: 0;
  122. width: 100%;
  123. height: 388rpx;
  124. background: #F5F7FF;
  125. border-radius: 40rpx 40rpx 0px 0px;
  126. .bottom_item {
  127. width: 33%;
  128. margin: 50rpx 0 90rpx;
  129. border: none !important;
  130. background-color: #F5F7FF !important;
  131. .item_icon {
  132. width: 76rpx;
  133. height: 76rpx;
  134. }
  135. .item_text {
  136. font-size: 26rpx;
  137. font-weight: 400;
  138. color: #333333;
  139. line-height: 36rpx;
  140. margin-top: 12rpx;
  141. }
  142. }
  143. button::after {
  144. border: none !important;
  145. }
  146. .share_cancel {
  147. width: 100%;
  148. text-align: center;
  149. font-size: 32rpx;
  150. font-weight: 400;
  151. color: #333333;
  152. line-height: 44rpx;
  153. }
  154. }
  155. }
  156. </style>