Blame view

pages/recommend/recommend.vue 4.7 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
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
  <template>
  	<view class="page">
  		<view class="main">
  			<view class="top">
  				<view class="postCon" v-show="isAdmin"
  					@click="toPostCon()">
  					人才发布
  				</view>
  			</view>
  			<!-- 搜索 -->
  			<view class="search-head" style="margin-bottom: 40rpx;">
  				<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.id)" :key="index">
  							<view class="item">
  								<view class="title">
  									<text class="two-omit">{{item.name}}</text>
  								</view>
  								<view class="find-collect">
  									<view class="find">
  										<text>{{item.gender}},{{item.age}},{{item.politicalOutlook}},{{item.education}}</text>
  									</view>
  								</view>
  								<view>
  									<view class="find-time">{{item.createTime}}</view>
  								</view>
  							</view>
  							<view class="thumb">
  								<view class="thumb-icon">{{item.graduationInstitution}}</view>
  								<!-- <view>3000-5000/月</view> -->
  							</view>
  						</view>
  					</view>
  				</view>
  			</view>
  
  			
  		</view>
  	</view>
  </template>
  
  <script>
  	import request from '@/utils/request.js'
  	import utils from '../../service/utils';
  	export default {
  		data() {
  			return {
  				talentList: [],
  				show:false,
  				keyword:'',
  				userCode:{},
  				isAdmin:false
  			}
  		},
  		onShow() {
  			this.getUser()
  			this.getTalentList()
  			// #ifdef APP-PLUS
  			this.getTalentList()
  			// #endif
  		},
  		methods: {
  			// 获取用户信息
  			getUser() {
  				if (uni.getStorageSync('user')) {
  					let userCode = uni.getStorageSync("user")
  					console.log(userCode)
  					if(userCode.userInfo.userId === 'admin'){
  						this.isAdmin = true
  					}
  					console.log('用户已登录!')
  				} 
  				// else {
  				// 	uni.showToast({
  				// 		title: '请登录',
  				// 		icon: 'none'
  				// 	})
  				// 	setTimeout(() => {
  				// 		uni.reLaunch({
  				// 			url: '/pages/login/index'
  				// 		})
  				// 	})
  				// }
  			},
  			// 获取人才列表
  			getTalentList() {
  				this.API.getRecommendList().then(res => {
  					if(res.code === 600){
  						// console.log(res)
  						uni.showToast({
  							icon:'error',
  							title:'登录过期,请重新登录'
  						})
  					}
  					if (res.code === 200) {
  						this.talentList = res.data.list.map(it => {
  							return {
  								...it,
  								createTime: utils.formatTime(it.creatorTime)
  							}
  						})
  						if(this.talentList.length > 0){
  							this.show = true
  						}
  					}
  					console.log(this.talentList)
  				})
  			},
  			onArticle(item) {
  				uni.navigateTo({
  					url: `/pages/recommend/recommendInfo/recommendInfo?data=${JSON.stringify(item)}`
  				})
  			},
  			// 跳转到发布人才招聘
  			toPostTalent(){
  				uni.navigateTo({
  					url:'/pages/postTalent/postTalent'
  				})
  			},
  			// 搜索功能
  			searchEvt(){
46dd6078   易尊强   人才搜索
160
  				this.API.getRecommendList({keyword:this.keyword}).then(res => {
290144e9   易尊强   第一次
161
162
163
164
165
  					console.log(res)
  					if (res.code === 200) {
  						this.talentList = res.data.list.map(it => {
  							return {
  								...it,
46dd6078   易尊强   人才搜索
166
167
  								// createTime: utils.formatTime(it.createTime)
  								createTime:utils.formatTime(it.creatorTime)
290144e9   易尊强   第一次
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
  							}
  						})
  						if(this.talentList.length > 0){
  							this.show = true
  						}
  					}
  					console.log(this.talentList)
  				})
  			},
  			// 跳转到人才发布页面
  			// toPost(item){
  			// 	uni.navigateTo({
  			// 		url:`/pages/recommend/postRecommend/postRecommend?data=${JSON.stringify(item)}`
  			// 	})
  				
  			// },
  			toPostCon(item){
  				uni.navigateTo({
  					url:`/pages/recommend/postRecommend/postRecommend`
  				})
  			},
  		}
  	};
  </script>
  
  <style scoped lang="scss">
  	@import 'talent.scss';
  </style>