IdentityType.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <view
  3. class="identity-type dir-left-nowrap"
  4. :class="{
  5. vip: isVip,
  6. normal: isNormal
  7. }"
  8. >
  9. <view class="static-text main-center cross-center">会员身份</view>
  10. <view class="identity-box dir-left-nowrap">
  11. <view class="user-type main-center cross-center">{{ isVip?'福卡会员':'普通用户' }}</view>
  12. <view class="discount main-center cross-center">
  13. {{ isVip?'享受福卡特权':'享受普通优惠' }}
  14. <u-text :text="price" mode="price" color="#ffffff" />
  15. </view>
  16. </view>
  17. <view class="checked main-center cross-center">
  18. <i v-if="checked" class="iconfont icon-checked" />
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. name: 'IdentityType',
  25. props: {
  26. price: {
  27. type: Number,
  28. default: 0
  29. },
  30. isVip: {
  31. type: Boolean,
  32. default: false
  33. },
  34. isNormal: {
  35. type: Boolean,
  36. default: false
  37. },
  38. checked: {
  39. type: Boolean,
  40. default: false
  41. }
  42. },
  43. data() {
  44. return {}
  45. },
  46. computed: {
  47. },
  48. methods: {}
  49. }
  50. </script>
  51. <style lang="scss" scoped>
  52. @import '@/static/css/mixin.scss';
  53. $vipHeight: 60;
  54. $height: $vipHeight + 8;
  55. .identity-type{
  56. margin: 10rpx 0;
  57. color: #fff;
  58. font-size: 28rpx;
  59. .static-text{
  60. height: #{$height}rpx;
  61. flex-shrink: 0;
  62. width: 150rpx;
  63. background-color: #888D93;
  64. }
  65. .identity-box{
  66. background: linear-gradient(#A6ADBF, #7E8796);
  67. flex: 1;
  68. .user-type{
  69. height: #{$height}rpx;
  70. width: 180rpx;
  71. }
  72. .discount{
  73. flex: 1;
  74. height: #{$height}rpx;
  75. }
  76. }
  77. .checked{
  78. height: #{$height}rpx;
  79. width: 100rpx;
  80. .iconfont{
  81. font-size: 46rpx;
  82. color: $text-grey-color;
  83. }
  84. }
  85. &.vip,
  86. &.normal{
  87. .static-text{
  88. background-color: #F9D2B5;
  89. color: #3D434F;
  90. }
  91. }
  92. &.vip{
  93. .identity-box {
  94. @include vipBorder;
  95. .user-type {
  96. height: #{$vipHeight}rpx;
  97. }
  98. .discount {
  99. height: #{$vipHeight}rpx;
  100. }
  101. }
  102. }
  103. &.normal{
  104. .identity-box{
  105. @include background;
  106. }
  107. }
  108. }
  109. </style>