CommonFooter.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <view class="footBox-container">
  3. <view class="footBox">
  4. <view class="add" @click="leftClick" v-if="leftText">
  5. <uni-icons type="plus" size="20" color="#fff"></uni-icons>
  6. {{ leftText }}
  7. </view>
  8. <view class="reg" @click="rightClick" v-if="rightText">
  9. <uni-icons type="scan" size="20" color="#fff" v-if="icon"></uni-icons>
  10. {{ rightText }}
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. props: {
  18. leftText: String,
  19. rightText: String,
  20. icon: {
  21. type: Boolean,
  22. default: true
  23. }
  24. },
  25. data () {
  26. return {}
  27. },
  28. methods: {
  29. leftClick () {
  30. this.$emit('leftClick')
  31. },
  32. rightClick () {
  33. this.$emit('rightClick')
  34. }
  35. }
  36. }
  37. </script>
  38. <style lang="scss" scoped>
  39. .footBox-container {
  40. height: 100rpx;
  41. width: 100vw;
  42. }
  43. .footBox {
  44. position: fixed;
  45. left: 0px;
  46. bottom: 0px;
  47. height: 100rpx;
  48. width: 100%;
  49. display: flex;
  50. align-items: center;
  51. justify-content: space-between;
  52. view {
  53. width: 100%;
  54. height: 100%;
  55. text-align: center;
  56. color: #fff;
  57. display: flex;
  58. align-items: center;
  59. justify-content: center;
  60. }
  61. .add {
  62. background: $uni-color-success;
  63. }
  64. .reg {
  65. background: $u-success-dark;
  66. }
  67. .uni-icons {
  68. margin-right: 8rpx !important;
  69. font-weight: bold;
  70. }
  71. }
  72. </style>