Blame view

pages/talent/talent.vue 4.44 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
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
  <template>
  	<view class="page">
  		<view class="main">
  			<view class="top">
  				<view @click="toPostTalent()">
  					<image src="../../static/nav/talent1.png" mode="widthFix"></image>
  				</view>
  				<view @click="toRecommend()">
  					<image src="../../static/nav/talent2.png" mode="widthFix"></image>
  				</view>
  			</view>
  			<!-- 搜索 -->
  			<view class="search-head">
  				<view class="search">
  					<image src="../../static/fdj1.png"></image>
  					<text></text>
  					<input type="text" v-model="keyword" placeholder="搜索关键词" />
  				</view>
  				<view class="btn" @click="searchEvt">
  					<text>搜索</text>
  				</view>
  			</view>
  			<!-- <view class="titleall-box">
  				<view class="talen-title"><text class="talen-line"></text>热门职位</view>
  				<view class="title-screen">
  					<scroll-view scroll-x="true" class="scrollview-box">
  						<view class="title-screen-box">
  							<view>德阳<image src="../../static/down.png"></image>
  							</view>
  						</view>
  						<view class="title-screen-box">
  							<view>发布时间<image src="../../static/down.png"></image>
  							</view>
  						</view>
  						<view class="title-screen-box">
  							<view>工作类型<image src="../../static/down.png"></image>
  							</view>
  						</view>
  					</scroll-view>
  				</view>
  			</view> -->
  			<!-- @down="downCallback"
  			@up="upCallback"
  			:down="downOption"
  			:up="upOption" 
  			:top="0"
  			-->
  			<view class="" v-if="!show" style="padding: 30rpx; font-size: 24rpx;">
  				暂无数据
  			</view>
  			<view v-else>
  				<view class="article-data">
  					<view class="article-list">
  						<view class="list" v-for="(item,index) in talentList" @click="onArticle(item)" :key="index">
  							<view class="item">
  								<view class="title">
  									<text class="two-omit">{{item.title}}</text>
  								</view>
  								<view class="find-collect">
  									<view class="find">
  										<text>{{item.subTitle}}</text>
  									</view>
  								</view>
  								<view>
  									<view class="find-time">{{item.createTime}}</view>
  								</view>
  							</view>
  							<view class="thumb">
  								<view class="thumb-icon">{{item.post}}</view>
7c019d2d   “wangming”   112
70
  								<view v-if="false">3000-5000/月</view>
290144e9   易尊强   第一次
71
72
73
74
75
76
  							</view>
  						</view>
  					</view>
  				</view>
  			</view>
  
7c019d2d   “wangming”   112
77
  
290144e9   易尊强   第一次
78
79
80
81
82
83
84
85
86
87
88
  		</view>
  	</view>
  </template>
  
  <script>
  	import request from '@/utils/request.js'
  	import utils from '../../service/utils';
  	export default {
  		data() {
  			return {
  				talentList: [],
7c019d2d   “wangming”   112
89
90
  				show: false,
  				keyword: ''
290144e9   易尊强   第一次
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
  			}
  		},
  		onShow() {
  			this.getUser()
  			this.getTalentList()
  			// #ifdef APP-PLUS
  			this.getTalentList()
  			// #endif
  		},
  		methods: {
  			// 获取用户信息
  			getUser() {
  				if (uni.getStorageSync('user')) {
  					// this.userCode = uni.getStorageSync('user').data.user.userInfo
  					// this.userInfo = this.userCode.userAccount
  					// this.userInfo = '123456'
  					console.log('用户已登录!')
  				} else {
  					uni.showToast({
  						title: '请登录',
  						icon: 'none'
  					})
  					setTimeout(() => {
  						uni.reLaunch({
  							url: '/pages/login/index'
  						})
  					})
  				}
  			},
  			// 获取人才列表
  			getTalentList() {
  				this.API.getTalentList().then(res => {
7c019d2d   “wangming”   112
123
  					if (res.code === 600) {
290144e9   易尊强   第一次
124
125
  						// console.log(res)
  						uni.showToast({
7c019d2d   “wangming”   112
126
127
  							icon: 'error',
  							title: '登录过期,请重新登录'
290144e9   易尊强   第一次
128
129
130
131
132
133
134
135
136
  						})
  					}
  					if (res.code === 200) {
  						this.talentList = res.data.list.map(it => {
  							return {
  								...it,
  								createTime: utils.formatTime(it.createTime)
  							}
  						})
7c019d2d   “wangming”   112
137
  						if (this.talentList.length > 0) {
290144e9   易尊强   第一次
138
139
140
141
142
143
144
145
146
147
148
149
  							this.show = true
  						}
  					}
  					console.log(this.talentList)
  				})
  			},
  			onArticle(item) {
  				uni.navigateTo({
  					url: `/pages/talentDetail/talentDetail?data=${JSON.stringify(item)}`
  				})
  			},
  			// 跳转到发布人才招聘
7c019d2d   “wangming”   112
150
  			toPostTalent() {
290144e9   易尊强   第一次
151
  				uni.navigateTo({
7c019d2d   “wangming”   112
152
  					url: '/pages/postTalent/postTalent'
290144e9   易尊强   第一次
153
154
155
  				})
  			},
  			// 搜索功能
7c019d2d   “wangming”   112
156
157
158
159
  			searchEvt() {
  				this.API.getTalentList({
  					keyword: this.keyword
  				}).then(res => {
290144e9   易尊强   第一次
160
161
162
163
164
165
166
167
  					console.log(res)
  					if (res.code === 200) {
  						this.talentList = res.data.list.map(it => {
  							return {
  								...it,
  								createTime: utils.formatTime(it.createTime)
  							}
  						})
7c019d2d   “wangming”   112
168
  						if (this.talentList.length > 0) {
290144e9   易尊强   第一次
169
170
171
172
173
174
175
  							this.show = true
  						}
  					}
  					console.log(this.talentList)
  				})
  			},
  			// 跳转到人才推介列表
7c019d2d   “wangming”   112
176
  			toRecommend() {
290144e9   易尊强   第一次
177
  				uni.navigateTo({
7c019d2d   “wangming”   112
178
  					url: `/pages/recommend/recommend`
290144e9   易尊强   第一次
179
180
181
182
183
184
185
186
187
  				})
  			}
  		}
  	};
  </script>
  
  <style scoped lang="scss">
  	@import 'talent.scss';
  </style>