<template>
	<view class="trade-index">
		<view class="top-bar">
			<view v-if="mainKey === '0'" class="text-view"><text class="title">交易大厅</text></view>
			<view v-if="mainKey === '1'">
				<view class="bar-contant">
					<view class="check-control title-left36" :class="current === '0' ? 'check-title' : 'oncheck-title'" @click="controlChange('0')"><text>报价</text></view>
					<view class="check-control title-left" :class="current === '1' ? 'check-title' : 'oncheck-title'" @click="controlChange('1')"><text>订单</text></view>
				</view>
			</view>
		</view>
		<view class="" v-if="mainKey === '0'"><not-logged @loginChange="loginChange()"></not-logged></view>
		<view class="" v-if="mainKey === '1'">
			<view class="content">
				<view v-show="current === '0'">
					<quotationList></quotationList>
				</view>
				<view v-show="current === '1'">
					<orderList></orderList>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import notLogged from '@/components/not-logged/not-logged.vue'
import scrollList from '@/components/scroll-list/scroll-list.vue'
import quotationList from './quotationList.vue'
import orderList from './orderList.vue'
import { getEnterpriseList, gettradingHallList } from '@/apis/trade'
export default {
	components: { notLogged, scrollList, quotationList, orderList },
	data() {
		return {
			key: '',
			mainKey: '1',
			current: '0',
			controlCurrent: 0,
			items: ['报价', '订单'],
			controlItems: ['全部', '待确认', '待发货', '已完成'],
		}
	},
	mounted() {
		// this.getQuotationQurty()
	},
	watch: {
		
	},
	methods: {
		loginChange() {
			this.mainKey === '0' ? '1' : '0'
		},
		// 标题选项卡点击事件
		controlChange(value) {
			this.current = value
			// if (value === '0') {
			// 	this.getQuotationQurty()
			// } else {
			// 	this.getTradingQurty()
			// }
		},
		//分段器点击事件
		onClickItem(value) {
			console.log(value)
		}
	}
}
</script>

<style lang="scss">
.trade-index {
	.top-bar {
		background-color: rgb(255, 255, 255);
		border-bottom-width: 1px;
		border-bottom-style: solid;
		border-bottom-color: #eee;
		z-index: 998;
		height: 44px;
	}
	.title {
		font-size: 40rpx;
		color: #000000;
		letter-spacing: 0;
		font-weight: 500;
	}
	.text-view {
		padding: 10px;
	}
	.bar-contant {
		display: flex;
	}
	.check-title {
		font-family: PingFangSC-Medium;
		font-size: 40rpx;
		color: #000000;
		letter-spacing: 0;
		font-weight: 550;
		border-bottom: 2px solid #007aff;
	}
	.oncheck-title {
		font-family: PingFangSC-Regular;
		font-size: 32rpx;
		color: #555555;
		font-weight: 550;
	}
	.check-control {
		line-height: 35px;

		width: 40px;
		text-align: center;
	}
	.title-left {
		margin-left: 24rpx;
	}
	.title-left36 {
		margin-left: 36rpx;
	}
}
</style>
