index.vue
3.93 KB
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
160
161
162
163
164
165
166
167
168
169
170
<template>
<div class='container'>
<!--列表-->
<navigator v-for='(v,i) in lists' :key='i' :url="'../leaveInfo/main?sysNewsId=0&id='+v.id">
<div class="list">
<div class="title">
<span class="reason">请假事由:{{v.cause}}</span>
<span class="status ongoing" v-if="v.status ==0">律所审核中</span>
<span class="status ongoing" v-if="v.status ==1">司法审核中</span>
<span class="status finish" v-if="v.status ==2 || v.status ==3">已审批</span>
</div>
<p>开始时间:{{v.start_Date}}</p>
<p>结束时间:{{v.end_Date}}</p>
</div>
</navigator>
<!--列表-->
<!--请假申请-->
<navigator url='../leave/main'>
<div class="leave">
<img src='/static/imgs/leave.png'>
<span>我要请假</span>
</div>
</navigator>
<!--请假申请-->
</div>
</template>
<script>
export default {
data() {
return {
lists: [],
pageNum: 1,
pageSize: 15,
isLastPage: false,
hasNextPage: false,
Refresh: false,
loaded: false
}
},
methods: {
getList(){
wx.showLoading({ title: '正在加载' })
wx.request({
url: this.rootUrl + 'leave/getLatestLeave',
method: 'get',
header: {'content-type': 'application/x-www-form-urlencoded'},
data:{
pageNum: this.pageNum,
pageSize: this.pageSize,
sessionID: wx.getStorageSync('sessionID')
},
success: res=> {
if(res.statusCode=='500'){
this.service.getUnionId(this.rootAvatar,this.rootUrl).then(res=>{
console.log(res)
this.loadArticles()
})
}else{
this.hasNextPage = res.data.hasNextPage
this.isLastPage = res.data.isLastPage
this.setLawyerData(res.data.list)
}
},
fail: res=> {
console.log(res)
}
})
},
setLawyerData(arr){
if(this.hasNextPage){
// console.log('++++')
const lists = [...this.lists,...arr]
this.lists = []
this.lists = lists
}else{
// console.log('=====')
if(this.pageNum === 1){
this.lists = arr
}else {
const lists = [...this.lists,...arr]
this.lists = []
this.lists = lists
// this.pageNum = 1
}
}
console.log(this.pageNum)
this.loaded = true
wx.hideLoading()
}
},
onLoad(){
// this.getList()
},
onReachBottom() {
if(this.hasNextPage){
this.pageNum = ++this.pageNum
this.getList()
}
},
onShow() {
this.lists = []
this.pageNum = 1
this.getList()
},
onUnload(){
this.lists = []
this.pageNum = 1
this.all_data_loaded = false
this.loaded = false
}
}
</script>
<style lang="stylus" scoped>
.container
position absolute
Background()
width 100%
min-height 100%
box-sizing border-box
padding-bottom 86rpx
.list
margin 20rpx
width calc(100% - 40rpx)
box-sizing border-box
padding 20rpx
border-radius 12rpx
background-color #fff
position relative
.title
margin-bottom 15rpx
.reason
color #333
white-space nowrap
overflow hidden
text-overflow ellipsis
.list p
margin-top 10rpx
font-size 28rpx
color #666
.status
float right
display inline-block
padding 5rpx 10rpx
border-radius 6rpx
color #fff
font-size 26rpx
.ongoing
background-color #f6b35a
.finish
background-color #00D49D
.leave
z-index 100
position fixed
left 0
bottom 0
width 100%
padding 25rpx 0
background-color #fff
color #1d7bef
border-top 1rpx solid #dedede
display flex
justify-content center
align-items center
.leave img
margin-right 15rpx
width 36rpx
height 36rpx
</style>