mali-applet-ui 1.0.39 → 1.0.40

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;
@@ -12,7 +12,8 @@
12
12
  export default {
13
13
  name: 'MlCol',
14
14
  options: {
15
- virtualHost: true
15
+ virtualHost: true,
16
+ styleIsolation: 'shared'
16
17
  },
17
18
  props: {
18
19
  span: [String, Number],
@@ -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>
@@ -8,7 +8,8 @@
8
8
  export default {
9
9
  name: 'MlRow',
10
10
  options: {
11
- virtualHost: true
11
+ virtualHost: true,
12
+ styleIsolation: 'shared'
12
13
  },
13
14
  props: {
14
15
  gutter: [String, Number],
@@ -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;
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.40",
4
4
  "description": "码里云小程序组件库",
5
5
  "files": [
6
6
  "lib",