mali-applet-ui 1.1.0 → 1.1.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.
@@ -30,7 +30,7 @@
30
30
 
31
31
  <script>
32
32
  import XEUtils from 'xe-utils'
33
- import { getPlatformEnv, toAmountString, toWanAmountString, toNumMoneyToChinese } from '../../../utils'
33
+ import MaliUtils from '../../../utils'
34
34
 
35
35
  function eqEmptyNull (value) {
36
36
  return value === '' || XEUtils.eqNull(value)
@@ -83,7 +83,7 @@ export default {
83
83
  },
84
84
  data () {
85
85
  return {
86
- platformEnv: getPlatformEnv(),
86
+ platformEnv: MaliUtils.getPlatformEnv(),
87
87
  inpVal: ''
88
88
  }
89
89
  },
@@ -96,9 +96,9 @@ export default {
96
96
  },
97
97
  amountLabel () {
98
98
  if (this.simplify) {
99
- return toWanAmountString(this.value)
99
+ return MaliUtils.toWanAmountString(this.value)
100
100
  }
101
- return toAmountString(this.value)
101
+ return MaliUtils.toAmountString(this.value)
102
102
  },
103
103
  minNum () {
104
104
  if (XEUtils.isNumber(this.min) || this.min) {
@@ -116,7 +116,7 @@ export default {
116
116
  return null
117
117
  },
118
118
  currAmountLabel () {
119
- return this.currAmountNum === '' ? '' : toNumMoneyToChinese(this.currAmountNum)
119
+ return this.currAmountNum === '' ? '' : MaliUtils.toNumMoneyToChinese(this.currAmountNum)
120
120
  }
121
121
  },
122
122
  watch: {
@@ -13,7 +13,7 @@
13
13
  </template>
14
14
 
15
15
  <script>
16
- import { toAmountString, toWanAmountString } from '../../../utils'
16
+ import MaliUtils from '../../../utils'
17
17
 
18
18
  export default {
19
19
  name: 'MlAmountText',
@@ -45,9 +45,9 @@ export default {
45
45
  },
46
46
  amountLabel () {
47
47
  if (this.simplify) {
48
- return toWanAmountString(this.value, this.digits)
48
+ return MaliUtils.toWanAmountString(this.value || 0, this.digits)
49
49
  }
50
- return toAmountString(this.value, this.digits)
50
+ return MaliUtils.toAmountString(this.value || 0, this.digits)
51
51
  }
52
52
  },
53
53
  methods: {
@@ -1,13 +1,13 @@
1
1
  import * as echarts from './echarts.simple.min.js'
2
2
  // import * as echarts from './echarts.all.js'
3
- import { getAppDpr } from '../../../utils'
3
+ import MaliUtils from '../../../utils'
4
4
 
5
5
  /* eslint-disable */
6
6
 
7
7
  // #ifdef MP-ALIPAY
8
8
  const eInit = echarts.init
9
9
  echarts.init = function (p1, p2, opts = {}) {
10
- opts.devicePixelRatio = opts.devicePixelRatio || getAppDpr()
10
+ opts.devicePixelRatio = opts.devicePixelRatio || MaliUtils.getAppDpr()
11
11
  return eInit.call(this, p1, p2, opts)
12
12
  }
13
13
  // #endif
@@ -8,7 +8,7 @@
8
8
  import WxCanvas from './wx-canvas'
9
9
  import echarts from './echarts'
10
10
  import XEUtils from 'xe-utils'
11
- import { getPlatformEnv, getAppDpr } from '../../../utils'
11
+ import MaliUtils from '../../../utils'
12
12
 
13
13
  function wrapTouch (event) {
14
14
  for (let i = 0; i < event.touches.length; ++i) {
@@ -37,7 +37,7 @@ export default {
37
37
  },
38
38
  data () {
39
39
  return {
40
- platformEnv: getPlatformEnv(),
40
+ platformEnv: MaliUtils.getPlatformEnv(),
41
41
  canvasId: XEUtils.uniqueId('chart'),
42
42
  cvsWidth: '',
43
43
  cvsHeight: ''
@@ -130,7 +130,7 @@ export default {
130
130
  .exec(res => {
131
131
  if (res && res[0]) {
132
132
  const canvasNode = res[0].node
133
- const ratio = getAppDpr()
133
+ const ratio = MaliUtils.getAppDpr()
134
134
  const canvasWidth = res[0].width
135
135
  const canvasHeight = res[0].height
136
136
  this.cvsWidth = canvasWidth
@@ -161,7 +161,7 @@ export default {
161
161
  return canvas
162
162
  })
163
163
  const query = uni.createSelectorQuery().in(this)
164
- const ratio = getAppDpr()
164
+ const ratio = MaliUtils.getAppDpr()
165
165
  query
166
166
  .select(`#${this.canvasId}`)
167
167
  .boundingClientRect(res => {
@@ -41,7 +41,7 @@
41
41
  </template>
42
42
 
43
43
  <script>
44
- import { getPlatformEnv } from '../../../utils'
44
+ import MaliUtils from '../../../utils'
45
45
  import XEUtils from 'xe-utils'
46
46
 
47
47
  export default {
@@ -93,7 +93,7 @@ export default {
93
93
  },
94
94
  data () {
95
95
  return {
96
- platformEnv: getPlatformEnv(),
96
+ platformEnv: MaliUtils.getPlatformEnv(),
97
97
  inpVal: ''
98
98
  }
99
99
  },
@@ -34,7 +34,7 @@
34
34
 
35
35
  <script>
36
36
  import XEUtils from 'xe-utils'
37
- import { getPlatformEnv } from '../../../utils'
37
+ import MaliUtils from '../../../utils'
38
38
 
39
39
  function eqEmptyNull (value) {
40
40
  return value === '' || XEUtils.eqNull(value)
@@ -74,7 +74,7 @@ export default {
74
74
  },
75
75
  data () {
76
76
  return {
77
- platformEnv: getPlatformEnv(),
77
+ platformEnv: MaliUtils.getPlatformEnv(),
78
78
  inpVal: ''
79
79
  }
80
80
  },
@@ -29,7 +29,7 @@
29
29
  </template>
30
30
 
31
31
  <script>
32
- import { getPlatformEnv } from '../../../utils'
32
+ import MaliUtils from '../../../utils'
33
33
 
34
34
  export default {
35
35
  name: 'MlSearchBar',
@@ -58,7 +58,7 @@ export default {
58
58
  },
59
59
  data () {
60
60
  return {
61
- platformEnv: getPlatformEnv(),
61
+ platformEnv: MaliUtils.getPlatformEnv(),
62
62
  inpVal: ''
63
63
  }
64
64
  },
@@ -35,7 +35,7 @@
35
35
  </template>
36
36
 
37
37
  <script>
38
- import { getPlatformEnv } from '../../../utils'
38
+ import MaliUtils from '../../../utils'
39
39
  import XEUtils from 'xe-utils'
40
40
  // import VoiceInput from './voice-input.vue'
41
41
 
@@ -90,7 +90,7 @@ export default {
90
90
  },
91
91
  data () {
92
92
  return {
93
- platformEnv: getPlatformEnv(),
93
+ platformEnv: MaliUtils.getPlatformEnv(),
94
94
  inpVal: ''
95
95
  }
96
96
  },
@@ -67,7 +67,7 @@
67
67
 
68
68
  <script>
69
69
  import globalStore from '../../../config/store'
70
- import { getPlatformEnv, getFileSuffix, getFileName } from '../../../utils'
70
+ import MaliUtils from '../../../utils'
71
71
 
72
72
  function normalizeChooseAndUploadFileRes (res, fileType) {
73
73
  res.tempFiles.forEach((item) => {
@@ -226,7 +226,7 @@ export default {
226
226
  fileList: [],
227
227
  docsTypes: ['doc', 'xls', 'ppt', 'pdf', 'docx', 'xlsx', 'pptx'],
228
228
  imgTypes: ['png', 'jpg', 'gif'],
229
- platformEnv: getPlatformEnv()
229
+ platformEnv: MaliUtils.getPlatformEnv()
230
230
  }
231
231
  },
232
232
  computed: {
@@ -295,17 +295,17 @@ export default {
295
295
  loadList () {
296
296
  if (this.simpleValue) {
297
297
  this.fileList = (this.urlList && this.urlList.length ? this.urlList : (this.value || [])).map(url => {
298
- const name = getFileName(url)
298
+ const name = MaliUtils.getFileName(url)
299
299
  const obj = {
300
300
  id: null,
301
301
  [this.nameField]: name,
302
- [this.typeField]: getFileSuffix(name),
302
+ [this.typeField]: MaliUtils.getFileSuffix(name),
303
303
  [this.urlField]: url
304
304
  }
305
305
  return {
306
306
  id: null,
307
307
  [this.nameField]: name,
308
- [this.typeField]: getFileSuffix(name),
308
+ [this.typeField]: MaliUtils.getFileSuffix(name),
309
309
  [this.urlField]: url,
310
310
  tempPath: this.getUrl(obj)
311
311
  }
@@ -504,7 +504,7 @@ export default {
504
504
  this.loading = true
505
505
  Promise.all(
506
506
  tempFiles.map(file => {
507
- const fileSuffix = getFileSuffix(file.name)
507
+ const fileSuffix = MaliUtils.getFileSuffix(file.name)
508
508
  if (uploadMethod) {
509
509
  return Promise.resolve(
510
510
  uploadMethod.call(this.currVM, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "vue2 码里云小程序组件库",
5
5
  "files": [
6
6
  "lib",
package/utils/index.js CHANGED
@@ -1,4 +1,12 @@
1
- import XEUtils from 'xe-utils'
1
+ import objectMethods from 'xe-utils/object'
2
+ import arrayMethods from 'xe-utils/array'
3
+ import baseMethods from 'xe-utils/base'
4
+ import numberMethods from 'xe-utils/number'
5
+ import dateMethods from 'xe-utils/date'
6
+ import stringMethods from 'xe-utils/string'
7
+ import functionMethods from 'xe-utils/function'
8
+ import urlMethods from 'xe-utils/url'
9
+ import webMethods from 'xe-utils/web'
2
10
 
3
11
  import * as appletFns from './applet'
4
12
  import * as dateFns from './date'
@@ -6,7 +14,25 @@ import * as numberFns from './number'
6
14
  import * as fileFns from './file'
7
15
 
8
16
  const MaliUtils = {
9
- ...XEUtils,
17
+ // Object
18
+ ...objectMethods,
19
+ // Array
20
+ ...arrayMethods,
21
+ // Base
22
+ ...baseMethods,
23
+ // Number
24
+ ...numberMethods,
25
+ // Date
26
+ ...dateMethods,
27
+ // String
28
+ ...stringMethods,
29
+ // Function
30
+ ...functionMethods,
31
+ // URL
32
+ ...urlMethods,
33
+ // Web
34
+ ...webMethods,
35
+
10
36
  ...appletFns,
11
37
  ...dateFns,
12
38
  ...numberFns,