<template>
	<view class="Distribution">
		<view class="top-view">

			<view class="cash-out clearfix">
				<view class="float_left">
					<view class="cash-tit">{{ '可提现佣金' }}(元)</view>
					<view class="cash-num">{{ dataInfo.balance || 0 }}</view>
				</view>
				<view class="float_right" @click="goPage('/pagesT/NewPartner/apply_cash?balance=' + (dataInfo.balance || 0) + '&id=' + dataInfo.id)">
					<view class="cash-btn">{{ '提现' }}</view>
				</view>
			</view>
			
			
			
			<view class="money-num">
				<view class="money-num-li">
					<text>{{ '累计佣金' }}</text>
					<view class="money-num-text">
						<text class="rmb-icon">¥</text>
						{{ dataInfo.totalMoney || 0 }}
					</view>
				</view>
				<view class="money-num-li">
					<text>{{ '已提现佣金' }}</text>
					<view class="money-num-text">
						<text class="rmb-icon">¥</text>
						{{ dataInfo.withdraw || 0 }}
					</view>
				</view>
			</view>
		</view>
		<view class="handel-ul">
			<view class="handel-li clearfix" @click="goPage('/pagesT/NewPartner/commission_detail?id=' + dataInfo.id)">
				<view class="float_left icon-left-view"><text class="ibonfont ibondingdan icon-left" style="color:#f46248"></text></view>
				<view class="float_left clearfix handel-right">
					<text class="float_left">{{ '分佣记录' }}</text>
					<view class="float_right handel-right-r">
						<text>{{ dataInfo.orderNum || 0 }}笔</text>
						<text class="ibonfont ibonjinru"></text>
					</view>
				</view>
			</view>
			<view class="handel-li clearfix" @click="goPage('/pagesT/NewPartner/balance_detail?id=' + dataInfo.id)">
				<view class="float_left icon-left-view"><text class="ibonfont ibondianshang icon-left" style="color:#fed261"></text></view>
				<view class="float_left clearfix handel-right">
					<text class="float_left">{{'余额明细' }}</text>
					<view class="float_right handel-right-r"><text class="ibonfont ibonjinru"></text></view>
				</view>
			</view>
			<view class="handel-li clearfix" @click="goPage('/pagesT/NewPartner/cash_detail?id=' + dataInfo.id)">
				<view class="float_left icon-left-view"><text class="ibonfont ibontixian icon-left" style="color:#46c09b"></text></view>
				<view class="float_left clearfix handel-right">
					<text class="float_left">{{'提现记录' }}</text>
					<view class="float_right handel-right-r"><text class="ibonfont ibonjinru"></text></view>
				</view>
			</view>

		</view>

	</view>
</template>

<script>
import { getAvator } from '@/access/common.js';
export default {
	data() {
		return {
			isLoding: false,
			text_set: {},
			avator: '',
			dataInfo: {
				
			}
		};
	},
	onShareAppMessage() {
		return {
			title: this.$store.state.baseSet.shop,
			path: '/pages/index/index?businessmanId=' + this.$store.state.userStatus.id,
			imageUrl: this.$store.state.baseSet.images,
			success: res => {
				console.log(res);
			}
		};
	},
	// 下拉刷新
	onPullDownRefresh() {
		this.getPartnerInfo();
	},
	onLoad() {
		uni.setNavigationBarColor({frontColor: '#ffffff',backgroundColor: '#fe582e'});
	},
	onShow() {
		this.getPartnerInfo();
	},
	methods: {
		getPartnerInfo(){
			var that = this;
			this.$u.api.getCommissionPartnerData().then(res=>{
				uni.stopPullDownRefresh();
				if(res.data && res.data.id>0){
					that.dataInfo = res.data;
				}
			});
		},
		
	}
};
</script>

<style lang="scss">
body {
	background: $page-color-base;
}
.top-view {
	color: #ffffff;
	background-color: #fe582e;
	.lever-view {
		padding: 30upx 24upx;
		.lever-view-left {
			font-size: 22upx;
			font-weight: bold;
			line-height: 38upx;
			height: 42upx;
			padding-right: 16upx;
			border-radius: 22upx;
			background-color: rgba($color: #ffffff, $alpha: 0.3);
			text {
				transform: translateY(4upx);
				display: inline-block;
			}
			.user-avator {
				margin-right: 8upx;
				width: 42upx;
				height: 42upx;
				border-radius: 100%;
				vertical-align: middle;
				transform: translateY(-2upx);
			}
		}
		.ew-code {
			line-height: 36upx;
			height: 36upx;
			opacity: 0.5;
			.ibonerweima-copy {
				font-size: 48upx;
			}
		}
	}
	.cash-out {
		padding: 0 24upx 30upx;
		.cash-tit {
			font-size: 24upx;
		}
		.cash-num {
			font-size: 60upx;
			font-weight: bold;
			padding-top: 20upx;
		}
		.cash-btn {
			margin-top: 76upx;
			font-size: 24upx;
			width: 146upx;
			height: 46upx;
			line-height: 46upx;
			text-align: center;
			background-color: #ffffff;
			border-radius: 40upx;
			color: #fe582e;
		}
	}
	.money-num {
		background-color: #f03b28;
		display: flex;
		padding: 34upx 0;
		.money-num-li {
			flex: 2;
			font-size: 24upx;
			padding-left: 24upx;
			&:first-child {
				border-right: 1px solid rgba($color: #ffffff, $alpha: 0.3);
			}

			.money-num-text {
				font-size: 32upx;
				margin-left: 16upx;
				display: inline-block;
				transform: translateY(4upx);
				.rmb-icon {
					font-size: 24upx;
					margin-right: 6upx;
				}
			}
		}
	}
}
.handel-ul {
	.handel-li {
		background-color: #ffffff;
		padding-left: 20upx;
		line-height: 100upx;
		font-size: 28upx;
		.icon-left-view {
			line-height: 100upx;
			height: 100upx;
			.icon-left {
				font-size: 36upx;
				margin-right: 30upx;
			}
		}

		.handel-right {
			width: 660upx;
			border-bottom: 1px solid #f5f5f5;
			.handel-right-r {
				color: #999999;
				padding-right: 20upx;
				.ibonjinru {
					font-size: 28upx;
					margin-left: 20upx;
				}
			}
		}
		&:last-child {
			.handel-right {
				border-bottom: 0 none;
			}
		}
	}
}
</style>
