index.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <u-navbar :title="title" placeholder class="custom_nav_bar">
  3. <template slot="left">
  4. <slot name="left">
  5. <view class="u-nav-slot">
  6. <image
  7. @click="leftClick"
  8. class="back_icon"
  9. width="12"
  10. height="20"
  11. src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/common_left_arrow.png"
  12. style="red;width: 12px;height: 20px;"
  13. alt=""
  14. srcset=""/>
  15. </view>
  16. </slot>
  17. </template>
  18. <template slot="center">
  19. <slot name="center">
  20. {{title}}
  21. </slot>
  22. </template>
  23. <template slot="right">
  24. <slot name="more">
  25. <view @click="rightClick" v-if="more" class="u-nav-slot">
  26. <u-icon
  27. class="more_dot"
  28. name="more-dot-fill"
  29. size="23"
  30. color="#0C1C33"></u-icon>
  31. </view>
  32. </slot>
  33. </template>
  34. </u-navbar>
  35. </template>
  36. <script>
  37. export default {
  38. name: "",
  39. components: {},
  40. props: {
  41. title: {
  42. type: String,
  43. },
  44. more: {
  45. type: Boolean,
  46. default: false,
  47. },
  48. route: {
  49. type: Boolean,
  50. default: true,
  51. },
  52. },
  53. data() {
  54. return {};
  55. },
  56. methods: {
  57. leftClick() {
  58. if (this.route) {
  59. uni.navigateBack();
  60. }
  61. this.$emit("leftClick");
  62. },
  63. rightClick() {
  64. this.$emit("rightClick");
  65. },
  66. },
  67. };
  68. </script>
  69. <style lang="scss" scoped>
  70. .custom_nav_bar {
  71. /deep/ .u-navbar__content__left {
  72. padding: 0;
  73. }
  74. /deep/ .u-navbar__content__right {
  75. padding: 0;
  76. }
  77. .back_icon {
  78. padding: 24rpx;
  79. margin-left: 20rpx;
  80. }
  81. .more_dot {
  82. padding: 24rpx;
  83. margin-right: 20rpx;
  84. }
  85. }
  86. </style>