123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695 |
- <template>
- <view>
- <u-navbar :is-back="false">
- <view class="navbar">
- <view class="navbar-tit" >充电明细</view>
- <view class="navbar-screen" v-show="current==0" @click="popupShow = true"><span>筛选</span>
- <u-icon name="filter-2-fill" custom-prefix="custom-icon" color="#b0b8c8" size="32"></u-icon>
- </view>
-
- </view>
- </u-navbar>
- <u-popup v-model="popupShow" mode="top" height="80%" >
- <view class="popup-screen">
- <view class="screen">
- <view class="screen-item">
- <view class="screen-head">查询日期</view>
- <view class="screen-main2">
-
- <u-calendar v-model="showdate" mode="range" @change="changedate"></u-calendar>
-
- <u-input :value="startTime?startTime+'至'+endTime:'选择时间筛选'" :type="type" :border="border" @click="showdate = true" />
- <!--
- <u-action-sheet :list="actionSheetList" v-model="show" @click="actionSheetCallback"></u-action-sheet>
- --></view>
- </view>
- <view class="screen-item">
- <view class="screen-head">充电桩类型</view>
- <view class="screen-main">
- <view
- :class="{
- active:selecttype==''
- }" @click="selecttype=''"
- class="screen-entry ">全部</view>
- <view
- :class="{
- active:selecttype=='0'
- }" @click="selecttype='0'"
-
- class="screen-entry type1">自行车充电</view>
- <view
- :class="{
- active:selecttype=='2'
- }" @click="selecttype='2'"
- class="screen-entry type3">交流慢充</view>
- <view
- :class="{
- active:selecttype=='1'
- }" @click="selecttype='1'"
- class="screen-entry type2">直流快充</view>
- </view>
- </view>
- <view class="screen-item">
- <view class="screen-head">站点</view>
- <view class="screen-main">
- <view class="screen-entry "
- :class="{
- active:selectstationId==''
- }"
- @click="selectstationId=''"
- >全部</view>
- <view
- v-for="(item,i) in stationList" :key="i"
- :class="{
- active:selectstationId==item.id
- }"
- @click="selectstationId=item.id,selectdeviceNo=''"
- class="screen-entry" >{{item.name}}</view>
-
- </view>
- </view>
- <view
-
- class="screen-item">
- <view class="screen-head">桩号</view>
- <view class="screen-main">
-
- <view class="screen-entry "
- :class="{
- active:selectdeviceNo==''
- }"
- @click="selectdeviceNo=''"
- >全部</view>
- <view
- v-for="(item,i) in stationListSon" :key="i"
- v-show="selectstationId?(selectstationId==item.stationId):true"
- :class="{
- active:selectdeviceNo==item.deviceNo
- }"
-
- @click="selectdeviceNo=item.deviceNo"
- class="screen-entry" >{{item.name}}</view>
- </view>
- </view>
- </view>
- <view class="screen-foot">
- <view class="screen-btn-l" @click="resetBtn" >重置</view>
- <view class="screen-btn-r" @click="okbtn" >确定</view>
- </view>
- </view>
- </u-popup>
-
- <u-tabs
- :bar-width="100"
- :list="tabList" :is-scroll="false" :current="current" @change="change" inactive-color="#acb2af"
- active-color="#101010"></u-tabs>
-
- <view class="detailed" v-show="current==0" >
- <view style="text-align: center;margin-top: 100px" v-if="!list.length">
- <img src="@/assets/img/blankpage.png">
- <view>查询为空</view>
- </view>
-
- <view class="detailed-list" v-for="(item ,index) in list"
- @click="gotoUrl('pagesFinance/detailed/details?id='+item.id)"
- :key="index">
- <view class="detailed-time" v-if="item.show">
- <p>{{item.showtime}}</p>
- <p v-if="showMap">共收{{showMap.get(item.showtime).num}}笔,{{showMap.get(item.showtime).amount.toFixed(2)}}元</p>
- </view>
- <view class="detailed-item">
- <view class="detailed-item-name" style="
- width: 70%;
- ">
- <h2 class="showName">{{item.stationName}}/{{item.deviceName}}</h2>
- <!-- <p>{{item.flowNo?item.flowNo:'无充电单号'}}</p> -->
- <span
-
- :style="{
- color:colorList[item.platform%3]
- }">{{item.platformText}}</span>
-
- <span v-if="item.userCardId" style="color:#FF8B00 ;margin-left: 10px;">月卡订单</span>
- </view>
- <view class="detailed-item-name" style="
-
- min-width: 60px;
- width: 30%;
- ">
-
- <h2 style=" text-align: end;">{{item.actualFee?item.actualFee.toFixed(2):0}}元</h2>
- <p style=" text-align: end;" >{{item.endTime?item.endTime.slice(11):''}}</p>
-
- </view>
- <view class="sign" v-if="false">
- <!-- //<img src="../../assets/img/tixian.png" alt=""> -->
- <!-- 月卡 -->
- <view class="product_tip" >
- <view class="product_tip_bg"></view>
- <p>月卡</p>
- </view>
- </view>
-
-
- </view>
-
-
- </view>
- <u-divider v-if="list.length&&list.length == recordsTotal" color="#B6BDC3" style="margin-top:20px;" bg-color="#f7f7f7">已经到底了</u-divider>
-
-
- </view>
- <!-- 包月卡 -->
- <view class="detailed"
- style=" padding-bottom: 20px;"
- v-show="current==1">
-
- <view style="text-align: center;margin-top: 100px" v-if="!list2.length">
- <img src="@/assets/img/blankpage.png">
- <view>查询为空</view>
- </view>
-
- <view class="detailed-list" v-for="(item ,index) in list2"
- @click="gotoUrl('pagesFinance/detailed/monthlyCardDetails?id='+item.id)"
-
- :key="index" >
-
- <view class="detailed-time" v-if="item.show" >
- <p>{{item.showtime}}</p>
-
- <p v-if="showMap2">共收{{showMap2.get(item.showtime).num}}笔,{{showMap2.get(item.showtime).amount.toFixed(2)}}元</p>
-
- </view>
- <view class="detailed-item">
- <view class="detailed-item-name" style="
- width: 70%;
- ">
- <h2 class="showName">{{item.monthlyRentName}}</h2>
- <p>{{item.payTime?item.payTime.slice(11):''}}</p>
- </view>
- <view class="detailed-item-name" style="
- min-width: 60px;
- width: 30%;
- font-size: 16px;
- text-align: right;
- ">
- <h2>{{item.payFee.toFixed(2)}}<span style="font-size: 12px;">元</span></h2>
-
- </view>
- <!-- <view class="sign">
- <img src="../../assets/img/tixian.png" alt="">
- </view> -->
- </view>
-
-
-
- </view>
-
- <u-divider v-if="list2.length&&list2.length == recordsTotal2" color="#B6BDC3" style="margin-top:20px;" bg-color="#f7f7f7">已经到底了</u-divider>
-
- </view>
-
- <Tabbar :current="1" ref="tabbarMain"></Tabbar>
- </view>
- </template>
- <script>
- import Tabbar from '@/components/TabbarFinance.vue'
- import * as API from '@/apis/finance.js'
- // import {
- // beforeTimeStamp,
- // currentTimeStamp,
- // parseUnixTime
- // } from '@/utils'
-
- export default {
- data() {
- return {
- showdate: false,
- startTime: "",
- colorList:["#00B962","#1677FF","#eb372a"],
- endTime: "",
- selecttype:"",
- selectstationId:"",
- selectdeviceNo:"",
- title:"",
-
- form:{
-
- },
- // current: 0,
- tabList: [{
- name: '充电订单'
- }, {
- name: '月卡订单'
- }],
- pageIndex: 1,
- recordsTotal: 0,
- list: [],
-
- pageIndex2: 1,
- recordsTotal2: 0,
- list2: [],
-
- popupShow: false,
- tabbarList: [{
- iconPath: "bar-chart-box-fill",
- selectedIconPath: "bar-chart-box-fill",
- text: '统计',
- count: 0,
- isDot: true,
- customIcon: true,
- },
- {
- iconPath: "article-fill",
- selectedIconPath: "article-fill",
- text: '明细',
- midButton: true,
- customIcon: true,
- },
- {
- iconPath: "account-pin-box-fill",
- selectedIconPath: "account-pin-box-fill",
- text: '我的',
- count: 0,
- isDot: false,
- customIcon: true,
- },
- ],
- showMap:null,
- showMap2:null,
- current: 0,
- value: '',
- type: 'select',
- show: false,
- border: true,
- stationList:[],
- stationListSon:[],
- actionSheetList: [
- {
- text: '男'
- },
- {
- text: '女'
- },
- {
- text: '保密'
- }
- ],
- }
- },
- components: {
- Tabbar
-
- },
- onReachBottom() {
-
- this.myLoadmore();
-
- },
- onShow() {
- if(this.$refs.tabbarMain){
- this.$refs.tabbarMain.setcount(1);
- }
- },
- onLoad() {
-
- },
- onReady() {
-
- this.getList()
- this.getList2()
- this.getStation()
-
- },
- methods: {
- change(index) {
- this.current = index;
- },
- changedate(e) {
- this.startTime = e.startDate
- this.endTime = e.endDate
-
- },
- resetBtn(){
- this.startTime=""
- this.endTime=""
- this.selecttype=""
- this.selectstationId=""
- this.selectdeviceNo=""
- this.pageIndex = 1;
- this.form = {
- startDate:"",
- endDate:"",
- pageIndex: this.pageIndex,
- type:this.selecttype,
- stationId:this.selectstationId,
- deviceNo:this.selectdeviceNo,
- };
- this.popupShow=false;
- this.list = [];
- this.getList()
-
- },
- okbtn(){
- this.popupShow=false;
- this.pageIndex = 1;
-
- this.form = {
- startDate:this.startTime,
- endDate:this.endTime,
- pageIndex: this.pageIndex,
- type:this.selecttype,
- stationId:this.selectstationId,
- deviceNo:this.selectdeviceNo,
- };
- this.list = [];
- this.getList()
- },
- getList() {
-
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- this.form.pageIndex=this.pageIndex
- this.form.pageSize=20
-
- API.incomeList(this.form).then((res) => {
-
- var showMap=new Map()
-
-
- this.list = [
- ...this.list,
- ...res.data.data
- ];
-
- this.list.forEach(item=>{
- if(item.endTime){
- var ktime=item.endTime.split(" ")[0]
- if(showMap.has(ktime)){
- item.show=false;
-
-
- }else{
- var Amount=item.totalAmount
- var num=item.totalNum
- showMap.set(ktime,{
- amount:Amount,
- num:num
- })
-
-
- item.show=true;
- item.showtime=ktime;
- }
- }
-
- })
-
- this.showMap=showMap;
- this.recordsTotal = res.data.recordsTotal
- uni.hideLoading()
-
- }).catch(error => {
- uni.showToast({
-
- title: error
- })
- })
- },
- getList2() {
-
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
-
-
- API.buyCardList({
- pageIndex:this.pageIndex2,
- pageSize:20
- }).then((res) => {
- var showMap=new Map()
- this.showMap2=showMap;
- this.list2 = [
- ...this.list2,
- ...res.data.data
- ];
-
- this.list2.forEach(item=>{
- if(item.createTime){
- var ktime=item.createTime.split(" ")[0]
- if(showMap.has(ktime)){
- item.show=false;
-
-
- }else{
- var Amount=item.totalAmount
- var num=item.totalNum
- showMap.set(ktime,{
- amount:Amount,
- num:num
- })
-
- item.show=true;
- item.showtime=ktime;
- }
- }
-
- })
-
- this.showMap2=showMap;
- this.recordsTotal2 = res.data.recordsTotal
- uni.hideLoading()
-
- }).catch(error => {
- uni.showToast({
-
- title: error
- })
- })
- },
- getStation(bl) {
-
- API.stationList().then((res) => {
-
- this.stationList = res.data.stationList
- this.stationListSon=res.data.deviceList
- }).catch(error => {
- uni.showToast({
-
- title: error
- })
- })
- },
- myLoadmore() {
- if(this.current==0){
- if (this.list.length < this.recordsTotal) {
- this.pageIndex += 1;
- this.getList()
- }
-
- }else{
- if (this.list2.length < this.recordsTotal2) {
- this.pageIndex2 += 1;
- this.getList2()
- }
- }
-
-
- },
- // 点击actionSheet回调
- actionSheetCallback(index) {
- this.value = this.actionSheetList[index].text;
- }
- }
- }
- </script>
- <style>
- page{
- background-color: #F7F7F7;
- }
- </style>
- <style lang="scss" scoped>
- .product_tip{
- position: absolute;
- top: 0;
- right: 0;
- width: 26px;
- height: 26px;
- text-align: right;
- p{
- font-size: 24rpx;
- color: #ffffff;
- transform: rotate(45deg);
- position: relative;
- top: 0rpx;
- right: 0rpx;
- }
- .product_tip_bg{
- width: 0;
- height: 0;
- border-bottom: 48rpx solid #FD662A;
- border-right: 48rpx solid transparent;
- border-left: 48rpx solid transparent;
- transform: rotate(45deg);
- position: absolute;
- top: -7rpx;
- right: -29rpx;
- }
- }
- .popup-screen{
- padding: 20px;
- position: relative;
- .screen{
- padding-bottom: 30px;
- }
- .screen-item{
- margin-bottom: 20px;
- .screen-head{
- margin-bottom: 8px;
- font-size: 16px;
- }
- .screen-main{
- display: flex;
- // display: -webkit-box;
- flex-wrap: wrap;
-
- }
- .screen-entry{
- width: 29%;
- padding:6px 0;
- display: flex;
- align-items: center;
- justify-content: center;
- background-color: #F2F5FA ;
- text-align: center;
- margin-bottom: 10px;
- border-radius: 3px;
-
- margin-right: 6px;
- }
- .screen-entry.active{
- background-color: #185AC6;
- color:#fff;
- }
- }
- .screen-foot{
- position: fixed;
- left: 0;
- right: 0;
- bottom: 0;
- display: flex;
- height:50px;
- border-top: 1px solid #ededed;
- .screen-btn-l{
- background-color: #fff;
- flex: 0.2;
- text-align: center;
- line-height: 50px;
- }
- .screen-btn-r{
- flex: 0.8;
- text-align: center;
- line-height: 50px;
- background-color: #185AC6;
- color:#fff;
- }
- }
- }
- .navbar{
- display: flex;
- justify-content: space-between;
- flex: 1;
- padding: 0 15px;
- }
- .navbar-tit{
- font-size: 20px;
- }
- .navbar-screen{
- display: flex;
- align-items: center;
- span{
- margin-right: 2px;
- color:#999;
- }
- }
- .detailed-time{
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 10px 20px;
- font-size: 16px;
- p{
- color:#666;
-
- }
- }
- .detailed-item{
- background-color: #fff;
- display: flex;
- justify-content: space-between;
- padding: 10px 20px;
- border-bottom: 1px solid #ededed;
- position: relative;
- .sign{
- width: 32px;
- height: 32px;
- position: absolute;
- top: 0;
- right: 0;
- img{
- width: 100%;
- }
- }
-
-
- .detailed-item-name{
- h4{
- font-weight: normal;
- }
- span{
- font-size: 15px;
- }
- p{
- font-size: 15px;
- margin-top: 4px;
- color:#A2A9B5;
-
- }
- }
- .detailed-item-num{
- display: flex;
- align-items: center;
- h2{
- margin-right: 4px;
- }
- }
- }
- .showName{
- font-weight: unset;
- font-weight: unset;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- font-size: 16px;
- }
-
- .u-tabs{
- /deep/.uni-scroll-view-content {
- width: 56.2% !important;
- margin: auto;
- }
- }
-
- /deep/.u-tab-bar {
-
- background-color: #0076FF !important;
-
- }
- </style>
|