cm-selector-coupons.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view class="selector-coupons" :style="{ top: top + 'px' }" v-if="visible" @click="$emit('click')">
  3. <image :src="image"></image>
  4. <view class="content">
  5. <text class="title">{{ title }}</text> <text class="subTitle">{{ subTitle }}</text>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. export default {
  11. name: 'cm-selector-coupons',
  12. props: {
  13. top: {
  14. type: Number,
  15. default: 0
  16. },
  17. image: {
  18. type: String
  19. },
  20. title: {
  21. type: String
  22. },
  23. subTitle: {
  24. type: String
  25. },
  26. visible: {
  27. type: Boolean,
  28. default: false
  29. }
  30. },
  31. created() {
  32. console.log(this.title, this.subTitle)
  33. }
  34. }
  35. </script>
  36. <style lang="scss" scoped>
  37. .selector-coupons {
  38. position: fixed;
  39. z-index: 999999;
  40. top: 0;
  41. left: 0;
  42. display: flex;
  43. justify-content: space-between;
  44. align-items: center;
  45. width: 750rpx;
  46. height: 128rpx;
  47. background: rgba(0, 0, 0, 0.7);
  48. box-sizing: border-box;
  49. padding: 0 40rpx;
  50. image {
  51. width: 78rpx;
  52. height: 78rpx;
  53. border-radius: 50%;
  54. }
  55. .content {
  56. display: flex;
  57. flex: 1;
  58. flex-direction: column;
  59. align-items: flex-start;
  60. justify-content: center;
  61. margin-left: 24rpx;
  62. .title {
  63. font-size: 26rpx;
  64. color: #fff;
  65. }
  66. .subTitle {
  67. font-size: 26rpx;
  68. color: #fff;
  69. margin-top: 10rpx;
  70. }
  71. }
  72. }
  73. </style>