<template>
	<view class="page">
		<view class="content">
			<view class="list-info" v-for="item in cent.paymentContent" :key="i" style="align-items: flex-start;">
				<view class="img">
					<image v-if="item.itemName == '物业费'" src="@/static/icon/icon11.png" mode="heightFix"></image>
					<image v-else-if="item.itemName == '卫生费'" src="@/static/icon/icon12.png" mode="heightFix"></image>
					<image v-else-if="item.itemName == '水费'" src="@/static/icon/icon13.png" mode="heightFix"></image>
					<image v-else-if="item.itemName == '电费'" src="@/static/icon/icon14.png" mode="heightFix"></image>
					<image v-else-if="item.itemName == '燃气费'" src="@/static/icon/icon15.png" mode="heightFix"></image>
					<image v-else src="@/static/icon/icon16.png" mode="heightFix"></image>
				</view>
				<view class="info-items">
					<view class="info-item">
						<view class="title">{{item.itemName}}</view>
						<view class="right"><text class="price"><u-icon name="rmb" style="font-size: 24rpx;" />{{ item.detailsVOList | jsitem}}</text></view>
					</view>
					<view class="info-item" style="color: #808080;">
						<view class="left">单价：￥{{item.itemStandard}}</view>
						<view class="right">费率：{{item.cheapRate}}%</view>
					</view>
					<view v-if="item.itemDetailsVOList&& item.itemDetailsVOList.length>0">
						<view v-if="item1.isshowxz" class="list" v-for="(item1,index1) in item.itemDetailsVOList">
							<view class="info-item">周期：{{item1.startDate}} - {{item1.endDate}}</view>
							<view class="info-item" style="margin-top: 6rpx;">
								<text style="margin-right: 20rpx;">数量：{{item1.number}}{{item1.itemUnit}}</text>
								<text class="price"><u-icon name="rmb" style="font-size: 24rpx;" />￥{{item1.payPrice}}</text>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="content" style="padding: 8rpx 34rpx;">
			<view class="form-item">
				<view class="left">订单状态</view>
				<view class="right">{{cent.orderStatus=='0'?'待支付':cent.orderStatus=='1'?'支付成功':cent.orderStatus=='2'?'支付失败':'-'}}</view>
			</view>
			<view class="form-item">
				<view class="left">实缴费用</view>
				<view class="right">￥{{Number(cent.actualPaymentFee)/100}}</view>
			</view>
			<view class="form-item">
				<view class="left">商户全称</view>
				<view class="right">{{cent.merchantName}}</view>
			</view>
			<view class="form-item">
				<view class="left">门店号</view>
				<view class="right">{{cent.storeNumber}}</view>
			</view>
			<view class="form-item">
				<view class="left">(户主)付款人</view>
				<view class="right">{{cent.payerName}}</view>
			</view>
			<view class="form-item">
				<view class="left">支付账号</view>
				<view class="right">{{cent.paymentAccount}}</view>
			</view>
			<view class="form-item">
				<view class="left">支付方式</view>
				<view class="right">{{cent.paymentMethod}}</view>
			</view>
			
			<view class="form-item">
				<view class="left">渠道</view>
				<view class="right">{{cent.channel || '-'}}</view>
			</view>
			<view class="form-item">
				<view class="left">支付开始时间</view>
				<view class="right">{{cent.paymentStartTime}}</view>
			</view>
			<view class="form-item">
				<view class="left">支付完成时间</view>
				<view class="right">{{cent.paymentCompletionTime}}</view>
			</view>
			<view class="form-item">
				<view class="left">支付订单号</view>
				<view class="right" style="width: 60%;display: flex;flex-wrap: wrap;" v-if="cent.orderNumber">
					<text style="width: 100%;text-align: right;" v-for="(item,index) in cent.orderNumber.split(',')">{{item}}</text>
				</view>
			</view>
	<!-- 		<view class="form-item">
				<view class="left">流水号</view>
				<view class="right" style="width: 60%;display: flex;flex-wrap: wrap;">{{cent.transactionNumber}}</view>
			</view> -->
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				dataList: [
					{
						children: [{}, {}]
					},
					{
						children: [{}, {}]
					},
				],
				cent:{}
			}
		},
		filters: {
		
			jsitem(e) {
				// console.error(e)
				let num = 0
				for (let n = 0; n < e.length; n++) {
					// num = num + Number(e[n].payPrice)
					if(e[n].isshowxz){
						num = num + Number(e[n].payPrice)
					}
				}
				return num.toFixed(2)
			}
		},
		onLoad(e) {
			this.cent = JSON.parse(e.cent)
			console.error(this.cent)
		},
		methods: {
			toDetail() {
				uni.navigateTo({
					url: '/pages/propertyPay/payDetail/payDetail'
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	@import 'payDetail.scss';
</style> 