invite.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view class="container">
  3. <view class="m_button illustrate">
  4. 规则说明
  5. </view>
  6. <view class="">
  7. 邀请好友
  8. </view>
  9. <view class="">
  10. 领现金
  11. </view>
  12. <view class="">
  13. 笔笔有提成
  14. </view>
  15. <view class="box">
  16. <view class="item">
  17. <view class="label">
  18. 已邀请
  19. </view>
  20. <view class="value">
  21. 0人
  22. </view>
  23. </view>
  24. <view class="item">
  25. <view class="label">
  26. 奖励总览
  27. </view>
  28. <view class="value">
  29. 0元
  30. </view>
  31. </view>
  32. </view>
  33. <view class="buttons">
  34. <view class="m_button">
  35. 邀请好友
  36. </view>
  37. <view class="m_button" @click="promotionCode">
  38. 我的推广码
  39. </view>
  40. </view>
  41. <uni-popup ref="popup" background-color="#fff">
  42. <view class="popup-content" >
  43. <image class="qrcode" :src="imgUrl" mode=""></image>
  44. </view>
  45. </uni-popup>
  46. </view>
  47. </template>
  48. <script>
  49. import {
  50. inviteQrcodeApi,
  51. inviteInfoApi
  52. } from "@/api/invite.js"
  53. export default {
  54. data() {
  55. return {
  56. imgUrl: ''
  57. }
  58. },
  59. methods: {
  60. promotionCode() {
  61. let _this = this
  62. inviteQrcodeApi().then(res => {
  63. console.log(res, '推广码')
  64. _this.imgUrl = res.data
  65. _this.$refs.popup.open('center')
  66. })
  67. }
  68. }
  69. }
  70. </script>
  71. <style scoped lang="scss">
  72. .container {
  73. background: #e7ffec;
  74. text-align: center;
  75. illustrate {
  76. position: absolute;
  77. right: 20px;
  78. top: 40px;
  79. font-size: 12px;
  80. padding: 5px 10px;
  81. border-radius: 4px;
  82. }
  83. .box {
  84. background: #fff;
  85. margin: 20px 20px;
  86. padding: 20px;
  87. border-radius: 15px;
  88. display: flex;
  89. justify-content: space-around;
  90. .item {
  91. display: flex;
  92. flex-direction: column;
  93. justify-content: center;
  94. align-items: center;
  95. .label {
  96. font-size: 24px;
  97. font-weight: 600;
  98. }
  99. .value {
  100. font-size: 24px;
  101. font-weight: 600;
  102. margin-top: 20px;
  103. }
  104. }
  105. }
  106. .buttons {
  107. display: flex;
  108. justify-content: space-around;
  109. .m_button {
  110. width: 40vw;
  111. height: 30px;
  112. line-height: 30px;
  113. }
  114. }
  115. .qrcode {
  116. width: 70vw;
  117. height: 70vw;
  118. }
  119. }
  120. </style>