mali-applet-ui 0.0.45 → 0.0.46

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,5 +1,9 @@
1
1
  <template>
2
+ <view v-if="isFromReadonly" class="ml-amount-input is-readonly">
3
+ <view class="ml-amount-input-readonly-content">{{ amountLabel }}</view>
4
+ </view>
2
5
  <input
6
+ v-else
3
7
  class="ml-amount-input"
4
8
  v-model="inpVal"
5
9
  type="digit"
@@ -14,7 +18,7 @@
14
18
 
15
19
  <script>
16
20
  import XEUtils from 'xe-utils'
17
- import { toNumMoneyToChinese } from '../../utils'
21
+ import { toAmountString, toWanAmountString } from '../../utils'
18
22
 
19
23
  export default {
20
24
  name: 'MlAmountInput',
@@ -47,17 +51,29 @@ export default {
47
51
  },
48
52
  className: String
49
53
  },
54
+ inject: {
55
+ form: {
56
+ from: 'mlForm',
57
+ default: null
58
+ }
59
+ },
50
60
  data () {
51
61
  return {
52
62
  inpVal: ''
53
63
  }
54
64
  },
55
65
  computed: {
66
+ isFromReadonly () {
67
+ return this.form ? this.form.readonly : false
68
+ },
56
69
  currAmountNum () {
57
70
  return this.value === '' ? '' : Number(this.value || 0)
58
71
  },
59
- currAmountLabel () {
60
- return this.currAmountNum === '' ? '无' : toNumMoneyToChinese(this.currAmountNum)
72
+ amountLabel () {
73
+ if (this.simplify) {
74
+ return toWanAmountString(this.value)
75
+ }
76
+ return toAmountString(this.value)
61
77
  },
62
78
  minNum () {
63
79
  if (XEUtils.isNumber(this.min) || this.min) {
@@ -108,8 +124,9 @@ export default {
108
124
  this.$emit('blur')
109
125
  },
110
126
  inputEvent () {
111
- this.$emit('input', this.inpVal)
112
- this.$emit('change', this.inpVal)
127
+ const value = this.inpVal
128
+ this.$emit('input', value)
129
+ this.$emit('change', { value })
113
130
  }
114
131
  }
115
132
  }
@@ -128,4 +145,7 @@ export default {
128
145
  border-radius: 10rpx;
129
146
  }
130
147
  }
148
+ .ml-amount-input-readonly-content {
149
+ padding: 20rpx;
150
+ }
131
151
  </style>
@@ -4,13 +4,13 @@
4
4
  <view class="ml-approval-record-header-title">审批记录</view>
5
5
  </view>
6
6
  <view class="ml-approval-record-body">
7
- <view class="ml-approval-record-list" v-for="(group, index) in options" :key="index">
7
+ <view class="ml-approval-record-list" v-for="(group, gIndex) in options" :key="gIndex">
8
8
  <view class="ml-approval-record-flow-line"></view>
9
9
  <view class="ml-approval-record-item">
10
10
  <view class="ml-approval-record-item-title">{{ group.name }}</view>
11
11
  </view>
12
12
  <view class="ml-approval-record-users">
13
- <view class="ml-approval-record-user-item" v-for="(item, index) in group.users" :key="index">
13
+ <view class="ml-approval-record-user-item" v-for="(item, uIndex) in group.users" :key="uIndex">
14
14
  <view class="ml-approval-record-user-item-info">
15
15
  <view class="ml-approval-record-user-item-left">
16
16
  <image class="ml-approval-record-user-picture" :src="item.picture" mode="scaleToFill"></image>
@@ -70,17 +70,17 @@ export default {
70
70
  &::before {
71
71
  content: "";
72
72
  position: absolute;
73
- top: 16rpx;
74
- left: -8rpx;
75
- width: 20rpx;
76
- height: 20rpx;
73
+ top: 12rpx;
74
+ left: -10rpx;
75
+ width: 24rpx;
76
+ height: 24rpx;
77
77
  border-radius: 50%;
78
78
  background: #D9D9D9;
79
79
  }
80
80
  }
81
81
  &:first-child {
82
82
  .ml-approval-record-flow-line {
83
- top: 16rpx;
83
+ top: 12rpx;
84
84
  &::before {
85
85
  top: 0;
86
86
  }
@@ -4,19 +4,19 @@
4
4
  <view class="ml-approval-select-header-title">审批流程</view>
5
5
  </view>
6
6
  <view class="ml-approval-select-body">
7
- <view class="ml-approval-select-list" v-for="(group, index) in options" :key="index">
7
+ <view class="ml-approval-select-list" v-for="(group, gIndex) in options" :key="gIndex">
8
8
  <view class="ml-approval-select-item">
9
9
  <view class="ml-approval-select-item-title">{{ group.name }}</view>
10
10
  </view>
11
11
  <view class="ml-approval-select-users">
12
- <view class="ml-approval-select-user-item" v-for="(item, index) in group.users" :key="index">
12
+ <view class="ml-approval-select-user-item" v-for="(item, uIndex) in group.users" :key="uIndex">
13
13
  <image class="ml-approval-select-user-picture" :src="item.picture" mode="scaleToFill"></image>
14
14
  <view class="ml-approval-select-user-name">{{ item.name }}</view>
15
15
  <view class="ml-approval-select-user-remove">
16
16
  <ml-icon name="close"></ml-icon>
17
17
  </view>
18
18
  </view>
19
- <view class="ml-approval-select-user-add">
19
+ <view class="ml-approval-select-user-add" @click="openAddUser">
20
20
  <view class="ml-approval-select-user-add-icon">
21
21
  <ml-icon name="add"></ml-icon>
22
22
  </view>
@@ -24,6 +24,11 @@
24
24
  </view>
25
25
  </view>
26
26
  </view>
27
+
28
+ <uni-popup ref="popup" type="bottom">
29
+ <text>Popup</text>
30
+ <button @click="close">关闭</button>
31
+ </uni-popup>
27
32
  </view>
28
33
  </template>
29
34
 
@@ -33,6 +38,11 @@ export default {
33
38
  props: {
34
39
  value: Array,
35
40
  options: Array
41
+ },
42
+ methods: {
43
+ openAddUser () {
44
+ this.$refs.popup.open()
45
+ }
36
46
  }
37
47
  }
38
48
  </script>
@@ -13,6 +13,8 @@
13
13
  <ml-select-picker v-else-if="matchComponent('MlSelectPicker')" :value="itemValue" :options="renderOpts.options" border @change="modelEvent"></ml-select-picker>
14
14
  <ml-textarea v-else-if="matchComponent('MlTextarea')" :value="itemValue" :rows="renderOpts.rows || 3" border @change="modelEvent"></ml-textarea>
15
15
  <ml-upload v-else-if="matchComponent('MlUpload')" :value="itemValue" :mediatype="renderOpts.mediatype || 'image'" @change="modelEvent"></ml-upload>
16
+ <ml-amount-input v-else-if="matchComponent('MlAmountInput')" :value="itemValue" @change="modelEvent"></ml-amount-input>
17
+ <ml-amount-text v-else-if="matchComponent('MlAmountText')" :value="itemValue" @change="modelEvent"></ml-amount-text>
16
18
  <view v-else>{{ itemValue }}</view>
17
19
  </slot>
18
20
  </uni-forms-item>
@@ -216,7 +216,7 @@ export default {
216
216
  })
217
217
  ).then(res => {
218
218
  uni.hideLoading();
219
- }).catch(() => {
219
+ }).catch((e) => {
220
220
  console.error(e)
221
221
  uni.hideLoading();
222
222
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "0.0.45",
3
+ "version": "0.0.46",
4
4
  "description": "码里云小程序组件库",
5
5
  "files": [
6
6
  "components",