mali-applet-ui 0.0.97 → 0.0.98

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,99 @@
1
+ <template>
2
+ <view class="ml-popup" :class="[className || '', {'is-visible': value}]">
3
+ <view v-if="value" 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>{{ cancelButtonText }}</ml-button>
14
+ <ml-button status="primary" width="40%" round>{{ 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
+ showCancelButton: Boolean,
37
+ cancelButtonText: {
38
+ type: String,
39
+ default: '取消'
40
+ },
41
+ className: String
42
+ },
43
+ computed: {
44
+ bodyStyles () {
45
+ return this.height ? `height:${this.height};` : ''
46
+ }
47
+ },
48
+ methods: {
49
+ close () {
50
+
51
+ },
52
+ open () {
53
+
54
+ }
55
+ }
56
+ }
57
+ </script>
58
+
59
+ <style lang="scss">
60
+ .ml-popup {
61
+ display: none;
62
+ position: fixed;
63
+ top: 0;
64
+ left: 0;
65
+ width: 100%;
66
+ height: 100vh;
67
+ z-index: 999;
68
+ background-color: rgba(0, 0, 0, 0.4);
69
+ &.is-visible {
70
+ display: block;
71
+ .ml-popup-warpper {
72
+ transform: translateY(0);
73
+ }
74
+ }
75
+ }
76
+ .ml-popup-warpper {
77
+ position: absolute;
78
+ bottom: 0;
79
+ left: 0;
80
+ width: 100%;
81
+ transform: translateY(100%);
82
+ transition: transform 300ms ease 0ms, transform 300ms ease 0ms;
83
+ background: #fff;
84
+ }
85
+ .ml-popup-header-title {
86
+ text-align: center;
87
+ height: 70rpx;
88
+ line-height: 70rpx;
89
+ }
90
+ .ml-popup-body {
91
+ padding: 20rpx;
92
+ overflow: auto;
93
+ height: 600rpx;
94
+ }
95
+ .ml-popup-footer {
96
+ display: flex;
97
+ flex-direction: row;
98
+ }
99
+ </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>
@@ -360,8 +360,8 @@ export default {
360
360
  .ml-upload-image-list {
361
361
  .ml-upload-file-item {
362
362
  display: inline-block;
363
- width: 210rpx;
364
- height: 210rpx;
363
+ width: 140rpx;
364
+ height: 140rpx;
365
365
  padding: 0 10rpx;
366
366
  }
367
367
  .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.98",
4
4
  "description": "码里云小程序组件库",
5
5
  "files": [
6
6
  "components",