<template>
  <view class="promoter-list"  >
    <view class="header">
      <view class="promoterHeader">
		<image class="bg" src="https://cdhyt-1383856587.cos.ap-chengdu.myqcloud.com/shop/images/transparent.png" />
        <view class="headerCon acea-row row-between-wrapper">
          <view>
            <view class="name">提现记录</view>
            <view>
              <text class="num">{{nowMoney}}</text>
              <text>元</text>
            </view>
          </view>
        </view>
      </view>
    </view>
	<view class="extract-list">
	  <view v-for="(item,index) in list" :key="index" class="item" >
	  	<view class="ordersn-box">
	  		<view class="title">提现金额：{{item.extractPrice}}</view>
	  		<view class="status-box">
	  			<text   class="text info" v-if="item.status==0">审核中</text>
	  			<text   class="text success" v-if="item.status==1">已提现</text>
	  			<text   class="text red" v-if="item.status==-1">已拒绝</text>
	  		</view>
	  	</view>
	  	<view class="content">
			<view class="ask-time" v-if="item.createTime!=null">提交时间：{{item.createTime}}</view>
			<view class="ask-time" v-if="item.updateTime!=null" >审核时间：{{item.updateTime}}</view>
			<view class="ask-text"  v-if="item.status!=0">审核结果：{{item.failMsg}}</view>
		</view>
	  </view>
	</view>
	<Loading :loaded="loaded" :loading="loading"></Loading>
  </view>
</template>
<script>
import {getUserInfo,getExtractList} from '@/api/user'
import Loading from "@/components/Loading";
export default {
    name: "tuiMoney",
	components: {
	  Loading
	},
    data: function () {
      return {
        nowMoney:0,
		page: {
		  page: 1,
		  pageSize: 10,
		  logsType:5
		},
		list: [],
		loaded: false,
		loading: false
      };
    },
    mounted: function () {
		this.getUserInfo();
		this.getExtractList();
    },
	onReachBottom() {
		!this.loading && this.getExtractList();
	},
    methods: {
		getExtractList: function () {
		  let that = this;
		  if (that.loaded || that.loading) return;
		  that.loading = true;
		  getExtractList(this.page).then(
		    res => {
					that.list.push.apply(that.list, res.data.list);
					that.loading = false;
					that.loaded = !res.data.hasNextPage;
					that.page.page = that.page.page + 1;
					uni.hideLoading()
		    },
		    err => {
		      uni.showToast({
		        title: err.msg,
		        icon: "none",
		        duration: 2000
		      });
		    },
		    300
		  );
		},
		getUserInfo(){
			getUserInfo().then(
				res => {
					if(res.code==200){
						if(res.user!=null){
							this.nowMoney=res.user.nowMoney;
						}
						else{
							this.utils.loginOut();
						}
						
					}else{
						uni.showToast({
							icon:'none',
							title: "请求失败",
						});
					}
				},
				rej => {}
			);
		},
    }
  };
</script>
<style lang="less">
	
	/*所有推广头部样式*/
	.promoterHeader {
	  width: 100%;
	  height: 2.2 * 100rpx;
	  background-color: #2BC7B9;
	  position: relative;
	  .bg{
		width: 100%;
		height: 100%;
		position: absolute;
		top: 0;
		left: 0;
	  }
	}
	
	.promoterHeader .headerCon {
	  height: 100%;
	  padding: 0 0.88 * 100rpx 0 0.55 * 100rpx;
	  font-size: 0.28 * 100rpx;
	  color: #fff;
	  background-repeat: no-repeat;
	  background-size: 100% 100%;
	}
	
	.promoterHeader .headerCon .name {
	  margin-bottom: 0.02 * 100rpx;
	}
	
	.promoterHeader .headerCon .num {
	  font-size: 0.5 * 100rpx;
	}
	
	.promoterHeader .headerCon .iconfont {
	  font-size: 1.25 * 100rpx;
	}
	.extract-list{
		.item{
			background: #FFFFFF;
			border-bottom: 1px solid #eee;
			padding: 40upx 30upx;
			position: relative;
			.ordersn-box{
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 0upx 0 10upx;
				.title{
					font-size: 32upx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #111;
					line-height: 1;
				}
				.status-box{
					display: flex;
					align-items: center;
					.recom-box{
						width: 108upx;
						height: 30upx;
						line-height: 30upx;
						text-align: left;
						padding-left: 8upx;
						font-size: 22upx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #FFFFFF;
						background-image: url(https://cdhyt-1383856587.cos.ap-chengdu.myqcloud.com/shop/images/recom.png);
						background-repeat: no-repeat;
						background-size: 100% 100%;
						margin-right: 8upx;
					}
					.text{
						font-size: 28upx;
						font-family: PingFang SC;
						font-weight: 500;
						line-height: 1;
						&.success{
							color: #2BC7B9;
						}
						&.red{
							color: #ff0000;
						}
						&.info{
							color: #999999;
						}
					}
				}
			}
			.content{
				.ask-text{
					font-size: 28upx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #999999;
					line-height: 42rpx;
				}
				.ask-time{
					font-size: 28upx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #999999;
					line-height: 42rpx;
				}
			}
			
			 
		}
	}
</style>
