<template>
	<view class="content">
		<web-view :src="url + type" @message="back1" ref="webH5"></web-view>
		<!-- #ifdef H5 -->
		<view class="btns">
			<view @click="back('/pages/transaction/bbjy?type=' + type + '&current=1')" class="btn btn-green" :class="{ dontbuy: isbuy != 1 }">買入</view>
			<view @click="back('/pages/transaction/bbjy?type=' + type + '&current=2')" class="btn btn-red" :class="{ dontbuy: isbuy != 1 }">賣出</view>
		</view>
		<!-- #endif -->
	</view>
</template>

<script>
var wv;
export default {
	data() {
		return {
			url: '/hybrid/html/local.html?type=',
			type: '',
			isbuy: 1
		};
	},
	onLoad(res) {
		this.type = res.type;
		console.log(res.type == 'GCB-USDT', 'this,type+++++++++++++');
		if (res.type == 'GCB-USDT') {
			this.isbuy = 2;
		}
	},
	onShow() {},
	methods: {
		back(url) {
			if (this.isbuy == 1) {
				console.log('触发');
				uni.navigateTo({
					url
				});
			}
		},
		back1(url) {
			console.log('触发1');
		}
	}
};
</script>

<style lang="scss">
page,
.content {
	min-height: 100%;
	height: auto;
}
.btns {
	position: fixed;
	z-index: 1000;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	padding: 10px;
	box-sizing: border-box;
	background-color: #131623;
	.btn {
		flex: 1;
		height: 40px;
		border-radius: 4px;
		line-height: 40px;
		text-align: center;
		color: #fff;
		font-size: 16px;
	}
	.btn-green {
		margin-right: 20px;
		background-color: #38ad70;
	}
	.btn-red {
		background-color: #fe5c57;
	}
	.dontbuy {
		background-color: #aaaaaa !important;
	}
}
</style>
