fh.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  1. <template>
  2. <view class="content">
  3. <view class="content-money">
  4. <view class="status_bar"><!-- 这里是状态栏 --></view>
  5. <view class="body-title">
  6. <view class="goback-box" @click="toBack"><image class="goback" src="../../static/icon/fanhui.png" mode=""></image></view>
  7. <view class="header"></view>
  8. </view>
  9. <view class="content-bg"><image src="../../static/img/tg-bg.png" mode=""></image></view>
  10. <view class="money-box">
  11. <view class="money">{{ type == 1?'会员分红池':(type== 2? '合伙人分红池': (type == 3? '股东分红池': '董事分红池')) }}</view>
  12. <!-- <view>我的奖金</view> -->
  13. </view>
  14. <!-- <view class="moneybtn-box">
  15. <view class="money-btn" @click="navto('/pages/user/yjzz')">奖金转账</view>
  16. <view class="money-btn" @click="navto('/pages/user/yjzye')">奖金转余额</view>
  17. <view class="money-btn" @click="navto('/pages/user/withdrawal')">奖金提现</view>
  18. </view> -->
  19. </view>
  20. <!-- <view class="info-box flex">
  21. <view class="info-item">
  22. <view class="info-font">累计金额</view>
  23. <view class="info-num">{{userInfo.brokerage || '0'}}</view>
  24. </view>
  25. <view class="shu"></view>
  26. <view class="info-item">
  27. <view class="info-font">释放金额</view>
  28. <view class="info-num">{{userInfo.extractTotalPrice || '0'}}</view>
  29. </view>
  30. </view> -->
  31. <view class="navbar">
  32. <view v-for="(item, index) in navList" :key="index" class="nav-item" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
  33. </view>
  34. <swiper :current="tabCurrentIndex" :style="{ height: height }" class="swiper-box" duration="300" @change="changeTab">
  35. <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
  36. <scroll-view scroll-y="true" class="list-scroll-content" @scrolltolower="loadData">
  37. <!-- 空白页 -->
  38. <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
  39. <!-- 订单列表 -->
  40. <view>
  41. <view class="order-item flex" v-for="(item, index) in tabItem.orderList" :key="index">
  42. <view class="title-box">
  43. <view class="title">
  44. <text>{{ item.nickname }}</text>
  45. </view>
  46. <view class="time">
  47. <text>{{ item.create_time }}</text>
  48. </view>
  49. </view>
  50. <view class="money">
  51. <view>{{ item.price }}</view>
  52. </view>
  53. </view>
  54. </view>
  55. <uni-load-more :status="tabItem.loadingType" v-if="!(tabItem.orderList.length == 0 && tabItem.loaded)"></uni-load-more>
  56. </scroll-view>
  57. </swiper-item>
  58. </swiper>
  59. </view>
  60. </template>
  61. <script>
  62. import {
  63. mapState,
  64. mapMutations
  65. } from 'vuex';
  66. import { getCommissionInfo,getUser } from '@/api/user.js';
  67. import { getMoneyStyle } from '@/utils/rocessor.js';
  68. import { mapGetters } from 'vuex';
  69. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  70. import empty from '@/components/empty';
  71. import { spreadCommission, userBalance,extractBank,fllj, flff, getTj } from '@/api/wallet.js';
  72. export default {
  73. filters: {
  74. getMoneyStyle
  75. },
  76. components: {
  77. empty,
  78. uniLoadMore
  79. },
  80. onReady(res) {
  81. var _this = this;
  82. uni.getSystemInfo({
  83. success: resu => {
  84. const query = uni.createSelectorQuery();
  85. query.select('.swiper-box').boundingClientRect();
  86. query.exec(function(res) {
  87. _this.height = resu.windowHeight - res[0].top + 'px';
  88. console.log('打印页面的剩余高度', _this.height);
  89. });
  90. },
  91. fail: res => {}
  92. });
  93. },
  94. data() {
  95. return {
  96. type: 1,
  97. userInfo: {},
  98. yj: '',
  99. height: '',
  100. // 头部图高度
  101. maxheight: '',
  102. tabCurrentIndex: 0,
  103. orderStatusSum: 0,
  104. recharge: 0,
  105. navList: [
  106. {
  107. state:1,
  108. text: '累计',
  109. loadingType: 'more',
  110. orderList: [],
  111. page: 1, //当前页数
  112. limit: 10 //每次信息条数
  113. },
  114. {
  115. state: 2,
  116. text: '发放',
  117. loadingType: 'more',
  118. orderList: [],
  119. page: 1, //当前页数
  120. limit: 10 //每次信息条数
  121. }
  122. ],
  123. money: ''
  124. };
  125. },
  126. onLoad(options) {
  127. if(options.state) {
  128. this.type = options.state
  129. }
  130. this.loadData();
  131. this.getTj()
  132. },
  133. onShow() {
  134. this.extractBank()
  135. this.getUserInfo()
  136. },
  137. methods: {
  138. getTj() {
  139. getTj({
  140. type: this.type
  141. }).then(res => {
  142. console.log(res)
  143. })
  144. },
  145. getUserInfo() {
  146. getUser({}).then(({ data }) => {
  147. this.userInfo = data
  148. });
  149. },
  150. extractBank() {
  151. extractBank().then(res => {
  152. console.log(res)
  153. this.yj = res.data.brokerage_price
  154. })
  155. },
  156. toBack() {
  157. uni.switchTab({
  158. url: '/pages/user/user'
  159. });
  160. },
  161. // 页面跳转
  162. navto(e) {
  163. uni.navigateTo({
  164. url: e
  165. });
  166. },
  167. //获取收入支出信息
  168. async loadData(source) {
  169. let obj = this;
  170. //这里是将订单挂载到tab列表下
  171. let index = this.tabCurrentIndex;
  172. let navItem = this.navList[index];
  173. let state = navItem.state;
  174. if (source === 'tabChange' && navItem.loaded === true) {
  175. //tab切换只有第一次需要加载数据
  176. return;
  177. }
  178. if (navItem.loadingType === 'loading' || navItem.loadingType == 'noMore') {
  179. //防止重复加载
  180. return;
  181. }
  182. // 修改当前对象状态为加载中
  183. navItem.loadingType = 'loading';
  184. let qdata = {
  185. page: navItem.page,
  186. limit: navItem.limit,
  187. type: obj.type
  188. }
  189. if(state == 1 ) {
  190. fllj(qdata).then(res => {
  191. navItem.orderList = navItem.orderList.concat(res.data.data)
  192. if(navItem.limit == res.data.data.length) {
  193. navItem.loadingType = 'more'
  194. }else {
  195. navItem.loadingType = 'noMore'
  196. }
  197. navItem.loaded = true
  198. })
  199. }
  200. if(state == 2) {
  201. flff(qdata).then(res => {
  202. navItem.orderList = navItem.orderList.concat(res.data.data)
  203. if(navItem.limit == res.data.data.length) {
  204. navItem.loadingType = 'more'
  205. }else {
  206. navItem.loadingType = 'noMore'
  207. }
  208. navItem.loaded = true
  209. })
  210. }
  211. },
  212. //swiper 切换
  213. changeTab(e) {
  214. this.tabCurrentIndex = e.target.current;
  215. this.loadData('tabChange');
  216. },
  217. //顶部tab点击
  218. tabClick(index) {
  219. this.tabCurrentIndex = index;
  220. }
  221. }
  222. };
  223. </script>
  224. <style lang="scss">
  225. page {
  226. background: #f1f1f1;
  227. height: 100%;
  228. }
  229. .status_bar {
  230. height: var(--status-bar-height);
  231. width: 100%;
  232. }
  233. .content-money {
  234. position: relative;
  235. height: 480rpx;
  236. .content-bg {
  237. position: absolute;
  238. top: 0;
  239. left: 0;
  240. right: 0;
  241. width: 750rpx;
  242. height: 480rpx;
  243. image {
  244. width: 100%;
  245. height: 100%;
  246. }
  247. }
  248. .body-title {
  249. height: 80rpx;
  250. text-align: center;
  251. font-size: 35rpx;
  252. position: relative;
  253. .header {
  254. position: absolute;
  255. left: 0;
  256. top: 0;
  257. width: 100%;
  258. font-size: 36rpx;
  259. font-family: PingFang SC;
  260. font-weight: bold;
  261. color: #fffeff;
  262. height: 80rpx;
  263. font-size: 36rpx;
  264. font-weight: 700;
  265. z-index: 9;
  266. display: flex;
  267. justify-content: center;
  268. align-items: center;
  269. }
  270. .goback-box {
  271. position: absolute;
  272. left: 18rpx;
  273. top: 0;
  274. height: 80rpx;
  275. display: flex;
  276. align-items: center;
  277. }
  278. .goback {
  279. z-index: 100;
  280. width: 34rpx;
  281. height: 34rpx;
  282. }
  283. }
  284. }
  285. .info-box {
  286. width: 670rpx;
  287. height: 186rpx;
  288. background: #ffffff;
  289. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  290. border-radius: 20rpx;
  291. margin: -100rpx auto 0;
  292. position: relative;
  293. z-index: 2;
  294. .info-item {
  295. width: 50%;
  296. display: flex;
  297. flex-direction: column;
  298. align-items: center;
  299. line-height: 1;
  300. .info-font {
  301. font-size: 30rpx;
  302. font-family: PingFang SC;
  303. font-weight: bold;
  304. color: #999999;
  305. }
  306. .info-num {
  307. margin-top: 30rpx;
  308. font-size: 30rpx;
  309. font-family: PingFang SC;
  310. font-weight: bold;
  311. color: #181818;
  312. }
  313. }
  314. .shu {
  315. width: 2rpx;
  316. height: 74rpx;
  317. background: #dcdfe6;
  318. }
  319. }
  320. .money-box {
  321. position: relative;
  322. z-index: 2;
  323. /* #ifdef H5 */
  324. padding-top: 90rpx;
  325. /* #endif */
  326. color: #ffffff;
  327. text-align: center;
  328. /* #ifdef APP-PLUS */
  329. height: 200rpx;
  330. display: flex;
  331. flex-direction: column;
  332. justify-content: center;
  333. /* #endif */
  334. /* #ifdef MP-WEIXIN */
  335. padding-top: 40rpx;
  336. /* #endif */
  337. .money {
  338. font-size: 72rpx;
  339. font-family: PingFang SC;
  340. font-weight: bold;
  341. color: #ffffff;
  342. }
  343. .text {
  344. font-size: 30rpx;
  345. }
  346. }
  347. .moneybtn-box {
  348. display: flex;
  349. justify-content: space-between;
  350. position: relative;
  351. z-index: 2;
  352. color: #ffffff;
  353. padding: 20rpx 50rpx 0;
  354. font-size: 30rpx;
  355. font-family: PingFang SC;
  356. font-weight: bold;
  357. color: #ffffff;
  358. }
  359. .navbar {
  360. margin-top: 20rpx;
  361. display: flex;
  362. height: 88rpx;
  363. padding: 0 5px;
  364. background: #fff;
  365. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  366. position: relative;
  367. z-index: 10;
  368. .nav-item {
  369. flex: 1;
  370. display: flex;
  371. justify-content: center;
  372. align-items: center;
  373. height: 100%;
  374. font-size: 15px;
  375. color: #999999;
  376. position: relative;
  377. &.current {
  378. color: #000;
  379. &:after {
  380. content: '';
  381. position: absolute;
  382. left: 50%;
  383. bottom: 0;
  384. transform: translateX(-50%);
  385. width: 44px;
  386. height: 0;
  387. border-bottom: 2px solid #fe5b38;
  388. }
  389. }
  390. }
  391. }
  392. //列表
  393. .swiper-box {
  394. .order-item:last-child {
  395. margin-bottom: 60rpx;
  396. }
  397. .order-item {
  398. padding: 20rpx 30rpx;
  399. line-height: 1.5;
  400. .title-box {
  401. .title {
  402. font-size: $font-lg;
  403. color: $font-color-base;
  404. }
  405. .time {
  406. font-size: $font-base;
  407. color: $font-color-light;
  408. }
  409. }
  410. .money {
  411. color: #fd5b23;
  412. font-size: $font-lg;
  413. text-align: right;
  414. .status {
  415. color: $font-color-light;
  416. }
  417. }
  418. }
  419. }
  420. .list-scroll-content {
  421. background: #ffffff;
  422. height: 100%;
  423. }
  424. .content {
  425. height: 100%;
  426. .empty-content {
  427. background-color: #ffffff;
  428. }
  429. }
  430. .btn-box {
  431. width: 674rpx;
  432. height: 88rpx;
  433. background: linear-gradient(0deg, #2e58ff, #32c6ff);
  434. border-radius: 44rpx;
  435. font-size: 36rpx;
  436. font-family: PingFang SC;
  437. font-weight: 500;
  438. color: #ffffff;
  439. text-align: center;
  440. line-height: 88rpx;
  441. position: fixed;
  442. bottom: 48rpx;
  443. left: 0;
  444. right: 0;
  445. margin: 0 auto;
  446. }
  447. </style>