supply.vue
5.82 KB
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
33
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<template>
<view class="page">
<view class="main">
<view class="top"><image src="../../static/img/supply1.png" @click="toPostProduct()" mode="widthFix"></image></view>
<view class="titleall-box">
<view class="title-screen">
<scroll-view scroll-x="true" class="scrollview-box">
<!-- 下方的红线 -->
<!-- <view ref="line" class="line" ></view> -->
<view :class="['title-screen-box',{'red_line':nowShow === 1}]" @click="equipPro(1,'装备制造')">
<view>装备制造</view>
</view>
<view :class="['title-screen-box',{'red_line':nowShow === 2}]" @click="medPro(2,' 医药')">
<view>医药</view>
</view>
<view :class="['title-screen-box',{'red_line':nowShow === 3}]" @click="foodPro(3,'食品工业')">
<view>食品工业</view>
</view>
<view :class="['title-screen-box',{'red_line':nowShow === 4}]" @click="aviationPro(4,'通用航空')">
<view>通用航空</view>
</view>
<view :class="['title-screen-box',{'red_line':nowShow === 5}]" @click="materialPro(5,'先进材料')">
<view>先进材料</view>
</view>
<view :class="['title-screen-box',{'red_line':nowShow === 6}]" @click="techPro(6,'科技服务')">
<view>科技服务</view>
</view>
<view :class="['title-screen-box',{'red_line':nowShow === 7}]" @click="anotherPro(7,'其他')">
<view>其他</view>
</view>
</scroll-view>
<view class="title-screen-box" style="background-color: #fff;margin-right: 0;text-align: center;">
<view class="title-screen-box-btn"><image src="../../static/supply.png"></image></view>
</view>
</view>
</view>
<view class="recommend-info">
<view class="" v-if="showList.length === 0">
<view class="" style="color: orangered;">
这类产品还没有哦
</view>
</view>
<view class="goods-list" v-else>
<view class="list" v-for="(it,index) in showList" :key="index" ref="ling" @click="GoodsDetails(it)">
<view class="pictrue">
<image src="../../static/img/add.jpg" mode="heightFix"></image>
</view>
<view class="title-tag">
<view class="tag">
{{it.title}}
</view>
<view class="tag-small">
{{it.remark}}
</view>
</view>
<view class="price-info">
<view class="user-price">
<view class="goods-city"><image src="../../static/image/default_logo.jpg"></image><span>{{it.companyName}}</span></view>
<view class="goods-city-img"><image src="../../static/right2.png"></image></view>
</view>
<view class="vip-price">
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import request from '@/utils/request.js'
export default {
data() {
return {
// 当前显示的种类
nowShow:1,
showList:[],
allList:[],
// // 装备制造
// equipList:[],
// // 医药
// medList:[],
// // 食品工业
// foodList:[],
// // 通用航空
// aviation:[],
// // 先进材料
// materialList:[],
// // 科技服务
// techList:[],
// // 其他
// anotherList:[]
}
},
mounted() {
// console.log(this.$refs.line.getBoundingClientRect())
// console.log(this.$refs.ling)
// #ifdef APP-PLUS
this.getProList()
// this.equipPro()
// #endif
this.getProList()
// this.equipPro()
// this.equipPro()
},
// onLoad() {
// // #ifdef APP-PLUS
// this.getProList()
// // this.equipPro()
// // #endif
// this.getProList()
// // this.equipPro()
// // this.equipPro()
// },
methods: {
// 获取商品列表
getProList(){
request({
url:'/api/Extend/baseproduct/GetListByApp',
method:'get',
data:{
pageSize:1000
}
}).then(res=>{
if(res.code === 200){
console.log(res)
this.allList = res.data.list
this.equipPro()
}
})
},
// 点击装备制造
equipPro(index,name){
let that = this
this.nowShow = index
this.showList = this.allList.filter(it=>{
return it.stage === '359691172446209285'
})
console.log(this.showList)
},
// 点击医药
medPro(index,name){
let that = this
that.nowShow = index
this.showList = this.allList.filter(it=>{
return it.stage === '359691279140914437'
})
console.log(this.showList)
},
// 点击食品工业
foodPro(index,name){
let that = this
that.nowShow = index
this.showList = this.allList.filter(it=>{
return it.stage === '359691451568751877'
})
console.log(this.showList)
},
// 点击通用航空
aviationPro(index,name){
let that = this
that.nowShow = index
this.showList = this.allList.filter(it=>{
return it.stage === '359691522012087557'
})
console.log(this.showList)
},
// 点击先进材料
materialPro(index,name){
let that = this
that.nowShow = index
this.showList = this.allList.filter(it=>{
return it.stage === '359691580954641669'
})
console.log(this.showList)
},
// 点击科技服务
techPro(index,name){
let that = this
that.nowShow = index
this.showList = this.allList.filter(it=>{
return it.stage === '402616512570983685'
})
console.log(this.showList)
},
// 点击其他
anotherPro(index,name){
let that = this
that.nowShow = index
this.showList = this.allList.filter(it=>{
return it.stage === '361520745303508229'
})
console.log(this.showList)
},
GoodsDetails(item) {
uni.navigateTo({
url: `/pages/GoodsDetails/GoodsDetails?data=${JSON.stringify(item)}`
})
},
// 跳转到产品发布
toPostProduct(){
uni.navigateTo({
url:'/pages/postProduct/postProduct'
})
}
}
};
</script>
<style scoped lang="scss">
@import 'supply.scss';
</style>