mali-applet-ui 0.1.18 → 0.1.20
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 +15 -3
- package/components/ml-chunk-item/ml-chunk-item.vue +13 -0
- package/components/ml-datetime-picker/ml-datetime-picker.vue +2 -1
- package/components/ml-form-group/ml-form-group.vue +3 -0
- package/components/ml-tab-pane/ml-tab-pane.vue +22 -0
- package/components/ml-tabs/ml-tabs.vue +6 -5
- package/components/ml-toast/ml-toast.vue +90 -0
- package/package.json +1 -1
|
@@ -132,9 +132,21 @@ export default {
|
|
|
132
132
|
background: $uni-color-error;
|
|
133
133
|
border-color: $uni-color-error;
|
|
134
134
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
&.is-round {
|
|
136
|
+
border-radius: 50rpx;
|
|
137
|
+
&.size-medium {
|
|
138
|
+
padding: 0 40rpx;
|
|
139
|
+
border-radius: 60rpx;
|
|
140
|
+
}
|
|
141
|
+
&.size-small {
|
|
142
|
+
padding: 0 30rpx;
|
|
143
|
+
border-radius: 40rpx;
|
|
144
|
+
}
|
|
145
|
+
&.size-mini {
|
|
146
|
+
padding: 0 20rpx;
|
|
147
|
+
border-radius: 30rpx;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
138
150
|
}
|
|
139
151
|
}
|
|
140
152
|
</style>
|
|
@@ -12,6 +12,8 @@ export default {
|
|
|
12
12
|
},
|
|
13
13
|
props: {
|
|
14
14
|
span: [String, Number],
|
|
15
|
+
url: String,
|
|
16
|
+
redirect: Boolean,
|
|
15
17
|
align: String,
|
|
16
18
|
width: String,
|
|
17
19
|
className: String
|
|
@@ -35,6 +37,17 @@ export default {
|
|
|
35
37
|
this.$emit('click', {})
|
|
36
38
|
},
|
|
37
39
|
tapEvent () {
|
|
40
|
+
if (this.url) {
|
|
41
|
+
if (this.redirect) {
|
|
42
|
+
uni.redirectTo({
|
|
43
|
+
url: this.url
|
|
44
|
+
})
|
|
45
|
+
} else {
|
|
46
|
+
uni.navigateTo({
|
|
47
|
+
url: this.url
|
|
48
|
+
})
|
|
49
|
+
}
|
|
50
|
+
}
|
|
38
51
|
this.$emit('tap', {})
|
|
39
52
|
}
|
|
40
53
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<uni-datetime-picker :class="className" v-model="selectVal" type="datetime" :start="minDate" :end="maxDate" @change="changeEvent" :border="border"/>
|
|
2
|
+
<uni-datetime-picker :class="className" v-model="selectVal" type="datetime" :start="minDate" :end="maxDate" :hide-second="hideSecond" @change="changeEvent" :border="border"/>
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script>
|
|
@@ -13,6 +13,7 @@ export default {
|
|
|
13
13
|
border: Boolean,
|
|
14
14
|
minDate: [String, Number],
|
|
15
15
|
maxDate: [String, Number],
|
|
16
|
+
hideSecond: Boolean,
|
|
16
17
|
className: String
|
|
17
18
|
},
|
|
18
19
|
data () {
|
|
@@ -12,6 +12,7 @@ export default {
|
|
|
12
12
|
},
|
|
13
13
|
props: {
|
|
14
14
|
name: [String, Number],
|
|
15
|
+
title: String,
|
|
15
16
|
className: String
|
|
16
17
|
},
|
|
17
18
|
inject: {
|
|
@@ -20,6 +21,27 @@ export default {
|
|
|
20
21
|
default: null
|
|
21
22
|
}
|
|
22
23
|
},
|
|
24
|
+
data () {
|
|
25
|
+
return {
|
|
26
|
+
mId: XEUtils.uniqueId('mlTabPane')
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
mounted () {
|
|
30
|
+
this.$nextTick(() => {
|
|
31
|
+
if (this.tabs) {
|
|
32
|
+
this.tabs.tabList.push({
|
|
33
|
+
mId: this.mId,
|
|
34
|
+
name: this.name,
|
|
35
|
+
title: this.title
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
},
|
|
40
|
+
beforeDestroy () {
|
|
41
|
+
if (this.tabs) {
|
|
42
|
+
XEUtils.remove(this.tabs.itemList, item => item.mId === this.mId)
|
|
43
|
+
}
|
|
44
|
+
},
|
|
23
45
|
computed: {
|
|
24
46
|
selectTab () {
|
|
25
47
|
return this.tabs ? this.tabs.value : null
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
<view class="ml-tabs-header">
|
|
4
4
|
<scroll-view scroll-x>
|
|
5
5
|
<view class="ml-tabs-navs" :class="[itemAlign ? `is-${itemAlign}` : '']">
|
|
6
|
-
<view class="ml-tabs-nav-item" v-for="(item, index) in
|
|
7
|
-
<view class="ml-tabs-nav-title">{{ item.
|
|
6
|
+
<view class="ml-tabs-nav-item" v-for="(item, index) in tabList" :key="index" :class="{'is-active': value === item.name}" :style="itemStyles" @tap="changeEvent(item)">
|
|
7
|
+
<view class="ml-tabs-nav-title">{{ item.title }}</view>
|
|
8
8
|
</view>
|
|
9
9
|
</view>
|
|
10
10
|
</scroll-view>
|
|
@@ -22,7 +22,6 @@ export default {
|
|
|
22
22
|
name: 'MlTabs',
|
|
23
23
|
props: {
|
|
24
24
|
value: [String, Number],
|
|
25
|
-
options: Array,
|
|
26
25
|
className: String,
|
|
27
26
|
itemAlign: String,
|
|
28
27
|
itemWidth: String
|
|
@@ -33,7 +32,9 @@ export default {
|
|
|
33
32
|
}
|
|
34
33
|
},
|
|
35
34
|
data () {
|
|
36
|
-
return {
|
|
35
|
+
return {
|
|
36
|
+
tabList: []
|
|
37
|
+
}
|
|
37
38
|
},
|
|
38
39
|
computed: {
|
|
39
40
|
itemStyles () {
|
|
@@ -42,7 +43,7 @@ export default {
|
|
|
42
43
|
},
|
|
43
44
|
methods: {
|
|
44
45
|
changeEvent (item) {
|
|
45
|
-
const value = item.
|
|
46
|
+
const value = item.name
|
|
46
47
|
this.$emit('input', value)
|
|
47
48
|
this.$emit('change', { value })
|
|
48
49
|
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="ml-toast" :class="[className || '', {'is-loading': type === 'loading', 'is-visible': value}]">
|
|
3
|
+
<view class="ml-toast-warpper">
|
|
4
|
+
<view class="ml-toast-chunk">
|
|
5
|
+
<view class="ml-toast-icon">
|
|
6
|
+
<ml-icon v-if="type === 'success'" name="success-filling" />
|
|
7
|
+
<ml-icon v-else-if="type === 'error'" name="delete-filling" />
|
|
8
|
+
<ml-icon v-else-if="type === 'warning'" name="prompt-filling" />
|
|
9
|
+
<ml-icon v-else-if="type === 'info'" name="info-fill" />
|
|
10
|
+
<ml-icon v-else-if="type === 'loading'" name="shuaxin" />
|
|
11
|
+
</view>
|
|
12
|
+
<view class="ml-toast-content">{{ text }}</view>
|
|
13
|
+
</view>
|
|
14
|
+
</view>
|
|
15
|
+
</view>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
export default {
|
|
20
|
+
name: 'MlToast',
|
|
21
|
+
props: {
|
|
22
|
+
value: Boolean,
|
|
23
|
+
type: String,
|
|
24
|
+
content: String,
|
|
25
|
+
className: String
|
|
26
|
+
},
|
|
27
|
+
computed: {
|
|
28
|
+
text () {
|
|
29
|
+
if (this.content) {
|
|
30
|
+
return this.content
|
|
31
|
+
}
|
|
32
|
+
return ''
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<style lang="scss">
|
|
39
|
+
.ml-toast {
|
|
40
|
+
display: none;
|
|
41
|
+
position: fixed;
|
|
42
|
+
top: 0;
|
|
43
|
+
left: 0;
|
|
44
|
+
width: 100%;
|
|
45
|
+
height: 100vh;
|
|
46
|
+
z-index: 999;
|
|
47
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
48
|
+
@keyframes rollCircle {
|
|
49
|
+
0% {
|
|
50
|
+
transform: rotate(0deg)
|
|
51
|
+
}
|
|
52
|
+
to {
|
|
53
|
+
transform: rotate(1turn)
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
&.is-visible {
|
|
57
|
+
display: block;
|
|
58
|
+
}
|
|
59
|
+
&.is-loading {
|
|
60
|
+
.ml-toast-icon {
|
|
61
|
+
animation: rollCircle 1s linear infinite;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
.ml-toast-warpper {
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
justify-content: center;
|
|
68
|
+
position: absolute;
|
|
69
|
+
top: 50%;
|
|
70
|
+
left: 50%;
|
|
71
|
+
width: 200rpx;
|
|
72
|
+
height: 200rpx;
|
|
73
|
+
border-radius: 20rpx;
|
|
74
|
+
transform: translate(-50%, -50%);
|
|
75
|
+
text-align: center;
|
|
76
|
+
background: #4C4C4C;
|
|
77
|
+
color: rgba(255, 255, 255, 0.9);
|
|
78
|
+
.ml-toast-icon {
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
color: rgba(255, 255, 255, 0.9);
|
|
83
|
+
font-size: 50rpx;
|
|
84
|
+
}
|
|
85
|
+
.ml-toast-content {
|
|
86
|
+
padding: 15rpx 20rpx 15rpx 20rpx;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
</style>
|