mali-applet-ui 1.0.39 → 1.0.41

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.
@@ -9,29 +9,28 @@
9
9
  </view>
10
10
  </view>
11
11
  <view v-else class="ml-amount-input" :class="[{'is-right': align === 'right', 'is-border': border, 'is-disabled': disabled, 'is-clear': clearable && inpVal}, className]">
12
- <view v-if="showTip" class="ml-amount-tip">
13
- <view>首位:</view>
14
- <view class="ml-amount-tip-label">{{ firstNumLabel }}</view>
15
- </view>
16
- <input
17
- v-model="inpVal"
18
- type="digit"
19
- class="ml-amount-input-inp"
20
- autocomplete="off"
21
- :placeholder="placeholder"
22
- :maxlength="maxLength"
23
- :disabled="disabled"
24
- @blur="blurEvent"
25
- @input="inputEvent" />
26
- <view v-if="clearable && !disabled && inpVal" class="ml-amount-input-clear-icon" @click.stop="clearEvent">
27
- <ml-icon name="delete-filling"></ml-icon>
12
+ <view class="ml-amount-input-warpper">
13
+ <input
14
+ v-model="inpVal"
15
+ type="digit"
16
+ class="ml-amount-input-inp"
17
+ autocomplete="off"
18
+ :placeholder="placeholder"
19
+ :maxlength="maxLength"
20
+ :disabled="disabled"
21
+ @blur="blurEvent"
22
+ @input="inputEvent" />
23
+ <view v-if="clearable && !disabled && inpVal" class="ml-amount-input-clear-icon" @click.stop="clearEvent">
24
+ <ml-icon name="delete-filling"></ml-icon>
25
+ </view>
28
26
  </view>
27
+ <view v-if="showTip" class="ml-amount-tip">{{ currAmountLabel }}</view>
29
28
  </view>
30
29
  </template>
31
30
 
32
31
  <script>
33
32
  import XEUtils from 'xe-utils'
34
- import { getPlatformEnv, toAmountString, toWanAmountString } from '../../../utils'
33
+ import { getPlatformEnv, toAmountString, toWanAmountString, toNumMoneyToChinese } from '../../../utils'
35
34
 
36
35
  function eqEmptyNull (value) {
37
36
  return value === '' || XEUtils.eqNull(value)
@@ -112,34 +111,8 @@ export default {
112
111
  }
113
112
  return null
114
113
  },
115
- firstNumLabel () {
116
- const numVal = XEUtils.toNumber(this.value)
117
- if (numVal > 999999999999) {
118
- return '万亿'
119
- } else if (numVal > 99999999999) {
120
- return '千亿'
121
- } else if (numVal > 9999999999) {
122
- return '百亿'
123
- } else if (numVal > 999999999) {
124
- return '十亿'
125
- } else if (numVal > 99999999) {
126
- return '亿'
127
- } else if (numVal > 9999999) {
128
- return '千万'
129
- } else if (numVal > 999999) {
130
- return '百万'
131
- } else if (numVal > 99999) {
132
- return '十万'
133
- } else if (numVal > 9999) {
134
- return '万'
135
- } else if (numVal > 999) {
136
- return '千'
137
- } else if (numVal > 99) {
138
- return '百'
139
- } else if (numVal > 9) {
140
- return '十'
141
- }
142
- return '-'
114
+ currAmountLabel () {
115
+ return this.currAmountNum === '' ? '' : toNumMoneyToChinese(this.currAmountNum)
143
116
  }
144
117
  },
145
118
  watch: {
@@ -212,8 +185,6 @@ export default {
212
185
  .ml-amount-input {
213
186
  position: relative;
214
187
  flex-grow: 1;
215
- display: flex;
216
- flex-direction: row;
217
188
  .ml-amount-input-placeholder {
218
189
  color: $ml-input-color-placeholder;;
219
190
  }
@@ -247,16 +218,12 @@ export default {
247
218
  }
248
219
  }
249
220
  .ml-amount-tip {
221
+ padding: 0 10rpx;
222
+ font-size: $ml-describe-font-size;
223
+ }
224
+ .ml-amount-input-warpper {
250
225
  display: flex;
251
226
  flex-direction: row;
252
- position: absolute;
253
- top: -60rpx;
254
- right: 10rpx;
255
- z-index: 1;
256
- .ml-amount-tip-label {
257
- min-width: 60rpx;
258
- text-align: right;
259
- }
260
227
  }
261
228
  .ml-amount-input-inp {
262
229
  outline: 0;
@@ -46,6 +46,7 @@ export default {
46
46
  border-radius: $ml-border-radius;
47
47
  background: #ffffff;
48
48
  margin-bottom: 20rpx;
49
+ color: $ml-font-color;
49
50
  .ml-chunk-group-title {
50
51
  display: flex;
51
52
  flex-direction: row;
@@ -61,6 +61,9 @@ export default {
61
61
  padding: 16rpx;
62
62
  line-height: 50rpx;
63
63
  font-size: $ml-describe-font-size;
64
+ overflow: hidden;
65
+ text-overflow: ellipsis;
66
+ white-space: nowrap;
64
67
  $spans: 4.16667%, 8.33333%, 12.5%, 16.66667%, 20.83333%, 25%, 29.16667%, 33.33333%,
65
68
  37.5%, 41.66667%, 45.83333%, 50%, 54.16667%, 58.33333%, 62.5%, 66.66667%,
66
69
  70.83333%, 75%, 79.16667%, 83.33333%, 87.5%, 91.66667%, 95.83333%, 100%;
@@ -2,7 +2,7 @@
2
2
  <view v-if="isFromReadonly" class="ml-date-picker is-readonly">
3
3
  <view class="ml-date-picker-readonly-content">{{ value }}</view>
4
4
  </view>
5
- <uni-datetime-picker v-else :class="className" v-model="selectVal" type="date" :start="minDate" :end="maxDate" @change="changeEvent" :border="border"/>
5
+ <uni-datetime-picker v-else :class="className" v-model="selectVal" type="date" :start="minDate" :end="maxDate" :placeholder="placeholder" @change="changeEvent" :border="border"/>
6
6
  </template>
7
7
 
8
8
  <script>
@@ -13,9 +13,16 @@ export default {
13
13
  },
14
14
  props: {
15
15
  value: String,
16
- border: Boolean,
16
+ border: {
17
+ type: Boolean,
18
+ default: false
19
+ },
17
20
  minDate: [String, Number],
18
21
  maxDate: [String, Number],
22
+ placeholder: {
23
+ type: String,
24
+ default: '请选择日期'
25
+ },
19
26
  className: String
20
27
  },
21
28
  inject: {
@@ -221,12 +221,14 @@ export default {
221
221
  }
222
222
  .ml-form-item-header {
223
223
  min-height: 78rpx;
224
+ padding: 0 10rpx;
224
225
  }
225
226
  .ml-form-item-header-asterisk {
226
- display: inline;
227
+ position: absolute;
228
+ left: 10rpx;
227
229
  color: red;
228
- padding-right: 4rpx;
229
230
  font-weight: 700;
231
+ padding-top: 10rpx;
230
232
  }
231
233
  .ml-form-item-header-title {
232
234
  display: inline;
@@ -6,7 +6,8 @@
6
6
  export default {
7
7
  name: 'MlIcon',
8
8
  options: {
9
- virtualHost: true
9
+ virtualHost: true,
10
+ styleIsolation: 'shared'
10
11
  },
11
12
  props: {
12
13
  name: String,
@@ -2,10 +2,11 @@
2
2
  <view class="ml-progress-bar" :class="className">
3
3
  <view class="progress-bar-header">
4
4
  <slot name="header">
5
- <view v-if="title" class="progress-bar-title" :class="{'is-underline': titleUnderline}">{{ title }}</view>
5
+ <view v-if="title" class="progress-header-title" :class="{'is-underline': titleUnderline}">{{ title }}</view>
6
+ <view v-if="title && showNum" class="progress-header-num">{{ value || 0 }}{{ unit || '' }}</view>
6
7
  </slot>
7
8
  </view>
8
- <view class="progress-bar-chart" @click="barClick">
9
+ <view class="progress-bar-chart" :class="{'show-num': !title && showNum}" @click="barClick">
9
10
  <progress
10
11
  :percent="percNum"
11
12
  :activeColor="activeColor || '#1890FF'"
@@ -13,7 +14,7 @@
13
14
  :strokeWidth="strokeWidth"
14
15
  :fontSize="fontSize"
15
16
  :border-radius="borderRadius" />
16
- <view v-if="showNum" class="progress-bar-num">{{ value || 0 }}{{ unit || '' }}</view>
17
+ <view v-if="!title && showNum" class="progress-bar-num">{{ value || 0 }}{{ unit || '' }}</view>
17
18
  </view>
18
19
  <view class="progress-bar-footer">
19
20
  <slot name="footer"></slot>
@@ -75,13 +76,17 @@ export default {
75
76
  .ml-progress-bar {
76
77
  font-size: $ml-base-font-size;
77
78
  .progress-bar-header {
79
+ display: flex;
80
+ flex-direction: row;
78
81
  text-align: left;
79
82
  }
80
83
  .progress-bar-chart {
81
84
  height: 24rpx;
82
85
  position: relative;
83
86
  margin: 12rpx 0;
84
- padding-right: 80rpx;
87
+ &.show-num {
88
+ padding-right: 80rpx;
89
+ }
85
90
  .progress-bar-num {
86
91
  position: absolute;
87
92
  right: 0;
@@ -91,7 +96,8 @@ export default {
91
96
  text-align: left;
92
97
  }
93
98
  }
94
- .progress-bar-title {
99
+ .progress-header-title {
100
+ flex-grow: 1;
95
101
  overflow: hidden;
96
102
  text-overflow: ellipsis;
97
103
  white-space: nowrap;
@@ -100,5 +106,10 @@ export default {
100
106
  text-decoration: underline;
101
107
  }
102
108
  }
109
+ .progress-header-num {
110
+ flex-grow: 1;
111
+ min-width: 60rpx;
112
+ text-align: right;
113
+ }
103
114
  }
104
115
  </style>
@@ -161,6 +161,9 @@ export default {
161
161
  text-overflow: ellipsis;
162
162
  white-space: nowrap;
163
163
  }
164
+ .ml-select-picker-placeholder {
165
+ color: $uni-text-color-placeholder;
166
+ }
164
167
  }
165
168
  .ml-select-picker-clear-icon {
166
169
  width: 34rpx;
@@ -17,6 +17,9 @@ import XEUtils from 'xe-utils'
17
17
 
18
18
  export default {
19
19
  name: 'MlText',
20
+ options: {
21
+ styleIsolation: 'shared'
22
+ },
20
23
  props: {
21
24
  status: String,
22
25
  content: String,
@@ -115,4 +118,4 @@ export default {
115
118
  display: inline;
116
119
  }
117
120
  }
118
- </style>
121
+ </style>
@@ -133,7 +133,7 @@ export default {
133
133
  .ml-textarea {
134
134
  display: block;
135
135
  width: 100%;
136
- padding: 20rpx 10rpx 10rpx 10rpx;
136
+ padding: 0 10rpx;
137
137
  background: #fff;
138
138
  .ml-textarea-placeholder {
139
139
  color: $ml-input-color-placeholder;;
@@ -157,6 +157,7 @@ export default {
157
157
  }
158
158
  .ml-textarea-inp,
159
159
  .ml-textarea-simulate {
160
+ padding: 0;
160
161
  height: 280rpx;
161
162
  width: 100%;
162
163
  font-size: $ml-base-font-size;
@@ -169,7 +170,6 @@ export default {
169
170
  flex-grow: 1;
170
171
  color: #999999;
171
172
  text-align: right;
172
- padding-right: 20rpx;
173
173
  font-size: $ml-describe-font-size;
174
174
  }
175
175
  }
@@ -8,28 +8,40 @@
8
8
  <ml-icon name="close" />
9
9
  </view>
10
10
  </view>
11
- <view v-if="!isFromReadonly && fileList.length < limit" class="ml-upload-image-add">
12
- <view class="ml-upload-image-add-btn" @tap="chooseEvent">
13
- <view class="ml-upload-image-add-icon">
14
- <ml-icon v-if="loading" name="loading" roll />
15
- <ml-icon v-else name="add" />
16
- <view v-if="loading" class="ml-upload-image-add-loading-text">上传中...</view>
11
+ <template v-if="!isFromReadonly && fileList.length < limit">
12
+ <view v-if="hasForm" class="ml-upload-image-form-add-btn" @tap="chooseEvent">
13
+ <ml-icon v-if="loading" name="loading" roll />
14
+ <ml-icon v-else name="add-circle" />
15
+ </view>
16
+ <view v-else class="ml-upload-image-add">
17
+ <view class="ml-upload-image-add-btn" @tap="chooseEvent">
18
+ <view class="ml-upload-image-add-icon">
19
+ <ml-icon v-if="loading" name="loading" roll />
20
+ <ml-icon v-else name="add" />
21
+ <view v-if="loading" class="ml-upload-image-add-loading-text">上传中...</view>
22
+ </view>
17
23
  </view>
18
24
  </view>
19
- </view>
25
+ </template>
20
26
  </view>
21
27
  <!-- 上传文件 -->
22
28
  <view v-else class="ml-upload-file-list">
23
- <view v-if="!isFromReadonly && fileList.length < limit" class="ml-upload-file-add">
24
- <view class="ml-upload-file-add-btn" @tap="chooseEvent">
25
- <text class="ml-upload-file-add-icon">
26
- <ml-icon v-if="loading" name="loading" roll />
27
- <ml-icon v-else name="add" />
28
- </text>
29
- <text v-if="loading">上传中...</text>
30
- <text v-else>添加文件</text>
29
+ <template v-if="!isFromReadonly && fileList.length < limit">
30
+ <view v-if="hasForm" class="ml-upload-file-form-add-btn" @tap="chooseEvent">
31
+ <ml-icon v-if="loading" name="loading" roll />
32
+ <ml-icon v-else name="add-circle" />
31
33
  </view>
32
- </view>
34
+ <view v-else class="ml-upload-file-add">
35
+ <view class="ml-upload-file-add-btn" @tap="chooseEvent">
36
+ <text class="ml-upload-file-add-icon">
37
+ <ml-icon v-if="loading" name="loading" roll />
38
+ <ml-icon v-else name="add" />
39
+ </text>
40
+ <text v-if="loading">上传中...</text>
41
+ <text v-else>添加文件</text>
42
+ </view>
43
+ </view>
44
+ </template>
33
45
  <view class="ml-upload-file-item" v-for="(item, index) in fileList" :key="index">
34
46
  <view class="ml-upload-file-left">
35
47
  <view class="ml-upload-file-icon">
@@ -217,6 +229,9 @@ export default {
217
229
  }
218
230
  },
219
231
  computed: {
232
+ hasForm () {
233
+ return !!this.form
234
+ },
220
235
  isFromReadonly () {
221
236
  if (this.readonly) {
222
237
  return true
@@ -523,6 +538,7 @@ export default {
523
538
 
524
539
  <style lang="scss">
525
540
  .ml-upload-image-list {
541
+ position: relative;
526
542
  display: flex;
527
543
  flex-direction: row;
528
544
  flex-wrap: wrap;
@@ -540,9 +556,9 @@ export default {
540
556
  position: absolute;
541
557
  right: 0;
542
558
  top: 0;
543
- width: 40rpx;
544
- height: 40rpx;
545
- line-height: 40rpx;
559
+ width: 36rpx;
560
+ height: 36rpx;
561
+ line-height: 36rpx;
546
562
  font-size: 28rpx;
547
563
  text-align: center;
548
564
  border-radius: 50%;
@@ -577,9 +593,10 @@ export default {
577
593
  }
578
594
  }
579
595
  .ml-upload-file-list {
596
+ position: relative;
580
597
  .ml-upload-file-add,
581
598
  .ml-upload-file-item {
582
- margin: 20rpx 0;
599
+ margin: 10rpx 0;
583
600
  }
584
601
  .ml-upload-file-item {
585
602
  display: flex;
@@ -638,4 +655,11 @@ export default {
638
655
  width: 60rpx;
639
656
  }
640
657
  }
658
+ .ml-upload-image-form-add-btn,
659
+ .ml-upload-file-form-add-btn {
660
+ position: absolute;
661
+ top: -74rpx;
662
+ right: 20rpx;
663
+ font-size: 44rpx;
664
+ }
641
665
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
4
4
  "description": "码里云小程序组件库",
5
5
  "files": [
6
6
  "lib",