my-topbar.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <view class="topbar uni-row">
  3. <view class="topbar-left-right uni-row uni-jct">
  4. <uni-icons v-if="showBack" type="back" class="topbar-ico topbar-ico-back" @click="btnBack"></uni-icons>
  5. </view>
  6. <text class="title" v-html="title"></text>
  7. <view class="topbar-left-right uni-row uni-jce">
  8. <!-- <uni-icons type="settings" class="topbar-ico topbar-ico-settings" @click="btnFullscreen"></uni-icons> -->
  9. <view class="uni-row" @click="btnFullscreen">
  10. <img class="topbar-ico-fullscreen" src="/static/ico_fullscreen.svg" onload="SVGInject(this)" />
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. import SVGInject from '@iconfu/svg-inject';
  17. export default {
  18. name:"my-topbar",
  19. props: {
  20. title: {
  21. type: String,
  22. default: ""
  23. },
  24. showBack: {
  25. type: Boolean,
  26. default: true
  27. }
  28. },
  29. emits: ['btnBackClick', 'btnInfoClick', 'btnSettingsClick'],
  30. data() {
  31. return {
  32. };
  33. },
  34. onLoad() {
  35. },
  36. methods: {
  37. btnBack() {
  38. this.$emit('btnBackClick');
  39. },
  40. btnInfo() {
  41. this.$emit('btnInfoClick');
  42. },
  43. btnFullscreen() {
  44. this.$global.fullscreen();
  45. this.$emit('btnSettingsClick');
  46. }
  47. }
  48. }
  49. </script>
  50. <style>
  51. .topbar {
  52. width: 97%;
  53. justify-content: space-between;
  54. color: #000000;
  55. }
  56. .topbar-color-default {
  57. color: #5b9100;
  58. }
  59. .topbar-left-right {
  60. min-width: 50rpx;
  61. }
  62. .topbar-ico { width: 43rpx; height: 43rpx;
  63. /* padding: 0 10rpx; */ color: inherit !important; font-size: 46rpx !important; }
  64. .topbar-ico-back {
  65. /* padding-right: 10rpx; */
  66. }
  67. .topbar-ico-settings {
  68. padding-right: 16rpx;
  69. }
  70. .topbar-ico-fullscreen {
  71. width: 39rpx;
  72. height: 39rpx;
  73. padding-right: 16rpx;
  74. }
  75. .topbar-rule {
  76. /* width: 60rpx; */
  77. padding: 0 10rpx;
  78. font-size: 30rpx;
  79. white-space: nowrap;
  80. }
  81. .title {
  82. /* padding: 0 10rpx; */
  83. /* width: 80%; */
  84. font-size: 36rpx;
  85. font-weight: 550;
  86. white-space: nowrap;
  87. overflow: hidden;
  88. /* text-overflow: ellipsis; */
  89. }
  90. .exchangeTitle {
  91. font-size: 22px;
  92. font-weight: 550;
  93. color: #A65600;
  94. white-space: nowrap;
  95. overflow: hidden;
  96. }
  97. </style>