mygwjf.vue 11 KB

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