invite.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <view class="container">
  3. <image class="bk" src="@/static/img/invite/bk.png" mode=""></image>
  4. <view class="page">
  5. <image class="illustrate" src="@/static/img/invite/button1.png" mode=""></image>
  6. <view class="box">
  7. <view class="item">
  8. <image mode="aspectFit" class="label1" src="@/static/img/invite/text2.png"></image>
  9. <view class="value">
  10. {{person}}
  11. <image mode="aspectFit" src="@/static/img/invite/text3.png"></image>
  12. </view>
  13. </view>
  14. <view class="item">
  15. <image mode="aspectFit" class="label2" src="@/static/img/invite/text1.png"></image>
  16. <view class="value">
  17. {{reward}}
  18. <image mode="aspectFit" src="@/static/img/invite/text4.png"></image>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="buttons">
  23. <button open-type="share" class="button">
  24. <image class="button1" mode="aspectFit" src="@/static/img/invite/button2.png"></image>
  25. </button>
  26. <image class="button2" mode="aspectFit" src="@/static/img/invite/button3.png" @click="promotionCode">
  27. </image>
  28. <!-- <view class="m_button">
  29. 邀请好友
  30. </view> -->
  31. <!-- <view class="m_button" @click="promotionCode">
  32. 我的推广码
  33. </view> -->
  34. </view>
  35. </view>
  36. <uni-popup ref="popup" background-color="#fff">
  37. <view class="popup-content">
  38. <image class="qrcode" :src="imgUrl" mode=""></image>
  39. </view>
  40. </uni-popup>
  41. </view>
  42. </template>
  43. <script>
  44. import {
  45. inviteQrcodeApi,
  46. inviteInfoApi
  47. } from "@/api/invite.js"
  48. export default {
  49. data() {
  50. return {
  51. imgUrl: '',
  52. inviteList: [],
  53. person: '',
  54. reward: '',
  55. }
  56. },
  57. onLoad() {
  58. this.getInviteList()
  59. },
  60. onShareAppMessage() {
  61. let userId = wx.getStorageSync('userId')
  62. return {
  63. title: '自定义转发标题222',
  64. path: '/pages/index/index?inviteId=' + userId
  65. }
  66. },
  67. methods: {
  68. getInviteList() {
  69. inviteInfoApi().then(res => {
  70. console.log(res, '我已经邀请的列表')
  71. this.inviteList = res.data.list
  72. this.person = res.data.person
  73. this.reward = res.data.reward
  74. })
  75. },
  76. promotionCode() {
  77. let _this = this
  78. inviteQrcodeApi().then(res => {
  79. console.log(res, '推广码')
  80. _this.imgUrl = res.data
  81. _this.$refs.popup.open('center')
  82. })
  83. }
  84. }
  85. }
  86. </script>
  87. <style scoped lang="scss">
  88. .container {
  89. // background: #e7ffec;
  90. text-align: center;
  91. .bk {
  92. position: absolute;
  93. height: 100vh;
  94. width: 100%;
  95. z-index: -1;
  96. }
  97. .page {
  98. max-height: 100vh;
  99. overflow: auto;
  100. padding-top: 300px;
  101. }
  102. .illustrate {
  103. position: absolute;
  104. right: 20px;
  105. top: 40px;
  106. font-size: 12px;
  107. width: 67px;
  108. height: 24px;
  109. // padding: 5px 10px;
  110. // border-radius: 4px;
  111. }
  112. .box {
  113. background: #fff;
  114. margin: 20px 20px;
  115. padding: 20px;
  116. border-radius: 15px;
  117. display: flex;
  118. justify-content: space-around;
  119. .item {
  120. display: flex;
  121. flex-direction: column;
  122. justify-content: center;
  123. align-items: center;
  124. width: 50%;
  125. .label1 {
  126. width: 100%;
  127. height: 22px;
  128. }
  129. .label2 {
  130. width: 100%;
  131. height: 22px;
  132. }
  133. .value {
  134. font-size: 28px;
  135. font-weight: 600;
  136. margin-top: 20px;
  137. width: 100%;
  138. display: flex;
  139. align-items: center;
  140. justify-content: center;
  141. image {
  142. width: 40px;
  143. height: 22px;
  144. }
  145. }
  146. }
  147. }
  148. .buttons {
  149. display: flex;
  150. justify-content: center;
  151. margin: 20px;
  152. width: calc(100% - 40px);
  153. image {
  154. height: 64px;
  155. position: relative;
  156. }
  157. .button {
  158. background: none;
  159. border: none !important;
  160. overflow: initial;
  161. text-align: start;
  162. padding: 0;
  163. width: 100%;
  164. box-shadow: none;
  165. -webkit-tap-highlight-color: transparent;
  166. }
  167. .button::after {
  168. border: none;
  169. }
  170. .button1 {
  171. right: -8px;
  172. width: 100%;
  173. }
  174. .button2 {
  175. left: -8px;
  176. }
  177. }
  178. .qrcode {
  179. width: 70vw;
  180. height: 70vw;
  181. }
  182. }
  183. </style>