page-header.vue 949 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <view>
  3. <view class="header-wrap" :style="{backgroundColor: bg}">
  4. <view :style="{opacity: showLeft ? 1 : 0}" class="left" @click="goBack()">
  5. <image src="@/static/right-arrow.png" alt="" />
  6. </view>
  7. <view class="center">{{ name }}</view>
  8. <view class="right"></view>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. data() {
  15. return {
  16. }
  17. },
  18. props: ['name','showLeft','showRight', 'bg'],
  19. onLoad() {
  20. },
  21. methods: {
  22. goBack() {
  23. this.$emit('goBack')
  24. }
  25. }
  26. }
  27. </script>
  28. <style scoped lang="scss">
  29. .header-wrap {
  30. display: flex;
  31. justify-content: center;
  32. align-items: center;
  33. color: white;
  34. height: 85rpx;
  35. font-size: 38rpx;
  36. padding: 0 34rpx;
  37. .left {
  38. width: 20%;
  39. transform: rotate(180deg);
  40. text-align: right;
  41. image {
  42. width: 20rpx;
  43. height: 36rpx;
  44. }
  45. }
  46. .center {
  47. width: 60%;
  48. text-align: center;
  49. }
  50. .right {
  51. width: 20%;
  52. }
  53. }
  54. </style>