Blame view

pages/equip/equip.vue 3.46 KB
290144e9   易尊强   第一次
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  <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>
  				<!-- 下方轮播 -->
  				<!-- <view class="swiper" style="margin-left: 20rpx;">
  					<orange-longswiper :list="listData" :config="configData"  @tapMore="tapMore" @tapList="tapList"></orange-longswiper>
  				</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>
e6b161ae   易尊强   2/23
33
  				<view class="item_box" v-for="(item,index) in twentyList" @click="onCompany(item.id)">
290144e9   易尊强   第一次
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
  					<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>
  </template>
  
  <script>
  	import piaoyiSwiper from '../../components/piaoyi-swiper/piaoyi-swiper.vue'
  	import request from '@/utils/request.js'
  	export default {
  		components:{
  			piaoyiSwiper
  		},
  		data() {
  			return {
  				imgList:[],
  				type:'',
  				// 此类所有公司
  				allList:[],
  				// 前五的明星企业
  				fiveList:[],
  				twentyList:[],
  				baseUrl:'https://app.cehuimi.com'
  				}
  		},
  		onLoad(options) {
  			console.log(options)
  			this.type = options.data
  			console.log(this.type)
  			this.getCompanyList()
  		},
  		methods: {
  			// 获取对应分类的公司机构
  			getCompanyList(){
  				request({
  					url:'/api/permission/organize',
  					methos:'get',
  					data:{stage:this.type}
  				}).then(res=>{
  					if(res.code === 200){
  						console.log(this.type,res)
  						this.allList = res.data.list
  						this.fiveList = this.allList.sort(function(a,b){return a.ViewCount - b.ViewCount}).slice(-5)
  						this.imgList = this.fiveList.map(it=>{
  							return {
  								...it,
  								id:it.id,
  								img:'../../static/image/default_logo.jpg',
  								subject:it.fullName,
  								detail:it.product
  							}
  						})
  						this.twentyList = this.allList.slice(-20)
  					}
  				})
  			},
  			GoodsDetails() {
  				uni.navigateTo({
  					url: '/pages/GoodsDetails/GoodsDetails'
  				})
  			},
  			// 跳转到需求中心
  			toDemand(){
  				uni.navigateTo({
  					url: '/pages/demand/demand'
  				})
  			},
  			// 跳转到供应中心
  			toSupply(){
  				uni.navigateTo({
  					url: '/pages/supply/supply'
  				})
  			},
  			// 跳转到所有企业
  			toAllCompany(){
  				uni.navigateTo({
  					url:'/pages/allCompany/allCompany'
  				})
  			},
  			onCompany(item){
  				uni.navigateTo({
  					url: `/pages/companyDetail/companyDetail?data=${JSON.stringify(item)}`
  				})
  			}
  		}
  	};
  </script>
  
  <style scoped lang="scss">
  	@import 'equip.scss';
  </style>