mali-applet-ui 1.1.96 → 1.1.97
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.
|
@@ -413,7 +413,7 @@ export default {
|
|
|
413
413
|
return this.imgTypes.includes(XEUtils.toValueString(item[this.typeField]).toLowerCase())
|
|
414
414
|
},
|
|
415
415
|
removeEvent (item) {
|
|
416
|
-
this.fileList = this.fileList.filter(obj => obj.
|
|
416
|
+
this.fileList = this.fileList.filter(obj => obj[this.urlField] !== item[this.urlField])
|
|
417
417
|
const removeMethod = this.removeFile ? this.removeFile : (globalStore.upload ? globalStore.upload.removeFile : null)
|
|
418
418
|
if (!item) {
|
|
419
419
|
console.error('删除出错!!!')
|
package/package.json
CHANGED
package/types/utils/index.d.ts
CHANGED
|
@@ -2,6 +2,11 @@ import 'xe-utils'
|
|
|
2
2
|
import { XEUtilsMethods } from 'xe-utils/ctor'
|
|
3
3
|
|
|
4
4
|
export interface MlUtilsCore extends XEUtilsMethods {
|
|
5
|
+
scanQRCode (options?: {
|
|
6
|
+
success?: (e: any) => void
|
|
7
|
+
fail?: (e: any) => void
|
|
8
|
+
}): Promise<any>
|
|
9
|
+
|
|
5
10
|
toDateString (date: any, format?: string): string
|
|
6
11
|
toStringDate (value: any): Date
|
|
7
12
|
|
package/utils/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import urlMethods from 'xe-utils/url'
|
|
|
9
9
|
import webMethods from 'xe-utils/web'
|
|
10
10
|
|
|
11
11
|
import * as appletFns from './applet'
|
|
12
|
+
import * as scanFns from './scan'
|
|
12
13
|
import * as dateFns from './date'
|
|
13
14
|
import * as numberFns from './number'
|
|
14
15
|
import * as fileFns from './file'
|
|
@@ -34,6 +35,7 @@ const MaliUtils = {
|
|
|
34
35
|
...webMethods,
|
|
35
36
|
|
|
36
37
|
...appletFns,
|
|
38
|
+
...scanFns,
|
|
37
39
|
...dateFns,
|
|
38
40
|
...numberFns,
|
|
39
41
|
...fileFns
|
package/utils/scan.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 扫码
|
|
3
|
+
*/
|
|
4
|
+
export function scanQRCode (options) {
|
|
5
|
+
const opts = Object.assign({}, options)
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
uni.scanCode({
|
|
8
|
+
scanType: 'qrCode',
|
|
9
|
+
success (res) {
|
|
10
|
+
if (opts.success) {
|
|
11
|
+
opts.success(res)
|
|
12
|
+
}
|
|
13
|
+
resolve(res)
|
|
14
|
+
},
|
|
15
|
+
fail (e) {
|
|
16
|
+
if (opts.fail) {
|
|
17
|
+
opts.fail(e)
|
|
18
|
+
}
|
|
19
|
+
reject(e)
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
})
|
|
23
|
+
}
|