Blame view

pages/demand/demand.vue 5.04 KB
290144e9   易尊强   第一次
1
2
3
  <template>
  	<view class="page">
  		<view class="main">
e6b161ae   易尊强   2/23
4
5
6
  			<view class="top">
  				<image src="../../static/img/supply2.png" @click="toPostDemand()" mode="widthFix"></image>
  			</view>
290144e9   易尊强   第一次
7
  			<view class="titleall-box">
9b1c150c   “wangming”   1
8
9
10
11
12
13
14
15
16
17
18
19
20
  				<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   易尊强   第一次
21
22
23
  				<view class="title-screen">
  					<scroll-view scroll-x="true" class="scrollview-box">
  						<!-- 下方的红线 -->
e6b161ae   易尊强   2/23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
  						<!-- <view ref="line" class="line" ></view> -->
  						<view :class="['title-screen-box',{'red_line':nowShow === 1}]" @click="allPro(1,'全部')">
  							<view>全部</view>
  						</view>
  						<view :class="['title-screen-box',{'red_line':nowShow === 2}]" @click="metalPro(2,'金属')">
  							<view>金属</view>
  						</view>
  						<view :class="['title-screen-box',{'red_line':nowShow === 3}]" @click="devicePro(3,'专用设备')">
  							<view>专用设备</view>
  						</view>
  						<view :class="['title-screen-box',{'red_line':nowShow === 4}]" @click="tranPro(4,'交通运输')">
  							<view>交通运输</view>
  						</view>
  						<view :class="['title-screen-box',{'red_line':nowShow === 5}]" @click="elecPro(5,'电气机械')">
  							<view>电气机械</view>
  						</view>
  						<view :class="['title-screen-box',{'red_line':nowShow === 6}]" @click="commuPro(6,'电子及通讯')">
  							<view>电子及通讯</view>
  						</view>
290144e9   易尊强   第一次
43
44
  					</scroll-view>
  					<view class="title-screen-box" style="background-color: #fff;margin-right: 0;text-align: center;">
e6b161ae   易尊强   2/23
45
46
47
  						<view class="title-screen-box-btn">
  							<image src="../../static/supply.png"></image>
  						</view>
290144e9   易尊强   第一次
48
49
50
  					</view>
  				</view>
  			</view>
e6b161ae   易尊强   2/23
51
  
290144e9   易尊强   第一次
52
53
54
55
56
57
58
59
60
61
62
63
64
  			<view class="recommend-info">
  				<view class="goods-list">
  					<view class="list" @click="ArticleDetails(item)" v-for="(item,index) in demandList" :key="index">
  						<view class="title-tag">
  							<view class="tag">
  								{{item.subTitle}}
  							</view>
  							<view class="tag-small">
  								{{item.subTitle}}
  							</view>
  						</view>
  						<view class="price-info">
  							<view class="user-price">
e6b161ae   易尊强   2/23
65
66
67
68
69
70
  								<view class="goods-city">
  									<image src="../../static/image/default_logo.jpg"></image>{{item.comanyName}}
  								</view>
  								<view class="goods-city-img">
  									<image src="../../static/right2.png"></image>
  								</view>
290144e9   易尊强   第一次
71
72
73
74
75
  							</view>
  							<view class="vip-price">
  							</view>
  						</view>
  					</view>
e6b161ae   易尊强   2/23
76
  
290144e9   易尊强   第一次
77
78
  				</view>
  			</view>
e6b161ae   易尊强   2/23
79
  
290144e9   易尊强   第一次
80
81
82
83
84
  		</view>
  	</view>
  </template>
  
  <script>
9b1c150c   “wangming”   1
85
  	import moHuSearch from '../../components/qj-fuzzy-search/index.vue'
290144e9   易尊强   第一次
86
  	export default {
9b1c150c   “wangming”   1
87
88
89
  		components: {
  			moHuSearch
  		},
290144e9   易尊强   第一次
90
91
  		data() {
  			return {
e6b161ae   易尊强   2/23
92
  				demandList: [],
9b1c150c   “wangming”   1
93
94
95
96
  				nowShow: 1,
  				comList:[],
  				selectShow:false,
  				keyWord:''
e6b161ae   易尊强   2/23
97
  			}
290144e9   易尊强   第一次
98
  		},
1af1c1b1   易尊强   2/29 17:39
99
  		mounted() {
290144e9   易尊强   第一次
100
101
102
103
  			let that = this
  			this.getDemandList()
  			this.allPro()
  		},
1af1c1b1   易尊强   2/29 17:39
104
105
106
107
108
  		// onLoad() {
  		// 	let that = this
  		// 	this.getDemandList()
  		// 	this.allPro()
  		// },
290144e9   易尊强   第一次
109
  		methods: {
9b1c150c   “wangming”   1
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
  			selectPro(){
  				let that = this
  				this.selectShow = true
  				that.API.getDemandList({
  					keyword:this.keyWord,
  					pageSize: 10000,
  				}).then(res => {
  					console.log(res)
  					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.ArticleDetails(item)
  				this.selectShow = false;
  			},
290144e9   易尊强   第一次
136
  			// 点击全部
e6b161ae   易尊强   2/23
137
  			allPro(index, name) {
290144e9   易尊强   第一次
138
139
  				let that = this
  				this.nowShow = index
e6b161ae   易尊强   2/23
140
  
290144e9   易尊强   第一次
141
  				console.log(name)
e6b161ae   易尊强   2/23
142
  
290144e9   易尊强   第一次
143
144
  			},
  			// 点击金属
e6b161ae   易尊强   2/23
145
  			metalPro(index, name) {
290144e9   易尊强   第一次
146
147
148
  				let that = this
  				that.nowShow = index
  				console.log(name)
e6b161ae   易尊强   2/23
149
  
290144e9   易尊强   第一次
150
151
  			},
  			// 点击专用设备
e6b161ae   易尊强   2/23
152
  			devicePro(index, name) {
290144e9   易尊强   第一次
153
154
155
  				let that = this
  				that.nowShow = index
  				console.log(name)
e6b161ae   易尊强   2/23
156
  
290144e9   易尊强   第一次
157
158
  			},
  			// 点击交通运输
e6b161ae   易尊强   2/23
159
  			tranPro(index, name) {
290144e9   易尊强   第一次
160
161
162
  				let that = this
  				that.nowShow = index
  				console.log(name)
e6b161ae   易尊强   2/23
163
  
290144e9   易尊强   第一次
164
165
  			},
  			// 点击电气机械
e6b161ae   易尊强   2/23
166
  			elecPro(index, name) {
290144e9   易尊强   第一次
167
168
169
  				let that = this
  				that.nowShow = index
  				console.log(name)
e6b161ae   易尊强   2/23
170
  
290144e9   易尊强   第一次
171
172
  			},
  			// 点击电子及通讯
e6b161ae   易尊强   2/23
173
  			commuPro(index, name) {
290144e9   易尊强   第一次
174
175
176
  				let that = this
  				that.nowShow = index
  				console.log(name)
e6b161ae   易尊强   2/23
177
  
290144e9   易尊强   第一次
178
179
  			},
  			// 获取全部需求数据
e6b161ae   易尊强   2/23
180
  			getDemandList() {
290144e9   易尊强   第一次
181
  				let that = this
e6b161ae   易尊强   2/23
182
  				that.API.getDemandList({
1af1c1b1   易尊强   2/29 17:39
183
  					pageSize: 10000,
e6b161ae   易尊强   2/23
184
  				}).then(res => {
290144e9   易尊强   第一次
185
186
187
188
  					console.log(res)
  					that.demandList = res.data.list
  				})
  			},
e6b161ae   易尊强   2/23
189
  			ArticleDetails(it) {
290144e9   易尊强   第一次
190
191
192
193
194
  				uni.navigateTo({
  					url: `/pages/ArticleDetails/ArticleDetails?data=${JSON.stringify(it)}`
  				})
  			},
  			// 去需求发布页面
e6b161ae   易尊强   2/23
195
  			toPostDemand() {
290144e9   易尊强   第一次
196
  				uni.navigateTo({
e6b161ae   易尊强   2/23
197
  					url: '/pages/postDemand/postDemand'
290144e9   易尊强   第一次
198
199
200
201
202
203
204
205
  				})
  			}
  		}
  	};
  </script>
  
  <style scoped lang="scss">
  	@import 'demand.scss';
e6b161ae   易尊强   2/23
206
  </style>