index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <view class="page">
  3. <image class="cover"
  4. src="http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/657c35e3cae1326607ea9ed2/ext/SHOP_INFO/20240816134523.png/1.png"
  5. mode="aspectFit"></image>
  6. <view class="info-card">
  7. <view class="header">
  8. <view class="titile">我的邀请</view>
  9. <view class="btn" @click="jump('/invite/wallet/withdraw?amount='+amount)">
  10. <view>去提现</view>
  11. <image class="icon" src="/static/right-arrow.png"></image>
  12. </view>
  13. </view>
  14. <view class="content">
  15. <view class="item">
  16. <view class="title">已邀请</view>
  17. <view class="value">{{ invite.inviteCount }}</view>
  18. </view>
  19. <view class="item">
  20. <view class="title">成功邀请</view>
  21. <view class="value">{{ invite.success }}</view>
  22. </view>
  23. <view class="item">
  24. <view class="title">累积获得</view>
  25. <view class="value">{{ currency(invite.totalAmount, { fromCents: true, symbol: '' }) }}元</view>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="card-content">
  30. <u-cell-group :border="false">
  31. <u-cell title="我的邀请码" isLink rightIcon="arrow-right" :border="false" @click="jump('./invite')">
  32. </u-cell>
  33. <!-- <u-cell title="邀请记录" isLink rightIcon="arrow-right" :border="false" @click="jump('./history')"></u-cell> -->
  34. <u-cell title="我的钱包" isLink rightIcon="arrow-right" :border="false" @click="jump('./wallet/index')"></u-cell>
  35. <u-cell title="邀请奖励明细" rightIcon="arrow-right" :border="false" @click="jump('./detail')"></u-cell>
  36. </u-cell-group>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. import { myInvite } from "@/api/invite"
  42. import { getWallet } from "@/api/wallet"
  43. import currency from '@/utils/currency'
  44. export default {
  45. data() {
  46. return {
  47. invite: {
  48. inviteCount: 0,
  49. success: 0,
  50. totalAmount: 0,
  51. },
  52. amount:0,
  53. currency: currency
  54. };
  55. },
  56. methods: {
  57. jump(url) {
  58. uni.navigateTo({
  59. url
  60. })
  61. },
  62. },
  63. onShow() {
  64. myInvite().then(({ content }) => {
  65. if (content) {
  66. this.invite = content
  67. }
  68. })
  69. getWallet().then(({ content }) => {
  70. if (content) {
  71. if (content.id) {
  72. uni.setStorageSync('walletId', content.id);
  73. this.amount = content.amount
  74. }
  75. }
  76. })
  77. }
  78. };
  79. </script>
  80. <style lang="scss" scoped>
  81. .page {
  82. background: #F9F9F9;
  83. min-height: 100vh;
  84. .cover {
  85. width: 100%;
  86. height: 440rpx;
  87. vertical-align: bottom;
  88. }
  89. .info-card {
  90. background: #FFFFFF;
  91. border-radius: 16rpx;
  92. padding: 28rpx 24rpx;
  93. margin: -100rpx 24rpx 24rpx 24rpx;
  94. // overflow: overlay;
  95. position: relative;
  96. z-index: 2;
  97. .header {
  98. display: flex;
  99. justify-content: space-between;
  100. margin-bottom: 30rpx;
  101. .title {
  102. color: #181818;
  103. font-size: 28rpx;
  104. }
  105. .btn {
  106. display: flex;
  107. justify-content: center;
  108. align-items: center;
  109. color: #0C6FFE;
  110. font-size: 28rpx;
  111. .icon {
  112. width: 48rpx;
  113. height: 48rpx;
  114. }
  115. }
  116. }
  117. .content {
  118. display: flex;
  119. justify-content: space-between;
  120. .item {
  121. display: flex;
  122. flex-direction: column;
  123. justify-content: center;
  124. align-items: center;
  125. .title {
  126. color: #CCCCCC;
  127. font-size: 24rpx;
  128. margin: 0 8rpx 8rpx 8rpx;
  129. }
  130. .value {
  131. color: #222222;
  132. font-weight: bold;
  133. font-size: 36rpx;
  134. }
  135. }
  136. }
  137. }
  138. .card-content {
  139. padding: 28rpx 24rpx;
  140. border-radius: 16rpx;
  141. background: #fff;
  142. margin: 20rpx 24rpx 0 24rpx;
  143. }
  144. }
  145. </style>