加油站付款小程序,打印小票
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

163 lines
2.8 KiB

6 months ago
  1. <template>
  2. <view class="navbar">
  3. <view class="title">
  4. <view class="left">
  5. <uv-icon name="arrow-left"
  6. v-if="leftClick"
  7. @click="leftClick()"
  8. color="#333" size="46rpx"></uv-icon>
  9. </view>
  10. <view>{{ title }}</view>
  11. <view class="icon">
  12. <uv-icon name="search"
  13. v-if="isSearch"
  14. color="#333" size="58rpx"></uv-icon>
  15. <uv-icon name="plus-circle" color="#333"
  16. v-if="isPlus"
  17. @click="plusCircleShow = true"
  18. size="46rpx" style="margin-left: 30rpx;"></uv-icon>
  19. <view v-if="moreClick" style="margin-left: 30rpx;">
  20. <uv-icon name="more-dot-fill" color="#333"
  21. v-if="!moreText"
  22. @click="moreClick()"
  23. size="46rpx"></uv-icon>
  24. <view v-else @click="moreClick"
  25. style="font-weight: 400;font-size: 30rpx;">
  26. {{ moreText }}
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. export default {
  35. name:"navbar",
  36. props : {
  37. title : {
  38. type : String,
  39. default : ''
  40. },
  41. leftClick : {
  42. type : Function,
  43. },
  44. moreClick : {
  45. type : Function,
  46. },
  47. isSearch : {
  48. type : Boolean,
  49. default : false,
  50. },
  51. isPlus : {
  52. type : Boolean,
  53. default : false,
  54. },
  55. moreText : {
  56. }
  57. },
  58. created() {
  59. },
  60. beforeDestroy() {
  61. },
  62. data() {
  63. return {
  64. };
  65. },
  66. methods : {
  67. }
  68. }
  69. </script>
  70. <style lang="scss" scoped>
  71. .navbar{
  72. width: 100%;
  73. height: 100rpx;
  74. .cover{
  75. position: fixed;
  76. left: 0;
  77. top: 0;
  78. width: 100vw;
  79. height: 100vh;
  80. z-index: 9999999;
  81. }
  82. .plusCircle{
  83. position: fixed;
  84. top: calc(100rpx + var(--status-bar-height));
  85. right: 10rpx;
  86. background-color: rgb(76, 76, 76);
  87. z-index: 99999999;
  88. border-radius: 10rpx;
  89. animation: fade-in .5s;
  90. &::after{
  91. content: '';
  92. display: block;
  93. position: absolute;
  94. top: -34rpx;
  95. right: 35rpx;
  96. border-left: 20rpx solid transparent;
  97. border-right: 20rpx solid transparent;
  98. border-top: 20rpx solid transparent;
  99. border-bottom: 20rpx solid rgb(76, 76, 76);
  100. }
  101. &>view{
  102. display: flex;
  103. color: #fff;
  104. width: 300rpx;
  105. height: 120rpx;
  106. align-items: center;
  107. border-bottom: 1px solid #ffffff22;
  108. font-size: 30rpx;
  109. .icon{
  110. padding-left: 30rpx;
  111. padding-right: 20rpx;
  112. image{
  113. width: 40rpx;
  114. height: 40rpx;
  115. }
  116. }
  117. }
  118. }
  119. }
  120. .title{
  121. position: fixed;
  122. top: 0;
  123. left: 0;
  124. padding-top: var(--status-bar-height);
  125. width: 100%;
  126. height: 100rpx;
  127. background-color: #f7f7f7;
  128. display: flex;
  129. justify-content: center;
  130. font-size: 32rpx;
  131. align-items: center;
  132. z-index: 99999;
  133. .left{
  134. position: absolute;
  135. left: 40rpx;
  136. display: flex;
  137. justify-content: flex-start;
  138. }
  139. .icon{
  140. position: absolute;
  141. right: 40rpx;
  142. display: flex;
  143. justify-content: flex-end;
  144. }
  145. }
  146. @keyframes fade-in {
  147. 0% {
  148. opacity: 0;
  149. }
  150. 100% {
  151. opacity: 1;
  152. }
  153. }
  154. </style>