mali-applet-ui 0.0.52 → 0.0.55
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/components/ml-button/ml-button.vue +3 -1
- package/components/ml-echarts/ml-echarts.vue +0 -37
- package/components/ml-form-item/ml-form-item.vue +1 -1
- package/components/ml-rich-text/ml-rich-text.vue +1 -0
- package/config/store.js +4 -0
- package/index.js +8 -2
- package/loading/index.js +19 -0
- package/package.json +3 -1
- package/toast/index.js +29 -0
|
@@ -71,11 +71,13 @@ export default {
|
|
|
71
71
|
}
|
|
72
72
|
&.type-button {
|
|
73
73
|
width: 100%;
|
|
74
|
-
margin: 0 10rpx;
|
|
75
74
|
padding: 0 20rpx;
|
|
76
75
|
line-height: 80rpx;
|
|
77
76
|
border: 1px solid #e5e5e5;
|
|
78
77
|
border-radius: 10rpx;
|
|
78
|
+
&+.ml-button {
|
|
79
|
+
margin-left: 20rpx;
|
|
80
|
+
}
|
|
79
81
|
&.status-primary {
|
|
80
82
|
color: #ffffff;
|
|
81
83
|
background: $uni-color-primary;
|
|
@@ -9,31 +9,6 @@ import XEUtils from 'xe-utils'
|
|
|
9
9
|
import WxCanvas from './wx-canvas';
|
|
10
10
|
import * as echarts from './echarts';
|
|
11
11
|
|
|
12
|
-
function compareVersion(v1, v2) {
|
|
13
|
-
v1 = v1.split('.')
|
|
14
|
-
v2 = v2.split('.')
|
|
15
|
-
const len = Math.max(v1.length, v2.length)
|
|
16
|
-
|
|
17
|
-
while (v1.length < len) {
|
|
18
|
-
v1.push('0')
|
|
19
|
-
}
|
|
20
|
-
while (v2.length < len) {
|
|
21
|
-
v2.push('0')
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
for (let i = 0; i < len; i++) {
|
|
25
|
-
const num1 = parseInt(v1[i])
|
|
26
|
-
const num2 = parseInt(v2[i])
|
|
27
|
-
|
|
28
|
-
if (num1 > num2) {
|
|
29
|
-
return 1
|
|
30
|
-
} else if (num1 < num2) {
|
|
31
|
-
return -1
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return 0
|
|
35
|
-
}
|
|
36
|
-
|
|
37
12
|
export default {
|
|
38
13
|
name: 'MlEcharts',
|
|
39
14
|
options: {
|
|
@@ -44,7 +19,6 @@ export default {
|
|
|
44
19
|
height:String,
|
|
45
20
|
width: String,
|
|
46
21
|
lazyLoad:Boolean,
|
|
47
|
-
forceUseOldCanvas: Boolean,
|
|
48
22
|
className: String
|
|
49
23
|
},
|
|
50
24
|
data() {
|
|
@@ -111,17 +85,6 @@ export default {
|
|
|
111
85
|
this.loadChart()
|
|
112
86
|
},
|
|
113
87
|
init: function() {
|
|
114
|
-
const version = uni.getSystemInfoSync().SDKVersion
|
|
115
|
-
const canUseNewCanvas = compareVersion(version, '2.9.0') >= 0;
|
|
116
|
-
const forceUseOldCanvas = this.forceUseOldCanvas;
|
|
117
|
-
const isUseNewCanvas = canUseNewCanvas && !forceUseOldCanvas;
|
|
118
|
-
this.isUseNewCanvas = isUseNewCanvas
|
|
119
|
-
|
|
120
|
-
if (forceUseOldCanvas && canUseNewCanvas) {
|
|
121
|
-
console.warn('开发者强制使用旧canvas,建议关闭');
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// version >= 2.9.0:使用新的方式初始化
|
|
125
88
|
const query = uni.createSelectorQuery().in(this)
|
|
126
89
|
query
|
|
127
90
|
.in(this)
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<ml-select-picker v-else-if="matchComponent('MlSelectPicker')" :value="itemValue" :options="renderOpts.options" border @change="modelEvent"></ml-select-picker>
|
|
14
14
|
<ml-textarea v-else-if="matchComponent('MlTextarea')" :value="itemValue" :rows="renderOpts.rows || 3" border @change="modelEvent"></ml-textarea>
|
|
15
15
|
<ml-upload v-else-if="matchComponent('MlUpload')" :value="itemValue" :mediatype="renderOpts.mediatype || 'image'" @change="modelEvent"></ml-upload>
|
|
16
|
-
<ml-amount-input v-else-if="matchComponent('MlAmountInput')" :value="itemValue" @change="modelEvent"></ml-amount-input>
|
|
16
|
+
<ml-amount-input v-else-if="matchComponent('MlAmountInput')" :value="itemValue" border @change="modelEvent"></ml-amount-input>
|
|
17
17
|
<ml-amount-text v-else-if="matchComponent('MlAmountText')" :value="itemValue" @change="modelEvent"></ml-amount-text>
|
|
18
18
|
<text v-else class="ml-form-item-default-content">{{ itemValue }}</text>
|
|
19
19
|
</slot>
|
package/config/store.js
CHANGED
package/index.js
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import config from './config'
|
|
2
|
+
import MaliToast from './toast'
|
|
3
|
+
import MaliLoading from './loading'
|
|
2
4
|
import * as MaliUtils from './utils'
|
|
3
5
|
|
|
4
6
|
const MaliUI = {
|
|
5
7
|
config,
|
|
6
|
-
MaliUtils
|
|
8
|
+
MaliUtils,
|
|
9
|
+
MaliToast,
|
|
10
|
+
MaliLoading
|
|
7
11
|
}
|
|
8
12
|
|
|
9
13
|
export {
|
|
10
|
-
MaliUtils
|
|
14
|
+
MaliUtils,
|
|
15
|
+
MaliToast,
|
|
16
|
+
MaliLoading
|
|
11
17
|
}
|
|
12
18
|
|
|
13
19
|
export default MaliUI
|
package/loading/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const MaliLoading = {
|
|
2
|
+
show (option = {}) {
|
|
3
|
+
return new Promise(resolve => {
|
|
4
|
+
uni.showLoading({
|
|
5
|
+
title: option.content || '加载中',
|
|
6
|
+
success: resolve
|
|
7
|
+
})
|
|
8
|
+
})
|
|
9
|
+
},
|
|
10
|
+
hide () {
|
|
11
|
+
return new Promise(resolve => {
|
|
12
|
+
uni.hideLoading({
|
|
13
|
+
success: resolve
|
|
14
|
+
})
|
|
15
|
+
})
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default MaliLoading
|
package/package.json
CHANGED
package/toast/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const MaliToast = {
|
|
2
|
+
success (option = {}) {
|
|
3
|
+
return new Promise(resolve => {
|
|
4
|
+
uni.showToast({
|
|
5
|
+
title: option.content || '操作成功',
|
|
6
|
+
icon: 'success',
|
|
7
|
+
success: resolve
|
|
8
|
+
})
|
|
9
|
+
})
|
|
10
|
+
},
|
|
11
|
+
error (option = {}) {
|
|
12
|
+
return new Promise(resolve => {
|
|
13
|
+
uni.showToast({
|
|
14
|
+
title: option.content || '操作失败',
|
|
15
|
+
icon: 'error',
|
|
16
|
+
success: resolve
|
|
17
|
+
})
|
|
18
|
+
})
|
|
19
|
+
},
|
|
20
|
+
hide () {
|
|
21
|
+
return new Promise(resolve => {
|
|
22
|
+
uni.hideToast({
|
|
23
|
+
success: resolve
|
|
24
|
+
})
|
|
25
|
+
})
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default MaliToast
|