gui-header-leading.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <view
  3. class="gui-header-leader gui-flex gui-row gui-nowrap gui-align-items-center">
  4. <view
  5. v-if="home"
  6. :style="{
  7. opacity : show ? 1 : 0
  8. }"
  9. class="gui-header-leader-btns"
  10. hover-class="gui-tap">
  11. <text
  12. :class="homeButtonClass"
  13. class="gui-header-leader-btns gui-block gui-icons"
  14. @tap="goHome">&#xe655;</text>
  15. </view>
  16. <view
  17. v-if="back"
  18. class="gui-header-leader-btns"
  19. :style="{
  20. opacity : show ? 1 : 0
  21. }"
  22. hover-class="gui-tap">
  23. <text
  24. style="font-size:44rpx;"
  25. :class="backButtonClass"
  26. class="gui-header-leader-btns gui-block gui-icons"
  27. @tap="goBack">&#xe600;</text>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. export default{
  33. name : "gui-header-leading",
  34. props : {
  35. back : {type:Boolean, default:true},
  36. home : {type:Boolean, default:true},
  37. backButtonClass : {type:Array, default:function(){return ['gui-primary-text'];}},
  38. homeButtonClass : {type:Array, default:function(){return ['gui-primary-text'];}}
  39. },
  40. data() {
  41. return {
  42. show : true
  43. }
  44. },
  45. mounted:function(){
  46. // #ifdef MP-ALIPAY
  47. this.show = false;
  48. // #endif
  49. // #ifdef MP-BAIDU
  50. this.show = false;
  51. // #endif
  52. // #ifdef MP-JD
  53. this.show = false;
  54. // #endif
  55. },
  56. methods:{
  57. goBack : function () {
  58. uni.navigateBack({delta:1});
  59. this.$emit('goBack');
  60. },
  61. goHome : function () {
  62. this.$emit('goHome');
  63. }
  64. },
  65. emits : ['goBack', 'goHome']
  66. }
  67. </script>
  68. <style scoped>
  69. .gui-header-leader{height:55rpx; border-radius:55rpx; font-weight:bold; margin-left:20rpx; overflow:hidden;}
  70. .gui-header-leader-btns{width:50rpx; line-height:50rpx; font-size:40rpx; margin:0rpx; overflow:hidden;}
  71. </style>