tui-share.nvue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <view class="container">
  3. <text class="tui-share-title">分享到</text>
  4. <view class="tui-share-list">
  5. <view class="tui-share-item" hover-class="tui-hover" :hover-stay-time="150" v-for="(item, index) in shareList" :key="index">
  6. <view class="tui-share-icon"><image :src="'/static/images/share/'+item.icon" class="tui-icon-app"></image></view>
  7. <text class="tui-share-text">{{ item.name }}</text>
  8. </view>
  9. </view>
  10. <view class="tui-btn-cancel" @tap="shareCancel"><text class="tui-btn-text">取消</text></view>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. data() {
  16. return {
  17. //"QQ","微信","朋友圈","新浪微博"
  18. shareList: [{
  19. name: "QQ",
  20. icon: "icon_qq.png"
  21. }, {
  22. name: "微信",
  23. icon: "icon_wechat.png"
  24. }, {
  25. name: "朋友圈",
  26. icon: "icon_moments.png"
  27. }, {
  28. name: "新浪微博",
  29. icon: "icon_sina.png"
  30. }]
  31. };
  32. },
  33. created() {
  34. const vm = this;
  35. // uni.$on('page-share', (data) => {
  36. // vm.page = data.page;
  37. // })
  38. },
  39. beforeDestroy() {
  40. //uni.$off('page-share')
  41. },
  42. methods: {
  43. shareCancel() {
  44. const subNVue = uni.getCurrentSubNVue();
  45. subNVue.hide('slide-out-bottom', 250);
  46. }
  47. }
  48. };
  49. </script>
  50. <style scoped>
  51. .container {
  52. padding: 0;
  53. background-color: #e8e8e8;
  54. }
  55. .tui-share-title {
  56. font-size: 26rpx;
  57. color: #7e7e7e;
  58. text-align: center;
  59. line-height: 26rpx;
  60. padding-top: 30rpx;
  61. padding-bottom: 80rpx;
  62. }
  63. .tui-share-list {
  64. width: 750rpx;
  65. padding-left: 36rpx;
  66. padding-right: 36rpx;
  67. flex-direction: row;
  68. align-items: center;
  69. justify-content: space-between;
  70. }
  71. .tui-share-item {
  72. width: 126rpx;
  73. align-items: center;
  74. }
  75. .tui-share-item:active {
  76. opacity: 0.6;
  77. }
  78. .tui-share-icon {
  79. align-items: center;
  80. justify-content: center;
  81. background-color: #ffffff;
  82. height: 126rpx;
  83. width: 126rpx;
  84. border-radius: 32rpx;
  85. }
  86. .tui-icon-app {
  87. height: 68rpx;
  88. width: 68rpx;
  89. }
  90. .tui-share-text {
  91. font-size: 24rpx;
  92. line-height: 24rpx;
  93. color: #7e7e7e;
  94. padding-top: 20rpx;
  95. padding-bottom: 20rpx;
  96. }
  97. .tui-btn-cancel {
  98. width: 750rpx;
  99. height: 100rpx;
  100. position: fixed;
  101. left: 0;
  102. bottom: 0;
  103. align-items: center;
  104. justify-content: center;
  105. background-color: #f6f6f6;
  106. /* border-top-width: 1rpx;
  107. border-top-style: solid;
  108. border-top-color: #eaeef1; */
  109. }
  110. .tui-btn-cancle:active {
  111. background-color: #eee;
  112. }
  113. .tui-btn-text {
  114. font-size: 34rpx;
  115. color: #3e3e3e;
  116. }
  117. </style>