index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <view class="container">
  3. <navBar title="佣金明细" :back="true" color="#333333" background="#FFFFFF" />
  4. <view class="bgBox" :style="{'background-image':`url(${picBase+'yongjin_bg.png'})`}">
  5. <view class="topBox">
  6. <view class="userBox">
  7. <image class="avatar" :src="!userInfo.avatar?picBase+'defaultAvatar.png':userInfo.avatar" mode="">
  8. </image>
  9. <text>{{userInfo.name?userInfo.name:'默认用户'}}</text>
  10. <view class=" flag" :style="{'background-image':`url(${picBase+'dashi_bg.png'})`}">
  11. 推广大使
  12. <!-- <image src="../../../static/other/huangguan.png" mode="" class="hg_i"></image> -->
  13. </view>
  14. </view>
  15. </view>
  16. <view class="addBg" :style="{'background-image':`url(${picBase+'card_b_bg.png'})`}">
  17. <view class="cardTop">
  18. <!-- <image src="../../../static/tabbar/my.png" mode="" class="water_coin"></image> -->
  19. <view class="left">
  20. <view class="txt">
  21. 累计收入(元)
  22. </view>
  23. <view class="money">
  24. ¥{{info.totalIncome}}
  25. </view>
  26. </view>
  27. <view class="right">
  28. <view class="txt">
  29. 可提现收入(元)
  30. </view>
  31. <view class="money">
  32. ¥{{info.withdrawIncome}}
  33. </view>
  34. </view>
  35. </view>
  36. <view class="cardBot">
  37. <view class="btn" @click="cash">
  38. 立即提现
  39. </view>
  40. </view>
  41. </view>
  42. <view class="botContent">
  43. <view class="titleBox">
  44. <image :src="picBase+'s_star.png'" mode="heightFix" class="starIcon"></image>
  45. 佣金明细
  46. </view>
  47. <view class="list">
  48. <view class="empty" style="margin-top: 50%;" v-if="info.data.length==0">
  49. <u-empty mode="data" />
  50. </view>
  51. <view class="" v-else>
  52. <view class="item" v-for="(item,index) in info.data"
  53. :style="{'background-image':`url(${picBase+'card_bg2.png'})`}">
  54. <!-- <image src="../../../static/tabbar/my.png" mode="" class="water2"></image> -->
  55. <view class="top">
  56. <view class="left">
  57. <image :src="item.user.avatar?item.user.avatar:picBase+'defaultAvatar.png'" mode=""
  58. class="avatar"></image>
  59. <view class="des">
  60. <view class="name">
  61. {{item.user.name?item.user.name:'默认用户'}}
  62. </view>
  63. <view class="time">
  64. {{item.created_at}}
  65. </view>
  66. </view>
  67. </view>
  68. <view class="right">
  69. ¥{{item.amount}}
  70. </view>
  71. </view>
  72. <view class="bot">
  73. {{item.title}}
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </template>
  82. <script>
  83. // import navBar from '@/components/navBar/index.vue'
  84. import {
  85. getYongjinList,
  86. getUserInfo
  87. } from '@/api/index/index.js'
  88. export default {
  89. // components: {
  90. // navBar
  91. // },
  92. data() {
  93. return {
  94. picBase: this.$picBase2,
  95. userInfo: null,
  96. info: {
  97. totalIncome: 0,
  98. withdrawIncome: 0,
  99. data: []
  100. },
  101. // list: []
  102. }
  103. },
  104. onLoad() {
  105. this.getUserInfo()
  106. },
  107. onShow() {
  108. this.getYongjinList()
  109. },
  110. methods: {
  111. async getUserInfo() {
  112. let res1 = await getUserInfo()
  113. console.log('用户信息返回值--------', res1);
  114. if (res1.code == 0) {
  115. uni.setStorageSync('userInfo', res1.data)
  116. this.userInfo = res1.data
  117. } else {
  118. this.$toast(res1.message)
  119. }
  120. },
  121. async getYongjinList() {
  122. let res1 = await getYongjinList()
  123. console.log('佣金明细返回值--------', res1);
  124. if (res1.code == 0) {
  125. this.info = res1.data
  126. // this.userInfo = [1, 1]
  127. } else {
  128. this.$toast(res1.message)
  129. }
  130. },
  131. cash() {
  132. // getApp().availMoney = this.info.withdrawIncome
  133. uni.navigateTo({
  134. url: '/pages/my/cash/index?availMoney=' + this.info.withdrawIncome
  135. })
  136. }
  137. }
  138. }
  139. </script>
  140. <style lang="scss" scoped>
  141. @import "./index.scss";
  142. </style>