<template>
	<view>
		<view class="detail">
			<image src="../static/images/top.png" class="top"></image>
			<view class="con">
				<view class="title">增值税电子普通发票<image src="../static/images/yin.png" class="yin"></image></view>
				<view class="li ddflex">
					<label>发票类型</label>
					<view class="item fflex">{{invoice.headerType == 1 ? '个人' : '单位'}}</view>
				</view>
				<view class="li ddflex">
					<label>发票抬头</label>
					<view class="item fflex">{{invoice.title}}</view>
				</view>
				<view class="li ddflex">
					<label>发票金额</label>
					<view class="money item fflex">￥{{invoice.money}}</view>
				</view>
				<view class="li ddflex">
					<label>开票时间</label>
					<view class="item fflex">{{invoice.createDate}}</view>
				</view>
				<view class="li ddflex">
					<label>开票内容</label>
					<view class="item fflex">{{invoice.content}}</view>
				</view>
			</view>
			<!-- <view class="check ddflex">查看发票<image src="../../static/pages/images/more.png" class="rico"></image></view> -->
		</view>
		<!-- <view class="send" @click="send()">发送到邮箱</view> -->
		<view class="ceng" v-if="isPop" @click="cancel()"></view>
		<view class="popup" :style="isPop ? 'bottom:' + pBottom : ''">
			<view class="pop-tit">发送到邮箱</view>
			<input value="991477725@qq.com" class="ipt" />
			<text class="tip">*可更改邮箱地址</text>
			<view class="pop-btn ddflex">
				<view class="cancel" @click="cancel()">取消</view>
				<view class="confirm" @click="confirm()">发送</view>
			</view>
		</view>
	</view>
</template>

<script>
	const req = require('../../utils/request.js');
	export default {
		data() {
			return{
				options: {},
				invoice: {},
				isPop: false,
				pBottom: '-100%'
			}
		},
		onLoad(options) {
			this.options = options;
			this.getData();
		},
		methods:{
			getData(){
				req.getRequest('/api/invoice/info', {invoiceId:this.options.id},res=>{
					this.invoice = res;
				})
			},
			send() {
				this.isPop = true;
				this.pBottom = 0;
			},
			cancel(){
				this.isPop = false;
				this.pBottom = '-100%';
			},
			confirm(){
				this.cancel()
			}
		}
	}
</script>

<style>
	@import "./detail.css";
</style>
