<template>
	<loadlogo v-if="loading==true"></loadlogo>
	<view v-else>
		<far-bottom></far-bottom>
		<view class="recordMainContent">
			<view class="recordTops">
				<view class="recordRecoredsImg">
					<image :src="info.logo"></image>
				</view>
				<view>{{info.storename}}</view>
				<view>¥{{info.ordermoney}}</view>
			</view>
			<view class="recordDetails">
				<view class="dis-flex flex-x-between flex-y-center">
					<view class="f-28 col-3">{{info.type=='2'?'特权礼包':'特权折扣'}}</view>
					<view class="dis-flex flex-x-between flex-y-center">{{info.storename}}</view>
				</view>
				<view class="dis-flex flex-x-between flex-y-center" v-if="info.type!=='2'">
					<view class="f-28 col-3">买单折扣</view>
					<view class="dis-flex flex-x-between flex-y-center ">{{info.discount<9.9 ? info.discount + '折':'无折扣'}}</view>
				</view>
				<view class="dis-flex flex-x-between flex-y-center">
					<view class="f-28 col-3">实际支付</view>
					<view class="dis-flex flex-x-between flex-y-center colorR">¥{{info.realmoney}}</view>
				</view>
				<view class="dis-flex flex-x-between flex-y-center" v-if="Number(info.cerditmoney) > 0">
					<view class="f-28 col-3">积分抵扣</view>
					<view class="dis-flex flex-x-between flex-y-center ">-¥{{info.cerditmoney}}</view>
				</view>
				<view class="dis-flex flex-x-between flex-y-center" v-if="Number(info.fullreducemoney) > 0">
					<view class="f-28 col-3">满减活动</view>
					<view class="dis-flex flex-x-between flex-y-center ">-¥{{info.fullreducemoney}}</view>
				</view>
				<view class="dis-flex flex-x-between flex-y-center" v-if="Number(info.redpackmoney) > 0">
					<view class="f-28 col-3">红包抵扣</view>
					<view class="dis-flex flex-x-between flex-y-center ">-¥{{info.redpackmoney}}</view>
				</view>
				<view class="dis-flex flex-x-between flex-y-center">
					<view class="f-28 col-3">持卡人</view>
					<view class="dis-flex flex-x-between flex-y-center">{{info.username}}</view>
				</view>
				<view class="dis-flex flex-x-between flex-y-center">
					<view class="f-28 col-3">核销员</view>
					<view class="dis-flex flex-x-between flex-y-center">{{info.vername}}</view>
				</view>
				<view class="dis-flex flex-x-between flex-y-center">
					<view class="f-28 col-3">消费时间</view>
					<view class="dis-flex flex-x-between flex-y-center">{{info.createtime}}</view>
				</view>
			</view>
		</view>
		<view v-if="info.commentflag !== '1'" class="recordComments dis-flex flex-x-between flex-y-center" @click="goComment()">
			<view class="f-28 col-3">评价</view>
			<view class="dis-flex flex-x-between flex-y-center">
				<view class="f-26 col-9">未评价</view>
				<view class="iconfont icon-right"></view>
			</view>
		</view>
	</view>
</template>

<script>
	import App from '@/common/js/app.js';
	// #ifdef H5
	import wxApi from '@/common/js/wxApi.js';
	// #endif
	import loadlogo from '@/components/template/loadlogo';
	export default {
		components:{
			loadlogo
		},
		data() {
			return {
				info:[],
				id:'',
				loading:true
			}
		},
		onLoad(option) {
			let _this = this;
			_this.id = option.id;
			_this.init();
		},
		methods: {
			init(){
				this.getDetails();
			},
			getDetails(){
				let _this = this;
				let data = {
					id: _this.id
				};
				App._post_form('&p=halfcard&do=getRecordDetails', data, res => {
					_this.info = res.data;
					_this.loading=false
				});
			},
			goComment(){
				let _this = this;
				App.navigationTo({
					url:'pages/mainPages/comment/comment?a=""&plugin=9&order_id='+_this.id+'&goods_id='+_this.info.merchantid
				})
			}
		}
	}
</script>

<style lang="less" scoped>
	.colorR{
		color: red !important;
	}
	page{
		background-color: #F6F6F6;
	}
	.recordMainContent{
		padding: 0upx 32upx;
		background-color: #FFFFFF;
		> view{
			display: inline-block;
			width: 100%;
			background-color: #FFFFFF;
		}
	}
	.recordTops{
		border-bottom: 2upx solid #EEEEEE;
		height: 320upx;
		>view{
			height: 60upx;
			line-height: 60upx;
			text-align: center;
			font-size: 28upx;
			
			font-weight: 600;
			color: #333333;
		}
	}
	.recordRecoredsImg{
		height: 162upx!important;
		> image{
			width: 100upx;
			height: 100upx;
			border-radius: 50%;
			margin-top: 35upx;
		}
	}
	.recordDetails{
		display: inline-block;
		width: 100%;
		
		font-size: 24upx;
		
		> view{
			display: flow-root;
			height: 60upx;
			line-height: 60upx;
			> view:nth-child(1) {
				color: #999999;
			}
			> view:nth-child(2) {
				color: #333333;
			}
		}
	}
	.recordComments{
		margin-top: 20upx;
		padding: 0upx 32upx;
		background-color: #FFFFFF;
		display: flow-root;
		height: 102upx;
		line-height: 102upx;
		
		font-size: 24upx;
		
		> view:nth-child(1) {
			color: #333333;
		}
		> view:nth-child(2) {
			color: #999999;
		}
	}
</style>
