mali-applet-ui 0.0.97 → 0.0.99

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.
@@ -137,6 +137,7 @@ export default {
137
137
  font-size: $uni-font-size-base;
138
138
  padding: 0 10rpx;
139
139
  height: 70rpx;
140
+ width: 100%;
140
141
  &.is-right {
141
142
  text-align: right;
142
143
  }
@@ -112,12 +112,12 @@ export default {
112
112
  })
113
113
  try {
114
114
  const data = await this.getList()
115
- uni.stopPullDownRefresh()
116
115
  uni.hideLoading()
116
+ uni.stopPullDownRefresh()
117
117
  this.$emit('input', data)
118
118
  } catch (e) {
119
- uni.stopPullDownRefresh()
120
119
  uni.hideLoading()
120
+ uni.stopPullDownRefresh()
121
121
  console.error(e)
122
122
  }
123
123
  },
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <view class="ml-list-item" :class="className" @click="clickEvent" @tap="tapEvent">
2
+ <view class="ml-list-item" :class="className" :style="styles" @click="clickEvent" @tap="tapEvent">
3
3
  <view v-if="prefixIcon && prefixIcon !== 'none'" class="ml-list-item-left-icon">
4
4
  <ml-icon :className="prefixIcon"></ml-icon>
5
5
  </view>
@@ -30,6 +30,8 @@ export default {
30
30
  },
31
31
  url: String,
32
32
  redirect: Boolean,
33
+ backgroundColor: String,
34
+ color: String,
33
35
  className: String
34
36
  },
35
37
  provide() {
@@ -37,6 +39,13 @@ export default {
37
39
  mlListMenu: this
38
40
  }
39
41
  },
42
+ computed: {
43
+ styles () {
44
+ const cr = this.color ? `color:${this.color};` : ''
45
+ const bgCr = this.backgroundColor ? `background-color:${this.backgroundColor};` : ''
46
+ return `${bgCr}${cr}`
47
+ }
48
+ },
40
49
  methods: {
41
50
  clickEvent () {
42
51
  this.$emit('click', {})
@@ -62,6 +62,7 @@ export default {
62
62
  font-size: $uni-font-size-base;
63
63
  padding: 0 10rpx;
64
64
  height: 70rpx;
65
+ width: 100%;
65
66
  &.is-right {
66
67
  text-align: right;
67
68
  }
@@ -0,0 +1,146 @@
1
+ <template>
2
+ <view class="ml-popup" :class="[className || '', {'is-visible': visible, 'is-animate': isAnimate}]">
3
+ <view v-if="visible" class="ml-popup-warpper">
4
+ <view v-if="showHeader" class="ml-popup-header">
5
+ <slot name="header">
6
+ <view v-if="title" class="ml-popup-header-title">{{ title }}</view>
7
+ </slot>
8
+ </view>
9
+ <view class="ml-popup-body" :style="bodyStyles">
10
+ <slot></slot>
11
+ </view>
12
+ <view v-if="showConfirmButton || showCancelButton" class="ml-popup-footer">
13
+ <ml-button width="40%" round @click="cancelEvent">{{ cancelButtonText }}</ml-button>
14
+ <ml-button status="primary" width="40%" round @click="confirmEvent">{{ confirmButtonText }}</ml-button>
15
+ </view>
16
+ </view>
17
+ </view>
18
+ </template>
19
+
20
+ <script>
21
+ export default {
22
+ name: 'MlPopup',
23
+ props: {
24
+ value: Boolean,
25
+ title: String,
26
+ height: String,
27
+ showHeader: {
28
+ type: Boolean,
29
+ default: true
30
+ },
31
+ showConfirmButton: Boolean,
32
+ confirmButtonText: {
33
+ type: String,
34
+ default: '确认'
35
+ },
36
+ confirmClosable: Boolean,
37
+ showCancelButton: Boolean,
38
+ cancelButtonText: {
39
+ type: String,
40
+ default: '取消'
41
+ },
42
+ cancelClosable: {
43
+ type: Boolean,
44
+ default: true
45
+ },
46
+ className: String
47
+ },
48
+ data () {
49
+ return {
50
+ visible: false,
51
+ isAnimate: false
52
+ }
53
+ },
54
+ computed: {
55
+ bodyStyles () {
56
+ return this.height ? `height:${this.height};` : ''
57
+ }
58
+ },
59
+ watch: {
60
+ value (val) {
61
+ if (val) {
62
+ this.open()
63
+ } else {
64
+ this.close()
65
+ }
66
+ }
67
+ },
68
+ created () {
69
+ this.$nextTick(() => {
70
+ if (this.value) {
71
+ this.open()
72
+ } else {
73
+ this.close()
74
+ }
75
+ })
76
+ },
77
+ methods: {
78
+ close () {
79
+ this.isAnimate = false
80
+ setTimeout(() => {
81
+ this.visible = false
82
+ }, 300)
83
+ },
84
+ open () {
85
+ this.visible = true
86
+ this.$nextTick(() => {
87
+ this.isAnimate = true
88
+ })
89
+ },
90
+ cancelEvent () {
91
+ if (this.cancelClosable) {
92
+ this.close()
93
+ }
94
+ },
95
+ confirmEvent () {
96
+ if (this.confirmClosable) {
97
+ this.close()
98
+ }
99
+ }
100
+ }
101
+ }
102
+ </script>
103
+
104
+ <style lang="scss">
105
+ .ml-popup {
106
+ display: none;
107
+ position: fixed;
108
+ top: 0;
109
+ left: 0;
110
+ width: 100%;
111
+ height: 100vh;
112
+ z-index: 999;
113
+ background-color: rgba(0, 0, 0, 0.4);
114
+ &.is-visible {
115
+ display: block;
116
+ }
117
+ &.is-animate {
118
+ .ml-popup-warpper {
119
+ transform: translateY(0);
120
+ }
121
+ }
122
+ }
123
+ .ml-popup-warpper {
124
+ position: absolute;
125
+ bottom: 0;
126
+ left: 0;
127
+ width: 100%;
128
+ transform: translateY(100%);
129
+ transition: transform 300ms ease 0ms, transform 300ms ease 0ms;
130
+ background: #fff;
131
+ }
132
+ .ml-popup-header-title {
133
+ text-align: center;
134
+ height: 70rpx;
135
+ line-height: 70rpx;
136
+ }
137
+ .ml-popup-body {
138
+ padding: 20rpx;
139
+ overflow: auto;
140
+ height: 600rpx;
141
+ }
142
+ .ml-popup-footer {
143
+ display: flex;
144
+ flex-direction: row;
145
+ }
146
+ </style>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <view class="ml-region-picker" :class="className" :style="{width: width || '160rpx'}">
2
+ <view class="ml-region-picker" :class="className" :style="{width: width}">
3
3
  <uni-data-picker
4
4
  v-model="selectVals"
5
5
  popup-title="请选择城市"
@@ -63,5 +63,6 @@ export default {
63
63
  <style lang="scss">
64
64
  .ml-region-picker {
65
65
  display: inline-block;
66
+ width: 100%;
66
67
  }
67
68
  </style>
@@ -87,7 +87,10 @@ export default {
87
87
  columns: Array,
88
88
  showMore: Boolean,
89
89
  loadStatus: String,
90
- sortConfig: Object,
90
+ sortConfig: {
91
+ type: Object,
92
+ defaule: () => ({})
93
+ },
91
94
  headerCellClass: [String, Function],
92
95
  headerCellFormat: Function,
93
96
  cellClass: [String, Function],
@@ -5,7 +5,7 @@
5
5
  <view v-else class="ml-textarea" :class="[className || '', {'is-border': border}]">
6
6
  <view v-if="readonly" class="ml-textarea-content">{{ inpVal }}</view>
7
7
  <view v-else>
8
- <textarea class="ml-textarea-inp" v-model="inpVal" :rows="rows" :maxlength="maxLength" :placeholder="placeholder" @input="inputEvent" :style="{color: fontColor, height: `${rows * 30}rpx`}"></textarea>
8
+ <textarea class="ml-textarea-inp" v-model="inpVal" :rows="rows" :maxlength="maxLength" :placeholder="placeholder" :show-count="false" @input="inputEvent" :style="{color: fontColor, height: `${rows * 30}rpx`}"></textarea>
9
9
  <view v-if="showWordLimit" class="ml-textarea-word-count">
10
10
  <VoiceInput v-if="showVoice" v-model="inpVal" @input="inputEvent"></VoiceInput>
11
11
  <view class="ml-textarea-word-numbers">{{ value ? value.length : 0 }}/{{ maxLength }}</view>
@@ -143,10 +143,17 @@ export default {
143
143
  })
144
144
  this.selectUniFileList = this.urlList.map(url => {
145
145
  const name = this.getUrlName(url)
146
+ const extname = this.getSuffix(name)
147
+ const obj = {
148
+ [this.nameField]: name,
149
+ [this.typeField]: extname,
150
+ [this.urlField]: url
151
+ }
146
152
  return {
153
+ ...obj,
147
154
  name: name,
148
- extname: this.getSuffix(name),
149
- url: url
155
+ extname: extname,
156
+ url: this.getUrl(obj)
150
157
  }
151
158
  })
152
159
  this.isUpdate = true
@@ -158,9 +165,10 @@ export default {
158
165
  })
159
166
  this.selectUniFileList = this.value.map(item => {
160
167
  return {
168
+ ...item,
161
169
  name: item[this.nameField],
162
170
  extname: item[this.typeField],
163
- url: item[this.urlField]
171
+ url: this.getUrl(item)
164
172
  }
165
173
  })
166
174
  }
@@ -360,8 +368,8 @@ export default {
360
368
  .ml-upload-image-list {
361
369
  .ml-upload-file-item {
362
370
  display: inline-block;
363
- width: 210rpx;
364
- height: 210rpx;
371
+ width: 140rpx;
372
+ height: 140rpx;
365
373
  padding: 0 10rpx;
366
374
  }
367
375
  .ml-upload-file-img {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "0.0.97",
3
+ "version": "0.0.99",
4
4
  "description": "码里云小程序组件库",
5
5
  "files": [
6
6
  "components",