searchUser.vue
4.18 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>
<v-layout id="SearchUser" column justify-center align-center>
<v-flex>
<v-card id="InfoBlock" flat class="infoList">
<v-list>
<v-list-tile>
<v-list-tile-content>
<v-list-tile-title >姓名</v-list-tile-title>
</v-list-tile-content>
<v-list-tile-action>
<input type="text" placeholder="请输入查询对象姓名" v-model="form.name">
</v-list-tile-action>
</v-list-tile>
<v-divider></v-divider>
<v-list-tile >
<v-list-tile-content>
<v-list-tile-title >手机号码</v-list-tile-title>
</v-list-tile-content>
<v-list-tile-action>
<input type="text" placeholder="请输入查询对象手机号" v-model="form.number">
</v-list-tile-action>
</v-list-tile>
</v-list>
</v-card>
<div class="ConfirmButtonBlock">
<v-btn depressed id="ConfirmButton" :disabled="disabled" :loading="isLoading" @click="submit">查询信用记录</v-btn>
<div id="FuckIphoneX"></div>
</div>
</v-flex>
<v-dialog v-model="dialogDisplay" persistent max-width="290">
<v-card class="hintDialog">
<v-card-title class="headline">提示</v-card-title>
<v-card-text class='dialogContent'>未找到符合的用户</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="black" flat @click.native="dialogDisplay = false">知道了</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-layout>
</template>
<script>
import {wechatShareSetting} from '@/helper'
export default {
layout: 'lightColor',
data:() => ({
form: {
name: '',
number: ''
},
isLoading: false,
dialogDisplay: false,
dialogInfo: ''
}),
head:() => ({
title: '信用查询'
}),
computed: {
disabled() {
return !(this.form.name && this.form.number)
}
},
mounted() {
wechatShareSetting(this.$axios, this.$store)
},
methods: {
async submit() {
if (this.disabled) return
this.isLoading = true
const {data} = await this.$axios.get(`/user/find?name=${this.form.name}&mobile=${this.form.number}`)
if (data.success) {
if (data.notFound) {
this.isLoading = false
this.dialogDisplay = true
} else {
this.$router.push(`/userRecord?id=${data.id}`)
}
} else {
this.isLoading = false
this.$store.dispatch('displayMessage', data.msg)
}
}
}
}
</script>
<style lang="scss" scoped>
#SearchUser {
.infoList {
width: 100vw;
background: #FFFFFF;
padding: 0;
.list {
padding: 0;
}
input {
outline: none;
text-align: right;
}
.subheader {
height: 2rem;
line-height: 2rem;
display: block;
background-image: linear-gradient(-229deg, #DAB269 37%, #E7C78C 87%);
}
}
.ConfirmButtonBlock {
width: 100vw;
margin: 1rem auto;
position: absolute;
bottom: 0;
text-align: center;
#ConfirmButton {
color: #484646;
width: 90vw;
background-image: linear-gradient(-213deg, #DAB269 0%, #E7C78C 92%);
border-radius: 2px;
height: 2.8rem;
font-size: 18px;
margin: auto;
transition: 0.2s all ease-in-out;
&:disabled {
background-image: none;
}
}
}
}
.hintDialog {
background-color: #fff;
color: #000;
.headline {
justify-content: center;
font-weight: bold;
padding-bottom: 0;
}
.dialogContent {
justify-content: center;
text-align: center;
.warningIcon {
margin-bottom: 0.5rem;
color: red;
font-size: 5rem;
}
.bold {
font-weight: bold;
}
p {
margin-bottom: 0;
}
}
.btn {
width: 100%;
}
#FuckIphoneX {
position: fixed;
bottom: 0;
width: 100%;
height: constant(safe-area-inset-bottom);
height: env(safe-area-inset-bottom);
background-color:transparent;
}
}
</style>