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.

274 lines
6.6 KiB

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. },
  76. methods: {
  77. getAgentFlow() {
  78. this.$api('getAgentFlow', {
  79. type: this.type
  80. }, res => {
  81. if (res.code == 200) {
  82. this.agentFlow = res.result
  83. }
  84. })
  85. },
  86. toNodes() {
  87. uni.navigateTo({
  88. url: '/pages/mine/nodes'
  89. })
  90. },
  91. leftClick() { //返回个人中心
  92. uni.switchTab({
  93. url: '/pages/index/center'
  94. })
  95. },
  96. showQrcode() {
  97. this.show = true
  98. // this.$api('showQrcode', {}, res => {
  99. // if (res.code == 200) {
  100. // this.imageUrl = res.result
  101. // }
  102. // })
  103. setTimeout(() => {
  104. this.$refs.placard.draw()
  105. })
  106. },
  107. wxshare() {
  108. window.jWeixin.config({
  109. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  110. appId: 'wxe934cebcbc89d869', // 必填,公众号的唯一标识
  111. // timestamp: res.data.timestamp, // 必填,生成签名的时间戳
  112. // nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
  113. // signature: res.data.signature, // 必填,签名,见附录1
  114. // surl: res.data.surl, //自己添加的,debug为true的时候可以网页打印出对应的URL是否正确
  115. jsApiList: ["updateAppMessageShareData", "updateTimelineShareData"]
  116. });
  117. window.jWeixin.ready(() => {
  118. //自定义“分享给朋友”及“分享到QQ”按钮的分享内容(1.4.0)
  119. window.jWeixin.updateAppMessageShareData({
  120. title: '邀请新用户', // 分享标题
  121. desc: "邀请新用户,成为你的粉丝", // 分享描述
  122. link: "http://tairoudj.natapp1.cc", // 分享链接
  123. imgUrl: res.result, // 分享图标
  124. success: res => {
  125. //点击分享时提示用户分享图,
  126. this.wxsharetip = true
  127. },
  128. cancel: function() {
  129. // 用户取消分享后执行的回调函数
  130. }
  131. });
  132. //自定义“分享到朋友圈”及“分享到QQ空间”按钮的分享内容(1.4.0)
  133. window.jWeixin.updateTimelineShareData({
  134. title: '标题', // 分享标题
  135. link: "http://tairoudj.natapp1.cc", // 分享链接
  136. imgUrl: res.result, // 分享图标
  137. success: res => {
  138. //点击分享时提示用户分享图,
  139. this.wxsharetip = true
  140. },
  141. cancel: function() {
  142. // 用户取消分享后执行的回调函数
  143. }
  144. });
  145. })
  146. },
  147. tagChange(index) { //选中标签发生改变
  148. this.type = index;
  149. this.getAgentFlow()
  150. },
  151. toWithdraw() { //跳转充值页面
  152. uni.navigateTo({
  153. url: '/pages/mine/withdraw'
  154. })
  155. }
  156. }
  157. }
  158. </script>
  159. <style scoped lang="scss">
  160. .distribution {
  161. background-color: #f3f3f3;
  162. min-height: 100vh;
  163. .box {
  164. position: relative;
  165. width: 100%;
  166. height: 175px;
  167. background-color: #fff;
  168. .box1 {
  169. height: 100px;
  170. background: linear-gradient(to right, #4899a6, #6fc6ad);
  171. }
  172. .content {
  173. position: absolute;
  174. display: flex;
  175. justify-content: space-around;
  176. width: 94%;
  177. height: 140px;
  178. background-color: #F5FDFB;
  179. top: 20px;
  180. left: 3%;
  181. z-index: 9;
  182. border-radius: 10px;
  183. box-shadow: 0px 1px 7px 1px #4899a6;
  184. .content-box {
  185. display: flex;
  186. width: 94%;
  187. height: 94%;
  188. flex-direction: column;
  189. align-items: self-end;
  190. .content-box1 {
  191. display: flex;
  192. width: 100%;
  193. height: 60px;
  194. justify-content: center;
  195. align-items: center;
  196. view {
  197. width: 200rpx;
  198. display: flex;
  199. justify-content: space-around;
  200. }
  201. }
  202. .content-box2 {
  203. display: flex;
  204. width: 100%;
  205. height: 60px;
  206. justify-content: center;
  207. align-items: center;
  208. view {
  209. width: 200rpx;
  210. display: flex;
  211. justify-content: space-around;
  212. color: #4C9FA6;
  213. font-size: 18px;
  214. }
  215. }
  216. .content-box3 {
  217. display: flex;
  218. width: 100%;
  219. height: 60px;
  220. justify-content: center;
  221. align-items: center;
  222. view {
  223. width: 200rpx;
  224. display: flex;
  225. justify-content: space-around;
  226. align-items: center;
  227. }
  228. text {
  229. display: inline-block;
  230. padding: 5px 20px;
  231. text-align: center;
  232. border: 1px solid #96C8CB;
  233. color: #76B7BA;
  234. border-radius: 5px;
  235. }
  236. }
  237. }
  238. }
  239. }
  240. .tab-box {
  241. width: 96%;
  242. margin-top: 10px;
  243. margin-left: 2%;
  244. background-color: #fff;
  245. border-radius: 10px;
  246. overflow: hidden;
  247. .tab-box1 {
  248. margin-top: 10px;
  249. }
  250. }
  251. }
  252. </style>