<template>
	<view class="balancedetailStyle" :style="{'height':contentHeight}" > 
		<view class="bd_box" style="border-bottom: 1px solid #f5f5f5;">
			<view class='bd_box_l'>
				<Text>交易金额</Text>
			</view>
			
			<Text  class='bd_r' :style="{color:g.Type==1 ? mainColor:'#6ABE60',}">{{g.Type==1 ? '+':'-'}}{{g.Balance}}</Text>
		</view>
		<view class="bd_box" >
			<view class='bd_box_l'>
				<Text>交易时间</Text>
			</view>
			
			<Text >{{g.CreateDate}}</Text>
		</view>
		<view class="bd_box" style="align-items: flex-start;">
			<view class='bd_box_l'>
				<Text>交易详情</Text>
			</view>
			<view style='width: calc(100vw - 20px - 80px);'>
				<Text >{{g.Description}}</Text>
			</view>
			
		</view>
		<view class="bd_box" >
			<view class='bd_box_l'>
				<Text>备注</Text>
			</view>
			
			<Text >{{g.Remarks}}</Text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pageTitle:"余额详情",
				contentHeight:0,
				mainColor: "",
				g:{},
				
			}
		},
		mounted() {
			let currentPages = getCurrentPages();
			 let u = "/" + currentPages[currentPages.length-1].route;
			 let pages = uni.getStorageSync("basedata")
			   ? uni.getStorageSync("basedata").bar_title
			   : [];
			 pages.forEach((x) => {
			   if (x.value == u) {
			     this.pageTitle = x.new_name ? x.new_name : x.name;
			   }
			 });
			 uni.setNavigationBarTitle({
			   title: this.pageTitle,
			 });
		},
		onLoad(option){
			
			
			if (option.item) {
				this.g = JSON.parse(decodeURIComponent(option.item));
				
			}
		},
		created(){
			 this.contentHeight = this.$utils.calcContentHeight(-40)+'px';
			  this.mainColor = this.$uiConfig.mainColor;
			 
			 
		},
		
		methods: {
			
			
			
				
		}
	}
</script>

<style>
	.balancedetailStyle{
		background: #f3f4f6;
		width: 100%;
	}
.balancedetailStyle .bd_box{
	width: 100%;
	background:#fff;
	padding: 15px 10px;
	display: flex;
	flex-direction: row;
	align-items: center;
	
	
}
.bd_box .bd_box_l{
	color: #999999;
	margin-right: 10px;
	width: 70px;
	display: inline-block;
}
.bd_box .bd_r{
	font-size: 20px;
}
</style>
