tui-footer.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <view class="tui-footer-class tui-footer" :class="[fixed?'tui-fixed':'']" :style='{backgroundColor:backgroundColor}'>
  3. <view class="tui-footer-link" v-if="navigate.length>0">
  4. <block v-for="(item,index) in navigate" :key="index">
  5. <navigator class="tui-link" hover-class="tui-link-hover" :hover-stop-propagation="true" :style="{color:(item.color || '#596d96'),fontSize:(item.size || 28)+'rpx'}"
  6. :open-type="item.type" :url="item.url" :target="item.target" :delta="item.delta" :app-id="item.appid"
  7. :path="item.path" :extra-data="item.extradata" :bindsuccess="item.bindsuccess" :bindfail="item.bindfail">{{item.text}}</navigator>
  8. </block>
  9. </view>
  10. <view class="tui-footer-copyright" :style="{color:color,fontSize:size+'rpx'}">
  11. {{copyright}}
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. name: "tuiFooter",
  18. props: {
  19. //type target url delta appid path extradata bindsuccess bindfail text color size
  20. //链接设置 数据格式对应上面注释的属性值
  21. navigate: {
  22. type: Array,
  23. default:function(){
  24. return []
  25. }
  26. },
  27. //底部文本
  28. copyright: {
  29. type: String,
  30. default: "All Rights Reserved."
  31. },
  32. //copyright 字体颜色
  33. color: {
  34. type: String,
  35. default: "#A7A7A7"
  36. },
  37. //copyright 字体大小
  38. size: {
  39. type: Number,
  40. default: 24
  41. },
  42. //footer背景颜色
  43. backgroundColor: {
  44. type: String,
  45. default: "transparent"
  46. },
  47. //是否固定在底部
  48. fixed: {
  49. type: Boolean,
  50. default: true
  51. }
  52. },
  53. methods: {
  54. }
  55. }
  56. </script>
  57. <style scoped>
  58. .tui-footer {
  59. width: 100%;
  60. overflow: hidden;
  61. padding: 30rpx 24rpx;
  62. box-sizing: border-box;
  63. }
  64. .tui-fixed {
  65. position: fixed;
  66. z-index: 9999;
  67. bottom: 0;
  68. left: 0;
  69. }
  70. .tui-footer-link {
  71. color: #596d96;
  72. display: flex;
  73. align-items: center;
  74. justify-content: center;
  75. font-size: 28rpx;
  76. }
  77. .tui-link {
  78. position: relative;
  79. padding: 0 18rpx;
  80. line-height: 1;
  81. }
  82. .tui-link::before {
  83. content: " ";
  84. position: absolute;
  85. right: 0;
  86. top: 0;
  87. width: 1px;
  88. bottom: 0;
  89. border-right: 1px solid #d3d3d3;
  90. -webkit-transform-origin: 100% 0;
  91. transform-origin: 100% 0;
  92. -webkit-transform: scaleX(0.5);
  93. transform: scaleX(0.5);
  94. }
  95. .tui-link:last-child::before {
  96. border-right: 0 !important
  97. }
  98. .tui-link-hover {
  99. opacity: 0.5
  100. }
  101. .tui-footer-copyright {
  102. font-size: 24rpx;
  103. color: #A7A7A7;
  104. line-height: 1;
  105. text-align: center;
  106. padding-top: 16rpx;
  107. padding-bottom:env(safe-area-inset-bottom);
  108. }
  109. </style>