index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625
  1. <template>
  2. <view>
  3. <u-navbar :is-back="false">
  4. <view class="navbar">
  5. <view class="navbar-tit">分润记录</view>
  6. <view class="navbar-screen" @click="popupShow = true"><span>筛选</span>
  7. <u-icon name="filter-2-fill" custom-prefix="custom-icon" color="#b0b8c8" size="32"></u-icon>
  8. </view>
  9. </view>
  10. </u-navbar>
  11. <u-popup v-model="popupShow" mode="top" height="80%">
  12. <view class="popup-screen">
  13. <view class="screen">
  14. <view class="screen-item">
  15. <view class="screen-head">查询日期</view>
  16. <view class="screen-main2">
  17. <u-calendar v-model="showdate" mode="date" @change="changedate"></u-calendar>
  18. <u-input :value="queryDate?queryDate:'选择时间筛选'" :type="type" :border="border"
  19. @click="showdate = true" />
  20. <!--
  21. <u-action-sheet :list="actionSheetList" v-model="show" @click="actionSheetCallback"></u-action-sheet>
  22. -->
  23. </view>
  24. </view>
  25. <view class="screen-item">
  26. <view class="screen-head">充电桩类型</view>
  27. <view class="screen-main">
  28. <view :class="{
  29. active:selecttype==''
  30. }" @click="selecttype=''" class="screen-entry ">全部</view>
  31. <view :class="{
  32. active:selecttype=='0'
  33. }" @click="selecttype='0'" class="screen-entry type1">自行车充电</view>
  34. <view :class="{
  35. active:selecttype=='2'
  36. }" @click="selecttype='2'" class="screen-entry type3">交流慢充</view>
  37. <view :class="{
  38. active:selecttype=='1'
  39. }" @click="selecttype='1'" class="screen-entry type2">直流快充</view>
  40. </view>
  41. </view>
  42. <view class="screen-item">
  43. <view class="screen-head">站点</view>
  44. <view class="screen-main">
  45. <view class="screen-entry " :class="{
  46. active:selectstationId==''
  47. }" @click="selectstationId=''">全部</view>
  48. <view v-for="(item,i) in stationList" :key="i" :class="{
  49. active:selectstationId==item.id
  50. }" @click="selectstationId=item.id,selectdeviceNo=''" class="screen-entry">{{item.name}}</view>
  51. </view>
  52. </view>
  53. <view class="screen-item">
  54. <view class="screen-head">桩号</view>
  55. <view class="screen-main">
  56. <view class="screen-entry " :class="{
  57. active:selectdeviceNo==''
  58. }" @click="selectdeviceNo=''">全部</view>
  59. <view v-for="(item,i) in stationListSon" :key="i"
  60. v-show="selectstationId?(selectstationId==item.stationId):true" :class="{
  61. active:selectdeviceNo==item.deviceNo
  62. }" @click="selectdeviceNo=item.deviceNo" class="screen-entry">{{item.name}}</view>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="screen-foot">
  67. <view class="screen-btn-l" @click="resetBtn">重置</view>
  68. <view class="screen-btn-r" @click="okbtn">确定</view>
  69. </view>
  70. </view>
  71. </u-popup>
  72. <u-tabs :list="tabList" v-if="false" bar-width="100" :is-scroll="false" :current="current" @change="change" inactive-color="#acb2af"
  73. active-color="#101010"></u-tabs>
  74. <!-- 充电订单 -->
  75. <view class="detailed" v-if="current==0">
  76. <view style="text-align: center;margin-top: 100px" v-if="!list.length">
  77. <img src="@/assets/img/blankpage.png">
  78. <view>查询为空</view>
  79. </view>
  80. <view class="detailed-list" v-for="(item ,index) in list"
  81. @click="gotoUrl('pagesFinance/share/details?id='+item.id)" :key="index">
  82. <view class="detailed-time" v-if="item.show">
  83. <p>{{item.showtime}}</p>
  84. <p>共收{{showMap.get(item.showtime).num}}笔,{{showMap.get(item.showtime).amount}}元</p>
  85. </view>
  86. <view class="detailed-item">
  87. <view class="detailed-item-name" style="
  88. width: 70%;
  89. ">
  90. <h2 class="showName">{{item.stationName}}/{{item.deviceName}}</h2>
  91. <p>{{item.flowNo?item.flowNo:'无充电单号'}}</p>
  92. </view>
  93. <view class="detailed-item-name" style="
  94. min-width: 60px;
  95. width: 30%;
  96. ">
  97. <h2 style=" text-align: end;">{{item.shareProfitAmount}}元</h2>
  98. <p style=" text-align: end;">{{item.createTime?item.createTime.slice(10):''}}</p>
  99. </view>
  100. </view>
  101. <view class="product_tip" v-if="item.status=='1'">
  102. <view class="product_tip_bg"></view>
  103. <p>已提现</p>
  104. </view>
  105. </view>
  106. <u-divider v-if="list.length&&list.length == recordsTotal" color="#B6BDC3" style="margin-top:20px;"
  107. bg-color="#f4f0f0">已经到底了</u-divider>
  108. </view>
  109. <!-- 包月卡 -->
  110. <view class="" v-if="current==1">
  111. <view class="detailed-list">
  112. <view class="detailed-time">
  113. <p>2022-07-19</p>
  114. <p>今日分润 178.00</p>
  115. </view>
  116. <view class="detailed-item">
  117. <view class="detailed-item-name" style="
  118. width: 70%;
  119. ">
  120. <h2 class="showName">荆鹏软件园充电站</h2>
  121. <p>包月卡卡号或用户ID</p>
  122. </view>
  123. <view class="detailed-item-name" style="
  124. min-width: 60px;
  125. width: 30%;
  126. ">
  127. <h2 style=" text-align: end;">100.00</h2>
  128. <p style=" text-align: end;">15:21:11</p>
  129. </view>
  130. </view>
  131. <view class="detailed-item">
  132. <view class="detailed-item-name" style="
  133. width: 70%;
  134. ">
  135. <h2 class="showName">荆鹏软件园充电站</h2>
  136. <p>包月卡卡号或用户ID</p>
  137. </view>
  138. <view class="detailed-item-name" style="
  139. min-width: 60px;
  140. width: 30%;
  141. ">
  142. <h2 style=" text-align: end;">22.00</h2>
  143. <p style=" text-align: end;">15:21:11</p>
  144. </view>
  145. </view>
  146. <view class="detailed-time">
  147. <p>2022-07-18</p>
  148. <p>今日分润 178.00</p>
  149. </view>
  150. <view class="detailed-item">
  151. <view class="detailed-item-name" style="
  152. width: 70%;
  153. ">
  154. <h2 class="showName">荆鹏软件园充电站</h2>
  155. <p>包月卡卡号或用户ID</p>
  156. </view>
  157. <view class="detailed-item-name" style="
  158. min-width: 60px;
  159. width: 30%;
  160. ">
  161. <h2 style=" text-align: end;">11.00</h2>
  162. <p style=" text-align: end;">15:21:11</p>
  163. </view>
  164. <view class="sign">
  165. <img src="../../assets/img/tixian.png" alt="">
  166. </view>
  167. </view>
  168. </view>
  169. </view>
  170. <Tabbar ref="tabbarMain" :current="2"></Tabbar>
  171. </view>
  172. </template>
  173. <script>
  174. import Tabbar from '@/components/TabbarFinance.vue'
  175. import * as API from '@/apis/finance.js'
  176. import {
  177. currentTimeStamp,
  178. parseUnixTime
  179. } from '@/utils'
  180. export default {
  181. data() {
  182. return {
  183. showdate: false,
  184. startTime: "",
  185. queryDate: "",
  186. endTime: "",
  187. selecttype: "",
  188. selectstationId: "",
  189. selectdeviceNo: "",
  190. title: "",
  191. year: "",
  192. startyear: "",
  193. endyear: "",
  194. current: 0,
  195. tabList: [{
  196. name: '分润记录'
  197. }, {
  198. name: '月卡分润'
  199. }],
  200. params: {
  201. year: true,
  202. month: false,
  203. day: false,
  204. hour: false,
  205. minute: false,
  206. second: false,
  207. // timestamp: true,
  208. },
  209. form: {
  210. },
  211. pageIndex: 1,
  212. recordsTotal: 0,
  213. list: [],
  214. popupShow: false,
  215. tabbarList: [{
  216. iconPath: "bar-chart-box-fill",
  217. selectedIconPath: "bar-chart-box-fill",
  218. text: '统计',
  219. count: 0,
  220. isDot: true,
  221. customIcon: true,
  222. },
  223. {
  224. iconPath: "article-fill",
  225. selectedIconPath: "article-fill",
  226. text: '明细',
  227. midButton: true,
  228. customIcon: true,
  229. },
  230. {
  231. iconPath: "account-pin-box-fill",
  232. selectedIconPath: "account-pin-box-fill",
  233. text: '我的',
  234. count: 0,
  235. isDot: false,
  236. customIcon: true,
  237. },
  238. ],
  239. showMap: null,
  240. //current: 0,
  241. value: '',
  242. type: 'select',
  243. show: false,
  244. border: true,
  245. stationList: [],
  246. stationListSon: [],
  247. actionSheetList: [{
  248. text: '男'
  249. },
  250. {
  251. text: '女'
  252. },
  253. {
  254. text: '保密'
  255. }
  256. ],
  257. }
  258. },
  259. components: {
  260. Tabbar
  261. },
  262. onShow() {
  263. if (this.$refs.tabbarMain) {
  264. this.$refs.tabbarMain.setcount(2);
  265. }
  266. },
  267. onReachBottom() {
  268. if (this.list.length < this.recordsTotal) {
  269. this.myLoadmore();
  270. }
  271. },
  272. onLoad() {
  273. // this.queryDate=parseUnixTime(new Date(),"{y}-{m}-{d}")
  274. this.startyear = new Date().getFullYear()
  275. console.log(this.startyear)
  276. this.endyear = this.startyear - 3
  277. console.log(this.endyear)
  278. },
  279. onReady() {
  280. this.getList()
  281. this.getStation()
  282. },
  283. methods: {
  284. change(index) {
  285. this.current = index;
  286. },
  287. showDateMoth(date) {
  288. var back = date;
  289. if (date) {
  290. var k = date.slice(5, 6)
  291. console.log(k)
  292. if (k == '0') {
  293. back = date.slice(6, 7)
  294. } else {
  295. back = date.slice(5, 7)
  296. }
  297. }
  298. return back;
  299. },
  300. changedate(e) {
  301. console.log(e)
  302. this.queryDate = e.result
  303. },
  304. resetBtn() {
  305. // this.queryDate=parseUnixTime(new Date(),"{y}-{m}-{d}")
  306. this.year = ""
  307. this.startTime = ""
  308. this.endTime = ""
  309. this.selecttype = ""
  310. this.selectstationId = ""
  311. this.selectdeviceNo = ""
  312. this.pageIndex = 1;
  313. this.form = {
  314. queryDate: "",
  315. pageIndex: this.pageIndex,
  316. type: this.selecttype,
  317. stationId: this.selectstationId,
  318. deviceNo: this.selectdeviceNo,
  319. };
  320. this.popupShow = false;
  321. this.list = [];
  322. this.getList()
  323. },
  324. okbtn() {
  325. this.popupShow = false;
  326. this.pageIndex = 1;
  327. this.form = {
  328. queryDate: this.queryDate,
  329. pageIndex: this.pageIndex,
  330. type: this.selecttype,
  331. stationId: this.selectstationId,
  332. deviceNo: this.selectdeviceNo,
  333. };
  334. this.list = [];
  335. this.getList()
  336. },
  337. getList() {
  338. uni.showLoading({
  339. title: "加载中",
  340. mask: true,
  341. })
  342. this.form.pageIndex = this.pageIndex
  343. this.form.pageSize = 20
  344. API.recordData(this.form).then((res) => {
  345. this.list = [
  346. ...this.list,
  347. ...res.data.data
  348. ];
  349. var showMap = new Map()
  350. this.list.forEach(item => {
  351. var ktime = item.createTime.split(" ")[0]
  352. if (showMap.has(ktime)) {
  353. item.show = false;
  354. } else {
  355. var Amount = item.todaySPAmount
  356. var num = item.todaySPNum
  357. showMap.set(ktime, {
  358. amount: Amount,
  359. num: num
  360. })
  361. item.show = true;
  362. item.showtime = ktime;
  363. }
  364. })
  365. this.showMap = showMap;
  366. this.recordsTotal = res.data.recordsTotal
  367. uni.hideLoading()
  368. }).catch(error => {
  369. uni.showToast({
  370. title: error
  371. })
  372. })
  373. },
  374. getStation(bl) {
  375. API.stationList().then((res) => {
  376. this.stationList = res.data.stationList
  377. this.stationListSon = res.data.deviceList
  378. }).catch(error => {
  379. uni.showToast({
  380. title: error
  381. })
  382. })
  383. },
  384. myLoadmore() {
  385. this.pageIndex += 1;
  386. this.getList()
  387. },
  388. // 点击actionSheet回调
  389. actionSheetCallback(index) {
  390. this.value = this.actionSheetList[index].text;
  391. }
  392. }
  393. }
  394. </script>
  395. <style>
  396. page {
  397. background-color: #F7F7F7;
  398. }
  399. </style>
  400. <style lang="scss" scoped>
  401. .popup-screen {
  402. padding: 20px;
  403. position: relative;
  404. .screen {
  405. padding-bottom: 30px;
  406. }
  407. .screen-item {
  408. margin-bottom: 20px;
  409. .screen-head {
  410. margin-bottom: 8px;
  411. font-size: 16px;
  412. }
  413. .screen-main {
  414. // display: -webkit-box;
  415. display: flex;
  416. flex-wrap: wrap;
  417. }
  418. .screen-entry {
  419. width: 29%;
  420. padding: 6px 0;
  421. display: flex;
  422. align-items: center;
  423. justify-content: center;
  424. background-color: #F2F5FA;
  425. text-align: center;
  426. margin-bottom: 10px;
  427. border-radius: 3px;
  428. margin-right: 6px;
  429. }
  430. .screen-entry.active {
  431. background-color: #185AC6;
  432. color: #fff;
  433. }
  434. }
  435. .screen-foot {
  436. position: fixed;
  437. left: 0;
  438. right: 0;
  439. bottom: 0;
  440. display: flex;
  441. height: 50px;
  442. border-top: 1px solid #ededed;
  443. .screen-btn-l {
  444. background-color: #fff;
  445. flex: 0.2;
  446. text-align: center;
  447. line-height: 50px;
  448. }
  449. .screen-btn-r {
  450. flex: 0.8;
  451. text-align: center;
  452. line-height: 50px;
  453. background-color: #185AC6;
  454. color: #fff;
  455. }
  456. }
  457. }
  458. .navbar {
  459. display: flex;
  460. justify-content: space-between;
  461. flex: 1;
  462. padding: 0 15px;
  463. }
  464. .navbar-tit {
  465. font-size: 20px;
  466. }
  467. .navbar-screen {
  468. display: flex;
  469. align-items: center;
  470. span {
  471. margin-right: 2px;
  472. color: #999;
  473. }
  474. }
  475. .detailed-time {
  476. display: flex;
  477. justify-content: space-between;
  478. align-items: center;
  479. padding: 10px 20px;
  480. font-size: 16px;
  481. p {
  482. color: #666;
  483. }
  484. }
  485. .detailed-item {
  486. background-color: #fff;
  487. display: flex;
  488. justify-content: space-between;
  489. padding: 10px 20px;
  490. border-bottom: 1px solid #ededed;
  491. position: relative;
  492. .sign{
  493. width: 32px;
  494. height: 32px;
  495. position: absolute;
  496. top: 0;
  497. right: 0;
  498. img{
  499. width: 100%;
  500. }
  501. }
  502. .detailed-item-name {
  503. h4 {
  504. font-weight: normal;
  505. }
  506. p {
  507. font-size: 15px;
  508. margin-top: 4px;
  509. color: #A2A9B5;
  510. }
  511. }
  512. .detailed-item-num {
  513. display: flex;
  514. align-items: center;
  515. h2 {
  516. margin-right: 4px;
  517. }
  518. }
  519. }
  520. .showName {
  521. font-weight: unset;
  522. overflow: hidden;
  523. text-overflow: ellipsis;
  524. white-space: nowrap;
  525. font-size: 16px;
  526. }
  527. .u-tabs{
  528. /deep/.uni-scroll-view-content {
  529. width: 56.2% !important;
  530. margin: auto;
  531. }
  532. }
  533. /deep/.u-tab-bar {
  534. background-color: #0076FF !important;
  535. }
  536. </style>