You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

235 lines
4.8 KiB

8 months ago
8 months ago
  1. <template>
  2. <view class="distribution">
  3. <mNavbar title="分销代理" :leftClick="leftClick" />
  4. <view class="box">
  5. <view class="box1" />
  6. <view class="content">
  7. <view class="content-box">
  8. <view class="content-box1">
  9. <view>可用余额</view>
  10. <view>累计提现</view>
  11. <view>累积收益</view>
  12. </view>
  13. <view class="content-box2">
  14. <view>{{ agentFlow.use_money }}</view>
  15. <view>{{ agentFlow.lei_give }}</view>
  16. <view>{{ agentFlow.lei_set }}</view>
  17. </view>
  18. <view class="content-box3">
  19. <view @click="toNodes">
  20. <text>粉丝</text>
  21. </view>
  22. <view @click="toWithdraw">
  23. <text>提现</text>
  24. </view>
  25. <view @click="showQrcode">
  26. <text>二维码</text>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <van-tabs v-model:active="active" @change="tagChange">
  33. <van-tab v-for="(item,index) in tabs" :key="index" :title="item.title"></van-tab>
  34. </van-tabs>
  35. <view class="tab-box">
  36. <view class="tab-box1" v-if="agentFlow.pageList && agentFlow.pageList.total">
  37. <van-cell center border :title="item.title" v-for="(item, index) in agentFlow.pageList.records"
  38. :value="x[item.type] + item.money" :label="item.createTime" />
  39. </view>
  40. <van-empty v-else description="暂无数据" image="/static/ms/empty.png" />
  41. </view>
  42. <van-overlay :show="show" @click="show = false" z-index="999999">
  43. <div style="display: flex;justify-content: center;
  44. height: 100%;align-items: center;">
  45. <placard ref="placard"></placard>
  46. </div>
  47. </van-overlay>
  48. </view>
  49. </template>
  50. <script>
  51. import mNavbar from '@/components/base/m-navbar.vue'
  52. import placard from '@/components/placard.vue'
  53. export default {
  54. components: {
  55. mNavbar,
  56. placard
  57. },
  58. data() {
  59. return {
  60. imageUrl: '',
  61. show: false,
  62. agentFlow: {},
  63. x: ['+', '-', '+'],
  64. type: 0,
  65. active : 0,
  66. tabs : [
  67. { title : '费用明细' },
  68. { title : '提现记录' },
  69. { title : '收益记录' }
  70. ]
  71. }
  72. },
  73. onShow() {
  74. this.getAgentFlow()
  75. this.$store.commit('getUserInfo')
  76. },
  77. methods: {
  78. getAgentFlow() {
  79. this.$api('getAgentFlow', {
  80. type: this.type
  81. }, res => {
  82. if (res.code == 200) {
  83. this.agentFlow = res.result
  84. }
  85. })
  86. },
  87. toNodes() {
  88. uni.navigateTo({
  89. url: '/pages/mine/nodes'
  90. })
  91. },
  92. leftClick() { //返回个人中心
  93. uni.switchTab({
  94. url: '/pages/index/center'
  95. })
  96. },
  97. showQrcode() {
  98. this.show = true
  99. // this.$api('showQrcode', {}, res => {
  100. // if (res.code == 200) {
  101. // this.imageUrl = res.result
  102. // }
  103. // })
  104. setTimeout(() => {
  105. this.$refs.placard.draw()
  106. })
  107. },
  108. tagChange(index) { //选中标签发生改变
  109. this.type = index;
  110. this.getAgentFlow()
  111. },
  112. toWithdraw() { //跳转充值页面
  113. uni.navigateTo({
  114. url: '/pages/mine/withdraw'
  115. })
  116. }
  117. }
  118. }
  119. </script>
  120. <style scoped lang="scss">
  121. .distribution {
  122. background-color: #f3f3f3;
  123. min-height: 100vh;
  124. .box {
  125. position: relative;
  126. width: 100%;
  127. height: 175px;
  128. background-color: #fff;
  129. .box1 {
  130. height: 100px;
  131. background: linear-gradient(to right, #4899a6, #6fc6ad);
  132. }
  133. .content {
  134. position: absolute;
  135. display: flex;
  136. justify-content: space-around;
  137. width: 94%;
  138. height: 140px;
  139. background-color: #F5FDFB;
  140. top: 20px;
  141. left: 3%;
  142. z-index: 9;
  143. border-radius: 10px;
  144. box-shadow: 0px 1px 7px 1px #4899a6;
  145. .content-box {
  146. display: flex;
  147. width: 94%;
  148. height: 94%;
  149. flex-direction: column;
  150. align-items: self-end;
  151. .content-box1 {
  152. display: flex;
  153. width: 100%;
  154. height: 60px;
  155. justify-content: center;
  156. align-items: center;
  157. view {
  158. width: 200rpx;
  159. display: flex;
  160. justify-content: space-around;
  161. }
  162. }
  163. .content-box2 {
  164. display: flex;
  165. width: 100%;
  166. height: 60px;
  167. justify-content: center;
  168. align-items: center;
  169. view {
  170. width: 200rpx;
  171. display: flex;
  172. justify-content: space-around;
  173. color: #4C9FA6;
  174. font-size: 18px;
  175. }
  176. }
  177. .content-box3 {
  178. display: flex;
  179. width: 100%;
  180. height: 60px;
  181. justify-content: center;
  182. align-items: center;
  183. view {
  184. width: 200rpx;
  185. display: flex;
  186. justify-content: space-around;
  187. align-items: center;
  188. }
  189. text {
  190. display: inline-block;
  191. padding: 5px 20px;
  192. text-align: center;
  193. border: 1px solid #96C8CB;
  194. color: #76B7BA;
  195. border-radius: 5px;
  196. }
  197. }
  198. }
  199. }
  200. }
  201. .tab-box {
  202. width: 96%;
  203. margin-top: 10px;
  204. margin-left: 2%;
  205. background-color: #fff;
  206. border-radius: 10px;
  207. overflow: hidden;
  208. .tab-box1 {
  209. margin-top: 10px;
  210. }
  211. }
  212. }
  213. </style>