<template>
	<view class="page">
		<!-- <view class="main">
			<view class="top">
				<view><image src="../../static/nav/supply.png" mode="widthFix" @click="toSupply"></image></view>
				<view><image src="../../static/nav/demand.png" mode="widthFix" @click="toDemand"></image></view>
			</view>
			
			<view class="star_box">
				<view class="title_box">
					<view class="right">
						<view class="redDian" style=""></view>
						<span>明星企业</span>
					</view>
					<p @click="toAllCompany">查看更多 <image src="../../static/right.png"></image></p>
				</view>
				<piaoyiSwiper :imgList="imgList" :itemMargin="60" :autoplay="false" :interval="3000" :duration="1000"/>
			</view>
	
			<view class="all_box">
				<view class="title_box">
					<view class="right">
						<view class="redDian" style=""></view>
						<span>全部企业</span>
					</view>
					<p @click="toAllCompany()">查看更多 <image src="../../static/right.png"></image></p>
				</view>
				<view class="item_box" v-for="(item,index) in twentyList" @click="onCompany(item.id)">
					<image :src="baseUrl + item.logo" mode="" v-if="item.logo"></image>
					<image src="../../static/image/default_logo.jpg" v-else mode=""></image>
					<view class="right">
						<p>{{item.fullName}}</p>
						<p class="detail_limit">
							{{item.product}}&nbsp;&nbsp;{{item.yingyeshouru}}
						</p>
					</view>
				</view>
			</view>
		</view> -->
		<view class="top">
			<view class="supply" :style="show === 0 ? 'font-weight: bold;color: #E60012;' : '' " @click="toSupply()">
				供应中心
			</view>
			<view class="demand" :style="show === 1 ? 'font-weight: bold;color: #E60012;' : '' " @click="toDemand()">
				需求中心
			</view>
		</view>
		<view class="shuju" style="margin-top: 40rpx;">
			<view class="one" v-if="show === 0">
				<supply></supply>
			</view>
			<view class="two" v-if="show === 1">
				<demand></demand>
			</view>
		</view>
	</view>
</template>

<script>
	import piaoyiSwiper from '../../components/piaoyi-swiper/piaoyi-swiper.vue'
	import request from '@/utils/request.js'
	import supply from '@/pages/supply/supply.vue'
	import demand from '@/pages/demand/demand.vue'
	export default {
		components:{
			piaoyiSwiper,
			supply,
			demand
		},
		data() {
			return {
				imgList:[],
				type:'',
				// 此类所有公司
				allList:[],
				// 前五的明星企业
				fiveList:[],
				twentyList:[],
				baseUrl:'https://app.cehuimi.com',
				show:0
				}
		},
		onLoad(options) {
			
		},
		methods: {
			// 跳转到需求中心
			toDemand(){
				this.show = 1
			},
			// 跳转到供应中心
			toSupply(){
				this.show = 0
			},
			
		}
	};
</script>

<style scoped lang="scss">
	@import 'equip.scss';
</style>
