index.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <!-- <view class="container" :style="{'min-height':`calc(100vh - ${(statusBarHeight+navBareight)+'px'})` }"> -->
  3. <view class="container">
  4. <navBar title="推广中心" :back="true" color="#333333" background="#FFFFFF" />
  5. <view class="outerBox">
  6. <!-- <view class="navHeight" :style="{height:statusBarHeight+'px'}"></view> -->
  7. <view class="userBox">
  8. <image class="avatar" :src="!userInfo.avatar?picBase+'defaultAvatar.png':userInfo.avatar" mode="">
  9. </image>
  10. {{userInfo.name?userInfo.name:'默认用户'}}
  11. <view class="flag" :style="{'background-image':`url(${picBase+'dashi_bg.png'})`}">
  12. 推广大使
  13. <!-- <image src="../../../static/other/huangguan.png" mode="" class="hg_i"></image> -->
  14. </view>
  15. </view>
  16. <view class="card" :style="{'background-image':`url(${picBase+'center_c_bg.png'})`}">
  17. <!-- <image src="../../../static/other/liujiaoxing.png" mode="widthFix" class="ljx_i"></image> -->
  18. <view class="imgPos">
  19. </view>
  20. <view class="labelBox">
  21. 推广收入.
  22. <image :src="state?eyeSrc:eyeSrc2" mode="widthFix" class="eye" @click="handleShow"></image>
  23. </view>
  24. <view class="shouRu">
  25. <view class="left">
  26. 累计收入:{{state?'¥'+info.totalIncome:'******'}}
  27. </view>
  28. <view class="right">
  29. 可提现收入: {{state?'¥'+info.withdrawIncome:'******'}}
  30. </view>
  31. </view>
  32. </view>
  33. <view class="titleM">
  34. 推广大使权益
  35. </view>
  36. <view class="list">
  37. <view class="item" v-for="(item,index) in serList" @click="toPage(index)">
  38. <!-- <view class="iconBox"> -->
  39. <image :src="item.icon" mode="widthFix" class="iconBox"></image>
  40. <!-- </view> -->
  41. {{item.txt}}
  42. </view>
  43. </view>
  44. <!-- <view class="bLogo"> -->
  45. <image :src="picBase+'logo_b.png'" mode="" class="bLogo"></image>
  46. <!-- 短腿鹤伴读
  47. </view> -->
  48. </view>
  49. </view>
  50. </template>
  51. <script>
  52. // import navBar from '@/components/navBar/index.vue'
  53. import {
  54. getUserInfo,
  55. getYongjinList
  56. } from '@/api/index/index.js'
  57. export default {
  58. // components: {
  59. // navBar
  60. // },
  61. data() {
  62. return {
  63. statusBarHeight: 20,
  64. navBareight: 45,
  65. picBase: this.$picBase2,
  66. userInfo: null,
  67. state: true,
  68. eyeSrc: this.$picBase2 + 'zyan.png',
  69. eyeSrc2: this.$picBase2 + 'biyan.png',
  70. serList: [{
  71. txt: '推广团队',
  72. icon: this.$picBase2 + 'icon1.png'
  73. },
  74. {
  75. txt: '佣金明细',
  76. icon: this.$picBase2 + 'icon2.png'
  77. },
  78. {
  79. txt: '佣金提现',
  80. icon: this.$picBase2 + 'icon3.png'
  81. },
  82. {
  83. txt: '提现明细',
  84. icon: this.$picBase2 + 'icon2.png'
  85. },
  86. {
  87. txt: '分享海报',
  88. icon: this.$picBase2 + 'icon5.png'
  89. },
  90. ],
  91. info: {
  92. totalIncome: 0,
  93. withdrawIncome: 0,
  94. // data: []
  95. }
  96. }
  97. },
  98. onLoad() {
  99. this.getUserInfo()
  100. //获取手机系统信息 -- 状态栏高度
  101. let {
  102. statusBarHeight,
  103. windowWidth
  104. } = uni.getSystemInfoSync()
  105. this.statusBarHeight = statusBarHeight
  106. this.windowWidth = windowWidth
  107. },
  108. onShow() {
  109. this.getYongjinList()
  110. },
  111. methods: {
  112. async getYongjinList() {
  113. let res1 = await getYongjinList()
  114. console.log('佣金明细返回值--------', res1);
  115. if (res1.code == 0) {
  116. this.info = res1.data
  117. } else {
  118. this.$toast(res1.message)
  119. }
  120. },
  121. async getUserInfo() {
  122. let res1 = await getUserInfo()
  123. console.log('用户信息返回值--------', res1);
  124. if (res1.code == 0) {
  125. uni.setStorageSync('userInfo', res1.data)
  126. this.userInfo = res1.data
  127. } else {
  128. this.$toast(res1.message)
  129. }
  130. },
  131. handleShow() {
  132. this.state = !this.state
  133. },
  134. toPage(i) {
  135. if (i == 0) {
  136. uni.navigateTo({
  137. url: '/pages/my/team/index'
  138. })
  139. } else if (i == 1) {
  140. uni.navigateTo({
  141. url: '/pages/my/yongjinDetail/index'
  142. })
  143. } else if (i == 2) {
  144. uni.navigateTo({
  145. url: '/pages/my/cash/index'
  146. })
  147. } else if (i == 3) {
  148. uni.navigateTo({
  149. url: '/pages/my/cashRecord/index'
  150. })
  151. } else {
  152. uni.navigateTo({
  153. url: '/pages/my/tuiguangHaibao/index'
  154. })
  155. }
  156. },
  157. }
  158. }
  159. </script>
  160. <style lang="scss" scoped>
  161. @import "./index.scss";
  162. </style>