<template>
	<view class="">
		<navigation :showBack="true" :bgnum="true">
			<text class="big_title">
			{{i18n.Transactiondetails}}
			</text>
		</navigation>
		<view class="main">
			<view class="main_con">
				<view class="yuan">
					<image src="../../../../static/tongyonh/check-circle.png" mode="aspectFit" class="img1"></image>
				</view>
				<view class="title">
					{{i18n.Confirmed}}
				</view>
				<view class="scroll">
					<view class="title_con flex">
						<view class="text1">
						{{i18n.Amount}}
						</view>
						<view class="text1">
							{{info.amount}} {{info.coin}}
						</view>
					</view>
					<view class="title_con flex">
						<view class="text1">
						{{i18n.Time}}
						</view>
						<view class="text2">
							{{info.transactionTime}}
						</view>
					</view>
					<view class="title_con flex">
						<view class="text2">
							{{i18n.TxFee}}
						</view>
						<view class="text2">
							{{info.fee}} {{info.chainName}}
						</view>
					</view>
					
					<view class="item">
						<view class="text1">
							{{i18n.TransactionID}}
						</view>
						<view class="text2">
							{{info.txid}}
							<image src="../../../../static/tongyonh/copy_24px.png" mode="aspectFit" class="img"
								@click="copyTextMethod(info.txid)"></image>
						</view>
					</view>
					<view class="item">
						<view class="text1">
						{{i18n.Sendaddress}}
							<text v-if="isIn"> ({{i18n.others}})</text>
							<text v-else> ({{i18n.me}})</text>
						</view>
						<view class="text2">
							{{info.fromAddress}}
							<image @click="copyTextMethod(info.fromAddress)" src="../../../../static/tongyonh/copy_24px.png" mode="aspectFit" class="img"></image>
						</view>
					</view>
					<view class="item">
						<view class="text1">
							{{i18n.Receivingaddress}}
							<text v-if="isIn">({{i18n.me}})</text>
							<text v-else>({{i18n.others}})</text>
						</view>
						<view class="text2">
							{{info.toAddress}}
							<image  @click="copyTextMethod(info.to)" src="../../../../static/tongyonh/copy_24px.png" mode="aspectFit" class="img"></image>
						</view>
					</view>
				</view>
				<view class="item goto">
					{{i18n.moreinformation}}
				</view>
				<!-- <view class="sett" v-if="show">
					<view class="top">
						<view class="item">
							Copy address
						</view>
						<view class="item">
							Add to Address Book
						</view>
					</view>
					<view class="cancel" @click="show = false">
						Cancel
					</view>
				</view> -->
			</view>

			<u-mask :show="show" z-index="10"></u-mask>
		
		</view>




	</view>



</template>

<script>
	import cont from "@/components/navigation/navigation.vue"
	import index from '@/utils/index.js'
	export default {
		data() {
			return {
				show: false,
				info: {},
				isIn:true,
				toTop: false,
			}
		},
		computed: {
			i18n() {
				return this.$t('index')
			},
		},
		methods: {
			copyTextMethod(text) {
				console.log(text)
				// #ifdef H5
				this.$copyText(text).then(res => {
					// Copy address Successful!
					uni.showToast({
						title: this.$t('index').CopySuccessful,
						icon: 'none',
						duration: 1500
					})

				})
				// #endif
				// #ifdef APP-PLUS
				var that = this
				console.log(123132)
				uni.setClipboardData({
					data: text,
					success() {
						uni.showToast({
							title: this.$t('index').CopySuccessful,
							icon: 'none',
							duration: 1500
						})
					}
				})
				// #endif
			}
		},
		onLoad(option) {
			this.info = uni.getStorageSync('transDetail')
			console.log(this.info,787878)
			this.isIn=this.info.type==='in';
			console.log(this.isIn)
			
		}
	};
</script>
<style scoped>
	page {
		background: #FAFAFA;

	}
</style>

<style>
	@import './index.css';
</style>
