index.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <view class="card">
  3. <view class="card-item" :style="{backgroundImage: 'url(' + item.bgImage + ')',
  4. 'background-repeat':'no-repeat', backgroundSize:'100% 100%'}" v-for="(item,index) in list" :key="index">
  5. <view class="info">
  6. <view class="title">{{item.title}}</view>
  7. <view class="score">{{item.desc}}</view>
  8. </view>
  9. <view class="btn">
  10. 立即使用
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. data() {
  18. return {
  19. list: [{
  20. title: '会员卡',
  21. num: 45,
  22. desc:'VIP会员用户,尊享9大特权',
  23. bgImage: require('../../static/card-bg1.png')
  24. },
  25. {
  26. title: '次数卡',
  27. num: 45,
  28. desc:'剩余次数:3次',
  29. bgImage: require('../../static/card-bg.png')
  30. },
  31. ]
  32. }
  33. }
  34. }
  35. </script>
  36. <style lang="scss" scoped>
  37. .card {
  38. background: black;
  39. padding: 30rpx 15rpx 0;
  40. min-height: 100vh;
  41. .card-item {
  42. height: 154rpx;
  43. border-radius: 16rpx;
  44. display: flex;
  45. align-items: center;
  46. justify-content: space-between;
  47. margin-bottom: 30rpx;
  48. padding: 40rpx 60rpx;
  49. box-sizing: border-box;
  50. .info {
  51. color: #FEDEB5;
  52. .title {
  53. font-size: 40rpx;
  54. font-weight: bold;
  55. }
  56. .score {
  57. font-size: 24rpx;
  58. font-family: PingFang SC-Regular, PingFang SC;
  59. margin-top: 10rpx;
  60. }
  61. }
  62. .btn {
  63. width: 144rpx;
  64. height: 52rpx;
  65. line-height: 52rpx;
  66. color: #302E2F;
  67. font-size: 24rpx;
  68. background: #FEDEB5;
  69. border-radius: 26rpx;
  70. text-align: center;
  71. }
  72. }
  73. }
  74. </style>