Dynamic.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <div class="usremei-container">
  3. <div class="invite-header">
  4. 邀请好友获得红旗资产
  5. </div>
  6. <div class="invite-list">
  7. <div class="invite-item" v-for="item in rewards" :key="item.renshu">
  8. <div class="invite-info">
  9. <div class="invite-title">{{ item.title }}</div>
  10. <div class="invite-reward">{{ item.reward }}</div>
  11. </div>
  12. <button class="btn" @click="receiveReward(item.renshu)">领取</button>
  13. </div>
  14. </div>
  15. </div>
  16. </template>
  17. <script>
  18. import { getShareccb } from '@/api/profile';
  19. export default {
  20. name: 'Dynamic',
  21. data() {
  22. return {
  23. rewards: [
  24. { renshu: 5, title: '邀请5人实名认证', reward: '奖励60000元红旗资产' },
  25. { renshu: 10, title: '邀请10人实名认证', reward: '奖励150000元红旗资产' },
  26. { renshu: 20, title: '邀请20人实名认证', reward: '奖励300000元红旗资产' },
  27. { renshu: 50, title: '邀请50人实名认证', reward: '奖励800000元红旗资产' },
  28. { renshu: 100, title: '邀请100人实名认证', reward: '奖励1800000元红旗资产' },
  29. { renshu: 150, title: '邀请150人实名认证', reward: '获得国家神秘奖励' }
  30. ]
  31. }
  32. },
  33. methods: {
  34. async receiveReward(renshu) {
  35. try {
  36. const res = await getShareccb(renshu);
  37. alert(res.data.msg);
  38. } catch (e) {
  39. // 接口异常时不弹窗
  40. }
  41. }
  42. }
  43. }
  44. </script>
  45. <style scoped>
  46. .usremei-container {
  47. min-height: 100vh;
  48. background-image: url('../assets/dabag.png');
  49. background-size: cover;
  50. background-position: center;
  51. padding-top: 60px;
  52. padding-bottom: 80px;
  53. box-sizing: border-box;
  54. overflow-y: auto;
  55. position: relative;
  56. }
  57. .invite-header {
  58. background: #ffeddf;
  59. color: #f11859;
  60. font-size: 24px;
  61. font-weight: bold;
  62. text-align: center;
  63. margin: 0 auto 30px auto;
  64. padding: 20px 0 10px 0;
  65. width: 90%;
  66. box-shadow: 0 4px 16px rgba(208,2,27,0.08);
  67. letter-spacing: 2px;
  68. }
  69. .invite-list {
  70. width: 90%;
  71. margin: 0 auto;
  72. }
  73. .invite-item {
  74. background: #ffeddf;
  75. margin-bottom: 22px;
  76. display: flex;
  77. align-items: center;
  78. justify-content: space-between;
  79. padding: 4px 20px;
  80. box-shadow: 0 2px 8px rgba(208,2,27,0.06);
  81. }
  82. .invite-info {
  83. display: flex;
  84. flex-direction: column;
  85. width:70%;
  86. align-items: center;
  87. }
  88. .invite-title {
  89. font-size: 14px;
  90. color: #222;
  91. font-weight: 600;
  92. margin-bottom: 6px;
  93. }
  94. .invite-reward {
  95. font-size: 14px;
  96. color: #000;
  97. }
  98. .btn {
  99. min-width: 70px;
  100. height: 32px;
  101. border: none;
  102. border-radius: 16px;
  103. font-size: 15px;
  104. font-weight: 500;
  105. padding: 0 18px;
  106. cursor: default;
  107. background: #d0021b;
  108. color: #fff;
  109. }
  110. .btn.received {
  111. background: #bdbdbd;
  112. color: #fff;
  113. }
  114. .btn.not-reached {
  115. background: #d0021b;
  116. color: #fff;
  117. }
  118. </style>