invite.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <view class="container">
  3. <image class="bk" src="https://mall.rongtongh.cn/storage/img/invite/bk.png" mode=""></image>
  4. <view class="page">
  5. <image class="illustrate" @click="$navigateTo('/pages/rule/rule', {type: 6})" src="https://mall.rongtongh.cn/storage/img/invite/button1.png" mode=""></image>
  6. <view class="box">
  7. <view class="item">
  8. <image mode="aspectFit" class="label1" src="https://mall.rongtongh.cn/storage/img/invite/text2.png"></image>
  9. <view class="value">
  10. {{person}}
  11. <image mode="aspectFit" src="https://mall.rongtongh.cn/storage/img/invite/text3.png"></image>
  12. </view>
  13. </view>
  14. <view class="item">
  15. <image mode="aspectFit" class="label2" src="https://mall.rongtongh.cn/storage/img/invite/text1.png"></image>
  16. <view class="value">
  17. {{reward}}
  18. <image mode="aspectFit" src="https://mall.rongtongh.cn/storage/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="https://mall.rongtongh.cn/storage/img/invite/button2.png"></image>
  25. </button>
  26. <image class="button2" mode="aspectFit" src="https://mall.rongtongh.cn/storage/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. computed: {
  61. userInfo() {
  62. return wx.getStorageSync('userInfo')
  63. }
  64. },
  65. onShareAppMessage() {
  66. let userId = wx.getStorageSync('userId')
  67. return {
  68. title: this.userInfo.nickName + '邀请你来宝可梦卡牌抽取喜欢的卡牌',
  69. path: '/pages/index/index?inviteId=' + userId
  70. }
  71. },
  72. methods: {
  73. getInviteList() {
  74. inviteInfoApi().then(res => {
  75. console.log(res, '我已经邀请的列表')
  76. this.inviteList = res.data.list
  77. this.person = res.data.person
  78. this.reward = res.data.reward
  79. })
  80. },
  81. promotionCode() {
  82. let _this = this
  83. inviteQrcodeApi().then(res => {
  84. console.log(res, '推广码')
  85. _this.imgUrl = res.data
  86. _this.$refs.popup.open('center')
  87. })
  88. }
  89. }
  90. }
  91. </script>
  92. <style scoped lang="scss">
  93. .container {
  94. // background: #e7ffec;
  95. text-align: center;
  96. .bk {
  97. position: absolute;
  98. height: 100vh;
  99. width: 100%;
  100. z-index: -1;
  101. }
  102. .page {
  103. max-height: 100vh;
  104. overflow: auto;
  105. padding-top: 300px;
  106. }
  107. .illustrate {
  108. position: absolute;
  109. right: 20px;
  110. top: 40px;
  111. font-size: 12px;
  112. width: 67px;
  113. height: 24px;
  114. // padding: 5px 10px;
  115. // border-radius: 4px;
  116. }
  117. .box {
  118. background: #fff;
  119. margin: 20px 20px;
  120. padding: 20px;
  121. border-radius: 15px;
  122. display: flex;
  123. justify-content: space-around;
  124. .item {
  125. display: flex;
  126. flex-direction: column;
  127. justify-content: center;
  128. align-items: center;
  129. width: 50%;
  130. .label1 {
  131. width: 100%;
  132. height: 22px;
  133. }
  134. .label2 {
  135. width: 100%;
  136. height: 22px;
  137. }
  138. .value {
  139. font-size: 28px;
  140. font-weight: 600;
  141. margin-top: 20px;
  142. width: 100%;
  143. display: flex;
  144. align-items: center;
  145. justify-content: center;
  146. image {
  147. width: 40px;
  148. height: 22px;
  149. }
  150. }
  151. }
  152. }
  153. .buttons {
  154. display: flex;
  155. justify-content: center;
  156. margin: 20px;
  157. width: calc(100% - 40px);
  158. image {
  159. height: 64px;
  160. position: relative;
  161. }
  162. .button {
  163. background: none;
  164. border: none !important;
  165. overflow: initial;
  166. text-align: start;
  167. padding: 0;
  168. width: 100%;
  169. box-shadow: none;
  170. -webkit-tap-highlight-color: transparent;
  171. }
  172. .button::after {
  173. border: none;
  174. }
  175. .button1 {
  176. right: -8px;
  177. width: 100%;
  178. }
  179. .button2 {
  180. left: -8px;
  181. }
  182. }
  183. .qrcode {
  184. width: 70vw;
  185. height: 70vw;
  186. }
  187. }
  188. </style>