reportPage.vue 16 KB

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