eoss-mobiles 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +95 -0
- package/lib/button-group.js +2 -2
- package/lib/button.js +2 -2
- package/lib/calendar.js +2 -2
- package/lib/cell.js +2 -2
- package/lib/checkbox.js +2 -2
- package/lib/circle.js +2 -2
- package/lib/count-down.js +2 -2
- package/lib/empty.js +2 -2
- package/lib/eoss-mobile.common.js +534 -85
- package/lib/field.js +2 -2
- package/lib/flow-btn.js +2 -2
- package/lib/form.js +593 -144
- package/lib/grid-item.js +2 -2
- package/lib/grid.js +2 -2
- package/lib/index.js +1 -1
- package/lib/list.js +2 -2
- package/lib/loading.js +85 -85
- package/lib/nav-bar.js +2 -2
- package/lib/picker.js +12 -11
- package/lib/popover.js +2 -2
- package/lib/radio.js +8 -7
- package/lib/search.js +2 -2
- package/lib/selector.js +28 -28
- package/lib/switch.js +2 -2
- package/lib/tab.js +2 -2
- package/lib/table-column.js +3 -2
- package/lib/tabs.js +2 -2
- package/lib/tag.js +2 -2
- package/lib/theme-chalk/fonts/iconfont.scss +98 -98
- package/lib/theme-chalk/fonts/iconfont1.scss +90 -90
- package/lib/theme-chalk/form.css +1 -1
- package/lib/theme-chalk/index.css +1 -1
- package/lib/uploader.js +3 -2
- package/package.json +1 -1
- package/packages/action-sheet/index.js +5 -5
- package/packages/action-sheet/src/main.vue +32 -32
- package/packages/button/index.js +5 -5
- package/packages/button/src/main.vue +15 -15
- package/packages/button-group/index.js +5 -5
- package/packages/button-group/src/main.vue +80 -80
- package/packages/calendar/index.js +5 -5
- package/packages/calendar/src/main.vue +34 -34
- package/packages/cascader/index.js +5 -5
- package/packages/cascader/src/main.vue +39 -39
- package/packages/cell/index.js +5 -5
- package/packages/cell/src/main.vue +77 -77
- package/packages/checkbox/index.js +5 -5
- package/packages/checkbox/src/main.vue +232 -232
- package/packages/circle/index.js +5 -5
- package/packages/circle/src/main.vue +27 -27
- package/packages/count-down/index.js +5 -5
- package/packages/count-down/src/main.vue +27 -27
- package/packages/date/index.js +5 -5
- package/packages/date/src/date-time.vue +290 -290
- package/packages/date/src/main.vue +401 -401
- package/packages/empty/index.js +5 -5
- package/packages/empty/src/main.vue +16 -16
- package/packages/esign/index.js +5 -5
- package/packages/esign/src/main.vue +144 -144
- package/packages/field/index.js +5 -5
- package/packages/flow/index.js +5 -5
- package/packages/flow/src/components/Circulate.vue +595 -595
- package/packages/flow/src/components/Handle.vue +2404 -2404
- package/packages/flow/src/components/Message.vue +208 -208
- package/packages/flow/src/components/ProcessSettings.vue +342 -342
- package/packages/flow/src/components/supervise.vue +139 -139
- package/packages/flow/src/flowMix.js +288 -288
- package/packages/flow/src/main.vue +116 -116
- package/packages/flow-btn/index.js +5 -5
- package/packages/flow-btn/src/main.vue +494 -494
- package/packages/flow-list/index.js +5 -5
- package/packages/flow-list/src/main.vue +248 -248
- package/packages/form/index.js +5 -5
- package/packages/form/src/CustomCard.vue +201 -0
- package/packages/form/src/main.vue +32 -19
- package/packages/grid/index.js +5 -5
- package/packages/grid/src/main.vue +486 -486
- package/packages/grid-item/index.js +5 -5
- package/packages/grid-item/src/main.vue +16 -16
- package/packages/image/index.js +5 -5
- package/packages/image/src/main.vue +12 -12
- package/packages/image-preview/index.js +5 -5
- package/packages/list/index.js +5 -5
- package/packages/list/src/main.vue +32 -32
- package/packages/loading/index.js +5 -5
- package/packages/loading/src/main.vue +19 -19
- package/packages/nav-bar/index.js +5 -5
- package/packages/nav-bar/src/main.vue +24 -24
- package/packages/notice-bar/index.js +5 -5
- package/packages/notice-bar/src/main.vue +15 -15
- package/packages/pagination/index.js +5 -5
- package/packages/pagination/src/main.vue +73 -73
- package/packages/picker/index.js +5 -5
- package/packages/picker/src/main.vue +604 -604
- package/packages/popover/index.js +5 -5
- package/packages/popover/src/main.vue +32 -32
- package/packages/popup/index.js +5 -5
- package/packages/popup/src/main.vue +27 -27
- package/packages/pull-refresh/index.js +5 -5
- package/packages/pull-refresh/src/main.vue +31 -31
- package/packages/radio/index.js +5 -5
- package/packages/radio/src/main.vue +179 -179
- package/packages/rate/index.js +5 -5
- package/packages/rate/src/main.vue +26 -26
- package/packages/retrial-auth/index.js +5 -5
- package/packages/retrial-auth/src/main.vue +257 -257
- package/packages/search/index.js +5 -5
- package/packages/search/src/main.vue +39 -39
- package/packages/selector/index.js +5 -5
- package/packages/selector/src/main.vue +186 -186
- package/packages/selector/src/selector-tree.vue +1117 -1117
- package/packages/selector/src/tree.vue +405 -405
- package/packages/skeleton/index.js +5 -5
- package/packages/skeleton/src/main.vue +17 -17
- package/packages/stepper/index.js +5 -5
- package/packages/stepper/src/main.vue +25 -25
- package/packages/swipe/index.js +5 -5
- package/packages/swipe/src/main.vue +42 -42
- package/packages/switch/index.js +5 -5
- package/packages/switch/src/main.vue +38 -38
- package/packages/tab/index.js +5 -5
- package/packages/tab/src/main.vue +16 -16
- package/packages/table/index.js +5 -5
- package/packages/table/src/main.vue +1006 -1006
- package/packages/table-column/index.js +5 -5
- package/packages/table-column/src/main.vue +931 -931
- package/packages/table-column/src/mixins/table.js +12 -12
- package/packages/tabs/index.js +5 -5
- package/packages/tabs/src/main.vue +34 -34
- package/packages/tag/index.js +5 -5
- package/packages/tag/src/main.vue +16 -16
- package/packages/theme-chalk/lib/action-sheet.css +0 -0
- package/packages/theme-chalk/lib/base.css +1 -0
- package/packages/theme-chalk/lib/button-group.css +1 -0
- package/packages/theme-chalk/lib/button.css +1 -0
- package/packages/theme-chalk/lib/calendar.css +1 -0
- package/packages/theme-chalk/lib/cascader.css +1 -0
- package/packages/theme-chalk/lib/cell.css +1 -0
- package/packages/theme-chalk/lib/checkbox.css +1 -0
- package/packages/theme-chalk/lib/circle.css +1 -0
- package/packages/theme-chalk/lib/count-down.css +0 -0
- package/packages/theme-chalk/lib/date.css +0 -0
- package/packages/theme-chalk/lib/empty.css +0 -0
- package/packages/theme-chalk/lib/esign.css +1 -0
- package/packages/theme-chalk/lib/field.css +1 -0
- package/packages/theme-chalk/lib/flow-btn.css +1 -0
- package/packages/theme-chalk/lib/flow-list-task-read.css +1 -0
- package/packages/theme-chalk/lib/flow-list.css +1 -0
- package/packages/theme-chalk/lib/flow.css +1 -0
- package/packages/theme-chalk/lib/fonts/iconfont.scss +98 -0
- package/packages/theme-chalk/lib/fonts/iconfont.ttf +0 -0
- package/packages/theme-chalk/lib/fonts/iconfont.woff +0 -0
- package/packages/theme-chalk/lib/fonts/iconfont1.scss +90 -0
- package/packages/theme-chalk/lib/form.css +1 -0
- package/packages/theme-chalk/lib/grid-item.css +1 -0
- package/packages/theme-chalk/lib/grid.css +1 -0
- package/packages/theme-chalk/lib/icon.css +1 -0
- package/packages/theme-chalk/lib/image-preview.css +0 -0
- package/packages/theme-chalk/lib/image.css +0 -0
- package/packages/theme-chalk/lib/index.css +1 -0
- package/packages/theme-chalk/lib/list.css +0 -0
- package/packages/theme-chalk/lib/loading.css +0 -0
- package/packages/theme-chalk/lib/nav-bar.css +0 -0
- package/packages/theme-chalk/lib/navbar.css +1 -0
- package/packages/theme-chalk/lib/notice-bar.css +0 -0
- package/packages/theme-chalk/lib/pagination.css +1 -0
- package/packages/theme-chalk/lib/picker.css +1 -0
- package/packages/theme-chalk/lib/popover.css +0 -0
- package/packages/theme-chalk/lib/popup.css +0 -0
- package/packages/theme-chalk/lib/pull-refresh.css +0 -0
- package/packages/theme-chalk/lib/radio.css +1 -0
- package/packages/theme-chalk/lib/rate.css +0 -0
- package/packages/theme-chalk/lib/retrial-auth.css +1 -0
- package/packages/theme-chalk/lib/search.css +0 -0
- package/packages/theme-chalk/lib/selector.css +1 -0
- package/packages/theme-chalk/lib/skeleton.css +0 -0
- package/packages/theme-chalk/lib/stepper.css +1 -0
- package/packages/theme-chalk/lib/swipe.css +0 -0
- package/packages/theme-chalk/lib/switch.css +1 -0
- package/packages/theme-chalk/lib/tab.css +0 -0
- package/packages/theme-chalk/lib/table-column.css +0 -0
- package/packages/theme-chalk/lib/table.css +1 -0
- package/packages/theme-chalk/lib/tabs.css +1 -0
- package/packages/theme-chalk/lib/tag.css +1 -0
- package/packages/theme-chalk/lib/theme.css +0 -0
- package/packages/theme-chalk/lib/tree.css +1 -0
- package/packages/theme-chalk/lib/uploader.css +0 -0
- package/packages/theme-chalk/src/base.scss +195 -195
- package/packages/theme-chalk/src/button-group.scss +25 -25
- package/packages/theme-chalk/src/button.scss +2 -2
- package/packages/theme-chalk/src/calendar.scss +11 -11
- package/packages/theme-chalk/src/cascader.scss +11 -11
- package/packages/theme-chalk/src/cell.scss +14 -14
- package/packages/theme-chalk/src/checkbox.scss +9 -9
- package/packages/theme-chalk/src/circle.scss +6 -6
- package/packages/theme-chalk/src/common/var.scss +1525 -1525
- package/packages/theme-chalk/src/esign.scss +51 -51
- package/packages/theme-chalk/src/field.scss +98 -98
- package/packages/theme-chalk/src/flow-btn.scss +99 -99
- package/packages/theme-chalk/src/flow-list.scss +122 -122
- package/packages/theme-chalk/src/fonts/iconfont.scss +98 -98
- package/packages/theme-chalk/src/fonts/iconfont1.scss +90 -90
- package/packages/theme-chalk/src/form.scss +107 -33
- package/packages/theme-chalk/src/grid-item.scss +16 -16
- package/packages/theme-chalk/src/grid.scss +46 -46
- package/packages/theme-chalk/src/icon.scss +1661 -1661
- package/packages/theme-chalk/src/mixins/color.scss +117 -117
- package/packages/theme-chalk/src/navbar.scss +5 -5
- package/packages/theme-chalk/src/pagination.scss +12 -12
- package/packages/theme-chalk/src/picker.scss +31 -31
- package/packages/theme-chalk/src/radio.scss +6 -6
- package/packages/theme-chalk/src/retrial-auth.scss +28 -28
- package/packages/theme-chalk/src/selector.scss +247 -247
- package/packages/theme-chalk/src/stepper.scss +9 -9
- package/packages/theme-chalk/src/switch.scss +5 -5
- package/packages/theme-chalk/src/table.scss +86 -86
- package/packages/theme-chalk/src/tabs.scss +31 -31
- package/packages/theme-chalk/src/tag.scss +12 -12
- package/packages/theme-chalk/src/theme.scss +1 -1
- package/packages/theme-chalk/src/tree.scss +127 -127
- package/packages/uploader/index.js +5 -5
- package/src/config/api.js +190 -190
- package/src/index.js +1 -1
- package/src/utils/axios.js +217 -217
- package/src/utils/date-util.js +312 -312
- package/src/utils/http.js +106 -106
- package/src/utils/rules.js +18 -18
- package/src/utils/store.js +21 -21
- package/packages/theme-chalk/gulpfile.js +0 -25
|
@@ -1,257 +1,257 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="em-retrial-auth" v-if="show">
|
|
3
|
-
<div class="em-retrial-auth-box">
|
|
4
|
-
验证码将发送至{{
|
|
5
|
-
active == 'WEB_SMS' ? `手机号:${phoneText}` : `邮箱:${emailText}`
|
|
6
|
-
}}
|
|
7
|
-
<em-input
|
|
8
|
-
style="margin:10px 0px"
|
|
9
|
-
v-model="formData.verificationCode"
|
|
10
|
-
center
|
|
11
|
-
clearable
|
|
12
|
-
hide-label
|
|
13
|
-
placeholder="请输入验证码"
|
|
14
|
-
>
|
|
15
|
-
<template slot="button">
|
|
16
|
-
<em-button
|
|
17
|
-
size="small"
|
|
18
|
-
type="primary"
|
|
19
|
-
:disabled="disabled"
|
|
20
|
-
@click.stop="getCode"
|
|
21
|
-
>{{ btnText }}</em-button
|
|
22
|
-
>
|
|
23
|
-
</template>
|
|
24
|
-
</em-input>
|
|
25
|
-
<em-button style="width:100%" type="primary" @click="handleAuth"
|
|
26
|
-
>提交验证</em-button
|
|
27
|
-
>
|
|
28
|
-
<div class="em-retrial-auth-icon-box" v-if="newType.length > 1">
|
|
29
|
-
<div
|
|
30
|
-
class="em-retrial-auth-icon-box-item"
|
|
31
|
-
:class="{ active: active === item }"
|
|
32
|
-
v-for="item in newType"
|
|
33
|
-
:key="item"
|
|
34
|
-
@click="active = item"
|
|
35
|
-
>
|
|
36
|
-
<van-icon
|
|
37
|
-
:name="item === 'WEB_SMS' ? 'phone-o' : 'envelop-o'"
|
|
38
|
-
color="#fff"
|
|
39
|
-
/>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
</template>
|
|
45
|
-
|
|
46
|
-
<script>
|
|
47
|
-
import request from '../../../src/utils/http.js';
|
|
48
|
-
import utils from '../../../src/utils/util';
|
|
49
|
-
import {
|
|
50
|
-
initRetrialAuth,
|
|
51
|
-
getRetrialAuthCode,
|
|
52
|
-
codeRetrialAuth
|
|
53
|
-
} from '../../../src/config/api';
|
|
54
|
-
|
|
55
|
-
export default {
|
|
56
|
-
name: 'EmRetrialAuth',
|
|
57
|
-
props: {
|
|
58
|
-
reload: {
|
|
59
|
-
type: String,
|
|
60
|
-
default: ''
|
|
61
|
-
},
|
|
62
|
-
group: {
|
|
63
|
-
type: String,
|
|
64
|
-
default: ''
|
|
65
|
-
},
|
|
66
|
-
type: {
|
|
67
|
-
type: [String, Array],
|
|
68
|
-
default: () => []
|
|
69
|
-
},
|
|
70
|
-
url: {
|
|
71
|
-
type: String,
|
|
72
|
-
default: ''
|
|
73
|
-
},
|
|
74
|
-
params: {
|
|
75
|
-
type: Object,
|
|
76
|
-
default: () => {}
|
|
77
|
-
},
|
|
78
|
-
method: {
|
|
79
|
-
type: String,
|
|
80
|
-
default: 'get'
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
data() {
|
|
84
|
-
return {
|
|
85
|
-
active: 0,
|
|
86
|
-
newReload: '',
|
|
87
|
-
newData: '',
|
|
88
|
-
show: false,
|
|
89
|
-
newGroup: '',
|
|
90
|
-
newType: '',
|
|
91
|
-
emailText: '',
|
|
92
|
-
retrialAuthGroupId: utils.generateUUID(),
|
|
93
|
-
formData: {
|
|
94
|
-
verificationCode: ''
|
|
95
|
-
},
|
|
96
|
-
phoneText: '',
|
|
97
|
-
btnText: '获取验证码',
|
|
98
|
-
disabled: false,
|
|
99
|
-
countdown: 0,
|
|
100
|
-
submit: false,
|
|
101
|
-
uuid: null,
|
|
102
|
-
timer:null
|
|
103
|
-
};
|
|
104
|
-
},
|
|
105
|
-
mounted() {
|
|
106
|
-
if (this.url) {
|
|
107
|
-
this.reqUrl();
|
|
108
|
-
} else {
|
|
109
|
-
this.newGroup = this.group;
|
|
110
|
-
this.newReload = this.reload;
|
|
111
|
-
this.newType = this.type.filter(item => item != 'SCANCODE');
|
|
112
|
-
if (this.newType.length > 0) {
|
|
113
|
-
this.active = this.newType[0];
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
methods: {
|
|
118
|
-
handleAuth() {
|
|
119
|
-
if (this.submit) {
|
|
120
|
-
return false;
|
|
121
|
-
}
|
|
122
|
-
if (!this.formData.verificationCode) return this.$toast('请输入验证码');
|
|
123
|
-
this.submit = true;
|
|
124
|
-
let params = {
|
|
125
|
-
retrialAuthGroupIds: this.newGroup,
|
|
126
|
-
targetType: this.active === 'WEB_SMS' ? 'SMS' : 'EMAIL',
|
|
127
|
-
verificationCode: this.formData.verificationCode
|
|
128
|
-
};
|
|
129
|
-
this.$toast.loading({
|
|
130
|
-
message: '加载中...',
|
|
131
|
-
forbidClick: true,
|
|
132
|
-
loadingType: 'spinner',
|
|
133
|
-
overlay: true,
|
|
134
|
-
duration: 0
|
|
135
|
-
});
|
|
136
|
-
request({
|
|
137
|
-
url: codeRetrialAuth,
|
|
138
|
-
type: 'post',
|
|
139
|
-
params: params
|
|
140
|
-
})
|
|
141
|
-
.then(res => {
|
|
142
|
-
let { rCode, msg } = res;
|
|
143
|
-
this.$toast.clear();
|
|
144
|
-
if (rCode == 0) {
|
|
145
|
-
this.$toast('认证成功');
|
|
146
|
-
this.$emit('success',this.retrialAuthGroupId);
|
|
147
|
-
} else {
|
|
148
|
-
this.$toast(msg);
|
|
149
|
-
this.$emit('error');
|
|
150
|
-
this.submit = false;
|
|
151
|
-
}
|
|
152
|
-
})
|
|
153
|
-
.catch();
|
|
154
|
-
},
|
|
155
|
-
getCode() {
|
|
156
|
-
if (this.countdown) {
|
|
157
|
-
return false;
|
|
158
|
-
}
|
|
159
|
-
let params = { targetType: this.active === 'WEB_SMS' ? 'SMS' : 'EMAIL' };
|
|
160
|
-
this.countdown = 60;
|
|
161
|
-
this.timer = setInterval(() => {
|
|
162
|
-
if (this.countdown > 0) {
|
|
163
|
-
this.countdown--;
|
|
164
|
-
this.disabled = true;
|
|
165
|
-
this.btnText = '重新获取' + this.countdown + 's';
|
|
166
|
-
} else {
|
|
167
|
-
this.btnText = '重新获取';
|
|
168
|
-
this.disabled = false;
|
|
169
|
-
this.submit = false;
|
|
170
|
-
clearInterval(this.timer);
|
|
171
|
-
}
|
|
172
|
-
}, 1000);
|
|
173
|
-
this.$toast.loading({
|
|
174
|
-
message: '加载中...',
|
|
175
|
-
forbidClick: true,
|
|
176
|
-
loadingType: 'spinner',
|
|
177
|
-
overlay: true,
|
|
178
|
-
duration: 0
|
|
179
|
-
});
|
|
180
|
-
request({
|
|
181
|
-
url: getRetrialAuthCode,
|
|
182
|
-
type: 'post',
|
|
183
|
-
params: params
|
|
184
|
-
})
|
|
185
|
-
.then(res => {
|
|
186
|
-
let { rCode, msg } = res;
|
|
187
|
-
this.$toast.clear();
|
|
188
|
-
if (rCode == 0) {
|
|
189
|
-
this.$toast(
|
|
190
|
-
'验证码已发送至' +
|
|
191
|
-
(this.active === 'WEB_SMS' ? '手机' : '邮箱') +
|
|
192
|
-
',请注意查收!'
|
|
193
|
-
);
|
|
194
|
-
} else {
|
|
195
|
-
this.$toast(msg);
|
|
196
|
-
this.$emit('error');
|
|
197
|
-
}
|
|
198
|
-
})
|
|
199
|
-
.catch();
|
|
200
|
-
},
|
|
201
|
-
init() {
|
|
202
|
-
request({
|
|
203
|
-
url: initRetrialAuth
|
|
204
|
-
})
|
|
205
|
-
.then(res => {
|
|
206
|
-
let { rCode, results } = res;
|
|
207
|
-
this.$toast.clear();
|
|
208
|
-
if (rCode == 0) {
|
|
209
|
-
this.uuid = results.uuid;
|
|
210
|
-
// this.qrImg = results.qrImg;
|
|
211
|
-
this.emailText = results.emailText;
|
|
212
|
-
this.phoneText = results.phoneText;
|
|
213
|
-
// if (this.active === 'SCANCODE') {
|
|
214
|
-
// this.handleScanCodeRetrialAuth();
|
|
215
|
-
// }
|
|
216
|
-
}
|
|
217
|
-
})
|
|
218
|
-
.catch();
|
|
219
|
-
},
|
|
220
|
-
reqUrl() {
|
|
221
|
-
this.$toast.loading({
|
|
222
|
-
message: '加载中...',
|
|
223
|
-
forbidClick: true,
|
|
224
|
-
loadingType: 'spinner',
|
|
225
|
-
overlay: true,
|
|
226
|
-
duration: 0
|
|
227
|
-
});
|
|
228
|
-
request({
|
|
229
|
-
url: this.url,
|
|
230
|
-
params: { ...this.params, retrialAuthGroupId: this.retrialAuthGroupId },
|
|
231
|
-
type: this.method
|
|
232
|
-
}).then(res => {
|
|
233
|
-
const { rCode, results, msg } = res;
|
|
234
|
-
if (rCode == 61) {
|
|
235
|
-
if (results) {
|
|
236
|
-
this.newReload = results.reload || results.refresh;
|
|
237
|
-
this.newGroup = results.retrialAuthGroupIds;
|
|
238
|
-
this.newType = results.retrialAuthType.filter(
|
|
239
|
-
item => item != 'SCANCODE'
|
|
240
|
-
);
|
|
241
|
-
this.init();
|
|
242
|
-
if (this.newType.length > 0) {
|
|
243
|
-
this.active = this.newType[0];
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
this.show = true;
|
|
247
|
-
} else {
|
|
248
|
-
this.$toast(msg);
|
|
249
|
-
this.$emit('error');
|
|
250
|
-
}
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
};
|
|
255
|
-
</script>
|
|
256
|
-
|
|
257
|
-
<style></style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="em-retrial-auth" v-if="show">
|
|
3
|
+
<div class="em-retrial-auth-box">
|
|
4
|
+
验证码将发送至{{
|
|
5
|
+
active == 'WEB_SMS' ? `手机号:${phoneText}` : `邮箱:${emailText}`
|
|
6
|
+
}}
|
|
7
|
+
<em-input
|
|
8
|
+
style="margin:10px 0px"
|
|
9
|
+
v-model="formData.verificationCode"
|
|
10
|
+
center
|
|
11
|
+
clearable
|
|
12
|
+
hide-label
|
|
13
|
+
placeholder="请输入验证码"
|
|
14
|
+
>
|
|
15
|
+
<template slot="button">
|
|
16
|
+
<em-button
|
|
17
|
+
size="small"
|
|
18
|
+
type="primary"
|
|
19
|
+
:disabled="disabled"
|
|
20
|
+
@click.stop="getCode"
|
|
21
|
+
>{{ btnText }}</em-button
|
|
22
|
+
>
|
|
23
|
+
</template>
|
|
24
|
+
</em-input>
|
|
25
|
+
<em-button style="width:100%" type="primary" @click="handleAuth"
|
|
26
|
+
>提交验证</em-button
|
|
27
|
+
>
|
|
28
|
+
<div class="em-retrial-auth-icon-box" v-if="newType.length > 1">
|
|
29
|
+
<div
|
|
30
|
+
class="em-retrial-auth-icon-box-item"
|
|
31
|
+
:class="{ active: active === item }"
|
|
32
|
+
v-for="item in newType"
|
|
33
|
+
:key="item"
|
|
34
|
+
@click="active = item"
|
|
35
|
+
>
|
|
36
|
+
<van-icon
|
|
37
|
+
:name="item === 'WEB_SMS' ? 'phone-o' : 'envelop-o'"
|
|
38
|
+
color="#fff"
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<script>
|
|
47
|
+
import request from '../../../src/utils/http.js';
|
|
48
|
+
import utils from '../../../src/utils/util';
|
|
49
|
+
import {
|
|
50
|
+
initRetrialAuth,
|
|
51
|
+
getRetrialAuthCode,
|
|
52
|
+
codeRetrialAuth
|
|
53
|
+
} from '../../../src/config/api';
|
|
54
|
+
|
|
55
|
+
export default {
|
|
56
|
+
name: 'EmRetrialAuth',
|
|
57
|
+
props: {
|
|
58
|
+
reload: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: ''
|
|
61
|
+
},
|
|
62
|
+
group: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: ''
|
|
65
|
+
},
|
|
66
|
+
type: {
|
|
67
|
+
type: [String, Array],
|
|
68
|
+
default: () => []
|
|
69
|
+
},
|
|
70
|
+
url: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: ''
|
|
73
|
+
},
|
|
74
|
+
params: {
|
|
75
|
+
type: Object,
|
|
76
|
+
default: () => {}
|
|
77
|
+
},
|
|
78
|
+
method: {
|
|
79
|
+
type: String,
|
|
80
|
+
default: 'get'
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
data() {
|
|
84
|
+
return {
|
|
85
|
+
active: 0,
|
|
86
|
+
newReload: '',
|
|
87
|
+
newData: '',
|
|
88
|
+
show: false,
|
|
89
|
+
newGroup: '',
|
|
90
|
+
newType: '',
|
|
91
|
+
emailText: '',
|
|
92
|
+
retrialAuthGroupId: utils.generateUUID(),
|
|
93
|
+
formData: {
|
|
94
|
+
verificationCode: ''
|
|
95
|
+
},
|
|
96
|
+
phoneText: '',
|
|
97
|
+
btnText: '获取验证码',
|
|
98
|
+
disabled: false,
|
|
99
|
+
countdown: 0,
|
|
100
|
+
submit: false,
|
|
101
|
+
uuid: null,
|
|
102
|
+
timer:null
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
mounted() {
|
|
106
|
+
if (this.url) {
|
|
107
|
+
this.reqUrl();
|
|
108
|
+
} else {
|
|
109
|
+
this.newGroup = this.group;
|
|
110
|
+
this.newReload = this.reload;
|
|
111
|
+
this.newType = this.type.filter(item => item != 'SCANCODE');
|
|
112
|
+
if (this.newType.length > 0) {
|
|
113
|
+
this.active = this.newType[0];
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
methods: {
|
|
118
|
+
handleAuth() {
|
|
119
|
+
if (this.submit) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
if (!this.formData.verificationCode) return this.$toast('请输入验证码');
|
|
123
|
+
this.submit = true;
|
|
124
|
+
let params = {
|
|
125
|
+
retrialAuthGroupIds: this.newGroup,
|
|
126
|
+
targetType: this.active === 'WEB_SMS' ? 'SMS' : 'EMAIL',
|
|
127
|
+
verificationCode: this.formData.verificationCode
|
|
128
|
+
};
|
|
129
|
+
this.$toast.loading({
|
|
130
|
+
message: '加载中...',
|
|
131
|
+
forbidClick: true,
|
|
132
|
+
loadingType: 'spinner',
|
|
133
|
+
overlay: true,
|
|
134
|
+
duration: 0
|
|
135
|
+
});
|
|
136
|
+
request({
|
|
137
|
+
url: codeRetrialAuth,
|
|
138
|
+
type: 'post',
|
|
139
|
+
params: params
|
|
140
|
+
})
|
|
141
|
+
.then(res => {
|
|
142
|
+
let { rCode, msg } = res;
|
|
143
|
+
this.$toast.clear();
|
|
144
|
+
if (rCode == 0) {
|
|
145
|
+
this.$toast('认证成功');
|
|
146
|
+
this.$emit('success',this.retrialAuthGroupId);
|
|
147
|
+
} else {
|
|
148
|
+
this.$toast(msg);
|
|
149
|
+
this.$emit('error');
|
|
150
|
+
this.submit = false;
|
|
151
|
+
}
|
|
152
|
+
})
|
|
153
|
+
.catch();
|
|
154
|
+
},
|
|
155
|
+
getCode() {
|
|
156
|
+
if (this.countdown) {
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
let params = { targetType: this.active === 'WEB_SMS' ? 'SMS' : 'EMAIL' };
|
|
160
|
+
this.countdown = 60;
|
|
161
|
+
this.timer = setInterval(() => {
|
|
162
|
+
if (this.countdown > 0) {
|
|
163
|
+
this.countdown--;
|
|
164
|
+
this.disabled = true;
|
|
165
|
+
this.btnText = '重新获取' + this.countdown + 's';
|
|
166
|
+
} else {
|
|
167
|
+
this.btnText = '重新获取';
|
|
168
|
+
this.disabled = false;
|
|
169
|
+
this.submit = false;
|
|
170
|
+
clearInterval(this.timer);
|
|
171
|
+
}
|
|
172
|
+
}, 1000);
|
|
173
|
+
this.$toast.loading({
|
|
174
|
+
message: '加载中...',
|
|
175
|
+
forbidClick: true,
|
|
176
|
+
loadingType: 'spinner',
|
|
177
|
+
overlay: true,
|
|
178
|
+
duration: 0
|
|
179
|
+
});
|
|
180
|
+
request({
|
|
181
|
+
url: getRetrialAuthCode,
|
|
182
|
+
type: 'post',
|
|
183
|
+
params: params
|
|
184
|
+
})
|
|
185
|
+
.then(res => {
|
|
186
|
+
let { rCode, msg } = res;
|
|
187
|
+
this.$toast.clear();
|
|
188
|
+
if (rCode == 0) {
|
|
189
|
+
this.$toast(
|
|
190
|
+
'验证码已发送至' +
|
|
191
|
+
(this.active === 'WEB_SMS' ? '手机' : '邮箱') +
|
|
192
|
+
',请注意查收!'
|
|
193
|
+
);
|
|
194
|
+
} else {
|
|
195
|
+
this.$toast(msg);
|
|
196
|
+
this.$emit('error');
|
|
197
|
+
}
|
|
198
|
+
})
|
|
199
|
+
.catch();
|
|
200
|
+
},
|
|
201
|
+
init() {
|
|
202
|
+
request({
|
|
203
|
+
url: initRetrialAuth
|
|
204
|
+
})
|
|
205
|
+
.then(res => {
|
|
206
|
+
let { rCode, results } = res;
|
|
207
|
+
this.$toast.clear();
|
|
208
|
+
if (rCode == 0) {
|
|
209
|
+
this.uuid = results.uuid;
|
|
210
|
+
// this.qrImg = results.qrImg;
|
|
211
|
+
this.emailText = results.emailText;
|
|
212
|
+
this.phoneText = results.phoneText;
|
|
213
|
+
// if (this.active === 'SCANCODE') {
|
|
214
|
+
// this.handleScanCodeRetrialAuth();
|
|
215
|
+
// }
|
|
216
|
+
}
|
|
217
|
+
})
|
|
218
|
+
.catch();
|
|
219
|
+
},
|
|
220
|
+
reqUrl() {
|
|
221
|
+
this.$toast.loading({
|
|
222
|
+
message: '加载中...',
|
|
223
|
+
forbidClick: true,
|
|
224
|
+
loadingType: 'spinner',
|
|
225
|
+
overlay: true,
|
|
226
|
+
duration: 0
|
|
227
|
+
});
|
|
228
|
+
request({
|
|
229
|
+
url: this.url,
|
|
230
|
+
params: { ...this.params, retrialAuthGroupId: this.retrialAuthGroupId },
|
|
231
|
+
type: this.method
|
|
232
|
+
}).then(res => {
|
|
233
|
+
const { rCode, results, msg } = res;
|
|
234
|
+
if (rCode == 61) {
|
|
235
|
+
if (results) {
|
|
236
|
+
this.newReload = results.reload || results.refresh;
|
|
237
|
+
this.newGroup = results.retrialAuthGroupIds;
|
|
238
|
+
this.newType = results.retrialAuthType.filter(
|
|
239
|
+
item => item != 'SCANCODE'
|
|
240
|
+
);
|
|
241
|
+
this.init();
|
|
242
|
+
if (this.newType.length > 0) {
|
|
243
|
+
this.active = this.newType[0];
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
this.show = true;
|
|
247
|
+
} else {
|
|
248
|
+
this.$toast(msg);
|
|
249
|
+
this.$emit('error');
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
</script>
|
|
256
|
+
|
|
257
|
+
<style></style>
|
package/packages/search/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import EmSearch from './src/main';
|
|
2
|
-
|
|
3
|
-
EmSearch.install = Vue => Vue.component(EmSearch.name, EmSearch);
|
|
4
|
-
|
|
5
|
-
export default EmSearch;
|
|
1
|
+
import EmSearch from './src/main';
|
|
2
|
+
|
|
3
|
+
EmSearch.install = Vue => Vue.component(EmSearch.name, EmSearch);
|
|
4
|
+
|
|
5
|
+
export default EmSearch;
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<van-search
|
|
3
|
-
v-model="newValue"
|
|
4
|
-
v-bind="$attrs"
|
|
5
|
-
v-on="$listeners"
|
|
6
|
-
:clearable="clearable"
|
|
7
|
-
>
|
|
8
|
-
<template v-for="(index, name) of $slots" :slot="name">
|
|
9
|
-
<slot :name="name" />
|
|
10
|
-
</template>
|
|
11
|
-
</van-search>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script>
|
|
15
|
-
export default {
|
|
16
|
-
name: 'EmSearch',
|
|
17
|
-
inheritAttrs: false,
|
|
18
|
-
props: {
|
|
19
|
-
value: {
|
|
20
|
-
type: String
|
|
21
|
-
},
|
|
22
|
-
clearable: {
|
|
23
|
-
type: Boolean,
|
|
24
|
-
default: false
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
computed: {
|
|
28
|
-
newValue: {
|
|
29
|
-
get() {
|
|
30
|
-
return this.value;
|
|
31
|
-
},
|
|
32
|
-
set(val) {
|
|
33
|
-
this.$emit('input', val);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
methods: {}
|
|
38
|
-
};
|
|
39
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<van-search
|
|
3
|
+
v-model="newValue"
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
v-on="$listeners"
|
|
6
|
+
:clearable="clearable"
|
|
7
|
+
>
|
|
8
|
+
<template v-for="(index, name) of $slots" :slot="name">
|
|
9
|
+
<slot :name="name" />
|
|
10
|
+
</template>
|
|
11
|
+
</van-search>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
export default {
|
|
16
|
+
name: 'EmSearch',
|
|
17
|
+
inheritAttrs: false,
|
|
18
|
+
props: {
|
|
19
|
+
value: {
|
|
20
|
+
type: String
|
|
21
|
+
},
|
|
22
|
+
clearable: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
computed: {
|
|
28
|
+
newValue: {
|
|
29
|
+
get() {
|
|
30
|
+
return this.value;
|
|
31
|
+
},
|
|
32
|
+
set(val) {
|
|
33
|
+
this.$emit('input', val);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
methods: {}
|
|
38
|
+
};
|
|
39
|
+
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import EmSelector from './src/main';
|
|
2
|
-
|
|
3
|
-
EmSelector.install = Vue => Vue.component(EmSelector.name, EmSelector);
|
|
4
|
-
|
|
5
|
-
export default EmSelector;
|
|
1
|
+
import EmSelector from './src/main';
|
|
2
|
+
|
|
3
|
+
EmSelector.install = Vue => Vue.component(EmSelector.name, EmSelector);
|
|
4
|
+
|
|
5
|
+
export default EmSelector;
|