<template>
	<view>
		<block v-if="type=='point'">
			<view class="top">
				<image style="border-radius: 50%;" :src="item.channelLogo" mode=""></image>
				<text class="title">{{item.channelName}}</text>
				<view class="data text-center center">
					<view style="padding: 0;">
						<text>-</text>
						<text>{{item.totalPrice}}</text>
					</view>
				</view>
			</view>
			<view class="card">
				
				<block v-if="item.type!=4">
					<view class="item">
						<text>交易状态</text>
						<text>{{item.payStatus}}</text>
					</view>
					<view class="item">
						<text>交易金额</text>
						<text>{{item.price}}</text>
					</view>
					<view class="item">
						<text>交易手续费</text>
						<text>{{item.fee}}</text>
					</view>
					<view class="item">
						<text>交易描述</text>
						<text>{{item.title}}</text>
					</view>
					<view class="item">
						<text>交易时间</text>
						<text>{{item.createTime}}</text>
					</view>
				</block>
				<view class="item">
					<text>交易单号</text>
					<text>{{item.id}}</text>
				</view>
			</view>
		</block>
		<block v-if="type=='balance'">
			<view class="top">
				<image  style="border-radius: 50%;"  :src="item.logo" mode=""></image>
				<text class="title">{{item.name}}</text>
				<view class="data text-center center">
					<view style="padding: 0;">
						<text>-</text>
						<text>{{item.totalPrice}}</text>
					</view>
				</view>
			</view>
			<view class="card">
				<view class="item">
					<text>交易标题</text>
					<text>{{item.title}}</text>
				</view>
				<view class="item">
					<text>交易状态</text>
					<text>{{item.payStatus}}</text>
				</view>
				<view class="item">
					<text>交易金额</text>
					<text>{{item.price}}</text>
				</view>
				<view class="item">
					<text>积分手续费</text>
					<text>{{item.fee}}</text>
				</view>
				<view class="item">
					<text>支付方式</text>
					<text>余额支付</text>
				</view>
				<view class="item">
					<text>交易时间</text>
					<text>{{item.createTime}}</text>
				</view>
				<view class="item">
					<text>交易单号</text>
					<text>{{item.id}}</text>
				</view>
			</view>
		</block>
		
		
		<button open-type="contact" class="question" style="height: 86rpx;font-size: 28rpx;">
			<text class="center">对订单有疑问</text>
			<text class="cuIcon-right center" style="margin-top: 5rpx;"></text>
		</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				item:null,
				type:''
			}
		},
		onLoad(options) {
			if(options.billDetail){
				this.item = JSON.parse(options.billDetail)
			}
			if(options.type){
				this.type = options.type
			}
		},
		methods: {

		}
	}
</script>

<style lang="scss" scoped>
	.top {
		padding: 50rpx 0 0;
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;

		image {
			width: 140rpx;
			height: 140rpx;
		}

		.title {
			color: #000;
			padding-top: 15rpx;
			font-size: 32rpx;
		}

		.data {
			padding-top: 30rpx;
			display: flex;

			image {
				width: 40rpx;
				height: 40rpx;
			}

			view {
				padding-left: 20rpx;

				text:first-child {
					color: #000;
					font-size: 38rpx;
				}

				text:last-child {
					font-size: 32rpx;
					padding-left: 20rpx;
				}
			}
		}
	}

	.card {
		margin-top: 50rpx;
		padding: 20rpx 30rpx;
		background-color: #FFFFFF;
		
		.item{
			padding: 20rpx 0;
			font-size: 28rpx;
			color: #888888;
			margin: 0 20rpx;
			display: flex;
			justify-content: space-between;
		}
	}
	
	.question{
		color: #888888;
		background-color: #FFFFFF;
		margin-top: 20rpx;
		padding: 20rpx 50rpx;
		display: flex;
		justify-content: space-between;
	}
</style>
