Blame view

pages/AllWork/AllWork.vue 5.23 KB
c7add6cf   “wangming”   初始版本开发完毕
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  <template>

  	<view>

  		<view class="search-box">

  			<view class="search">

  				<view class="iconfont icon-fadajing"></view>

  				<input type="text" placeholder="热门搜索:成都、高薪" v-model="query.keyword" />

  				<view class="search-btn" @click="Searchtbrecruit()">搜索</view>

  			</view>

  		</view>

  		<view class="title-screen">

  			<view class="title-screen-box">发布时间<image src="../../static/down.png"></image>

  			</view>

  		</view>

  		<!-- 文章数据 -->

33740e18   “wangming”   体验版给客户看了
15
16
  		<mescroll-body ref="mescrollRef" @down="downCallback" @up="upCallback" :isUpAutoLoad="true" :down="downOption"

  			:up="upOption" :top="0">

c7add6cf   “wangming”   初始版本开发完毕
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
  			<view class="record-list">

  				<view class="list" @click="JobsDetails(item.id)" v-for="item in tbrecruitList">

  					<view class="title-date">

  						<view class="title">

  							<text class="two-omit">{{item.companyName}}-{{item.jop}}</text>

  						</view>

  						<view class="date">

  							<text class="one-omit">{{item.introduce}}</text>

  						</view>

  						<view>

  							<view class="yellow-btn">{{getDifferTime(item.lastModifyTime)}}</view>

  						</view>

  					</view>

  					<view class="integral">

  						<text class="integral-btn">{{item.jopName}}</text>

  						<view class="integral-num">{{item.pay}}</view>

  					</view>

  				</view>

  

  			</view>

  

  		</mescroll-body>

  		<!-- tabbar -->

33740e18   “wangming”   体验版给客户看了
40
  		<TabBar :tabBarShow="0"></TabBar>

c7add6cf   “wangming”   初始版本开发完毕
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
  	</view>

  </template>

  

  <script>

  	import BASE_URL from '@/common/config.js'

  	import TabBar from '../../components/TabBar/TabBar.vue';

  	import customHead from "@/components/xy-customhead/xy-customhead.vue";

  	// 引入mescroll-mixins.js

  	import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";

  	export default {

  		mixins: [MescrollMixin], // 使用mixin

  		components: {

  			TabBar,

  			customHead,

  		},

  		data() {

  			return {

  				BASE_URL,

  				headtitle: '铭钛招聘',

  				mescroll: null, // mescroll实例对象 (此行可删,mixins已默认)

  				// 下拉刷新的配置(可选, 绝大部分情况无需配置)

  				downOption: {},

  				// 上拉加载的配置(可选, 绝大部分情况无需配置)

33740e18   “wangming”   体验版给客户看了
64
65
66
  				upOption: {

  

  				},

c7add6cf   “wangming”   初始版本开发完毕
67
68
69
70
  				tbrecruitList: [],

  				query: {

  					currentPage: 1,

  					pageSize: 10,

33740e18   “wangming”   体验版给客户看了
71
72
73
  					keyword: "",

  					sidx: "lastModifyTime",

  					sort: "desc"

c7add6cf   “wangming”   初始版本开发完毕
74
75
76
77
78
79
80
81
82
83
84
85
  				}

  			};

  		},

  		onReady() {

  			uni.hideTabBar();

  

  		},

  		onLoad(e) {

  			this.query.keyword = e.keyword;

  			this.Gettbrecruit();

  		},

  		methods: {

33740e18   “wangming”   体验版给客户看了
86
87
88
89
90
91
92
93
  			orderSort() {

  				if (this.query.sort == "asc") {

  					this.query.sort = "desc";

  				} else {

  					this.query.sort = "asc";

  				}

  				this.Gettbrecruit();

  			},

c7add6cf   “wangming”   初始版本开发完毕
94
95
96
97
98
99
100
101
102
103
104
105
  			JobsDetails(id) {

  				uni.navigateTo({

  					url: '/pages/JobsDetails/JobsDetails?id=' + id

  				})

  			},

  			Searchtbrecruit() {

  				this.query.currentPage = 1;

  				this.query.pageSize = 10;

  				this.tbrecruitList = [];

  				this.Gettbrecruit();

  			},

  			Gettbrecruit() {

c7add6cf   “wangming”   初始版本开发完毕
106
  				this.API.Gettbrecruit(this.query).then(res => {

33740e18   “wangming”   体验版给客户看了
107
108
109
110
111
  					if (this.query.currentPage == 1) {

  						this.tbrecruitList = res.data.list;

  					} else {

  						this.tbrecruitList = this.tbrecruitList.concat(res.data.list);

  					}

c7add6cf   “wangming”   初始版本开发完毕
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
160
161
162
163
164
  				});

  			},

  			getDifferTime(startDate) {

  				startDate = this.formatDateTime(startDate);

  				let startTime = new Date(Date.parse(startDate.replace(/-/g, "/"))).getTime();

  				let endTime = new Date(Date.parse(this.getNowDate().replace(/-/g, "/"))).getTime();

  				let dates = Math.abs((startTime - endTime)) / (1000 * 60 * 60 * 24);

  				let DayNumber = Math.ceil(dates);

  				if (DayNumber <= 7) {

  					return DayNumber + "天内发布"

  				} else {

  					return DayNumber + "天前发布"

  				}

  			},

  			getNowDate() {

  				const timeOne = new Date()

  				const year = timeOne.getFullYear()

  				let month = timeOne.getMonth() + 1

  				let day = timeOne.getDate()

  				month = month < 10 ? '0' + month : month

  				day = day < 10 ? '0' + day : day

  				const NOW_MONTHS_AGO = `${year}-${month}-${day}`

  				return NOW_MONTHS_AGO

  			},

  			formatDateTime(value) { // 时间戳转换日期格式方法

  				if (value == null) {

  					return ''

  				} else {

  					const date = new Date(value)

  					const y = date.getFullYear() // 年

  					let MM = date.getMonth() + 1 // 月

  					MM = MM < 10 ? ('0' + MM) : MM

  					let d = date.getDate() // 日

  					d = d < 10 ? ('0' + d) : d

  					let h = date.getHours() // 时

  					h = h < 10 ? ('0' + h) : h

  					let m = date.getMinutes() // 分

  					m = m < 10 ? ('0' + m) : m

  					let s = date.getSeconds() // 秒

  					s = s < 10 ? ('0' + s) : s

  					return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s

  				}

  			},

  			/*下拉刷新的回调, 有三种处理方式:*/

  			downCallback() {

  				this.mescroll.endSuccess();

  				var that = this;

  				that.query.currentPage = 1;

  				that.query.pageSize = 10;

  				this.Gettbrecruit(that.query);

  			},

  			/*上拉加载的回调*/

  			upCallback(page) {

33740e18   “wangming”   体验版给客户看了
165
  				var that = this;

c7add6cf   “wangming”   初始版本开发完毕
166
167
  				setTimeout(() => {

  					this.mescroll.endByPage(10, 20);

33740e18   “wangming”   体验版给客户看了
168
169
  					that.query.currentPage = that.query.currentPage + 1;

  					this.Gettbrecruit(that.query);

c7add6cf   “wangming”   初始版本开发完毕
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
  				}, 2000)

  			},

  			/**

  			 * 文章点击

  			 */

  			onArticle(id) {

  				uni.navigateTo({

  					url: '/pages/ArticleDetails/ArticleDetails?id=' + id,

  				})

  			}

  		}

  	}

  </script>

  

  <style scoped lang="scss">

  	@import 'AllWork.scss';

  </style>