<template>
	<view class="">
		<navigation :showBack="true" :bgnum="true">
			<text class="big_title">
				Transaction details
			</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">
					Confirmed
				</view>
				<view class="scroll">


					<view class="title_con flex">
						<view class="text1">
							Amount
						</view>
						<view class="text1">
							{{info.value}} {{info.network}}
						</view>
					</view>
					<view class="title_con flex">
						<view class="text1">
							Time
						</view>
						<view class="text2">
							{{info.time}}
						</view>
					</view>
					<view class="title_con flex">
						<view class="text2">
							Tx Fee
						</view>
						<view class="text2">
							{{info.fee}} {{info.network}}
						</view>
					</view>
					
					<view class="item">
						<view class="text1">
							Transaction ID
						</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">
							Send address
							<text v-if="isIn"> (others)</text>
							<text v-else>(me)</text>
						</view>
						<view class="text2">
							{{info.from}}
							<image @click="copyTextMethod(info.from)" src="../../../../static/tongyonh/copy_24px.png" mode="aspectFit" class="img"></image>
						</view>
					</view>
					<view class="item">
						<view class="text1">
							Receiving address
							<text v-if="isIn">(me)</text>
							<text v-else>(others)</text>
						</view>
						<view class="text2">
							{{info.to}}
							<image  @click="copyTextMethod(info.to)" src="../../../../static/tongyonh/copy_24px.png" mode="aspectFit" class="img"></image>
						</view>
					</view>
				</view>
				<view class="item goto">
					Go to your browser for more information
				</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,
			}
		},
		methods: {
			copyTextMethod(text) {
				console.log(text)
				// #ifdef H5
				this.$copyText(text).then(res => {
					// Copy address Successful!
					uni.showToast({
						title: 'Copy Successful!',
						icon: 'none',
						duration: 1500
					})

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

	}
</style>

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