mali-applet-ui 1.0.173 → 1.0.175
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.
|
@@ -564,6 +564,9 @@ export default {
|
|
|
564
564
|
this.tempRange.before = this.cale.multipleStatus.before
|
|
565
565
|
this.tempRange.after = this.cale.multipleStatus.after
|
|
566
566
|
}
|
|
567
|
+
if (!this.time) {
|
|
568
|
+
this.time = this.hideSecond ? '00:00' : '00:00:00'
|
|
569
|
+
}
|
|
567
570
|
this.change()
|
|
568
571
|
},
|
|
569
572
|
/**
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<image class="ml-image" :src="url" :mode="mode" :style="imgStyles"></image>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
export default {
|
|
7
|
+
name: 'MlImage',
|
|
8
|
+
props: {
|
|
9
|
+
url: String,
|
|
10
|
+
mode: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: 'aspectFit'
|
|
13
|
+
},
|
|
14
|
+
width: [String, Number],
|
|
15
|
+
height: [String, Number]
|
|
16
|
+
},
|
|
17
|
+
computed: {
|
|
18
|
+
imgStyles () {
|
|
19
|
+
const width = this.width
|
|
20
|
+
const height = this.height
|
|
21
|
+
const wSty = width ? `width: ${isNaN(width) ? width : `${width}rpx`};` : ''
|
|
22
|
+
const hSty = height ? `height: ${isNaN(height) ? height : `${height}rpx`};` : ''
|
|
23
|
+
return `${wSty}${hSty}`
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<style lang="scss">
|
|
30
|
+
.ml-image {
|
|
31
|
+
width: 80rpx;
|
|
32
|
+
height: 80rpx;
|
|
33
|
+
}
|
|
34
|
+
</style>
|
|
@@ -102,6 +102,10 @@ export default {
|
|
|
102
102
|
return this.showPage
|
|
103
103
|
? {
|
|
104
104
|
pageObj: this.pageVO,
|
|
105
|
+
pageData: {
|
|
106
|
+
[this.pagePropOpts.currentPage || 'page']: this.pageVO.currPage,
|
|
107
|
+
[this.pagePropOpts.pageSize || 'limit']: this.pageVO.pageSize
|
|
108
|
+
},
|
|
105
109
|
data: {
|
|
106
110
|
[this.pagePropOpts.currentPage || 'page']: this.pageVO.currPage,
|
|
107
111
|
[this.pagePropOpts.pageSize || 'limit']: this.pageVO.pageSize
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="ml-switch" :
|
|
3
|
-
<view
|
|
4
|
-
<view class="ml-switch
|
|
5
|
-
<view class="ml-switch
|
|
2
|
+
<view class="ml-switch" :class="[isChecked ? 'is--on' : 'is--off', {'is--disabled': disabled,'is--animat': this.hasAnimat}]">
|
|
3
|
+
<view class="ml-switch--button" @tap="clickEvent">
|
|
4
|
+
<view class="ml-switch--label ml-switch--label-on">{{ onShowLabel }}</view>
|
|
5
|
+
<view class="ml-switch--label ml-switch--label-off">{{ offShowLabel }}</view>
|
|
6
|
+
<view class="ml-switch--icon"></view>
|
|
6
7
|
</view>
|
|
7
|
-
<switch v-else class="ml-switch-native" :class="className" :checked="checked" :color="color" @change="changeEvent"></switch>
|
|
8
8
|
</view>
|
|
9
9
|
</template>
|
|
10
10
|
|
|
@@ -16,10 +16,6 @@ export default {
|
|
|
16
16
|
},
|
|
17
17
|
props: {
|
|
18
18
|
value: [String, Number, Boolean],
|
|
19
|
-
color: {
|
|
20
|
-
type: String,
|
|
21
|
-
default: '#007aff'
|
|
22
|
-
},
|
|
23
19
|
width: String,
|
|
24
20
|
openLabel: String,
|
|
25
21
|
closeLabel: String,
|
|
@@ -31,27 +27,42 @@ export default {
|
|
|
31
27
|
type: [String, Number, Boolean],
|
|
32
28
|
default: false
|
|
33
29
|
},
|
|
30
|
+
disabled: Boolean,
|
|
34
31
|
className: String
|
|
35
32
|
},
|
|
33
|
+
data () {
|
|
34
|
+
return {
|
|
35
|
+
isActivated: false,
|
|
36
|
+
hasAnimat: false
|
|
37
|
+
}
|
|
38
|
+
},
|
|
36
39
|
computed: {
|
|
37
|
-
|
|
38
|
-
const wSys = this.width ? `width: ${this.width};` : ''
|
|
39
|
-
return `${wSys}`
|
|
40
|
-
},
|
|
41
|
-
checked () {
|
|
40
|
+
isChecked () {
|
|
42
41
|
return this.value === this.openValue
|
|
42
|
+
},
|
|
43
|
+
onShowLabel () {
|
|
44
|
+
return this.openLabel || ''
|
|
45
|
+
},
|
|
46
|
+
offShowLabel () {
|
|
47
|
+
return this.closeLabel || ''
|
|
43
48
|
}
|
|
44
49
|
},
|
|
45
50
|
methods: {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
clickEvent (evnt) {
|
|
52
|
+
if (!this.disabled) {
|
|
53
|
+
clearTimeout(this.activeTimeout)
|
|
54
|
+
const value = this.isChecked ? this.closeValue : this.openValue
|
|
55
|
+
this.hasAnimat = true
|
|
56
|
+
this.$emit('input', value)
|
|
57
|
+
this.$emit('change', { value })
|
|
58
|
+
// 自动更新校验状态
|
|
59
|
+
if (this.$xeform && this.$xeformiteminfo) {
|
|
60
|
+
this.$xeform.triggerItemEvent(evnt, this.$xeformiteminfo.itemConfig.field, value)
|
|
61
|
+
}
|
|
62
|
+
this.activeTimeout = setTimeout(() => {
|
|
63
|
+
this.hasAnimat = false
|
|
64
|
+
}, 400)
|
|
65
|
+
}
|
|
55
66
|
}
|
|
56
67
|
}
|
|
57
68
|
}
|
|
@@ -59,28 +70,103 @@ export default {
|
|
|
59
70
|
|
|
60
71
|
<style lang="scss">
|
|
61
72
|
.ml-switch {
|
|
62
|
-
display: inline-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
.ml-switch
|
|
73
|
-
flex-grow: 1;
|
|
74
|
-
padding: 0 24rpx;
|
|
75
|
-
height: 44rpx;
|
|
76
|
-
line-height: 44rpx;
|
|
77
|
-
font-size: $ml-describe-font-size;
|
|
73
|
+
display: inline-block;
|
|
74
|
+
color: $ml-font-color;
|
|
75
|
+
vertical-align: middle;
|
|
76
|
+
padding: 12rpx;
|
|
77
|
+
user-select: none;
|
|
78
|
+
text-align: center;
|
|
79
|
+
&.is--animat {
|
|
80
|
+
.ml-switch--button {
|
|
81
|
+
transition: border-color .3s, background-color .3s;
|
|
82
|
+
}
|
|
83
|
+
.ml-switch--icon {
|
|
78
84
|
transition: all 0.3s;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
&.is--on {
|
|
88
|
+
.ml-switch--button {
|
|
89
|
+
padding-right: 40rpx;
|
|
90
|
+
background-color: $ml-theme-primary-color;
|
|
91
|
+
}
|
|
92
|
+
.ml-switch--icon {
|
|
93
|
+
left: 100%;
|
|
94
|
+
transform: translateX(-38rpx);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
&.is--off {
|
|
98
|
+
.ml-switch--button {
|
|
99
|
+
padding-left: 40rpx;
|
|
100
|
+
background-color: rgba(0,0,0,0.35);
|
|
101
|
+
}
|
|
102
|
+
.ml-switch--icon {
|
|
103
|
+
left: 6rpx;
|
|
104
|
+
transform: translateX(0);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
&.is--on .ml-switch--label-off,
|
|
108
|
+
&.is--off .ml-switch--label-on {
|
|
109
|
+
height: 0;
|
|
110
|
+
visibility: hidden;
|
|
111
|
+
overflow: hidden;
|
|
112
|
+
}
|
|
113
|
+
&.is--on,
|
|
114
|
+
&.is--off {
|
|
115
|
+
.ml-switch--label {
|
|
116
|
+
opacity: 1;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
&:not(.is--disabled) {
|
|
120
|
+
.ml-switch--button {
|
|
121
|
+
cursor: pointer;
|
|
122
|
+
&:focus {
|
|
123
|
+
box-shadow: 0 0 8rpx 0 #246BFD;
|
|
82
124
|
}
|
|
83
125
|
}
|
|
84
126
|
}
|
|
127
|
+
&.is--disabled {
|
|
128
|
+
.ml-switch--button {
|
|
129
|
+
cursor: no-drop;
|
|
130
|
+
}
|
|
131
|
+
&.is--on {
|
|
132
|
+
.ml-switch--button {
|
|
133
|
+
background-color: lighten(#246BFD, 20%);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
&.is--off {
|
|
137
|
+
.ml-switch--button {
|
|
138
|
+
background-color: rgba(0,0,0,0.15)
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
.ml-switch--button {
|
|
143
|
+
display: block;
|
|
144
|
+
position: relative;
|
|
145
|
+
height: 46rpx;
|
|
146
|
+
line-height: 46rpx;
|
|
147
|
+
min-width: 80rpx;
|
|
148
|
+
padding: 0 14rpx;
|
|
149
|
+
border-radius: 46rpx;
|
|
150
|
+
border: 0;
|
|
151
|
+
outline: 0;
|
|
152
|
+
}
|
|
153
|
+
.ml-switch--label {
|
|
154
|
+
opacity: 0;
|
|
155
|
+
display: block;
|
|
156
|
+
color: #fff;
|
|
157
|
+
font-size: 22rpx;
|
|
158
|
+
}
|
|
159
|
+
.ml-switch--icon {
|
|
160
|
+
position: absolute;
|
|
161
|
+
top: 7rpx;
|
|
162
|
+
left: 0;
|
|
163
|
+
width: 34rpx;
|
|
164
|
+
height: 34rpx;
|
|
165
|
+
border-radius: 50%;
|
|
166
|
+
background-color: #fff;
|
|
167
|
+
}
|
|
168
|
+
.ml-switch--label-icon {
|
|
169
|
+
margin-right: 10rpx;
|
|
170
|
+
}
|
|
85
171
|
}
|
|
86
172
|
</style>
|
package/package.json
CHANGED
package/utils/applet.js
CHANGED
|
@@ -3,21 +3,23 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export function checkForUpdate () {
|
|
5
5
|
const updateManager = uni.getUpdateManager()
|
|
6
|
-
updateManager
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
if (updateManager) {
|
|
7
|
+
updateManager.onCheckForUpdate((res) => {
|
|
8
|
+
console.log('检查版本', res.hasUpdate)
|
|
9
|
+
})
|
|
10
|
+
updateManager.onUpdateReady(() => {
|
|
11
|
+
uni.showModal({
|
|
12
|
+
title: '更新提示',
|
|
13
|
+
content: '新版本已经准备好,是否重启应用?',
|
|
14
|
+
success (res) {
|
|
15
|
+
if (res.confirm) {
|
|
16
|
+
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
|
17
|
+
updateManager.applyUpdate()
|
|
18
|
+
}
|
|
17
19
|
}
|
|
18
|
-
}
|
|
20
|
+
})
|
|
19
21
|
})
|
|
20
|
-
}
|
|
22
|
+
}
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
/**
|