mali-applet-ui 1.0.94 → 1.0.96

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.
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <view class="ml-list-select-user-page" :class="[className || '', {'is-border': border, 'is-disabled': disabled}]" @tap="tapEvent">
3
- <view class="ml-list-select-user-list">
3
+ <view v-if="selectRows.length" class="ml-list-select-user-list">
4
4
  <view v-for="(item, index) in selectRows" :key="index" class="ml-list-select-user-item">
5
5
  <view class="ml-list-select-user-name">
6
6
  <view class="ml-list-select-user-content">{{ item[optLabelField] }}</view>
@@ -10,6 +10,9 @@
10
10
  </view>
11
11
  </view>
12
12
  </view>
13
+ <view v-else class="ml-list-select-user-list">
14
+ <view class="ml-list-select-user-page-placeholder">{{ placeholder }}</view>
15
+ </view>
13
16
  <view class="ml-list-select-user-add-item" @click="openUserEvent">
14
17
  <view class="ml-list-select-user-add-btn">
15
18
  <ml-icon name="add-circle" />
@@ -151,6 +154,14 @@ export default {
151
154
  right: 20rpx;
152
155
  font-size: 44rpx;
153
156
  }
157
+ &.is-disabled {
158
+ // #ifdef H5
159
+ cursor: pointer;
160
+ // #endif
161
+ .ml-list-select-user-add-item {
162
+ color: $uni-text-color-disable;
163
+ }
164
+ }
154
165
  .ml-list-select-user-img {
155
166
  width: 50rpx;
156
167
  height: 50rpx;
@@ -170,5 +181,8 @@ export default {
170
181
  flex-shrink: 0;
171
182
  margin-left: 16rpx;
172
183
  }
184
+ .ml-list-select-user-page-placeholder {
185
+ color: $ml-input-color-placeholder;
186
+ }
173
187
  }
174
188
  </style>
@@ -162,19 +162,33 @@ export default {
162
162
  return { status: true, value: numVal }
163
163
  },
164
164
  minusEvent () {
165
- const numVal = XEUtils.toNumber(this.inpVal)
166
- if (this.minNum === null || (numVal > this.minNum)) {
167
- this.inpVal = numVal - this.stepNum
168
- this.$emit('input', this.inpVal)
169
- this.$emit('change', {})
165
+ const numVal = this.type === 'integer' ? XEUtils.toInteger(this.inpVal) : XEUtils.toNumber(this.inpVal)
166
+ let value = XEUtils.subtract(numVal, this.stepNum)
167
+ if (this.maxNum !== null) {
168
+ value = Math.min(this.maxNum, value)
169
+ }
170
+ if (this.minNum !== null) {
171
+ value = Math.max(this.minNum, value)
172
+ }
173
+ if (`${value}` !== `${this.value}`) {
174
+ this.inpVal = value
175
+ this.$emit('input', value)
176
+ this.$emit('change', { value })
170
177
  }
171
178
  },
172
179
  plusEvent () {
173
- const numVal = XEUtils.toNumber(this.inpVal)
174
- if (this.maxNum === null || (numVal < this.maxNum)) {
175
- this.inpVal = numVal + this.stepNum
176
- this.$emit('input', this.inpVal)
177
- this.$emit('change', {})
180
+ const numVal = this.type === 'integer' ? XEUtils.toInteger(this.inpVal) : XEUtils.toNumber(this.inpVal)
181
+ let value = XEUtils.add(numVal, this.stepNum)
182
+ if (this.minNum !== null) {
183
+ value = Math.max(this.minNum, value)
184
+ }
185
+ if (this.maxNum !== null) {
186
+ value = Math.min(this.maxNum, value)
187
+ }
188
+ if (`${value}` !== `${this.value}`) {
189
+ this.inpVal = value
190
+ this.$emit('input', value)
191
+ this.$emit('change', { value })
178
192
  }
179
193
  },
180
194
  blurEvent () {
@@ -163,7 +163,7 @@ export default {
163
163
  white-space: nowrap;
164
164
  }
165
165
  .ml-select-picker-placeholder {
166
- color: $uni-text-color-placeholder;
166
+ color: $ml-input-color-placeholder;
167
167
  }
168
168
  }
169
169
  .ml-select-picker-clear-icon {
@@ -164,17 +164,17 @@ export default {
164
164
  }
165
165
  },
166
166
  mounted () {
167
- const { autoload, reloadLazy } = this
167
+ const { autoload, requestLazy } = this
168
168
  if (autoload) {
169
- reloadLazy()
169
+ requestLazy()
170
170
  }
171
171
  },
172
172
  methods: {
173
173
  async handleIntoChildren (item) {
174
- const { reloadLazy } = this
174
+ const { requestLazy } = this
175
175
  if (!(item.children && item.children.length) && !item.isLeaf) {
176
176
  // this.lazyLoading = true
177
- await reloadLazy(item)
177
+ await requestLazy(item)
178
178
  // this.lazyLoading = false
179
179
  }
180
180
  if (item.children && item.children.length) {
@@ -182,7 +182,11 @@ export default {
182
182
  this.$emit('into', this.cache[this.cache.length - 1])
183
183
  }
184
184
  },
185
- async reloadLazy (current) {
185
+ reloadLazy () {
186
+ const { current } = this
187
+ this.requestLazy(current)
188
+ },
189
+ async requestLazy (current) {
186
190
  const { lazyLoad, lazy, useProps } = this
187
191
  if (lazy && lazyLoad) {
188
192
  const list = await lazyLoad.call(this.currVM, current)
@@ -3,7 +3,7 @@
3
3
  <!-- 上传图片 -->
4
4
  <view v-if="mediatype === 'image'" class="ml-upload-image-list">
5
5
  <view class="ml-upload-image-item" v-for="(item, index) in fileList" :key="index">
6
- <image class="ml-upload-image-img" mode="aspectFit" :src="getThumbnailFileUrl(item)" @tap="previewImageEvent(item, index)"></image>
6
+ <image class="ml-upload-image-img" mode="aspectFill" :src="getThumbnailFileUrl(item)" @tap="previewImageEvent(item, index)"></image>
7
7
  <view v-if="!isFromReadonly" class="ml-upload-image-del-btn" @tap="removeEvent(item)">
8
8
  <ml-icon name="close" />
9
9
  </view>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "1.0.94",
3
+ "version": "1.0.96",
4
4
  "description": "码里云小程序组件库",
5
5
  "files": [
6
6
  "lib",
package/theme.scss CHANGED
@@ -30,5 +30,5 @@ $ml-border-radius: 8rpx;
30
30
  $ml-button-interval-margin: 16rpx;
31
31
  // 输入框清除按钮颜色
32
32
  $ml-input-clear-icon-color: rgba(23, 26, 29, 0.4);
33
- // 输入框提示物资颜色
34
- $ml-input-color-placeholder: rgba(23, 26, 29, 0.4);
33
+ // 输入框提示文本颜色
34
+ $ml-input-color-placeholder: rgba(23, 26, 29, 0.7);