reportPage.vue 15 KB

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