VipView.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <!-- 会员卡面板 -->
  3. <view class="mask" :class="!maskState ? 'none' : maskState ? 'show' : ''">
  4. <view class="shadow-bg"></view>
  5. <view class="mask-content" @click.stop.prevent="stopPrevent">
  6. <view class="dont-use"><text @click="dontUse">不使用会员卡</text></view>
  7. <view v-for="(item) in vipList" :key="item.id" @click="selvip(item)" style="margin:10rpx 0">
  8. <view class="bg_color" :class="item.styleId===1?'card-style-golden':item.styleId===2?'card-style-erythrine':item.styleId===3?'card-style-gray':item.styleId===4?'card-style-brown':item.styleId===5?'card-style-blue':item.styleId===6?'card-style-black':''">
  9. <view class="clearfix">
  10. <view class="float_left">
  11. <view class="vip-name">
  12. <image class="vip-img" src="https://onlineimg.qianniao.vip/vip-icon.png" mode="aspectFit" />
  13. <text class="vip-name-tit">{{item.name}}</text>
  14. </view>
  15. <view class="expiration">有效期至:{{ item.effectiveDate === 5 ? '长期有效' : item.effectiveMonth + '个月'}}</view>
  16. </view>
  17. <view class="float_right discount">
  18. <text class="rmb-ic">¥</text>
  19. {{$_utils.formatNub(item.price)}}
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. props: {
  30. maskState: {
  31. type: Boolean,
  32. default: false
  33. },
  34. vipList: {
  35. type: Array,
  36. default: () => {
  37. return [];
  38. }
  39. }
  40. },
  41. onLoad() {
  42. this.vipList()
  43. },
  44. data() {
  45. return {}
  46. },
  47. methods: {
  48. stopPrevent() {},
  49. //不使用优惠
  50. dontUse() {
  51. this.$emit('dontUse');
  52. },
  53. // 选择优惠券
  54. selvip(row) {
  55. this.$emit('selvip', row);
  56. }
  57. }
  58. };
  59. </script>
  60. <style lang="scss">
  61. /* 优惠券面板 */
  62. .mask {
  63. position: fixed;
  64. left: 0;
  65. top: 100%;
  66. // bottom: 0;
  67. width: 100%;
  68. // background: rgba(0, 0, 0, 0);
  69. z-index: 9995;
  70. height: 100vh;
  71. transition: 0.3s;
  72. .shadow-bg {
  73. background: rgba(0, 0, 0, 0.4);
  74. position: absolute;
  75. top: 0;
  76. left: 0;
  77. width: 100%;
  78. height: 100vh;
  79. }
  80. .mask-content {
  81. position: absolute;
  82. bottom: 0;
  83. left: 0;
  84. width: 100%;
  85. min-height: 30vh;
  86. max-height: 70vh;
  87. background: #f3f3f3;
  88. z-index: 9995;
  89. // transform: translateY(100%);
  90. transition: 0.3s;
  91. overflow-y: scroll;
  92. .dont-use {
  93. text-align: right;
  94. color: #666;
  95. font-size: 24upx;
  96. padding: 20upx 30upx;
  97. }
  98. }
  99. &.none {
  100. top: 100%;
  101. .shadow-bg {
  102. display: none;
  103. }
  104. .mask-content {
  105. transform: translateY(100%);
  106. }
  107. }
  108. &.show {
  109. top: 0;
  110. .shadow-bg {
  111. display: block;
  112. }
  113. .mask-content {
  114. transform: translateY(0);
  115. }
  116. }
  117. }
  118. .card-style-golden {
  119. background: linear-gradient(to right, #c1a167, #e9d5aa);
  120. }
  121. .card-style-erythrine {
  122. background: linear-gradient(to right, #745757, #966d6d);
  123. }
  124. .card-style-gray {
  125. background: linear-gradient(to right, #434247, #7a7985);
  126. }
  127. .card-style-brown {
  128. background: linear-gradient(to right, #736e6c, #978c8c);
  129. }
  130. .card-style-blue {
  131. background: linear-gradient(to right, #576074, #6d7b96);
  132. }
  133. .card-style-black {
  134. background: linear-gradient(to right, #373737, #4a4a4a);
  135. }
  136. .bg_color {
  137. position: relative;
  138. margin: 0 auto;
  139. width: 600upx;
  140. border-radius: 10upx;
  141. color: #FFFFFF;
  142. padding: 20upx;
  143. .vip-img {
  144. width: 40rpx;
  145. height: 40rpx;
  146. vertical-align: middle;
  147. opacity: 0.9;
  148. }
  149. .vip-name {
  150. font-size: 30upx;
  151. .vip-name-tit {
  152. padding-left: 15upx;
  153. }
  154. }
  155. .discount {
  156. font-size: 60upx;
  157. font-weight: bold;
  158. text-align: right;
  159. .rmb-ic {
  160. font-weight: 400;
  161. font-size: 24upx;
  162. margin-right: 10upx;
  163. }
  164. }
  165. .expiration {
  166. padding: 10upx 0;
  167. font-size: 24upx;
  168. color: rgba($color: #ffffff, $alpha: 0.7);
  169. }
  170. }
  171. </style>