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
<template>
<view class="back_view">
<view class="item_view margin_top_30">
<text class="item_title">选择工龄</text>
</view>
<view
class="item_view"
v-for="(item,ikey) in ageList":key="ikey"
@click="itemClick(item,ikey)">
<text :class="selected_index == ikey ? 'item_title select_color' : 'item_title default_color' ">{{item.title}}</text>
</view>
<view class="bottom_view">
<view class="bottom_btn" @click="confirmClick()">
<text class="bottom_title">确定</text>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
ageList:[],
selected_index:999,
selected_age:'',
}
},
onLoad(e) {
getApp().trackPage('入驻工龄选择页')
this.getAgeData()
},
methods: {
getAgeData: function () {
this.ageList = [
{'title':'1年'},
{'title':'2年'},
{'title':'3年'},
{'title':'4年'},
{'title':'5年'},
]
},
itemClick: function (item, ikey) {
this.selected_age = item.title
this.selected_index = ikey
},
confirmClick: function () {
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2]; //上一个页面
prevPage.$vm.age = this.selected_age;
uni.navigateBack({
})
}
}
}
</script>
<style>
.back_view{
background-color: #F3F3F3;
position: absolute;
top: 0;
left: 0;
width: 100%;
display: flex;
flex-direction: column;
}
.item_view{
background-color: #FFFFFF;
width: 100%;
height: 88rpx;
display: flex;
align-items: center;
justify-content: center;
border: 2rpx solid #F3F3F3;
}
.item_title{
font-size: 30rpx;
}
.default_color{
color: #333333;
}
.select_color{
color: #2272FF;
}
.margin_top_30{
margin-top: 30rpx;
}
.bottom_view{
width: 100%;
height: 170rpx;
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 0;
}
.bottom_btn{
background-color: #2272FF;
width: 600rpx;
height: 100rpx;
display: flex;
align-items: center;
justify-content: center;
border: 2rpx solid #999999;
}
.bottom_title{
font-size: 32rpx;
color: #FFFFFF;
}
</style>