<template>
	<view class="">
			<view class="wrap">
	  <swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" >
	                        <swiper-item>
	                            <view class="swiper-item">
									<image src="../../static/tongyonh/phone_image.png" class="img1" mode="aspectFit"></image>
									<view class="text_con">
										<view class="text1">
											Decentralised wallets,
											self-directed assets
										</view>
										<view class="text2">
											Local storage of private keys, safe and secure
										</view>
									</view>
									
								</view>
	                        </swiper-item>
	                   <swiper-item>
	                       <view class="swiper-item">
	                   		<image src="../../static/tongyonh/phone_image.png" class="img1" mode="aspectFit"></image>
	                   		<view class="text_con">
	                   			<view class="text1">
	                   				Decentralised wallets,
	                   				self-directed assets
	                   			</view>
	                   			<view class="text2">
	                   				Local storage of private keys, safe and secure
	                   			</view>
	                   		</view>
	                   		
	                   	</view>
	                   </swiper-item>               
	                    </swiper>
			</view>
			
			
			<view class="reg_con">
				<view class="reg">
					<view class="border">
					<view class="item flex">
						<view class="left flex">
							<image src="../../static/tongyonh/create_wallet.png" mode="aspectFit" class="letimg"></image>
						<view class="textcon">
							<view class="text1" @click="createWallet">
								Create a wallet
							</view>
							<view class="text2">
								One identity management
							</view>
						</view>	
						</view>
						<image src="../../static/tongyonh/chevron_right_24px.png" class="rigimg" mode="aspectFit"></image>
					</view>
						</view>
					
					<view class="item flex">
						<view class="left flex">
							<image src="../../static/tongyonh/login_wallet.png" mode="aspectFit" class="letimg"></image>
						<view class="textcon">
							<view class="text1" @click="loginWallet">
								Login to wallet
							</view>
							<view class="text2">
							Restore existing wallets
							</view>
						</view>	
						</view>
						<image src="../../static/tongyonh/chevron_right_24px.png" class="rigimg" mode="aspectFit"></image>
					</view>
					
					
					
					
				</view>
				
				
				<view class="select">
					<u-checkbox-group @change="checkboxGroupChange">
								<u-checkbox 
									@change="checkboxChange" 
									v-model="item.checked" 
									v-for="(item, index) in list2" :key="index" 
									:name="item.name"
									 active-color="#5B53FF"
								>  <text class="name">I have read and agree to the 
							 <text class="active" @click.stop="Terms">Terms of Service</text>	
								</text> </u-checkbox>
							</u-checkbox-group>
				</view>
			</view>
			
			
			
	</view>
</template>

<script>
	import api from '@/utils/api'
	import utils from '@/utils'
	import md5 from 'js-md5'
	import store from '@/store'
	import token from '@/utils/TokenUtil'
	import cont from "@/components/navigation/navigation.vue"

	export default {
		data() {
			return {
				list2: [
							{
								name: '',
								checked: false,
								disabled: false,
							},
						],
				list: ['','../../../static/tongyonh/phone_image.png'],
				indicatorDots:true,
				autoplay:true,
				interval:3000,
				inde:1,
	}
		},

		onLoad() {
		this.list2.checked=false;
		
		
		},
		methods: {
			checkboxGroupChange(){
				
			},
			checkboxChange(){
				if(this.inde%2==0){
					this.list2.checked=false;
				}else{
					this.list2.checked=true;
				}
				this.inde++
			},
	createWallet(){
		if(this.list2.checked!=true){
			uni.showToast({
				title: 'Please check the terms of service',
				icon: 'none',
				duration: 1500
			})
			return;
		}
		var walletInfo=token.creatingWallets()
		// 读到钱包助记词信息,存入缓存
		uni.setStorage({
			key: 'walletInfo',
			data: walletInfo,
			success: function() {
				console.log('success',walletInfo)
			}
		});
		 uni.navigateTo({
		 	url:'../menu/backUp/index',
		 })
	},
	loginWallet(){
		if(this.list2.checked!=true){
			uni.showToast({
				title: 'Please check the terms of service',
				icon: 'none',
				duration: 1500
			})
			return;
		}
		uni.navigateTo({
			url:'../menu/backUp/backUp3/index',
		})
	},
Terms(){
	uni.navigateTo({
		url:'../menu/about/terms/index',
	})
}
	},
	}
	
</script>

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