mygwjf.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  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. navItem.page++
  226. if(navItem.limit == data.list.length) {
  227. navItem.loadingType = 'more'
  228. }else {
  229. navItem.loadingType = 'noMore'
  230. }
  231. navItem.loaded = true
  232. })
  233. .catch(e => {
  234. console.log(e);
  235. });
  236. },
  237. //swiper 切换
  238. changeTab(e) {
  239. this.tabCurrentIndex = e.target.current;
  240. this.loadData('tabChange');
  241. },
  242. //顶部tab点击
  243. tabClick(index) {
  244. this.tabCurrentIndex = index;
  245. }
  246. }
  247. };
  248. </script>
  249. <style lang="scss">
  250. page {
  251. background: #f1f1f1;
  252. height: 100%;
  253. }
  254. .status_bar {
  255. height: var(--status-bar-height);
  256. width: 100%;
  257. }
  258. .content-money {
  259. position: relative;
  260. height: 480rpx;
  261. .content-bg {
  262. position: absolute;
  263. top: 0;
  264. left: 0;
  265. right: 0;
  266. width: 750rpx;
  267. height: 480rpx;
  268. image {
  269. width: 100%;
  270. height: 100%;
  271. }
  272. }
  273. .body-title {
  274. height: 80rpx;
  275. text-align: center;
  276. font-size: 35rpx;
  277. position: relative;
  278. .header {
  279. position: absolute;
  280. left: 0;
  281. top: 0;
  282. width: 100%;
  283. font-size: 36rpx;
  284. font-family: PingFang SC;
  285. font-weight: bold;
  286. color: #fffeff;
  287. height: 80rpx;
  288. font-size: 36rpx;
  289. font-weight: 700;
  290. z-index: 9;
  291. display: flex;
  292. justify-content: center;
  293. align-items: center;
  294. }
  295. .goback-box {
  296. position: absolute;
  297. left: 18rpx;
  298. top: 0;
  299. height: 80rpx;
  300. display: flex;
  301. align-items: center;
  302. }
  303. .goback {
  304. z-index: 100;
  305. width: 34rpx;
  306. height: 34rpx;
  307. }
  308. }
  309. }
  310. .info-box {
  311. width: 670rpx;
  312. height: 186rpx;
  313. background: #ffffff;
  314. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  315. border-radius: 20rpx;
  316. margin: -100rpx auto 0;
  317. position: relative;
  318. z-index: 2;
  319. .info-item {
  320. width: 50%;
  321. display: flex;
  322. flex-direction: column;
  323. align-items: center;
  324. line-height: 1;
  325. .info-font {
  326. font-size: 30rpx;
  327. font-family: PingFang SC;
  328. font-weight: bold;
  329. color: #999999;
  330. }
  331. .info-num {
  332. margin-top: 30rpx;
  333. font-size: 30rpx;
  334. font-family: PingFang SC;
  335. font-weight: bold;
  336. color: #181818;
  337. }
  338. }
  339. .shu {
  340. width: 2rpx;
  341. height: 74rpx;
  342. background: #dcdfe6;
  343. }
  344. }
  345. .money-box {
  346. position: relative;
  347. z-index: 2;
  348. padding-top: 20rpx;
  349. color: #ffffff;
  350. text-align: center;
  351. .money {
  352. font-size: 72rpx;
  353. font-family: PingFang SC;
  354. font-weight: bold;
  355. color: #ffffff;
  356. }
  357. .text {
  358. font-size: 30rpx;
  359. }
  360. }
  361. .money-btn {
  362. position: relative;
  363. z-index: 2;
  364. color: #ffffff;
  365. padding: 0 50rpx;
  366. text-align: right;
  367. font-size: 30rpx;
  368. font-family: PingFang SC;
  369. font-weight: bold;
  370. color: #FFFFFF;
  371. text {
  372. display: inline-block;
  373. padding-left: 10rpx;
  374. }
  375. }
  376. .navbar {
  377. margin-top: 20rpx;
  378. display: flex;
  379. height: 88rpx;
  380. padding: 0 5px;
  381. background: #fff;
  382. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  383. position: relative;
  384. z-index: 10;
  385. .nav-item {
  386. flex: 1;
  387. display: flex;
  388. justify-content: center;
  389. align-items: center;
  390. height: 100%;
  391. font-size: 15px;
  392. color: #999999;
  393. position: relative;
  394. &.current {
  395. color: #000;
  396. &:after {
  397. content: '';
  398. position: absolute;
  399. left: 50%;
  400. bottom: 0;
  401. transform: translateX(-50%);
  402. width: 44px;
  403. height: 0;
  404. border-bottom: 2px solid #fe5b38;
  405. }
  406. }
  407. }
  408. }
  409. //列表
  410. .swiper-box {
  411. .order-item:last-child {
  412. margin-bottom: 60rpx;
  413. }
  414. .order-item {
  415. padding: 20rpx 30rpx;
  416. line-height: 1.5;
  417. .title-box {
  418. .title {
  419. font-size: $font-lg;
  420. color: $font-color-base;
  421. }
  422. .time {
  423. font-size: $font-base;
  424. color: $font-color-light;
  425. }
  426. }
  427. .money {
  428. color: #fd5b23;
  429. font-size: $font-lg;
  430. text-align: right;
  431. .status {
  432. color: $font-color-light;
  433. }
  434. }
  435. }
  436. }
  437. .list-scroll-content {
  438. background: #ffffff;
  439. height: 100%;
  440. }
  441. .content {
  442. height: 100%;
  443. .empty-content {
  444. background-color: #ffffff;
  445. }
  446. }
  447. .btn-box {
  448. width: 674rpx;
  449. height: 88rpx;
  450. background: linear-gradient(0deg, #2e58ff, #32c6ff);
  451. border-radius: 44rpx;
  452. font-size: 36rpx;
  453. font-family: PingFang SC;
  454. font-weight: 500;
  455. color: #ffffff;
  456. text-align: center;
  457. line-height: 88rpx;
  458. position: fixed;
  459. bottom: 48rpx;
  460. left: 0;
  461. right: 0;
  462. margin: 0 auto;
  463. }
  464. .my-jf {
  465. position: relative;
  466. width: 670rpx;
  467. height: 386rpx;
  468. background: #FFFFFF;
  469. box-shadow: 0px 0px 20rpx 0px rgba(50,50,52,0.0600);
  470. border-radius: 20rpx;
  471. margin: 44rpx auto 0;
  472. text-align: center;
  473. font-size: 28rpx;
  474. font-weight: 500;
  475. color: #181818;
  476. .jf-zz {
  477. width: 147rpx;
  478. line-height: 50rpx;
  479. text-align: center;
  480. background: linear-gradient(90deg, #FF6F30, #FF7131);
  481. border-radius: 7rpx 0px 0px 7rpx;
  482. position: absolute;
  483. top: 59rpx;
  484. right: 0;
  485. font-size: 27rpx;
  486. font-weight: 400;
  487. color: #FFFFFF;
  488. }
  489. .jf-tx {
  490. top: 160rpx;
  491. }
  492. .jf-tit {
  493. padding-top: 70rpx;
  494. }
  495. .jf-val {
  496. font-size: 74rpx;
  497. font-weight: bold;
  498. color: #181818;
  499. padding-top: 10rpx;
  500. }
  501. .jf-item-list {
  502. position: absolute;
  503. bottom: 30rpx;
  504. height: 80rpx;
  505. width: 670rpx;
  506. .jf-item {
  507. width: 25%;
  508. }
  509. .jg {
  510. width: 1rpx;
  511. height: 74rpx;
  512. background: #DCDFE6;
  513. }
  514. }
  515. }
  516. </style>