pageButton.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <view class="i-z-index3" v-show="isShow">
  3. <!-- 头部 -->
  4. <view class="i-pst-f i-l-p11 i-t-p5 i-z-index3 animate__animated"
  5. :class="pageStatus===1?'animate__fadeInLeft':pageStatus===3?'animate__fadeOutLeft':''">
  6. <view class=" i-flex i-al-center" @click="gotoLast()">
  7. <view class="i-radius-p50 i-bd-1 i-flex i-al-center i-jst-center">
  8. <uni-icons type="back" size="1.6rem" color="#FFF"></uni-icons>
  9. </view>
  10. <span class="i-c-fff i-ml-10 i-fs-30">{{nowTitle}}</span>
  11. </view>
  12. </view>
  13. <!-- 底部按钮 -->
  14. <view class="i-pst-f i-r-p10 i-b-p15 i-flex i-z-index3">
  15. <view class=" animate__animated"
  16. :class="pageStatus===1?'animate__fadeInRight':pageStatus===3?'animate__fadeOutRight':''">
  17. <view class=" i-flex i-al-center i-z-index3 i-bd-1 i-radius-40 i-plr-20 i-ptb-20 i-b-c-fff"
  18. @click="gotoLast()">
  19. <view class="i-radius-p50 i-bd-3 i-flex i-al-center i-jst-center" tabindex="-1">
  20. <uni-icons type="back" size="1.7rem" color="#000" tabindex="-1"></uni-icons>
  21. <!-- <span class="i-fs-20"><</span> -->
  22. </view>
  23. <span class="i-c-000 i-ml-10 i-fs-26">返回上一级</span>
  24. </view>
  25. </view>
  26. <view class="i-ml-10 animate__animated"
  27. :class="pageStatus===1?'animate__fadeInRight':pageStatus===3?'animate__fadeOutRight':''">
  28. <view class=" i-flex i-al-center i-z-index3 i-bd-1 i-radius-40 i-plr-20 i-ptb-20 i-b-c-fff"
  29. @click="gotoBack()">
  30. <!-- <view class="i-radius-p50 i-bd-3 i-p-2"> -->
  31. <uni-icons type="home" size="1.9rem" color="#000"></uni-icons>
  32. <!-- </view> -->
  33. <span class="i-c-000 i-ml-10 i-fs-26">回到首页</span>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. export default {
  41. name: "pageButton",
  42. data() {
  43. return {
  44. };
  45. },
  46. props: {
  47. buttonData: {
  48. type: Object,
  49. },
  50. nowTitle: {
  51. type: String,
  52. default: '默认'
  53. },
  54. isShow: {
  55. type: Boolean,
  56. default: true
  57. },
  58. // 页面状态 动画效果
  59. pageStatus: {
  60. type: Number,
  61. default: 1,
  62. },
  63. },
  64. watch: {},
  65. methods: {
  66. // 返回上一页
  67. gotoLast() {
  68. // 先执行动画再返回
  69. if (this.buttonData.lastpage[this.buttonData.lastpage.length - 2] == 'default') {
  70. // this.buttonAnimation()
  71. }
  72. this.$emit('tolastEvent')
  73. },
  74. // 返回主页
  75. gotoBack() {
  76. this.$emit('backEvent')
  77. }
  78. }
  79. }
  80. </script>
  81. <style>
  82. uni-icons: {
  83. pointer-events: none;
  84. outline: none;
  85. }
  86. </style>