reportPage.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
  1. <template>
  2. <view class="content">
  3. <view class="headerSection">
  4. <view class="sectionA">
  5. <view class="left">
  6. <view class="name">今日可提现</view>
  7. <view class="value" :style="`color: ${color2};`">¥{{headerInfo.canCashOut || 0.00}}</view>
  8. <!-- <num-run :value="700"></num-run> -->
  9. </view>
  10. <view class="right">
  11. <view class="txRecord" :style="`color: ${color2};`">提现记录></view>
  12. <view class="txRequest" :style="`background-color: ${color1};`">提现申请</view>
  13. </view>
  14. </view>
  15. <view class="sectionB">
  16. <view class="item1" v-for="(item, idx) in shouyiList" :key="idx">
  17. <view class="name">{{item.title}}</view>
  18. <view class="value">¥{{item.value}}</view>
  19. <view class="des" v-if="idx == 1">
  20. (服续费¥{{item.subValue}})
  21. </view>
  22. <view class="rightLine" v-if="idx < 2"></view>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="screenSection">
  27. <view class="sectionA">
  28. <view class="title">我的收益明细</view>
  29. <view class="dataScreen">
  30. <block v-if="listParmas.startDate">
  31. <text @click="dataScreenAction">{{listParmas.startDate + '-' + listParmas.endDate}}</text>
  32. <text @click="clearDate" :style="`margin-left: 10px; color: ${color2};`">清空</text>
  33. </block>
  34. <block v-else>
  35. <text @click="dataScreenAction">时间选择</text>
  36. <image src="../../static/icons/icon_dropDown@2x.png" mode="aspectFit"></image>
  37. </block>
  38. </view>
  39. </view>
  40. <view class="sectionB">
  41. <view class="item" v-for="(item, idx) in tabList" :key="idx" :style="`background-color: ${item.isSelect ? color1: '#fff'}; color: ${item.isSelect ? '#fff': '#B1B1B1'};`"
  42. @click="selectTab(item)">
  43. {{item.typeName}}
  44. </view>
  45. </view>
  46. </view>
  47. <view class="listSection">
  48. <view class="top-Section">
  49. <view class="point"></view>
  50. <view class="name">任务详情</view>
  51. <view class="totalPrice" :style="`color: ${color2};`">总收益:{{totalIncome}}元</view>
  52. </view>
  53. <view class="item" v-for="(item, idx) in dataList" :key="idx">
  54. <view class="sectionA">
  55. <view class="point" :style="`background-color: ${color1};`"></view>
  56. <view class="name" :style="`color: ${color1};`">{{item.name}}</view>
  57. </view>
  58. <view class="sectionB">
  59. <image class="icon" src="https://dm.static.elab-plus.com/yezhu/h5/icon_dingwei.png" mode="aspectFit" style="color: #0066CC;"></image>
  60. <view class="date">{{item.happenTime || '-'}}</view>
  61. </view>
  62. <view class="sectionC">
  63. <view class="point"></view>
  64. <view class="name">收益明细</view>
  65. </view>
  66. <view class="sectionD">
  67. <view class="name">{{item.incomeType || '-'}}</view>
  68. <view class="value" :style="`color: ${color2};`">+{{item.income}}元</view>
  69. </view>
  70. <view class="bottomLine" v-if="idx < dataList.length - 1"></view>
  71. </view>
  72. <view class="com_noMore_text" v-if="noMore && dataList.length > 0">没有更多了</view>
  73. <view class="empty" v-if="dataList.length == 0">
  74. <image class="emptyImg" src="https://dm.static.elab-plus.com/yezhu/h5/icon_empty.png" mode=""></image>
  75. <view class="text">暂无数据</view>
  76. </view>
  77. </view>
  78. <dm-calendar-picker-view ref='calendarPickerView' @confirmSelDate='confirmSelDate'></dm-calendar-picker-view>
  79. </view>
  80. </template>
  81. <script>
  82. import numRun from '../../components/numRun/numRun.vue'
  83. import dmCalendarPickerView from '../../components/subComponents/dmCalendarPickerView.vue'
  84. import moment from '../../static/moment.min.js'
  85. let app = getApp();
  86. export default {
  87. data() {
  88. return {
  89. headerInfo: {
  90. alreadyCashOut: 0.00,
  91. canCashOut: 0.00,
  92. serviceFee: 0.00,
  93. todayIncome: 0.00,
  94. totalIncome: 0.00
  95. },
  96. shouyiList: [{
  97. title: '今日收益',
  98. value: 0,
  99. des: ''
  100. },
  101. {
  102. title: '总收益',
  103. value: 0,
  104. subValue: 20,
  105. des: ''
  106. },
  107. {
  108. title: '累计已提现',
  109. value: 0,
  110. des: ''
  111. }
  112. ],
  113. color1: '',
  114. color2: '',
  115. tabList: [],
  116. listParmas: {
  117. endDate: "",
  118. pageNo: 1,
  119. pageSize: 20,
  120. startDate: "",
  121. type: 0
  122. },
  123. dataList: [],
  124. noMore: true,
  125. totalIncome: 0.00
  126. }
  127. },
  128. mounted() {
  129. this.color1 = app.globalData.color1;
  130. this.color2 = app.globalData.color2;
  131. this.getReportHeader()
  132. this.getReportMenu()
  133. },
  134. methods: {
  135. // 表头数据
  136. async getReportHeader() {
  137. const res = await this.$myRequest({
  138. url: '/report/header',
  139. method: 'GET'
  140. });
  141. if (res && res.data.success) {
  142. console.log('表头res:', res)
  143. this.headerInfo = res.data.single || {
  144. alreadyCashOut: 0.00,
  145. canCashOut: 0.00,
  146. serviceFee: 0.00,
  147. todayIncome: 0.00,
  148. totalIncome: 0.00
  149. }
  150. this.shouyiList[0].value = this.headerInfo.todayIncome || 0.00
  151. this.shouyiList[1].value = this.headerInfo.totalIncome || 0.00
  152. this.shouyiList[2].value = this.headerInfo.alreadyCashOut || 0.00
  153. this.shouyiList[1].subValue = this.headerInfo.serviceFee || 0.00
  154. }
  155. },
  156. async getReportMenu() {
  157. const res = await this.$myRequest({
  158. url: '/report/nav',
  159. method: 'GET'
  160. });
  161. if (res && res.data.success) {
  162. console.log('菜单res:', res)
  163. var tempList = res.data.list || []
  164. tempList.forEach((item, idx) => {
  165. item['isSelect'] = idx == 0 ? true : false
  166. })
  167. this.tabList = tempList
  168. if (this.tabList.length > 0) {
  169. this.selectTab(this.tabList[0])
  170. }
  171. }
  172. },
  173. selectTab(e) {
  174. this.tabList.forEach((item, idx) => {
  175. item.isSelect = false
  176. if (e.type == item.type) {
  177. item.isSelect = true
  178. }
  179. })
  180. this.listParmas.type = e.type
  181. this.pullDownRefresh(true)
  182. },
  183. async getReportList() {
  184. var self = this
  185. const res = await this.$myRequest({
  186. url: '/report/list',
  187. data: self.listParmas
  188. });
  189. if (res && res.data.success) {
  190. if (this.listParmas.pageNo == 1) {
  191. this.dataList = res.data.single.pageInfoModel.resultSet || []
  192. } else {
  193. this.dataList = this.dataList.concat(res.data.single.pageInfoModel.resultSet || []);
  194. }
  195. this.totalIncome = res.data.single.totalIncome || '0.00'
  196. this.noMore = res.data.single.pageInfoModel.resultSet.length < this.listParmas.pageSize
  197. uni.stopPullDownRefresh();
  198. }
  199. else {
  200. this.noMore = true
  201. this.totalIncome = '0.00'
  202. uni.stopPullDownRefresh();
  203. }
  204. },
  205. dataScreenAction() {
  206. this.$refs.calendarPickerView.show()
  207. },
  208. confirmSelDate(e) {
  209. const startDate = e.startDate;
  210. const endDate = e.endDate;
  211. if (moment(startDate).isBefore(endDate)) {
  212. this.listParmas.startDate = startDate;
  213. this.listParmas.endDate = endDate;
  214. } else {
  215. this.listParmas.startDate = endDate;
  216. this.listParmas.endDate = startDate;
  217. }
  218. this.pullDownRefresh()
  219. },
  220. clearDate() {
  221. this.listParmas.startDate = '';
  222. this.listParmas.endDate = '';
  223. this.pullDownRefresh()
  224. },
  225. pullDownRefresh(isPullDown = true) {
  226. if (isPullDown) {
  227. this.listParmas.pageNo = 1;
  228. this.getReportList()
  229. } else {
  230. if (this.noMore) {
  231. return;
  232. }
  233. this.listParmas.pageNo++;
  234. this.getReportList()
  235. }
  236. },
  237. },
  238. onPullDownRefresh() {
  239. this.pullDownRefresh(true)
  240. setTimeout(function() {
  241. uni.stopPullDownRefresh();
  242. }, 1000);
  243. },
  244. onReachBottom() {
  245. this.pullDownRefresh(false)
  246. },
  247. watch: {
  248. },
  249. components: {
  250. numRun,
  251. dmCalendarPickerView
  252. }
  253. }
  254. </script>
  255. <style lang="scss" scoped>
  256. page {
  257. width: 100vw;
  258. // height: 100vh;
  259. }
  260. .content {
  261. width: 100%;
  262. // height: 100%;
  263. // max-height: 100%;
  264. // overflow-y: scroll;
  265. background-color: #F5F5F7;
  266. padding: 20rpx 20rpx 100rpx 20rpx;
  267. box-sizing: border-box;
  268. .headerSection {
  269. width: 100%;
  270. height: 352rpx;
  271. background-color: #fff;
  272. border-radius: 16rpx;
  273. padding: 32rpx 30rpx 16rpx 48rpx;
  274. box-sizing: border-box;
  275. .sectionA {
  276. display: flex;
  277. align-items: center;
  278. justify-content: space-between;
  279. .left {
  280. .name {
  281. font-size: 32rpx;
  282. font-family: Verdana, Verdana-Regular;
  283. font-weight: 400;
  284. text-align: left;
  285. color: #2c2c2c;
  286. line-height: 40px;
  287. }
  288. .value {
  289. margin-left: -12rpx;
  290. font-size: 64rpx;
  291. font-family: DIN Alternate, DIN Alternate-Bold;
  292. font-weight: 700;
  293. text-align: left;
  294. }
  295. }
  296. .right {
  297. .txRecord {
  298. font-size: 24rpx;
  299. font-family: Verdana, Verdana-Regular;
  300. font-weight: 400;
  301. text-align: right;
  302. }
  303. .txRequest {
  304. margin-top: 32rpx;
  305. width: 178rpx;
  306. height: 60rpx;
  307. border-radius: 12rpx;
  308. font-size: 28rpx;
  309. font-family: Verdana, Verdana-Bold;
  310. font-weight: 700;
  311. text-align: center;
  312. color: #ffffff;
  313. line-height: 60rpx;
  314. }
  315. }
  316. }
  317. .sectionB {
  318. margin-top: 40rpx;
  319. display: flex;
  320. justify-content: space-between;
  321. align-items: flex-start;
  322. .item1 {
  323. width: calc((100% - 90rpx) / 3);
  324. position: relative;
  325. height: 110rpx;
  326. .name {
  327. font-size: 24rpx;
  328. font-family: Verdana, Verdana-Regular;
  329. font-weight: 400;
  330. text-align: left;
  331. color: #999999;
  332. }
  333. .value {
  334. font-size: 32rpx;
  335. font-family: DIN Alternate, DIN Alternate-Bold;
  336. font-weight: 700;
  337. text-align: left;
  338. color: #262626;
  339. }
  340. .des {
  341. font-size: 20rpx;
  342. font-family: Verdana, Verdana-Regular;
  343. font-weight: 400;
  344. text-align: left;
  345. color: #cecece;
  346. white-space: nowrap;
  347. margin-left: -15rpx;
  348. }
  349. .rightLine {
  350. position: absolute;
  351. right: 0;
  352. width: 2rpx;
  353. height: 60rpx;
  354. border-right: 2rpx dashed #7f7f7f;
  355. top: calc((100% - 60rpx) / 2);
  356. opacity: 0.2;
  357. }
  358. }
  359. }
  360. }
  361. .screenSection {
  362. margin-top: 60rpx;
  363. width: 100%;
  364. padding: 20rpx;
  365. box-sizing: border-box;
  366. .sectionA {
  367. display: flex;
  368. justify-content: space-between;
  369. align-items: center;
  370. .title {
  371. font-size: 28rpx;
  372. font-family: Verdana, Verdana-Bold;
  373. font-weight: 700;
  374. text-align: left;
  375. color: #262626;
  376. }
  377. .dataScreen {
  378. display: flex;
  379. align-items: center;
  380. font-size: 24rpx;
  381. font-family: Verdana, Verdana-Regular;
  382. font-weight: 400;
  383. text-align: right;
  384. color: #262626;
  385. image {
  386. margin-left: 10rpx;
  387. width: 30rpx;
  388. height: 30rpx;
  389. }
  390. }
  391. }
  392. .sectionB {
  393. margin-top: 24rpx;
  394. display: flex;
  395. align-items: center;
  396. justify-content: space-between;
  397. flex-wrap: nowrap;
  398. overflow-x: scroll;
  399. .item {
  400. width: 160rpx;
  401. min-width: 160rpx;
  402. height: 70rpx;
  403. border-radius: 8rpx;
  404. font-size: 24rpx;
  405. font-family: Verdana, Verdana-Bold;
  406. font-weight: 700;
  407. text-align: center;
  408. line-height: 70rpx;
  409. margin-right: 10rpx;
  410. }
  411. }
  412. .sectionB::-webkit-scrollbar {
  413. display: none;
  414. /* Chrome Safari */
  415. }
  416. }
  417. .listSection {
  418. padding: 30rpx;
  419. box-sizing: border-box;
  420. position: relative;
  421. background-color: #fff;
  422. border-radius: 20rpx;
  423. .top-Section {
  424. height: 80rpx;
  425. display: flex;
  426. justify-content: space-between;
  427. align-items: center;
  428. border-bottom: 2px dashed rgba($color: #7F7F7F, $alpha: 0.1);
  429. .point {
  430. width: 16rpx;
  431. height: 16rpx;
  432. background: #3ecde6;
  433. border-radius: 50%;
  434. }
  435. .name {
  436. margin-left: 26rpx;
  437. font-size: 28rpx;
  438. font-family: Verdana, Verdana-Regular;
  439. font-weight: 400;
  440. text-align: left;
  441. color: #262626;
  442. flex-grow: 1;
  443. }
  444. .totalPrice {
  445. font-size: 28rpx;
  446. font-family: Verdana, Verdana-Regular;
  447. font-weight: 400;
  448. text-align: right;
  449. }
  450. }
  451. .item {
  452. position: relative;
  453. padding: 40rpx 0;
  454. box-sizing: border-box;
  455. .sectionA {
  456. display: flex;
  457. align-items: center;
  458. .point {
  459. width: 14rpx;
  460. height: 14rpx;
  461. border-radius: 50%;
  462. }
  463. .name {
  464. margin-left: 28rpx;
  465. font-size: 32rpx;
  466. font-family: Verdana, Verdana-Bold;
  467. font-weight: 700;
  468. text-align: left;
  469. }
  470. }
  471. .sectionB {
  472. display: flex;
  473. align-items: center;
  474. margin-top: 12rpx;
  475. .icon {
  476. margin-left: -5rpx;
  477. width: 22rpx;
  478. height: 27rpx;
  479. margin-right: 24rpx;
  480. }
  481. .date {
  482. font-size: 30rpx;
  483. font-family: Verdana, Verdana-Regular;
  484. font-weight: 400;
  485. text-align: left;
  486. color: #262626;
  487. }
  488. }
  489. .sectionC {
  490. display: flex;
  491. align-items: center;
  492. margin-top: 34rpx;
  493. .point {
  494. width: 14rpx;
  495. height: 14rpx;
  496. background: #e0e0e0;
  497. border-radius: 50%;
  498. margin-right: 28rpx;
  499. }
  500. .name {
  501. font-size: 22rpx;
  502. font-family: Verdana, Verdana-Regular;
  503. font-weight: 400;
  504. text-align: left;
  505. color: #b1b1b1;
  506. }
  507. }
  508. .sectionD {
  509. display: flex;
  510. align-items: center;
  511. margin-top: 6rpx;
  512. justify-content: space-between;
  513. .name {
  514. margin-left: 35rpx;
  515. font-size: 30rpx;
  516. font-family: Verdana, Verdana-Regular;
  517. font-weight: 400;
  518. text-align: left;
  519. color: #262626;
  520. }
  521. .value {
  522. font-size: 30rpx;
  523. font-family: Verdana, Verdana-Regular;
  524. font-weight: 400;
  525. text-align: right;
  526. color: #fd8f3c;
  527. }
  528. }
  529. .bottomLine {
  530. bottom: 0;
  531. width: 100%;
  532. left: 0;
  533. position: absolute;
  534. border-bottom: 2rpx dashed rgba($color: #7F7F7F, $alpha: 0.1);
  535. }
  536. }
  537. .empty {
  538. display: flex;
  539. flex-direction: column;
  540. align-items: center;
  541. .emptyImg {
  542. width: 283rpx;
  543. height: 227rpx;
  544. }
  545. .text {
  546. margin-top: -20rpx;
  547. font-size: 28rpx;
  548. font-family: PingFang SC, PingFang SC-Medium;
  549. font-weight: 500;
  550. text-align: center;
  551. color: #b1b3ba;
  552. }
  553. }
  554. }
  555. }
  556. </style>