qyjf.vue 10 KB

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