wbpNavBarTimer.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <view class="u-f-ajc u-f-jsb wbpNavBar" :style="{backgroundColor: bgColor}">
  3. <view class="wbp-back-content" @click="onBack">
  4. <image :src="bgColor!='#ffffff'?'/static/news/back_icon20.png':'/static/common/back.png'" class="wbp-back"></image>
  5. </view>
  6. <view v-if="title.length" style="display: flex; flex-direction: row; align-items: center; justify-content: center;">
  7. <image style="width: 32rpx; height: 32rpx;" src="../../static/questionnaire/top_time_icon.png"></image>
  8. <text class="wbp-title" :style="{color:titleColor}">{{title}}</text>
  9. </view>
  10. <view v-if="rightTitle.length > 0" class="wbp-right-icon">
  11. <view v-for="(item,index) in rightTitle" :src="item" :data-index="index" @click="rightTap">
  12. <text>{{item}}</text>
  13. </view>
  14. </view>
  15. <view v-else class="wbp-right-icon">
  16. <view v-for="(item,index) in rightIcons" :src="item" :data-index="index" @click="rightTap">
  17. <image :src="item"></image>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. props: {
  25. title: {
  26. type: String,
  27. default: ""
  28. },
  29. rightIcons: {
  30. type: Array,
  31. default: () => {
  32. return []
  33. }
  34. },
  35. rightTitle: {
  36. type: Array,
  37. default: () => {
  38. return []
  39. }
  40. },
  41. bgColor: {
  42. type: String,
  43. default: "#ffffff"
  44. },
  45. titleColor: {
  46. type: String,
  47. default: "#0A0204"
  48. },
  49. backgroundImage:{
  50. type: String,
  51. default: "#0A0204"
  52. },
  53. customBack: {
  54. type: Boolean,
  55. default: false
  56. }
  57. },
  58. data() {
  59. return {
  60. };
  61. },
  62. methods: {
  63. onBack() {
  64. if (!this.customBack) {
  65. uni.navigateBack({
  66. animationType: 'pop-out',
  67. animationDuration: 200
  68. });
  69. } else {
  70. this.$emit('backTap');
  71. }
  72. },
  73. rightTap(e) {
  74. this.$emit("rightTap", {
  75. index: e.currentTarget.dataset.index
  76. })
  77. }
  78. }
  79. }
  80. </script>
  81. <style lang="scss" scoped>
  82. .wbpNavBar {
  83. background-color: #FFFFFF;
  84. width: 750rpx;
  85. height: 88rpx;
  86. display: flex;
  87. justify-content: space-between;
  88. align-items: center;
  89. .wbp-back-content {
  90. width: 140rpx;
  91. height: 100%;
  92. display: flex;
  93. justify-content: flex-start;
  94. align-items: center;
  95. .wbp-back {
  96. width: 40rpx;
  97. height: 40rpx;
  98. margin-left: 30rpx;
  99. }
  100. }
  101. .wbp-title {
  102. margin-left: 10rpx;
  103. font-size: 32rpx;
  104. text-align: center;
  105. color: #0A0204;
  106. white-space: nowrap;
  107. text-overflow: ellipsis;
  108. overflow: hidden;
  109. word-break: break-all;
  110. }
  111. .wbp-right-icon {
  112. display: flex;
  113. width: 140rpx;
  114. flex-direction: row;
  115. justify-content: flex-end;
  116. align-items: center;
  117. height: 100%;
  118. image {
  119. width: 40rpx;
  120. height: 40rpx;
  121. margin-right: 30rpx;
  122. }
  123. text {
  124. margin-right: 30rpx;
  125. color: #DF0E14;
  126. font-size: 32rpx;
  127. }
  128. }
  129. }
  130. </style>