290144e9
易尊强
第一次
|
1
2
3
4
|
<template>
<view class="page">
<view class="main">
<view class="top"><image src="../../static/img/supply1.png" @click="toPostProduct()" mode="widthFix"></image></view>
|
9b1c150c
“wangming”
1
|
5
|
|
290144e9
易尊强
第一次
|
6
|
<view class="titleall-box">
|
9b1c150c
“wangming”
1
|
7
8
9
10
11
12
13
14
15
16
17
18
19
|
<view class="search-head">
<view class="search">
<image src="../../static/fdj1.png"></image>
<text></text>
<input type="text" v-model="keyWord" placeholder="搜索关键词" @input="selectPro()" />
</view>
<!-- 显示公司选项 -->
<view class="btn" @click="selectPro()">
<text>搜索</text>
</view>
</view>
<mo-hu-search :show="selectShow" :list="comList" @select="select" label-name="name"
value-name="id"></mo-hu-search>
|
290144e9
易尊强
第一次
|
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
|
<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)">
|
9b1c150c
“wangming”
1
|
60
61
62
63
|
<view class="pictrue" v-if="it.isImg">
<image :src="baseURL + it.url" mode="heightFix"></image>
</view>
<view class="pictrue" v-else>
|
290144e9
易尊强
第一次
|
64
|
<image src="../../static/img/add.jpg" mode="heightFix"></image>
|
9b1c150c
“wangming”
1
|
65
|
|
290144e9
易尊强
第一次
|
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
|
</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'
|
9b1c150c
“wangming”
1
|
96
97
|
import moHuSearch from '../../components/qj-fuzzy-search/index.vue'
import baseURL from '@/common/config.js'
|
290144e9
易尊强
第一次
|
98
|
export default {
|
9b1c150c
“wangming”
1
|
99
100
101
|
components: {
moHuSearch
},
|
290144e9
易尊强
第一次
|
102
103
104
105
106
107
|
data() {
return {
// 当前显示的种类
nowShow:1,
showList:[],
allList:[],
|
9b1c150c
“wangming”
1
|
108
109
110
111
112
|
keyWord:'',
selectShow:false,
comList:[],
// isImg:false,
baseURL:baseURL
|
290144e9
易尊强
第一次
|
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
// // 装备制造
// equipList:[],
// // 医药
// medList:[],
// // 食品工业
// foodList:[],
// // 通用航空
// aviation:[],
// // 先进材料
// materialList:[],
// // 科技服务
// techList:[],
// // 其他
// anotherList:[]
}
},
mounted() {
// console.log(this.$refs.line.getBoundingClientRect())
// console.log(this.$refs.ling)
|
290144e9
易尊强
第一次
|
132
133
134
135
136
137
138
139
|
// #ifdef APP-PLUS
this.getProList()
// this.equipPro()
// #endif
this.getProList()
// this.equipPro()
// this.equipPro()
},
|
1af1c1b1
易尊强
2/29 17:39
|
140
141
142
143
144
145
146
147
148
|
// onLoad() {
// // #ifdef APP-PLUS
// this.getProList()
// // this.equipPro()
// // #endif
// this.getProList()
// // this.equipPro()
// // this.equipPro()
// },
|
290144e9
易尊强
第一次
|
149
150
151
152
153
154
155
156
157
158
159
160
161
|
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
|
9b1c150c
“wangming”
1
|
162
163
164
165
166
167
168
169
170
171
172
173
174
|
this.allList = res.data.list.map(it=>{
let url = ''
if(it.vimages.length > 0){
url = it.vimages[0].url
}
return {
...it,
isImg:it.vimages.length > 0,
url:url
// url:it.vimages
// firstImg:JSON.parse(JSON.stringify(it.vimages[0].url))
}
})
|
290144e9
易尊强
第一次
|
175
176
177
178
|
this.equipPro()
}
})
},
|
9b1c150c
“wangming”
1
|
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
|
selectPro(){
this.selectShow = true
request({
url:'/api/Extend/baseproduct/GetListByApp',
method:'get',
data:{
keyWord:this.keyWord,
pageSize:1000
}
}).then(res=>{
if(res.code === 200){
console.log(res)
// this.comList = res.data.list
let arr = res.data.list
this.comList = arr.map(it=>{
return {
...it,
name:it.title
}
})
}
})
},
select(item) {
// this.selectName = item.name;
// this.selectId = item.id
// this.categoryId = item.categoryId
// console.log("栏目ID",this.categoryId)
this.GoodsDetails(item)
this.selectShow = false;
},
|
290144e9
易尊强
第一次
|
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
|
// 点击装备制造
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>
|