reportPage.vue 15 KB

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