|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+<template>
|
|
|
2
|
+ <view>
|
|
|
3
|
+ <view class="loginway">
|
|
|
4
|
+ <div class="navigation"></div>
|
|
|
5
|
+ <image class="loginimg" mode="widthFix" src="/static/login/logo_word.png"></image>
|
|
|
6
|
+ <view class="input_wrap">
|
|
|
7
|
+ <u--form labelPosition="left" :model="form" :rules="rules" ref="uForm">
|
|
|
8
|
+ <u-form-item label="" prop="username" class="inputFormWrap">
|
|
|
9
|
+ <u--input shape="circle" clearable prefixIcon="/static/login/icon-account.png"
|
|
|
10
|
+ :prefixIconStyle="prefixIconStyle" v-model="form.username" placeholder="请输入账号"></u--input>
|
|
|
11
|
+ </u-form-item>
|
|
|
12
|
+ <u-form-item label="" prop="password" class="inputFormWrap">
|
|
|
13
|
+ <u--input shape="circle" clearable password prefixIcon="/static/login/icon-password.png"
|
|
|
14
|
+ :prefixIconStyle="prefixIconStyle" v-model="form.password" placeholder="请输入密码"></u--input>
|
|
|
15
|
+ </u-form-item>
|
|
|
16
|
+ <u-form-item label="" prop="" class="inputFormWrap">
|
|
|
17
|
+ <u-checkbox-group v-model="checkboxs" placement="column" @change="changeRemember">
|
|
|
18
|
+ <u-checkbox :label="'记住密码'" :name="'remember'"></u-checkbox>
|
|
|
19
|
+ </u-checkbox-group>
|
|
|
20
|
+ </u-form-item>
|
|
|
21
|
+ <u-form-item>
|
|
|
22
|
+ <u-button type="primary" text="登录" shape="circle" @click="handleLogin"></u-button>
|
|
|
23
|
+ </u-form-item>
|
|
|
24
|
+ <!-- <u-form-item>
|
|
|
25
|
+ <view class="network_configuration_box">
|
|
|
26
|
+ <view class="netWrokSet" @click="handleToConfiguration">
|
|
|
27
|
+ <image src="/static/login/network.png" mode=""></image>
|
|
|
28
|
+ <text class="text">呼叫中心配置</text>
|
|
|
29
|
+ </view>
|
|
|
30
|
+ </view>
|
|
|
31
|
+ </u-form-item> -->
|
|
|
32
|
+ </u--form>
|
|
|
33
|
+ </view>
|
|
|
34
|
+ </view>
|
|
|
35
|
+ </view>
|
|
|
36
|
+</template>
|
|
|
37
|
+
|
|
|
38
|
+<script>
|
|
|
39
|
+ export default {
|
|
|
40
|
+ data() {
|
|
|
41
|
+ return {
|
|
|
42
|
+ firstLoginState : "",
|
|
|
43
|
+ // systemList,
|
|
|
44
|
+ prefixIconStyle: {
|
|
|
45
|
+ width: "16px",
|
|
|
46
|
+ height: "16px",
|
|
|
47
|
+ marginRight: "4px",
|
|
|
48
|
+ marginLeft: "10px"
|
|
|
49
|
+ },
|
|
|
50
|
+ form: {
|
|
|
51
|
+ // password: "Huilong@#$999",
|
|
|
52
|
+ password: "",
|
|
|
53
|
+ systemCode: "system_crm",
|
|
|
54
|
+ username: "",
|
|
|
55
|
+ clientFlag: "2",
|
|
|
56
|
+ // username: "huihui",
|
|
|
57
|
+ code: "996007qa.code",
|
|
|
58
|
+ uuid: "123"
|
|
|
59
|
+ },
|
|
|
60
|
+ checkboxs: [],
|
|
|
61
|
+ rules: {
|
|
|
62
|
+ username: {
|
|
|
63
|
+ type: 'string',
|
|
|
64
|
+ required: true,
|
|
|
65
|
+ message: '请输入账号',
|
|
|
66
|
+ trigger: []
|
|
|
67
|
+ },
|
|
|
68
|
+ password: {
|
|
|
69
|
+ type: 'string',
|
|
|
70
|
+ required: true,
|
|
|
71
|
+ message: '请输入密码',
|
|
|
72
|
+ trigger: []
|
|
|
73
|
+ }
|
|
|
74
|
+ },
|
|
|
75
|
+ // mac: getMacAddress(),
|
|
|
76
|
+ };
|
|
|
77
|
+ },
|
|
|
78
|
+ computed: {
|
|
|
79
|
+ systemList() {
|
|
|
80
|
+ return this.$store.state.user.systemList;
|
|
|
81
|
+ },
|
|
|
82
|
+ remember: {
|
|
|
83
|
+ get() {
|
|
|
84
|
+ return this.checkboxs.length > 0
|
|
|
85
|
+ },
|
|
|
86
|
+ set(value) {
|
|
|
87
|
+ this.checkboxs = value ? ['remember'] : [];
|
|
|
88
|
+ }
|
|
|
89
|
+ }
|
|
|
90
|
+ },
|
|
|
91
|
+ mounted() {
|
|
|
92
|
+ // 触发水印隐藏
|
|
|
93
|
+ this.systemChange(this.form.systemCode);
|
|
|
94
|
+ this.getUserByCache();
|
|
|
95
|
+ },
|
|
|
96
|
+ onLoad(option){
|
|
|
97
|
+ const { shiYuWxLogin } = option;
|
|
|
98
|
+ this.firstLoginState = shiYuWxLogin;
|
|
|
99
|
+ },
|
|
|
100
|
+ methods: {
|
|
|
101
|
+ changeRemember(value){
|
|
|
102
|
+ if (value.length > 0) {
|
|
|
103
|
+ uni.setStorageSync('username', this.form.username);
|
|
|
104
|
+ uni.setStorageSync('password', this.form.password);
|
|
|
105
|
+ } else {
|
|
|
106
|
+ uni.removeStorageSync('username');
|
|
|
107
|
+ uni.removeStorageSync('password');
|
|
|
108
|
+ }
|
|
|
109
|
+ },
|
|
|
110
|
+ getUserByCache() {
|
|
|
111
|
+ const savedUsername = uni.getStorageSync('username');
|
|
|
112
|
+ const savedPassword = uni.getStorageSync('password');
|
|
|
113
|
+
|
|
|
114
|
+ if (savedUsername && savedPassword) {
|
|
|
115
|
+ this.form.username = savedUsername;
|
|
|
116
|
+ this.form.password = savedPassword;
|
|
|
117
|
+ this.remember = true;
|
|
|
118
|
+ }
|
|
|
119
|
+ },
|
|
|
120
|
+ handleToConfiguration() {
|
|
|
121
|
+ uni.navigateTo({
|
|
|
122
|
+ url: "/pages/configuration/index"
|
|
|
123
|
+ })
|
|
|
124
|
+ },
|
|
|
125
|
+ systemChange(e) {
|
|
|
126
|
+ if (!e) return;
|
|
|
127
|
+ uni.$u.api.getAppSystemList().then((res) => {
|
|
|
128
|
+ const systemCodeList = res.data;
|
|
|
129
|
+ this.$store.dispatch("user/setSystemlist", systemCodeList);
|
|
|
130
|
+ const system = this.systemList.find(v => v.value === e);
|
|
|
131
|
+ this.$store.commit("user/SET_SYSTEM", system);
|
|
|
132
|
+ }).catch((e) => {
|
|
|
133
|
+ uni.$u.toast("服务网络不通");
|
|
|
134
|
+ })
|
|
|
135
|
+ },
|
|
|
136
|
+ handleLogin() {
|
|
|
137
|
+ this.$refs.uForm.validate().then(() => {
|
|
|
138
|
+ if (this.remember) {
|
|
|
139
|
+ uni.setStorageSync('username', this.form.username);
|
|
|
140
|
+ uni.setStorageSync('password', this.form.password);
|
|
|
141
|
+ } else {
|
|
|
142
|
+ uni.removeStorageSync('username');
|
|
|
143
|
+ uni.removeStorageSync('password');
|
|
|
144
|
+ }
|
|
|
145
|
+ this.$store.dispatch("user/login", this.form).then(async (userId) => {
|
|
|
146
|
+ // #ifdef H5
|
|
|
147
|
+ if(this.firstLoginState){
|
|
|
148
|
+ // 有state要绑定一下用户
|
|
|
149
|
+ await uni.$u.api.firstLogin({ userId , firstLoginState : this.firstLoginState });
|
|
|
150
|
+
|
|
|
151
|
+ uni.reLaunch({
|
|
|
152
|
+ url:"/pages/bindSuccess/index",
|
|
|
153
|
+ success: () => {
|
|
|
154
|
+ uni.$u.toast("绑定成功");
|
|
|
155
|
+ }
|
|
|
156
|
+ });
|
|
|
157
|
+ }else{
|
|
|
158
|
+ uni.$u.toast("授权失败,无法绑定");
|
|
|
159
|
+ }
|
|
|
160
|
+ // #endif
|
|
|
161
|
+
|
|
|
162
|
+ // #ifdef APP-PLUS
|
|
|
163
|
+ uni.switchTab({
|
|
|
164
|
+ url: `/pages/person/index`,
|
|
|
165
|
+ success: () => {
|
|
|
166
|
+ this.$store.dispatch("app/register");
|
|
|
167
|
+ uni.$u.toast("登录成功");
|
|
|
168
|
+ }
|
|
|
169
|
+ })
|
|
|
170
|
+ // #endif
|
|
|
171
|
+
|
|
|
172
|
+ }).catch((res) => {
|
|
|
173
|
+ uni.$u.toast(res);
|
|
|
174
|
+ })
|
|
|
175
|
+ })
|
|
|
176
|
+ },
|
|
|
177
|
+ },
|
|
|
178
|
+ }
|
|
|
179
|
+</script>
|
|
|
180
|
+
|
|
|
181
|
+<style lang="scss">
|
|
|
182
|
+ .network_configuration_box {
|
|
|
183
|
+ margin: auto;
|
|
|
184
|
+
|
|
|
185
|
+ .netWrokSet {
|
|
|
186
|
+ display: flex;
|
|
|
187
|
+ align-items: center;
|
|
|
188
|
+
|
|
|
189
|
+ image {
|
|
|
190
|
+ width: 30rpx;
|
|
|
191
|
+ height: 30rpx;
|
|
|
192
|
+ }
|
|
|
193
|
+
|
|
|
194
|
+ .text {
|
|
|
195
|
+ margin-left: 10rpx;
|
|
|
196
|
+ font-size: 26rpx;
|
|
|
197
|
+ }
|
|
|
198
|
+ }
|
|
|
199
|
+ }
|
|
|
200
|
+
|
|
|
201
|
+ .systemLabel_wrap {
|
|
|
202
|
+ display: flex;
|
|
|
203
|
+ align-items: center;
|
|
|
204
|
+
|
|
|
205
|
+ .label {
|
|
|
206
|
+ margin-left: 10rpx;
|
|
|
207
|
+ }
|
|
|
208
|
+ }
|
|
|
209
|
+
|
|
|
210
|
+ .systemCode_wrap {
|
|
|
211
|
+ position: relative;
|
|
|
212
|
+
|
|
|
213
|
+ ::v-deep .uni-select {
|
|
|
214
|
+ border-radius: 100px;
|
|
|
215
|
+ border: 1px solid #dadbde;
|
|
|
216
|
+ height: 40px;
|
|
|
217
|
+ padding: 0px 10px 0px 46px;
|
|
|
218
|
+
|
|
|
219
|
+ &:before {
|
|
|
220
|
+ content: "";
|
|
|
221
|
+ display: block;
|
|
|
222
|
+ width: 16px;
|
|
|
223
|
+ height: 16px;
|
|
|
224
|
+ background-image: url("../../static/login/icon-system.png");
|
|
|
225
|
+ background-size: 16px 16px;
|
|
|
226
|
+ position: absolute;
|
|
|
227
|
+ left: 20px;
|
|
|
228
|
+ top: 50%;
|
|
|
229
|
+ transform: translate(0%, -50%);
|
|
|
230
|
+ }
|
|
|
231
|
+
|
|
|
232
|
+ .uni-select__input-placeholder {
|
|
|
233
|
+ font-size: 14px;
|
|
|
234
|
+ color: rgb(192, 196, 204);
|
|
|
235
|
+ }
|
|
|
236
|
+ }
|
|
|
237
|
+
|
|
|
238
|
+ .system_debt {
|
|
|
239
|
+ ::v-deep .uni-select {
|
|
|
240
|
+ &:before {
|
|
|
241
|
+ background-image: url("../../static/outbound/icon-zycs.png");
|
|
|
242
|
+ }
|
|
|
243
|
+ }
|
|
|
244
|
+ }
|
|
|
245
|
+
|
|
|
246
|
+ .system_debt_ccb {
|
|
|
247
|
+ ::v-deep .uni-select {
|
|
|
248
|
+ &:before {
|
|
|
249
|
+ background-image: url("../../static/outbound/icon-zycs.png");
|
|
|
250
|
+ }
|
|
|
251
|
+ }
|
|
|
252
|
+ }
|
|
|
253
|
+
|
|
|
254
|
+ .system_debt_spdb {
|
|
|
255
|
+ ::v-deep .uni-select {
|
|
|
256
|
+ &:before {
|
|
|
257
|
+ background-image: url("../../static/outbound/icon-zycs.png");
|
|
|
258
|
+ }
|
|
|
259
|
+ }
|
|
|
260
|
+ }
|
|
|
261
|
+
|
|
|
262
|
+ .system_debt_public {
|
|
|
263
|
+ ::v-deep .uni-select {
|
|
|
264
|
+ &:before {
|
|
|
265
|
+ background-image: url("../../static/outbound/icon-zycs.png");
|
|
|
266
|
+ }
|
|
|
267
|
+ }
|
|
|
268
|
+ }
|
|
|
269
|
+
|
|
|
270
|
+ .system_debt_dfkl {
|
|
|
271
|
+ ::v-deep .uni-select {
|
|
|
272
|
+ &:before {
|
|
|
273
|
+ background-image: url("../../static/outbound/icon-zycs.png");
|
|
|
274
|
+ }
|
|
|
275
|
+ }
|
|
|
276
|
+ }
|
|
|
277
|
+
|
|
|
278
|
+ .system_debt_cib {
|
|
|
279
|
+ ::v-deep .uni-select {
|
|
|
280
|
+ &:before {
|
|
|
281
|
+ background-image: url("../../static/outbound/icon-zycs.png");
|
|
|
282
|
+ }
|
|
|
283
|
+ }
|
|
|
284
|
+ }
|
|
|
285
|
+
|
|
|
286
|
+ .system_debt_icbc_h {
|
|
|
287
|
+ ::v-deep .uni-select {
|
|
|
288
|
+ &:before {
|
|
|
289
|
+ background-image: url("../../static/outbound/icon-zycs.png");
|
|
|
290
|
+ }
|
|
|
291
|
+ }
|
|
|
292
|
+ }
|
|
|
293
|
+
|
|
|
294
|
+ .system_debt_tjxt {
|
|
|
295
|
+ ::v-deep .uni-select {
|
|
|
296
|
+ &:before {
|
|
|
297
|
+ background-image: url("../../static/outbound/icon-zycs.png");
|
|
|
298
|
+ }
|
|
|
299
|
+ }
|
|
|
300
|
+ }
|
|
|
301
|
+
|
|
|
302
|
+ // .systemIcon{
|
|
|
303
|
+ // width: 16px;
|
|
|
304
|
+ // height: 16px;
|
|
|
305
|
+ // position: absolute;
|
|
|
306
|
+ // left: 20px;
|
|
|
307
|
+ // top: 50%;
|
|
|
308
|
+ // transform: translate(0%, -50%);
|
|
|
309
|
+ // display: none;
|
|
|
310
|
+ // }
|
|
|
311
|
+ }
|
|
|
312
|
+
|
|
|
313
|
+ .inputFormWrap {
|
|
|
314
|
+ ::v-deep .u-border {
|
|
|
315
|
+ border: 1px solid #dadbde !important;
|
|
|
316
|
+ }
|
|
|
317
|
+ }
|
|
|
318
|
+
|
|
|
319
|
+ .max {
|
|
|
320
|
+ width: 500rpx;
|
|
|
321
|
+ height: 500rpx;
|
|
|
322
|
+ }
|
|
|
323
|
+
|
|
|
324
|
+ page {
|
|
|
325
|
+ background: #fff;
|
|
|
326
|
+ }
|
|
|
327
|
+
|
|
|
328
|
+ .loginway {
|
|
|
329
|
+ display: flex;
|
|
|
330
|
+ flex-direction: column;
|
|
|
331
|
+ height: 100vh;
|
|
|
332
|
+
|
|
|
333
|
+ .navigation {
|
|
|
334
|
+ background-color: #108cff;
|
|
|
335
|
+ width: 100%;
|
|
|
336
|
+ height: 120rpx;
|
|
|
337
|
+ }
|
|
|
338
|
+
|
|
|
339
|
+ .loginimg {
|
|
|
340
|
+ display: block;
|
|
|
341
|
+ width: 100%;
|
|
|
342
|
+ height: 100%;
|
|
|
343
|
+ }
|
|
|
344
|
+
|
|
|
345
|
+ .input_wrap {
|
|
|
346
|
+ padding: 20rpx 30rpx;
|
|
|
347
|
+ }
|
|
|
348
|
+ }
|
|
|
349
|
+</style>
|