mali-applet-ui 1.0.25 → 1.0.28

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.
@@ -46,10 +46,11 @@ export default {
46
46
  $spans: 4.16667%, 8.33333%, 12.5%, 16.66667%, 20.83333%, 25%, 29.16667%, 33.33333%,
47
47
  37.5%, 41.66667%, 45.83333%, 50%, 54.16667%, 58.33333%, 62.5%, 66.66667%,
48
48
  70.83333%, 75%, 79.16667%, 83.33333%, 87.5%, 91.66667%, 95.83333%, 100%;
49
- &.is-light {
50
- color: rgba(0, 0, 0, 0.45);
51
- }
49
+ // &.is-light {
50
+ // color: rgba(0, 0, 0, 0.45);
51
+ // }
52
52
  &.is-important {
53
+ color: $ml-font-color;
53
54
  padding-bottom: 10rpx;
54
55
  font-size: $ml-base-font-size;
55
56
  }
@@ -121,50 +121,50 @@ export default {
121
121
  }
122
122
  }
123
123
  &.is-round {
124
- padding: 8rpx 16rpx;
124
+ padding: 6rpx 20rpx;
125
125
  border-radius: $ml-border-radius;
126
- font-size: 24rpx;
126
+ font-size: $ml-describe-font-size;
127
127
  &.ss-primary {
128
- color: #ffffff;
129
- background: $uni-color-primary;
128
+ color: $uni-color-primary;
129
+ background: #e0efff;
130
130
  }
131
131
  &.ss-success {
132
- color: #ffffff;
133
- background: $uni-color-success;
132
+ color: $uni-color-success;
133
+ background: #e0f5e8;
134
134
  }
135
135
  &.ss-info {
136
- background: #909399;
136
+ background: #eaebed;
137
137
  }
138
138
  &.ss-warning {
139
139
  color: #ffffff;
140
140
  background: $uni-color-warning;
141
141
  }
142
142
  &.ss-danger {
143
- color: #ffffff;
144
- background: $uni-color-error;
143
+ color: $uni-color-error;
144
+ background: #ffeaec;
145
145
  }
146
146
  &.ss-gray {
147
147
  background: $ml-gray-color;
148
148
  }
149
149
  &.ss-blue {
150
- color: #ffffff;
151
- background: $ml-blue-color;
150
+ color: $ml-blue-color;
151
+ background: #e0efff;
152
152
  }
153
153
  &.ss-green {
154
- color: #ffffff;
155
- background: $ml-green-color;
154
+ color: $ml-green-color;
155
+ background: #e0f5e8;
156
156
  }
157
157
  &.ss-pink {
158
- color: #ffffff;
159
- background: $ml-pink-color;
158
+ color: $ml-pink-color;
159
+ background: #ffeaec;
160
160
  }
161
161
  &.ss-orange {
162
- color: #ffffff;
163
- background: $ml-orange-color;
162
+ color: $ml-orange-color;
163
+ background: #ffedd6;
164
164
  }
165
165
  &.ss-purple {
166
- color: #ffffff;
167
- background: $ml-purple-color;
166
+ color: $ml-purple-color;
167
+ background: #f2e9ff;
168
168
  }
169
169
  }
170
170
  &:not(.is-round) {
@@ -62,6 +62,9 @@ export default {
62
62
  },
63
63
  computed: {
64
64
  titleStyle () {
65
+ if (this.itemVertical) {
66
+ return ''
67
+ }
65
68
  return this.itemLabelWidth ? `width:${this.itemLabelWidth};` : ''
66
69
  },
67
70
  isFormBorder () {
@@ -188,6 +188,7 @@ export default {
188
188
  overflow: hidden;
189
189
  text-overflow: ellipsis;
190
190
  white-space: nowrap;
191
+ color: rgba(0, 0, 0, 0.45);
191
192
  }
192
193
  &.is-vertical {
193
194
  .ml-list-item-content {
@@ -132,7 +132,7 @@ export default {
132
132
  .ml-textarea {
133
133
  display: block;
134
134
  width: 100%;
135
- padding: 20rpx 10rpx 10rpx 20rpx;
135
+ padding: 20rpx 10rpx 10rpx 10rpx;
136
136
  background: #fff;
137
137
  .ml-textarea-placeholder {
138
138
  color: $ml-input-color-placeholder;;
@@ -69,13 +69,45 @@ function normalizeChooseAndUploadFileRes (res, fileType) {
69
69
  return res
70
70
  }
71
71
 
72
+ function compressImages (tempFiles) {
73
+ return Promise.all(
74
+ tempFiles.map(tempFilePath => {
75
+ return new Promise(resolve => {
76
+ uni.compressImage({
77
+ src: tempFilePath,
78
+ quality: this.imageQuality,
79
+ success (compressRes) {
80
+ resolve(compressRes.tempFilePath)
81
+ },
82
+ fail () {
83
+ resolve(tempFilePath)
84
+ }
85
+ })
86
+ })
87
+ })
88
+ )
89
+ }
90
+
72
91
  function uploadImageFiles (opts) {
73
92
  return new Promise((resolve, reject) => {
74
93
  uni.chooseImage({
75
94
  count: opts.count || 9,
76
- sourceType: opts.sourceType || ['album', 'camera'],
77
- success (res) {
78
- resolve(normalizeChooseAndUploadFileRes(res, 'image'))
95
+ sourceType: opts.sourceType,
96
+ // #ifdef MP-WEIXIN
97
+ sizeType: opts.sizeType,
98
+ // #endif
99
+ success (chooseRes) {
100
+ const rest = normalizeChooseAndUploadFileRes(chooseRes, 'image')
101
+ if (this.imageQuality) {
102
+ compressImages(rest.tempFiles).then((compressFiles) => {
103
+ resolve({
104
+ ...rest,
105
+ tempFiles: compressFiles
106
+ })
107
+ })
108
+ } else {
109
+ resolve(rest)
110
+ }
79
111
  },
80
112
  fail (res) {
81
113
  reject(res)
@@ -147,6 +179,15 @@ export default {
147
179
  type: Object,
148
180
  default: () => ({})
149
181
  },
182
+ imageQuality: Number,
183
+ sizeType: {
184
+ type: Array,
185
+ default: () => ['original', 'compressed']
186
+ },
187
+ sourceType: {
188
+ type: Array,
189
+ default: () => ['album', 'camera']
190
+ },
150
191
  getFileUrl: Function,
151
192
  getThumbnailUrl: Function,
152
193
  uploadFile: Function,
@@ -424,6 +465,8 @@ export default {
424
465
  }
425
466
  const uploadMethod = this.uploadFile ? this.uploadFile : (globalStore.upload ? globalStore.upload.uploadFile : null)
426
467
  chooseMethod({
468
+ sizeType: this.sizeType,
469
+ sourceType: this.sourceType,
427
470
  count: this.limit - this.fileList.length
428
471
  }).then(res => {
429
472
  const { tempFiles } = res
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "1.0.25",
3
+ "version": "1.0.28",
4
4
  "description": "码里云小程序组件库",
5
5
  "files": [
6
6
  "lib",
package/theme.scss CHANGED
@@ -1,6 +1,9 @@
1
1
  // 页面宽度
2
2
  $ml-page-full-width: 100%;
3
3
 
4
+ // 文字颜色
5
+ $ml-font-color: rgba(0, 0, 0, 0.85);
6
+
4
7
  // 字体
5
8
  $ml-base-font-size: 34rpx;
6
9
  // 副标题体