Blame view

pages/demand/demand.vue 3.75 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
8
9
10
  			<view class="titleall-box">
  				<view class="title-screen">
  					<scroll-view scroll-x="true" class="scrollview-box">
  						<!-- 下方的红线 -->
e6b161ae   易尊强   2/23
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  						<!-- <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   易尊强   第一次
30
31
  					</scroll-view>
  					<view class="title-screen-box" style="background-color: #fff;margin-right: 0;text-align: center;">
e6b161ae   易尊强   2/23
32
33
34
  						<view class="title-screen-box-btn">
  							<image src="../../static/supply.png"></image>
  						</view>
290144e9   易尊强   第一次
35
36
37
  					</view>
  				</view>
  			</view>
e6b161ae   易尊强   2/23
38
  
290144e9   易尊强   第一次
39
40
41
42
43
44
45
46
47
48
49
50
51
  			<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
52
53
54
55
56
57
  								<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   易尊强   第一次
58
59
60
61
62
  							</view>
  							<view class="vip-price">
  							</view>
  						</view>
  					</view>
e6b161ae   易尊强   2/23
63
  
290144e9   易尊强   第一次
64
65
  				</view>
  			</view>
e6b161ae   易尊强   2/23
66
  
290144e9   易尊强   第一次
67
68
69
70
71
72
73
74
  		</view>
  	</view>
  </template>
  
  <script>
  	export default {
  		data() {
  			return {
e6b161ae   易尊强   2/23
75
76
77
  				demandList: [],
  				nowShow: 1
  			}
290144e9   易尊强   第一次
78
79
80
81
82
83
84
85
  		},
  		onLoad() {
  			let that = this
  			this.getDemandList()
  			this.allPro()
  		},
  		methods: {
  			// 点击全部
e6b161ae   易尊强   2/23
86
  			allPro(index, name) {
290144e9   易尊强   第一次
87
88
  				let that = this
  				this.nowShow = index
e6b161ae   易尊强   2/23
89
  
290144e9   易尊强   第一次
90
  				console.log(name)
e6b161ae   易尊强   2/23
91
  
290144e9   易尊强   第一次
92
93
  			},
  			// 点击金属
e6b161ae   易尊强   2/23
94
  			metalPro(index, name) {
290144e9   易尊强   第一次
95
96
97
  				let that = this
  				that.nowShow = index
  				console.log(name)
e6b161ae   易尊强   2/23
98
  
290144e9   易尊强   第一次
99
100
  			},
  			// 点击专用设备
e6b161ae   易尊强   2/23
101
  			devicePro(index, name) {
290144e9   易尊强   第一次
102
103
104
  				let that = this
  				that.nowShow = index
  				console.log(name)
e6b161ae   易尊强   2/23
105
  
290144e9   易尊强   第一次
106
107
  			},
  			// 点击交通运输
e6b161ae   易尊强   2/23
108
  			tranPro(index, name) {
290144e9   易尊强   第一次
109
110
111
  				let that = this
  				that.nowShow = index
  				console.log(name)
e6b161ae   易尊强   2/23
112
  
290144e9   易尊强   第一次
113
114
  			},
  			// 点击电气机械
e6b161ae   易尊强   2/23
115
  			elecPro(index, name) {
290144e9   易尊强   第一次
116
117
118
  				let that = this
  				that.nowShow = index
  				console.log(name)
e6b161ae   易尊强   2/23
119
  
290144e9   易尊强   第一次
120
121
  			},
  			// 点击电子及通讯
e6b161ae   易尊强   2/23
122
  			commuPro(index, name) {
290144e9   易尊强   第一次
123
124
125
  				let that = this
  				that.nowShow = index
  				console.log(name)
e6b161ae   易尊强   2/23
126
  
290144e9   易尊强   第一次
127
128
  			},
  			// 获取全部需求数据
e6b161ae   易尊强   2/23
129
  			getDemandList() {
290144e9   易尊强   第一次
130
  				let that = this
e6b161ae   易尊强   2/23
131
132
133
  				that.API.getDemandList({
  					pageSize: 50,
  				}).then(res => {
290144e9   易尊强   第一次
134
135
136
137
  					console.log(res)
  					that.demandList = res.data.list
  				})
  			},
e6b161ae   易尊强   2/23
138
  			ArticleDetails(it) {
290144e9   易尊强   第一次
139
140
141
142
143
  				uni.navigateTo({
  					url: `/pages/ArticleDetails/ArticleDetails?data=${JSON.stringify(it)}`
  				})
  			},
  			// 去需求发布页面
e6b161ae   易尊强   2/23
144
  			toPostDemand() {
290144e9   易尊强   第一次
145
  				uni.navigateTo({
e6b161ae   易尊强   2/23
146
  					url: '/pages/postDemand/postDemand'
290144e9   易尊强   第一次
147
148
149
150
151
152
153
154
  				})
  			}
  		}
  	};
  </script>
  
  <style scoped lang="scss">
  	@import 'demand.scss';
e6b161ae   易尊强   2/23
155
  </style>