mygwjf.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  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=1')">积分转余额</view>
  12. <view class="jf-zz" @click.stop="navto('/pages/user/xfjfzz?type=1')">积分转账</view>
  13. <view class="jf-zz jf-tx" @click.stop="navto('/pages/users/user_cash/index?jftype=1')">积分提现</view>
  14. <view class="jf-tit">积分余额</view>
  15. <view class="jf-val">{{ userInfo.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, integrallist } 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.navigateBack({});
  149. },
  150. //获取收入支出信息
  151. async loadData(source) {
  152. let obj = this;
  153. //这里是将订单挂载到tab列表下
  154. let index = this.tabCurrentIndex;
  155. let navItem = this.navList[index];
  156. let state = navItem.state;
  157. if (source === 'tabChange' && navItem.loaded === true) {
  158. //tab切换只有第一次需要加载数据
  159. return;
  160. }
  161. if (navItem.loadingType == 'loading' || navItem.loadingType == 'nomore') {
  162. //防止重复加载
  163. return;
  164. }
  165. // 修改当前对象状态为加载中
  166. navItem.loadingType = 'loading';
  167. integrallist({
  168. page: navItem.page,
  169. limit: navItem.limit,
  170. status: navItem.state
  171. })
  172. .then(({ data }) => {
  173. obj.sr = data.sr;
  174. obj.zc = data.zc;
  175. obj.dsf = data.dsf;
  176. obj.jrsf = data.jrsf;
  177. navItem.orderList = navItem.orderList.concat(data.list);
  178. navItem.page++;
  179. if (navItem.limit == data.list.length) {
  180. navItem.loadingType = 'more';
  181. } else {
  182. navItem.loadingType = 'noMore';
  183. }
  184. navItem.loaded = true;
  185. })
  186. .catch(e => {
  187. console.log(e);
  188. });
  189. },
  190. //swiper 切换
  191. changeTab(e) {
  192. this.tabCurrentIndex = e.target.current;
  193. this.loadData('tabChange');
  194. },
  195. //顶部tab点击
  196. tabClick(index) {
  197. this.tabCurrentIndex = index;
  198. }
  199. }
  200. };
  201. </script>
  202. <style lang="scss">
  203. page {
  204. background: #f1f1f1;
  205. height: 100%;
  206. }
  207. .status_bar {
  208. height: var(--status-bar-height);
  209. width: 100%;
  210. }
  211. .content-money {
  212. position: relative;
  213. height: 480rpx;
  214. .content-bg {
  215. position: absolute;
  216. top: 0;
  217. left: 0;
  218. right: 0;
  219. width: 750rpx;
  220. height: 480rpx;
  221. image {
  222. width: 100%;
  223. height: 100%;
  224. }
  225. }
  226. .body-title {
  227. height: 80rpx;
  228. text-align: center;
  229. font-size: 35rpx;
  230. position: relative;
  231. .header {
  232. position: absolute;
  233. left: 0;
  234. top: 0;
  235. width: 100%;
  236. font-size: 36rpx;
  237. font-family: PingFang SC;
  238. font-weight: bold;
  239. color: #fffeff;
  240. height: 80rpx;
  241. font-size: 36rpx;
  242. font-weight: 700;
  243. z-index: 9;
  244. display: flex;
  245. justify-content: center;
  246. align-items: center;
  247. }
  248. .goback-box {
  249. position: absolute;
  250. left: 18rpx;
  251. top: 0;
  252. height: 80rpx;
  253. display: flex;
  254. align-items: center;
  255. }
  256. .goback {
  257. z-index: 100;
  258. width: 34rpx;
  259. height: 34rpx;
  260. }
  261. }
  262. }
  263. .info-box {
  264. width: 670rpx;
  265. height: 186rpx;
  266. background: #ffffff;
  267. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  268. border-radius: 20rpx;
  269. margin: -100rpx auto 0;
  270. position: relative;
  271. z-index: 2;
  272. .info-item {
  273. width: 50%;
  274. display: flex;
  275. flex-direction: column;
  276. align-items: center;
  277. line-height: 1;
  278. .info-font {
  279. font-size: 30rpx;
  280. font-family: PingFang SC;
  281. font-weight: bold;
  282. color: #999999;
  283. }
  284. .info-num {
  285. margin-top: 30rpx;
  286. font-size: 30rpx;
  287. font-family: PingFang SC;
  288. font-weight: bold;
  289. color: #181818;
  290. }
  291. }
  292. .shu {
  293. width: 2rpx;
  294. height: 74rpx;
  295. background: #dcdfe6;
  296. }
  297. }
  298. .money-box {
  299. position: relative;
  300. z-index: 2;
  301. padding-top: 20rpx;
  302. color: #ffffff;
  303. text-align: center;
  304. .money {
  305. font-size: 72rpx;
  306. font-family: PingFang SC;
  307. font-weight: bold;
  308. color: #ffffff;
  309. }
  310. .text {
  311. font-size: 30rpx;
  312. }
  313. }
  314. .money-btn {
  315. position: relative;
  316. z-index: 2;
  317. color: #ffffff;
  318. padding: 0 50rpx;
  319. text-align: right;
  320. font-size: 30rpx;
  321. font-family: PingFang SC;
  322. font-weight: bold;
  323. color: #ffffff;
  324. text {
  325. display: inline-block;
  326. padding-left: 10rpx;
  327. }
  328. }
  329. .navbar {
  330. margin-top: 20rpx;
  331. display: flex;
  332. height: 88rpx;
  333. padding: 0 5px;
  334. background: #fff;
  335. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  336. position: relative;
  337. z-index: 10;
  338. .nav-item {
  339. flex: 1;
  340. display: flex;
  341. justify-content: center;
  342. align-items: center;
  343. height: 100%;
  344. font-size: 15px;
  345. color: #999999;
  346. position: relative;
  347. &.current {
  348. color: #000;
  349. &:after {
  350. content: '';
  351. position: absolute;
  352. left: 50%;
  353. bottom: 0;
  354. transform: translateX(-50%);
  355. width: 44px;
  356. height: 0;
  357. border-bottom: 2px solid #fe5b38;
  358. }
  359. }
  360. }
  361. }
  362. //列表
  363. .swiper-box {
  364. .order-item:last-child {
  365. margin-bottom: 60rpx;
  366. }
  367. .order-item {
  368. padding: 20rpx 30rpx;
  369. line-height: 1.5;
  370. .title-box {
  371. .title {
  372. font-size: $font-lg;
  373. color: $font-color-base;
  374. }
  375. .time {
  376. font-size: $font-base;
  377. color: $font-color-light;
  378. }
  379. }
  380. .money {
  381. color: #fd5b23;
  382. font-size: $font-lg;
  383. text-align: right;
  384. .status {
  385. color: $font-color-light;
  386. }
  387. }
  388. }
  389. }
  390. .list-scroll-content {
  391. background: #ffffff;
  392. height: 100%;
  393. }
  394. .content {
  395. height: 100%;
  396. .empty-content {
  397. background-color: #ffffff;
  398. }
  399. }
  400. .btn-box {
  401. width: 674rpx;
  402. height: 88rpx;
  403. background: linear-gradient(0deg, #2e58ff, #32c6ff);
  404. border-radius: 44rpx;
  405. font-size: 36rpx;
  406. font-family: PingFang SC;
  407. font-weight: 500;
  408. color: #ffffff;
  409. text-align: center;
  410. line-height: 88rpx;
  411. position: fixed;
  412. bottom: 48rpx;
  413. left: 0;
  414. right: 0;
  415. margin: 0 auto;
  416. }
  417. .my-jf {
  418. position: relative;
  419. width: 670rpx;
  420. height: 386rpx;
  421. background: #ffffff;
  422. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  423. border-radius: 20rpx;
  424. margin: 44rpx auto 0;
  425. text-align: center;
  426. font-size: 28rpx;
  427. font-weight: 500;
  428. color: #181818;
  429. .jf-zz {
  430. width: 147rpx;
  431. line-height: 50rpx;
  432. text-align: center;
  433. background: linear-gradient(90deg, #ff6f30, #ff7131);
  434. border-radius: 7rpx 0px 0px 7rpx;
  435. position: absolute;
  436. top: 59rpx;
  437. right: 0;
  438. font-size: 27rpx;
  439. font-weight: 400;
  440. color: #ffffff;
  441. }
  442. .jf-ye {
  443. left: 0;
  444. width: 160rpx;
  445. border-radius: 0rpx 7px 7px 0rpx;
  446. }
  447. .jf-tx {
  448. top: 160rpx;
  449. }
  450. .jf-tit {
  451. padding-top: 70rpx;
  452. }
  453. .jf-val {
  454. font-size: 74rpx;
  455. font-weight: bold;
  456. color: #181818;
  457. padding-top: 10rpx;
  458. }
  459. .jf-item-list {
  460. position: absolute;
  461. bottom: 30rpx;
  462. height: 80rpx;
  463. width: 670rpx;
  464. .jf-item {
  465. width: 25%;
  466. }
  467. .jg {
  468. width: 1rpx;
  469. height: 74rpx;
  470. background: #dcdfe6;
  471. }
  472. }
  473. }
  474. </style>