search.vue
4.62 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
171
172
173
174
175
176
177
178
<template>
<div class="qulification_search_container">
<NafmHeader navClass="nafmii-head-bg3" title="资质查询" />
<main class="qulification_content">
<section class="logo">
</section>
<h3 class="search_title">{{$t('qulification.title')}}</h3>
<section class="search_box">
<span class="select" @click="showSheet = true">
<van-icon name="search" />
<span class="qulification_type">{{qulificationType}}</span>
<van-icon name="play" />
</span>
<div class="visual_input" @click="toListSearch">
<span>{{placeholdTxt}}</span>
</div>
</section>
<section class="search_history">
<div class="history_header">
<span>{{$t('qulification.history')}}</span>
<span class="delete_circle">
<van-icon name="delete" />
</span>
</div>
<div>
<span class="history_item" v-for=" item in historyItems" :key="item.id" @click="toDetail">{{item.name}}</span>
</div>
</section>
</main>
<van-action-sheet v-model="showSheet" :actions="actions" :cancel-text="$t('button.cancel')" close-on-click-action @select="onSelect" />
</div>
</template>
<script>
export default {
name: 'QulificationSearch',
computed: {
actions() {
return [this.$t('qulification.searchAction').org, this.$t('qulification.searchAction').product ]
}
},
data() {
return {
// actions: [
// {name:'机构', type: 'org' },
// {name:'非法人产品', type: 'pro'}
// ],
qulificationType: '',
placeholdTxt: '',
showSheet: false,
historyItems: [{
name: 'jdnskjfnjkds',
id:11111
}, {
name: 'dksjnjkfdskjnkf',
id: 2222
}, {name: 'jdnskjfnjkds',
id:111112
}, {
name: 'dksjnjkfdskjnkf',
id: 22222
}]
}
},
created() {
this.defaultInput()
},
methods: {
defaultInput() {
this.qulificationType = this.$t('qulification.searchAction').org.name
this.placeholdTxt = this.$t('qulification.searchAction').org.placeholder
},
onSelect(item) {
this.show = false;
this.qulificationType = item.name;
this.placeholdTxt = this.$t('qulification.searchAction')[item.key].placeholder
},
toListSearch() {
this.$router.push({name: 'QulificationList'})
},
toDetail() {
this.$router.push({name: 'QulificationDetail'})
}
}
}
</script>
<style lang="less" scoped>
.qulification_search_container {
width: 384px;
margin: 0 auto;
.logo {
display: block;
width: 100px;
height: 100px;
margin: 15px auto;
background: url(../../assets/icon/logo.png) no-repeat;
background-size: contain;
}
.search_title {
font-size: 16px;
font-family: PingFangSC-Semibold;
color: #333333;
text-align: center;
}
.search_box {
width: 384px;
margin: 30px auto 25px;
border-radius: 16px;
background-color: rgba(246, 246, 246, 1);
display: flex;
font-size: 12px;
.select {
color: #999999;
display: flex;
align-items: center;
padding: 10px 10px 10px 5px;
.van-icon-search {
margin: 0 11px;
font-size: 12px;
}
.qulification_type {
color: #333333;
margin-right: 5px;
}
.van-icon-play {
transform: rotate(90deg);
-ms-transform: rotate(90deg); /* IE 9 */
-moz-transform: rotate(90deg); /* Firefox */
-webkit-transform: rotate(90deg); /* Safari 和 Chrome */
-o-transform: rotate(90deg);
}
}
.visual_input {
// width: 285px;
color: #999999;
padding: 10px 0;
overflow: hidden; /*超出部分隐藏*/
white-space: nowrap; /*不换行*/
text-overflow: ellipsis; /*超出部分文字以...显示*/
span {
padding-left: 15px;
border-left: 0.5px solid #999999;
}
}
}
.search_history {
.history_header {
line-height: 25px;
margin-bottom: 5px;
font-size: 14px;
display: flex;
justify-content: space-between;
align-items: center;
.delete_circle {
display: inline-block;
width: 25px;
height: 25px;
border-radius: 50%;
background-color: #f6f6f6;
text-align: center;
line-height: 25px;
// .van-icon-delete {
// align-self: middle;
// }
}
}
.history_item {
display: inline-block;
font-size: 12px;
color: #666666;
padding: 6px 20px;
border-radius: 50px;
background-color: #f6f6f6;
margin: 10px 10px 0 0;
}
}
}
</style>