123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 |
- <template>
- <view>
- <u-navbar title="提现记录"></u-navbar>
- <view class="detailed">
- <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"
- :key="index"
- v-for="(item ,index) in list" >
- <view class="detailed-time" v-if="item.show">
- <p>{{showTime(item.showtime)}}</p>
- <p>共提现 {{showMap.get(item.showtime).toFixed(2)}}元</p>
- </view>
- <view class="detailed-item" @click="gotoItem(item)" >
- <view class="detailed-item-name">
- <view class="u-flex">
- <h4>{{item.applicationTypeText}}</h4>
- <span :class="{
- success:item.status==1,
- error:item.status==2,
- error2:item.status==0
- }">({{item.statusText}})</span>
-
- </view>
- <p>{{item.stationName}}</p>
- </view>
- <view class="detailed-item-num">
- <h2>{{item.applicationAmount?item.applicationAmount.toFixed(2):'0'}}元</h2>
-
- <p>{{showTime2(info.createTime)}}</p>
- </view>
- </view>
-
- </view>
- <u-divider v-if="list.length&&list.length == recordsTotal" color="#B6BDC3" style="margin-top:20px;" bg-color="#f7f7f7">已经到底了</u-divider>
-
-
- </view>
-
- <u-button v-if="info.status" @click="uuid=new Date().getTime(),gotoUrl('pagesFinance/user/applicationForWithdrawal?uuid='+uuid)" >创建提现单</u-button>
- </view>
- </template>
- <script>
- import * as API from '@/apis/finance.js'
-
- export default {
- data() {
- return {
-
- pageIndex: 1,
- recordsTotal: 0,
- list: [],
- info:{},
- form: {
- name: '',
- intro: '',
- },
- showMap:null,
- uuid:""
-
- }
- },
- onLoad(){
- this.info=this.carhelp.getPersonInfo("merchantUser")
-
- },
- onReady() {
- this.getList()
- },
-
- onReachBottom() {
- if (this.list.length < this.recordsTotal) {
- this.myLoadmore();
- }
- },
- onShow(){
- var obj=this.carhelp.get("withdrawRecord")
- if(obj&&obj.uuid==this.uuid){
-
- this.list=[];
- this.pageIndex = 1;
- this.getList()
- }
- },
- methods: {
- showTime(name){
- if(!name){
- return ''
- }
- return name.replace('-','年')+'月';
- },
- showTime2(name){
- if(!name){
- return ''
- }
- return name.substring(5);
- },
- gotoItem(item){
-
- this.uuid=new Date().getTime()
- if(this.info.status&&item.status=='-1'){
- this.gotoUrl('pagesFinance/user/applicationForWithdrawal?id='+item.id+"&uuid="+this.uuid)
- }else{
- this.gotoUrl('pagesFinance/user/applicationDetails?id='+item.id)
- }
- },
- getList() {
-
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
-
-
- API.withdrawRecord({
- pageIndex:this.pageIndex
- }).then((res) => {
-
- this.list = [
- ...this.list,
- ...res.data.data
- ];
-
- var showMap=new Map()
- this.list.forEach(item=>{
- var ktime=item.applicationMonth;
-
- if(showMap.has(ktime)){
- item.show=false;
- // var m=showMap.get(ktime)*100+item.applicationAmount*100;
- // showMap.set(ktime,m/100)
- }else{
- showMap.set(ktime,item.totalApplicationAmount)
-
- item.show=true;
- item.showtime=ktime;
- }
- })
- this.showMap=showMap;
- this.recordsTotal = res.data.recordsTotal
- uni.hideLoading()
-
- }).catch(error => {
- uni.showToast({
-
- title: error
- })
- })
- },
- }
- }
- </script>
- <style>
- page{
- background-color: #F7F7F7;
- }
- </style>
- <style lang="scss" scoped>
-
- .detailed-time{
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 10px 20px;
- p{
- color:#666;
- }
- }
- .detailed-item{
- background-color: #fff;
- display: flex;
- justify-content: space-between;
- padding: 10px 20px;
- border-bottom: 1px solid #ededed;
- .detailed-item-name{
- font-size: 14px;
- h4{
-
- font-weight: normal;
- }
- p{
- font-size: 12px;
- margin-top: 4px;
- color:#666;
- }
- span{
- margin-left: 10px;
- }
- .success{color:#27b148}
- .error{color:#FF6200;}
- .error2{color:#1ba7f4;}
- }
- .detailed-item-num{
- text-align: right;
- align-items: center;
- h2{
-
-
- }
- }
- }
-
- .u-btn{
- margin: 0 16px;
- position: fixed;
- bottom: 12px;
- left: 0;
- right: 0;
- height: 44px;
- line-height: 44px;
- border-radius: 8px;
- background-color: rgba(24, 90, 198, 100);
- color: rgba(255, 255, 255, 100);
- }
- </style>
|