reportPage.vue 15 KB

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