footer-share.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <view class="footer-share-box display-around">
  3. <button
  4. class="display-flex-start items-center share-font"
  5. :style="{ 'border-right': isCollection ? '1px solid #d8d8d8' : 'none' }"
  6. open-type="share"
  7. @click="sharePage()"
  8. >
  9. <view style="margin-right: 15rpx; font-size: 26rpx">分享</view>
  10. <image
  11. src="../../static/share_icon.png"
  12. mode="aspectFill"
  13. style="width: 30rpx; height: 30rpx"
  14. ></image>
  15. </button>
  16. <view
  17. class="display-flex-start items-center share-font"
  18. v-if="isCollection"
  19. @click="collectionPage()"
  20. >
  21. <view style="margin-right: 15rpx; font-size: 26rpx">收藏</view>
  22. <image
  23. :src="isCollectedIcon ? '../../static/collected.png' : '../../static/collection.png'"
  24. mode="aspectFill"
  25. style="width: 40rpx; height: 40rpx"
  26. ></image>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. name: "footer-share",
  33. props: {
  34. isCollection: {
  35. type: Boolean,
  36. default: false,
  37. },
  38. isCollectedIcon: {
  39. type: Boolean,
  40. default: false,
  41. },
  42. },
  43. data() {
  44. return {};
  45. },
  46. methods: {
  47. sharePage() {
  48. this.$emit("sharePages");
  49. },
  50. collectionPage() {
  51. this.$emit("collectionPages");
  52. },
  53. },
  54. };
  55. </script>
  56. <style>
  57. .footer-share-box {
  58. height: 50rpx;
  59. position: fixed;
  60. bottom: 0;
  61. width: 98%;
  62. border-radius: 10rpx;
  63. box-shadow: 0px 2px 16px rgba(0, 0, 0, 0.1);
  64. padding: 20rpx;
  65. background: #fff;
  66. margin-left: -20rpx;
  67. }
  68. .share-font {
  69. width: 45%;
  70. justify-content: center;
  71. }
  72. .footer-share-box button {
  73. background-color: #fff;
  74. border-radius: 0;
  75. }
  76. .footer-share-box button::after {
  77. border: none;
  78. }
  79. </style>