wl-design-mobile 0.8.19 → 0.8.21
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/README.md +6 -6
- package/api/doc.js +25 -25
- package/api/x1.js +56 -56
- package/btn/components/lambo-info-btn.vue +123 -123
- package/btn/components/lambo-primary-btn.vue +117 -117
- package/btn/components/lambo-text-btn.vue +116 -116
- package/btn/lambo-btn-divide.vue +35 -120
- package/btn/lambo-btn-group.vue +46 -46
- package/btn/lambo-btn-split-line.vue +41 -41
- package/btn/lambo-btn.vue +68 -68
- package/btn/lambo-extend-btn.vue +121 -121
- package/btn/lambo-icon-btn.vue +82 -82
- package/card-item/card-row-icon.vue +71 -71
- package/card-item/filtrate-row.vue +73 -73
- package/card-item/lambo-card-footer.vue +40 -40
- package/card-item/lambo-card-head.vue +66 -66
- package/card-item/lambo-card-row.vue +59 -59
- package/collapse/lambo-collapse.vue +93 -93
- package/config/config.js +14 -14
- package/detail/lambo-detail-grid.vue +58 -58
- package/detail/lambo-detail-row.vue +59 -59
- package/doc/file/compoents/lambo-file-list.vue +42 -42
- package/doc/file/compoents/lambo-file-row.vue +77 -77
- package/doc/file/lambo-file-upload-collapse.vue +107 -107
- package/doc/file-type/file-type.js +286 -286
- package/doc/img/comonents/lambo-img-grid.vue +109 -109
- package/doc/img/lambo-img-upload-collapse.vue +107 -107
- package/doc/img/styles/css/index.css +3 -3
- package/edit/list/Lambo-edit-list.vue +87 -87
- package/edit/list/lambo-edit-card-group.vue +100 -100
- package/edit/list/styles/css/index.css +39 -39
- package/edit/select/lambo-edit-date-range.vue +147 -147
- package/edit/select/lambo-edit-date-time.vue +122 -122
- package/edit/select/lambo-edit-date.vue +120 -120
- package/edit/select/lambo-edit-input-textarea.vue +91 -91
- package/edit/select/lambo-edit-input.vue +91 -91
- package/edit/select/lambo-edit-multi-select.vue +168 -168
- package/edit/select/lambo-edit-search-single-select.vue +186 -186
- package/edit/select/lambo-edit-single-select.vue +162 -162
- package/edit/select/styles/css/index.css +133 -133
- package/flow/approval/flow-approval.vue +552 -552
- package/flow/comps/flow-attachment-list.vue +230 -230
- package/flow/comps/flow-attachment-modal.vue +194 -194
- package/flow/comps/flow-copy-users.vue +358 -358
- package/flow/comps/flow-node-card.vue +150 -150
- package/flow/comps/flow-node-header.vue +172 -172
- package/flow/comps/flow-util.js +156 -156
- package/flow/comps/icons/approved.svg +11 -11
- package/flow/comps/icons/canceled.svg +11 -11
- package/flow/comps/icons/rejected.svg +11 -11
- package/flow/comps/icons/underway.svg +11 -11
- package/flow/detail/flow-detail.vue +467 -467
- package/flow/index.js +51 -51
- package/flow/lambo-flow-detail.vue +912 -912
- package/flow/lambo-flow-edit.vue +15 -15
- package/flow/submit/flow-submit.vue +383 -383
- package/icon/lambo-required-red-star.vue +47 -47
- package/icon/lambo-vector-icon.vue +71 -71
- package/list/lambo-list.vue +412 -413
- package/nav/lambo-top-nav.vue +81 -81
- package/order/comps/icons/approved.svg +10 -10
- package/order/comps/icons/underway.svg +10 -10
- package/order/comps/order-attachment-list.vue +228 -228
- package/order/comps/order-attachment-modal.vue +194 -194
- package/order/comps/order-node-card.vue +126 -126
- package/order/comps/order-node-header.vue +133 -133
- package/order/comps/order-util.js +132 -132
- package/order/detail/order-detail.vue +432 -432
- package/order/handle/order-handle.vue +517 -517
- package/order/index.js +33 -33
- package/package.json +38 -37
- package/search/lambo-date-range-page.vue +196 -196
- package/search/lambo-date-range.vue +111 -111
- package/search/lambo-date.vue +105 -105
- package/search/lambo-input.vue +74 -74
- package/search/lambo-multi-select.vue +129 -129
- package/search/lambo-org-select-page.vue +109 -109
- package/search/lambo-search-box.vue +61 -61
- package/search/lambo-search-single-select.vue +152 -152
- package/search/lambo-single-select.vue +123 -123
- package/search/lambo-week-date-select.vue +521 -521
- package/search/styles/css/index.css +138 -138
- package/styles/base.less +77 -77
- package/styles/components/btn.less +7 -7
- package/styles/components/search.less +33 -33
- package/styles/components/tag.less +181 -181
- package/styles/index.less +4 -4
- package/table/lambo-ag-table.vue +227 -227
- package/tag/lambo-tag.vue +23 -23
- package/title/lambo-title1.vue +151 -151
- package/title/lambo-title2.vue +37 -37
- package/title/lambo-title3.vue +77 -77
- package/util/assist.js +43 -43
- package/util/axios/cacheconf.js +19 -19
- package/util/axios/index.js +11 -11
- package/util/axios/interceptors.js +101 -101
- package/util/bus.js +4 -4
- package/util/jssdk-sczy.js +104 -104
- package/util/jssdk.js +608 -565
- package/util/math.js +76 -76
- package/util/token.js +36 -36
package/util/jssdk.js
CHANGED
|
@@ -1,565 +1,608 @@
|
|
|
1
|
-
import wx from "weixin-js-sdk";
|
|
2
|
-
import * as ww from '@wecom/jssdk'
|
|
3
|
-
import * as dd from 'dingtalk-jsapi';
|
|
4
|
-
import config from '../config/config'
|
|
5
|
-
import {axios} from '../util/axios'
|
|
6
|
-
import {Toast } from 'vant'
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
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
|
-
function
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
let
|
|
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
|
-
wx.
|
|
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
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
});
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
resolve(
|
|
480
|
-
},
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
})
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
1
|
+
import wx from "weixin-js-sdk";
|
|
2
|
+
import * as ww from '@wecom/jssdk'
|
|
3
|
+
import * as dd from 'dingtalk-jsapi';
|
|
4
|
+
import config from '../config/config'
|
|
5
|
+
import {axios} from '../util/axios'
|
|
6
|
+
import {Toast } from 'vant'
|
|
7
|
+
import ccworkBridge from 'ccwork-jsbridge';
|
|
8
|
+
|
|
9
|
+
let appId,agentId,corpId,appKey
|
|
10
|
+
|
|
11
|
+
const APP_ID = 'JsSdk_appId'
|
|
12
|
+
const AGENT_ID = 'JsSdk_agentId'
|
|
13
|
+
const CORP_ID = 'JsSdk_corpId'
|
|
14
|
+
const APP_KEY = 'JsSdk_appKey'
|
|
15
|
+
|
|
16
|
+
function init({appId:a,agentId:b,corpId:c,appKey:d}){
|
|
17
|
+
appId = a
|
|
18
|
+
agentId = b
|
|
19
|
+
corpId = c
|
|
20
|
+
appKey = d
|
|
21
|
+
|
|
22
|
+
if(appId){
|
|
23
|
+
sessionStorage.setItem(APP_ID,appId)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if(agentId){
|
|
27
|
+
sessionStorage.setItem(AGENT_ID,agentId)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if(corpId){
|
|
31
|
+
sessionStorage.setItem(CORP_ID,corpId)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if(appKey){
|
|
35
|
+
sessionStorage.setItem(APP_KEY,appKey)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if(getAppType() === '40'){
|
|
39
|
+
ccworkBridge.init(function(hasLogin) {
|
|
40
|
+
console.log('ccworkBridge init successfully , hasLogin:', hasLogin)
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
function getAppType() {
|
|
47
|
+
let ua = navigator.userAgent.toLowerCase();
|
|
48
|
+
let isWxWork = ua.match(/WxWork/i) == 'wxwork';
|
|
49
|
+
if (isWxWork) {
|
|
50
|
+
console.log('当前是企业微信环境')
|
|
51
|
+
return '20'
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
let isWx = ua.match(/MicroMessenger/i) == 'micromessenger';
|
|
55
|
+
if (isWx) {
|
|
56
|
+
if(agentId){//如果有agentId认为是企业微信
|
|
57
|
+
console.log('当前是企业微信环境')
|
|
58
|
+
return '20'
|
|
59
|
+
}
|
|
60
|
+
console.log('当前是服务号环境')
|
|
61
|
+
return '10'
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
let ccwork = ua.match(/ccwork/i) == "ccwork";
|
|
66
|
+
if(ccwork){
|
|
67
|
+
return '40'
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
if (dd.env.platform != 'notInDingTalk') {
|
|
73
|
+
console.log('当前是钉钉环境')
|
|
74
|
+
return '30'
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return ''
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* 判断ios系统版本号是否大于14
|
|
82
|
+
* @returns {boolean}
|
|
83
|
+
*/
|
|
84
|
+
const isIos14AndMore = () =>{
|
|
85
|
+
// 判断ios手机版本号是否大于14,大于14就拿App.vue存储的url,否则拿当前页面的url
|
|
86
|
+
try {
|
|
87
|
+
const str = navigator.userAgent.toLowerCase()
|
|
88
|
+
const ver = str.match(/cpu iphone os (.*?) like mac os/)
|
|
89
|
+
if (!ver) {
|
|
90
|
+
return false
|
|
91
|
+
} else {
|
|
92
|
+
return Number(ver[1].split('_')[0]) >= 14
|
|
93
|
+
}
|
|
94
|
+
} catch (e) {
|
|
95
|
+
console.log('isIos14AndMore', e)
|
|
96
|
+
return false
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function getJsConfig(){
|
|
101
|
+
let url = window.location.href.split('#')[0].toString();
|
|
102
|
+
if (isIos14AndMore() && '10' === getAppType()) {
|
|
103
|
+
console.log('isIos14AndMore true')
|
|
104
|
+
url = sessionStorage.getItem('ios14ConfigUrl')?sessionStorage.getItem('ios14ConfigUrl'):url
|
|
105
|
+
}
|
|
106
|
+
return new Promise((resolve, reject)=>{
|
|
107
|
+
axios.post(config.platformServerContext + '/api/weixin/getJsConfig', {
|
|
108
|
+
appType: getAppType(),
|
|
109
|
+
appId: sessionStorage.getItem(APP_ID),
|
|
110
|
+
agentId: sessionStorage.getItem(AGENT_ID),
|
|
111
|
+
corpId: sessionStorage.getItem(CORP_ID),
|
|
112
|
+
appKey: sessionStorage.getItem(APP_KEY),
|
|
113
|
+
url: url
|
|
114
|
+
}).then((resp) => {
|
|
115
|
+
resolve(resp.data)
|
|
116
|
+
}).catch((error) => {
|
|
117
|
+
reject(error)
|
|
118
|
+
})
|
|
119
|
+
})
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function configWx(){
|
|
123
|
+
return new Promise((resolve, reject) =>{
|
|
124
|
+
getJsConfig().then((resp)=>{
|
|
125
|
+
wx.config({
|
|
126
|
+
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
|
|
127
|
+
appId: sessionStorage.getItem(APP_ID), // 必填,公众号的唯一标识
|
|
128
|
+
timestamp: resp.timestamp, // 必填,生成签名的时间戳
|
|
129
|
+
nonceStr: resp.noncestr, // 必填,生成签名的随机串
|
|
130
|
+
signature: resp.signature, // 必填,签名
|
|
131
|
+
jsApiList: ['chooseImage', 'uploadImage', 'downloadImage', 'getLocalImgData', 'openLocation', 'getLocation', 'scanQRCode', 'chooseWXPay', 'onHistoryBack','invoke','onLocationChange','previewFile'] // 必填,需要使用的JS接口列表
|
|
132
|
+
//jsApiList: ['chooseImage', 'uploadImage', 'downloadImage', 'getLocalImgData', 'openLocation', 'getLocation', 'scanQRCode', 'chooseWXPay', 'onHistoryBack','startLocationUpdateBackground','startLocationUpdate','onLocationChange','offLocationChange'] // 必填,需要使用的JS接口列表
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
wx.ready(() => {
|
|
136
|
+
console.log('微信初始化js-sdk成功');
|
|
137
|
+
resolve()
|
|
138
|
+
});
|
|
139
|
+
wx.error(res => {
|
|
140
|
+
console.log('微信初始化js-sdk失败' + res.errMsg);
|
|
141
|
+
console.log('友情提示:当前页面URL中不能有转义后的字符!(右上角复制链接查看)');
|
|
142
|
+
reject('微信初始化js-sdk失败' + res.errMsg)
|
|
143
|
+
});
|
|
144
|
+
}).catch((error)=>{
|
|
145
|
+
reject('请求服务端jssdk签名失败:'+error)
|
|
146
|
+
})
|
|
147
|
+
})
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function getConfigSignature(url) {
|
|
151
|
+
return new Promise((resolve,reject)=>{
|
|
152
|
+
axios.post(config.platformServerContext + '/api/weixin/getJsConfig', {
|
|
153
|
+
appType: getAppType(),
|
|
154
|
+
appId: sessionStorage.getItem(APP_ID),
|
|
155
|
+
agentId: sessionStorage.getItem(AGENT_ID),
|
|
156
|
+
corpId: sessionStorage.getItem(CORP_ID),
|
|
157
|
+
appKey: sessionStorage.getItem(APP_KEY),
|
|
158
|
+
url: url.split('#')[0]
|
|
159
|
+
}).then(resp=>{
|
|
160
|
+
console.log('getConfigSignature',resp)
|
|
161
|
+
let timestamp = resp.data.timestamp
|
|
162
|
+
let nonceStr = resp.data.noncestr
|
|
163
|
+
let signature = resp.data.signature
|
|
164
|
+
resolve({ timestamp, nonceStr, signature })
|
|
165
|
+
}).catch((error)=>{
|
|
166
|
+
console.log(error)
|
|
167
|
+
reject(error)
|
|
168
|
+
})
|
|
169
|
+
})
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function configWw(){
|
|
173
|
+
return new Promise((resolve, reject) =>{
|
|
174
|
+
ww.register({
|
|
175
|
+
corpId: sessionStorage.getItem(APP_ID), // 必填,当前用户企业所属企业ID
|
|
176
|
+
jsApiList: ['chooseImage', 'uploadImage', 'downloadImage', 'getLocalImgData', 'openLocation', 'getLocation', 'scanQRCode', 'chooseWXPay', 'onHistoryBack','invoke','onLocationChange','previewFile'], // 必填,需要使用的JSAPI列表
|
|
177
|
+
getConfigSignature, // 必填,根据url生成企业签名的回调函数
|
|
178
|
+
onConfigSuccess:(res) => {
|
|
179
|
+
console.log('企业微信初始化js-sdk成功');
|
|
180
|
+
console.log(res)
|
|
181
|
+
resolve()
|
|
182
|
+
},
|
|
183
|
+
onConfigFail:(res) =>{
|
|
184
|
+
console.log('企业微信初始化js-sdk失败' + res.errMsg);
|
|
185
|
+
console.log(res)
|
|
186
|
+
reject('企业微信初始化js-sdk失败' + res.errMsg)
|
|
187
|
+
}
|
|
188
|
+
})
|
|
189
|
+
})
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function configDd(){
|
|
193
|
+
return new Promise((resolve, reject)=>{
|
|
194
|
+
getJsConfig().then((resp)=>{
|
|
195
|
+
//钉钉js-api配置
|
|
196
|
+
console.log("当前页面:"+location.href);
|
|
197
|
+
dd.config({
|
|
198
|
+
agentId:sessionStorage.getItem(AGENT_ID),
|
|
199
|
+
corpId: sessionStorage.getItem(CORP_ID), // 必填,公众号的唯一标识
|
|
200
|
+
timeStamp: resp.timestamp, // 必填,生成签名的时间戳
|
|
201
|
+
nonceStr: resp.noncestr, // 必填,生成签名的随机串
|
|
202
|
+
signature: resp.signature, // 必填,签名
|
|
203
|
+
jsApiList: [
|
|
204
|
+
'getDeviceUUID',
|
|
205
|
+
'getLocation',
|
|
206
|
+
|
|
207
|
+
] // 必填,需要使用的jsapi列表,注意:不要带dd。
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
dd.ready(() => {
|
|
211
|
+
console.log('初始化钉钉 js-sdk成功');
|
|
212
|
+
resolve()
|
|
213
|
+
});
|
|
214
|
+
dd.error(res => {
|
|
215
|
+
console.log('初始化钉钉 js-sdk失败' + JSON.stringify(res));
|
|
216
|
+
console.log('友情提示:当前页面URL中不能有转义后的字符!(右上角复制链接查看)!');
|
|
217
|
+
reject('初始化钉钉 js-sdk失败' + JSON.stringify(res))
|
|
218
|
+
});
|
|
219
|
+
}).catch((error)=>{
|
|
220
|
+
reject('请求服务端jssdk签名失败:'+error)
|
|
221
|
+
})
|
|
222
|
+
})
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
let JsSDK = (function () {
|
|
226
|
+
function scanQRCode(){
|
|
227
|
+
return new Promise((resolve, reject) =>{
|
|
228
|
+
if(getAppType() === '30'){
|
|
229
|
+
dd.scan({
|
|
230
|
+
type: 'all',
|
|
231
|
+
success: (res) => {
|
|
232
|
+
console.log('钉钉扫码结果',res)
|
|
233
|
+
resolve(res.text)
|
|
234
|
+
},
|
|
235
|
+
fail: (err) => {
|
|
236
|
+
console.log('钉钉扫码失败',err)
|
|
237
|
+
reject('钉钉扫码失败:'+err)
|
|
238
|
+
},
|
|
239
|
+
complete: () => {},
|
|
240
|
+
});
|
|
241
|
+
}else if(getAppType() === '40'){
|
|
242
|
+
const params = {
|
|
243
|
+
path: '',
|
|
244
|
+
filters: ['QR','EAN13','EAN8']
|
|
245
|
+
}
|
|
246
|
+
ccworkBridge.ccworkScanCode(params, (res) => {
|
|
247
|
+
resolve(res)
|
|
248
|
+
})
|
|
249
|
+
}else{
|
|
250
|
+
configWx().then(()=>{
|
|
251
|
+
wx.scanQRCode({
|
|
252
|
+
desc: 'scanQRCode desc',
|
|
253
|
+
needResult: 1,
|
|
254
|
+
scanType: ["qrCode", "barCode"],
|
|
255
|
+
success: function (resp) {
|
|
256
|
+
console.log("微信扫码结果:",resp)
|
|
257
|
+
let result = resp.resultStr
|
|
258
|
+
resolve(result)
|
|
259
|
+
},
|
|
260
|
+
fail: function (res) {
|
|
261
|
+
console.log("失败res=>",res)
|
|
262
|
+
if (res.errMsg.indexOf('function_not_exist') > 0) {
|
|
263
|
+
reject('版本过低请升级');
|
|
264
|
+
} else {
|
|
265
|
+
reject("微信扫码失败,请联系系统管理员!");
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
})
|
|
269
|
+
}).catch((error)=>{
|
|
270
|
+
reject('微信扫码失败:'+error)
|
|
271
|
+
})
|
|
272
|
+
}
|
|
273
|
+
})
|
|
274
|
+
}
|
|
275
|
+
function takePhoto({count = 1} = {}){
|
|
276
|
+
return new Promise((resolve, reject) =>{
|
|
277
|
+
if(getAppType() === '30'){
|
|
278
|
+
reject('钉钉不支持此方式拍照')
|
|
279
|
+
}else if(getAppType() === '40'){
|
|
280
|
+
const params = {
|
|
281
|
+
quality: 'mid',
|
|
282
|
+
mode: 'camera'
|
|
283
|
+
}
|
|
284
|
+
ccworkBridge.ccworkGetPicsFromCameraAndAlbumV4(params, (res) => {console.log(res)})
|
|
285
|
+
}else{
|
|
286
|
+
configWx().then(()=>{
|
|
287
|
+
wx.chooseImage({
|
|
288
|
+
count: count, // 默认1
|
|
289
|
+
sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
|
|
290
|
+
sourceType: ['camera'], // 可以指定来源是相册还是相机,默认二者都有
|
|
291
|
+
success: async function (res) {
|
|
292
|
+
let localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
|
|
293
|
+
Toast.loading({
|
|
294
|
+
duration: 0, // 持续展示 toast
|
|
295
|
+
forbidClick: false,
|
|
296
|
+
message: '正在上传',
|
|
297
|
+
});
|
|
298
|
+
let uploadPromises = localIds.map(localId => {
|
|
299
|
+
return new Promise((resolve, reject) => {
|
|
300
|
+
wx.uploadImage({
|
|
301
|
+
localId: localId, // 需要上传的图片的本地ID,由chooseImage接口获得
|
|
302
|
+
isShowProgressTips: 0, // 默认为1,显示进度提示
|
|
303
|
+
success: function (res) {
|
|
304
|
+
let serverId = res.serverId; // 返回图片的服务器端ID
|
|
305
|
+
resolve(serverId);
|
|
306
|
+
},
|
|
307
|
+
fail: function (error) {
|
|
308
|
+
reject(error);
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
});
|
|
312
|
+
});
|
|
313
|
+
try {
|
|
314
|
+
let serverIds = await Promise.all(uploadPromises);
|
|
315
|
+
console.log('choosePhoto', serverIds)
|
|
316
|
+
Toast.clear()
|
|
317
|
+
resolve({
|
|
318
|
+
appId: sessionStorage.getItem(APP_ID),
|
|
319
|
+
agentId: sessionStorage.getItem(AGENT_ID),
|
|
320
|
+
serverId: serverIds[0],
|
|
321
|
+
serverIds: serverIds
|
|
322
|
+
});
|
|
323
|
+
} catch (error) {
|
|
324
|
+
Toast.clear()
|
|
325
|
+
reject('上传图片失败:' + error);
|
|
326
|
+
}
|
|
327
|
+
// setTimeout(() => {
|
|
328
|
+
// wx.uploadImage({
|
|
329
|
+
// localId: localId, // 需要上传的图片的本地ID,由chooseImage接口获得
|
|
330
|
+
// isShowProgressTips: 0, // 默认为1,显示进度提示
|
|
331
|
+
// success: function (res) {
|
|
332
|
+
// Toast.clear()
|
|
333
|
+
// let serverId = res.serverId; // 返回图片的服务器端ID
|
|
334
|
+
// resolve({
|
|
335
|
+
// appId:sessionStorage.getItem(APP_ID),
|
|
336
|
+
// agentId:sessionStorage.getItem(AGENT_ID),
|
|
337
|
+
// serverId:serverId
|
|
338
|
+
// })
|
|
339
|
+
// }
|
|
340
|
+
// })
|
|
341
|
+
// }, 200);
|
|
342
|
+
},
|
|
343
|
+
cancel:function (){
|
|
344
|
+
reject('取消拍照')
|
|
345
|
+
}
|
|
346
|
+
})
|
|
347
|
+
}).catch((error)=>{
|
|
348
|
+
reject('微信拍照失败:'+error)
|
|
349
|
+
})
|
|
350
|
+
}
|
|
351
|
+
})
|
|
352
|
+
}
|
|
353
|
+
function choosePhoto({count = 1} = {}) {
|
|
354
|
+
return new Promise((resolve, reject) => {
|
|
355
|
+
if (getAppType() === '30') {
|
|
356
|
+
reject('钉钉不支持此方式选择照片');
|
|
357
|
+
}else if (getAppType() === '40'){
|
|
358
|
+
const params = {
|
|
359
|
+
quality: 'mid',
|
|
360
|
+
mode: 'album'
|
|
361
|
+
}
|
|
362
|
+
ccworkBridge.ccworkGetPicsFromCameraAndAlbumV4(params, (res) => {console.log(res)})
|
|
363
|
+
} else {
|
|
364
|
+
configWx().then(() => {
|
|
365
|
+
wx.chooseImage({
|
|
366
|
+
count: count, // 默认1
|
|
367
|
+
sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
|
|
368
|
+
sourceType: ['album'], // 可以指定来源是相册还是相机,默认二者都有
|
|
369
|
+
success: async function (res) {
|
|
370
|
+
let localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
|
|
371
|
+
Toast.loading({
|
|
372
|
+
duration: 0, // 持续展示 toast
|
|
373
|
+
forbidClick: false,
|
|
374
|
+
message: '正在上传',
|
|
375
|
+
});
|
|
376
|
+
let uploadPromises = localIds.map(localId => {
|
|
377
|
+
return new Promise((resolve, reject) => {
|
|
378
|
+
wx.uploadImage({
|
|
379
|
+
localId: localId, // 需要上传的图片的本地ID,由chooseImage接口获得
|
|
380
|
+
isShowProgressTips: 0, // 默认为1,显示进度提示
|
|
381
|
+
success: function (res) {
|
|
382
|
+
let serverId = res.serverId; // 返回图片的服务器端ID
|
|
383
|
+
resolve(serverId);
|
|
384
|
+
},
|
|
385
|
+
fail: function (error) {
|
|
386
|
+
reject(error);
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
});
|
|
390
|
+
});
|
|
391
|
+
|
|
392
|
+
try {
|
|
393
|
+
let serverIds = await Promise.all(uploadPromises);
|
|
394
|
+
console.log('choosePhoto',serverIds)
|
|
395
|
+
Toast.clear()
|
|
396
|
+
resolve({
|
|
397
|
+
appId: sessionStorage.getItem(APP_ID),
|
|
398
|
+
agentId: sessionStorage.getItem(AGENT_ID),
|
|
399
|
+
serverId:serverIds[0],
|
|
400
|
+
serverIds: serverIds
|
|
401
|
+
});
|
|
402
|
+
} catch (error) {
|
|
403
|
+
Toast.clear()
|
|
404
|
+
reject('上传图片失败:' + error);
|
|
405
|
+
}
|
|
406
|
+
},
|
|
407
|
+
cancel: function () {
|
|
408
|
+
reject('取消选择照片');
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
}).catch((error) => {
|
|
412
|
+
reject('微信选择照片失败:' + error);
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
function getLocation(){
|
|
418
|
+
return new Promise((resolve, reject)=>{
|
|
419
|
+
if(getAppType() === '30'){
|
|
420
|
+
configDd().then(()=>{
|
|
421
|
+
dd.getLocation({
|
|
422
|
+
targetAccuracy: '200',
|
|
423
|
+
cacheTimeout: 20,
|
|
424
|
+
coordinate: '1',
|
|
425
|
+
useCache: true,
|
|
426
|
+
withReGeocode: true,
|
|
427
|
+
type: 1,
|
|
428
|
+
success: (res) => {
|
|
429
|
+
console.log('钉钉获取当前位置结果:', res)
|
|
430
|
+
resolve(res)
|
|
431
|
+
},
|
|
432
|
+
fail: (error) => {
|
|
433
|
+
console.log('钉钉获取位置失败:', error)
|
|
434
|
+
reject('钉钉获取位置失败:'+error)
|
|
435
|
+
},
|
|
436
|
+
complete: () => {},
|
|
437
|
+
})
|
|
438
|
+
}).catch((error)=>{
|
|
439
|
+
reject('钉钉获取位置失败:'+error)
|
|
440
|
+
})
|
|
441
|
+
}else if(getAppType() === '40'){
|
|
442
|
+
ccworkBridge.ccworkGetLocation((res) => {console.log(res)})
|
|
443
|
+
}else{
|
|
444
|
+
configWx().then(()=>{
|
|
445
|
+
wx.getLocation({
|
|
446
|
+
type: 'gcj02', //获取gcj02的坐标
|
|
447
|
+
success: (res) => {
|
|
448
|
+
//res.longitude 获取经度
|
|
449
|
+
//res.latitude 获取纬度
|
|
450
|
+
console.log(res);
|
|
451
|
+
resolve(res)
|
|
452
|
+
}, fail: (res) => {
|
|
453
|
+
console.log("微信获取位置失败。"+JSON.stringify(res));
|
|
454
|
+
reject("微信获取位置失败" + JSON.stringify(res))
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
}).catch((error)=>{
|
|
458
|
+
reject('微信获取位置失败:'+error)
|
|
459
|
+
})
|
|
460
|
+
}
|
|
461
|
+
})
|
|
462
|
+
}
|
|
463
|
+
function openLocation({longitude,latitude,name,address,scale= 15} = {}){
|
|
464
|
+
return new Promise((resolve, reject)=>{
|
|
465
|
+
if(getAppType() === '30'){
|
|
466
|
+
configDd().then(()=>{
|
|
467
|
+
dd.openLocation({
|
|
468
|
+
title: name,
|
|
469
|
+
address: address,
|
|
470
|
+
latitude: latitude,
|
|
471
|
+
longitude: longitude,
|
|
472
|
+
success: () => {
|
|
473
|
+
resolve()
|
|
474
|
+
},
|
|
475
|
+
fail: () => {
|
|
476
|
+
reject()
|
|
477
|
+
},
|
|
478
|
+
complete: () => {
|
|
479
|
+
resolve()
|
|
480
|
+
},
|
|
481
|
+
});
|
|
482
|
+
|
|
483
|
+
}).catch((error)=>{
|
|
484
|
+
reject('钉钉启动内置地图位置失败:'+error)
|
|
485
|
+
})
|
|
486
|
+
}else if(getAppType() === '40'){
|
|
487
|
+
const params = {
|
|
488
|
+
dstlng: longitude,
|
|
489
|
+
dstlat: latitude,
|
|
490
|
+
coordtype: 'GCJ-02'
|
|
491
|
+
}
|
|
492
|
+
ccworkBridge.ccworkInvokeNavi(params, (res) => {console.log(res)})
|
|
493
|
+
}else{
|
|
494
|
+
configWx().then(()=>{
|
|
495
|
+
wx.openLocation({
|
|
496
|
+
latitude: latitude,//目的地latitude
|
|
497
|
+
longitude: longitude,//目的地longitude
|
|
498
|
+
name: name,
|
|
499
|
+
address: address,
|
|
500
|
+
scale: scale//地图缩放大小,可根据情况具体调整
|
|
501
|
+
});
|
|
502
|
+
resolve()
|
|
503
|
+
}).catch((error)=>{
|
|
504
|
+
reject('微信启动内置地图失败:'+error)
|
|
505
|
+
})
|
|
506
|
+
}
|
|
507
|
+
})
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
function startAutoLBS({sceneId:sceneId}){
|
|
511
|
+
return new Promise((resolve, reject)=>{
|
|
512
|
+
if(getAppType() === '30'){
|
|
513
|
+
configDd().then(()=>{
|
|
514
|
+
dd.startLocating({
|
|
515
|
+
sceneId: sceneId,
|
|
516
|
+
useCache: true,
|
|
517
|
+
withReGeocode: false,
|
|
518
|
+
targetAccuracy: 200,
|
|
519
|
+
callBackInterval: 1000,
|
|
520
|
+
iOSDistanceFilter: 10,
|
|
521
|
+
success: (res) => {
|
|
522
|
+
resolve({longitude:res.longitude,latitude:res.latitude})
|
|
523
|
+
},
|
|
524
|
+
fail: () => {
|
|
525
|
+
reject()
|
|
526
|
+
},
|
|
527
|
+
complete: () => {
|
|
528
|
+
resolve()
|
|
529
|
+
},
|
|
530
|
+
});
|
|
531
|
+
}).catch((error)=>{
|
|
532
|
+
reject('钉钉启动内置地图位置失败:'+error)
|
|
533
|
+
})
|
|
534
|
+
}else if(getAppType() === '20'){
|
|
535
|
+
configWw().then(()=>{
|
|
536
|
+
ww.startAutoLBS({
|
|
537
|
+
type: 'gcj02',
|
|
538
|
+
success:()=>{
|
|
539
|
+
ww.onLocationChange(function(event) {
|
|
540
|
+
console.log('onLocationChange',event)
|
|
541
|
+
resolve({longitude:event.longitude,latitude:event.latitude})
|
|
542
|
+
})
|
|
543
|
+
},
|
|
544
|
+
fail:()=>{
|
|
545
|
+
reject()
|
|
546
|
+
}
|
|
547
|
+
}).then(resp => {
|
|
548
|
+
console.log('企业微信开启连续定位',resp)
|
|
549
|
+
})
|
|
550
|
+
}).catch((error)=>{
|
|
551
|
+
reject('企业微信开启连续定位失败:'+error)
|
|
552
|
+
})
|
|
553
|
+
}else{
|
|
554
|
+
reject('微信不支持连续定位')
|
|
555
|
+
}
|
|
556
|
+
})
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
function stopAutoLBS({sceneId:sceneId}){
|
|
560
|
+
return new Promise((resolve, reject)=>{
|
|
561
|
+
if(getAppType() === '30'){
|
|
562
|
+
configDd().then(()=>{
|
|
563
|
+
dd.stopLocating({
|
|
564
|
+
sceneId: sceneId,
|
|
565
|
+
success: () => {
|
|
566
|
+
resolve()
|
|
567
|
+
},
|
|
568
|
+
fail: () => {
|
|
569
|
+
reject()
|
|
570
|
+
},
|
|
571
|
+
complete: () => {
|
|
572
|
+
resolve()
|
|
573
|
+
},
|
|
574
|
+
});
|
|
575
|
+
resolve()
|
|
576
|
+
}).catch((error)=>{
|
|
577
|
+
reject('钉钉启动内置地图位置失败:'+error)
|
|
578
|
+
})
|
|
579
|
+
}else if(getAppType() === '20'){
|
|
580
|
+
configWw().then(()=>{
|
|
581
|
+
ww.stopAutoLBS().then(resp => {
|
|
582
|
+
console.log(resp)
|
|
583
|
+
resolve()
|
|
584
|
+
})
|
|
585
|
+
}).catch((error)=>{
|
|
586
|
+
reject('企业微信关闭连续定位失败:'+error)
|
|
587
|
+
})
|
|
588
|
+
}else{
|
|
589
|
+
reject('微信不支持连续定位')
|
|
590
|
+
}
|
|
591
|
+
})
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
// 公开API
|
|
595
|
+
return {
|
|
596
|
+
init:init,
|
|
597
|
+
takePhoto:takePhoto,
|
|
598
|
+
choosePhoto:choosePhoto,
|
|
599
|
+
scanQRCode: scanQRCode,
|
|
600
|
+
getLocation:getLocation,
|
|
601
|
+
openLocation:openLocation,
|
|
602
|
+
startAutoLBS:startAutoLBS,
|
|
603
|
+
stopAutoLBS:stopAutoLBS,
|
|
604
|
+
};
|
|
605
|
+
})();
|
|
606
|
+
|
|
607
|
+
export default JsSDK
|
|
608
|
+
|