equity.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  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">
  7. </view>
  8. <view class="header">股权积分</view>
  9. </view>
  10. <view class="content-bg">
  11. <image src="../../users/static/tc.png" mode=""></image>
  12. </view>
  13. <view class="money-box">
  14. <view class="money">{{ userInfo.stock_integral || 0 }}</view>
  15. <view class="col">当前余额</view>
  16. </view>
  17. </view>
  18. <!-- <view class="info-box flex">
  19. <view class="info-item">
  20. <view class="info-font">累计收入</view>
  21. <view class="info-num">{{userInfo.brokerage || '0'}}</view>
  22. </view>
  23. <view class="shu"></view>
  24. <view class="info-item">
  25. <view class="info-font">累计支出</view>
  26. <view class="info-num">{{userInfo.extract || '0'}}</view>
  27. </view>
  28. </view> -->
  29. <!-- <view class="navbar">
  30. <view v-for="(item, index) in navList" :key="index" class="nav-item"
  31. :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
  32. </view> -->
  33. <swiper :current="tabCurrentIndex" :style="{ height: height }" class="swiper-box" duration="300"
  34. @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. <view>
  39. <view class="order-item acea-row row-between" v-for="(item, index) in tabItem.orderList" :key="index">
  40. <view class="title-box">
  41. <view class="title">
  42. <text>{{ item.mark }}</text>
  43. </view>
  44. <view class="time">
  45. <text>{{ item.add_time }}</text>
  46. </view>
  47. </view>
  48. <view class="money">
  49. <view>{{ (item.pm == 0 ? '-' : '+') + item.number * 1 }}</view>
  50. </view>
  51. </view>
  52. </view>
  53. </scroll-view>
  54. </swiper-item>
  55. </swiper>
  56. </view>
  57. </template>
  58. <script>
  59. import {
  60. userinfo,
  61. } from '@/api/user.js';
  62. import {
  63. getTypeListIn
  64. } from '@/api/newapi.js';
  65. export default {
  66. onReady(res) {
  67. var _this = this;
  68. uni.getSystemInfo({
  69. success: resu => {
  70. const query = uni.createSelectorQuery();
  71. query.select('.swiper-box').boundingClientRect();
  72. query.exec(function(res) {
  73. _this.height = resu.windowHeight - res[0].top + 'px';
  74. console.log('打印页面的剩余高度', _this.height);
  75. });
  76. },
  77. fail: res => {}
  78. });
  79. },
  80. data() {
  81. return {
  82. userInfo: {},
  83. yj: '',
  84. height: '',
  85. // 头部图高度
  86. maxheight: '',
  87. tabCurrentIndex: 0,
  88. orderStatusSum: 0,
  89. recharge: 0,
  90. navList: [
  91. {
  92. state: 'stock_integral',
  93. text: '记录列表',
  94. loadingType: 'more',
  95. orderList: [],
  96. page: 1, //当前页数
  97. limit: 10 //每次信息条数
  98. },
  99. ],
  100. money: ''
  101. };
  102. },
  103. onLoad(options) {},
  104. onShow() {
  105. this.getUserInfo()
  106. this.loadData();
  107. },
  108. methods: {
  109. getUserInfo() {
  110. userinfo({}).then(({
  111. data
  112. }) => {
  113. this.userInfo = data
  114. });
  115. },
  116. toBack() {
  117. uni.switchTab({
  118. url: '/pages/user/user'
  119. });
  120. },
  121. // 页面跳转
  122. navto(e) {
  123. uni.navigateTo({
  124. url: e
  125. });
  126. },
  127. //获取收入支出信息
  128. async loadData(source) {
  129. let obj = this;
  130. //这里是将订单挂载到tab列表下
  131. let index = this.tabCurrentIndex;
  132. let navItem = this.navList[index];
  133. let state = navItem.state;
  134. if (source === 'tabChange' && navItem.loaded === true) {
  135. //tab切换只有第一次需要加载数据
  136. return;
  137. }
  138. if (navItem.loadingType === 'loading') {
  139. //防止重复加载
  140. return;
  141. }
  142. // 修改当前对象状态为加载中
  143. navItem.loadingType = 'loading';
  144. getTypeListIn({
  145. page: navItem.page,
  146. limit: navItem.limit,
  147. }, state)
  148. .then(({
  149. data
  150. }) => {
  151. if (data.length > 0) {
  152. navItem.orderList = navItem.orderList.concat(data);
  153. console.log(navItem.orderList);
  154. navItem.page++;
  155. }
  156. //判断是否还有数据, 有改为more, 没有改为noMore
  157. if (navItem.limit == data.length) {
  158. navItem.loadingType = 'more';
  159. return;
  160. } else {
  161. navItem.loadingType = 'noMore';
  162. }
  163. uni.hideLoading();
  164. this.$set(navItem, 'loaded', true);
  165. })
  166. .catch(e => {
  167. console.log(e);
  168. });
  169. },
  170. //swiper 切换
  171. changeTab(e) {
  172. this.tabCurrentIndex = e.target.current;
  173. this.loadData('tabChange');
  174. },
  175. //顶部tab点击
  176. tabClick(index) {
  177. this.tabCurrentIndex = index;
  178. }
  179. }
  180. };
  181. </script>
  182. <style lang="scss">
  183. page {
  184. background: #f1f1f1;
  185. height: 100%;
  186. }
  187. .status_bar {
  188. height: var(--status-bar-height);
  189. width: 100%;
  190. }
  191. .content-money {
  192. position: relative;
  193. height: 480rpx;
  194. .content-bg {
  195. position: absolute;
  196. top: 0;
  197. left: 0;
  198. right: 0;
  199. width: 750rpx;
  200. height: 480rpx;
  201. image {
  202. width: 100%;
  203. height: 100%;
  204. }
  205. }
  206. .body-title {
  207. height: 80rpx;
  208. text-align: center;
  209. font-size: 35rpx;
  210. position: relative;
  211. .header {
  212. position: absolute;
  213. left: 0;
  214. top: 0;
  215. width: 100%;
  216. font-size: 36rpx;
  217. font-family: PingFang SC;
  218. font-weight: bold;
  219. color: #fff;
  220. height: 80rpx;
  221. font-size: 36rpx;
  222. font-weight: 700;
  223. z-index: 9;
  224. display: flex;
  225. justify-content: center;
  226. align-items: center;
  227. }
  228. .goback-box {
  229. position: absolute;
  230. left: 18rpx;
  231. top: 0;
  232. height: 80rpx;
  233. display: flex;
  234. align-items: center;
  235. }
  236. .goback {
  237. z-index: 100;
  238. width: 34rpx;
  239. height: 34rpx;
  240. }
  241. }
  242. }
  243. .info-box {
  244. width: 670rpx;
  245. height: 186rpx;
  246. background: #ffffff;
  247. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  248. border-radius: 20rpx;
  249. margin: -100rpx auto 0;
  250. position: relative;
  251. z-index: 2;
  252. .info-item {
  253. padding-top: 50rpx;
  254. width: 50%;
  255. display: flex;
  256. flex-direction: column;
  257. align-items: center;
  258. line-height: 1;
  259. .info-font {
  260. font-size: 30rpx;
  261. font-weight: bold;
  262. color: #999999;
  263. }
  264. .info-num {
  265. margin-top: 30rpx;
  266. font-size: 30rpx;
  267. font-weight: bold;
  268. color: #181818;
  269. }
  270. }
  271. .shu {
  272. width: 2rpx;
  273. height: 74rpx;
  274. background: #dcdfe6;
  275. margin-top: 55rpx;
  276. }
  277. }
  278. .money-box {
  279. position: relative;
  280. z-index: 2;
  281. /* #ifdef H5 */
  282. padding-top: 90rpx;
  283. /* #endif */
  284. color: #fff;
  285. text-align: center;
  286. /* #ifdef APP-PLUS */
  287. height: 200rpx;
  288. display: flex;
  289. flex-direction: column;
  290. justify-content: center;
  291. /* #endif */
  292. /* #ifdef MP-WEIXIN */
  293. padding-top: 40rpx;
  294. /* #endif */
  295. .money {
  296. font-size: 72rpx;
  297. font-weight: bold;
  298. color: #fff;
  299. }
  300. .text {
  301. font-size: 30rpx;
  302. }
  303. }
  304. .box {
  305. width: 670rpx;
  306. height: 50rpx;
  307. display: flex;
  308. justify-content: space-between;
  309. align-items: center;
  310. }
  311. .moneybtn-box {
  312. display: flex;
  313. justify-content: space-between;
  314. position: relative;
  315. z-index: 2;
  316. padding: -20rpx 10rpx;
  317. font-size: 30rpx;
  318. font-weight: bold;
  319. color: #6E4019;
  320. }
  321. .moneybtn-box1 {
  322. display: flex;
  323. justify-content: space-between;
  324. position: relative;
  325. z-index: 2;
  326. color: #6E4019;
  327. padding: 40rpx 60rpx;
  328. font-size: 30rpx;
  329. font-weight: bold;
  330. color: #6E4019;
  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: 26rpx;
  376. }
  377. .time {
  378. font-size: 26rpx;
  379. }
  380. }
  381. .money {
  382. color: #fd5b23;
  383. font-size: 26rpx;
  384. text-align: right;
  385. .status {
  386. color: #6E4019;
  387. }
  388. }
  389. }
  390. }
  391. .list-scroll-content {
  392. background: #ffffff;
  393. height: 100%;
  394. }
  395. .content {
  396. height: 100%;
  397. .empty-content {
  398. background-color: #ffffff;
  399. }
  400. }
  401. .btn-box {
  402. width: 674rpx;
  403. height: 88rpx;
  404. background: linear-gradient(0deg, #2e58ff, #32c6ff);
  405. border-radius: 44rpx;
  406. font-size: 36rpx;
  407. font-family: PingFang SC;
  408. font-weight: 500;
  409. color: #ffffff;
  410. text-align: center;
  411. line-height: 88rpx;
  412. position: fixed;
  413. bottom: 48rpx;
  414. left: 0;
  415. right: 0;
  416. margin: 0 auto;
  417. }
  418. </style>