dolphin-weex-ui 1.2.2 → 1.2.3

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.
package/index.js CHANGED
@@ -29,6 +29,7 @@ import DofConfirm from './packages/dof-confirm';
29
29
  import DofConfirmBox from './packages/dof-confirm-box';
30
30
  import DofCountdown from './packages/dof-countdown';
31
31
  import DofDateCyclePicker from './packages/dof-date-cycle-picker';
32
+ import DofDiamondTab from './packages/dof-diamond-tab';
32
33
  import DofDigitalPanel from './packages/dof-digital-panel';
33
34
  import DofEpSlider from './packages/dof-ep-slider';
34
35
  import DofFullPage from './packages/dof-full-page';
@@ -127,6 +128,7 @@ export {
127
128
  DofConfirmBox,
128
129
  DofCountdown,
129
130
  DofDateCyclePicker,
131
+ DofDiamondTab,
130
132
  DofDigitalPanel,
131
133
  DofEpSlider,
132
134
  DofFullPage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dolphin-weex-ui",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "inteligense cross platform frame",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -11,15 +11,24 @@
11
11
  </div>
12
12
  <div ref="dof-popup" v-if="show" :hack="isNeedShow" @click="() => {}" :class="['dof-popup', pos]" :style="padStyle">
13
13
  <slot name="title">
14
- <text v-if="title || $slots.title" class="title" :style="titleStyle">{{ title }}</text>
14
+ <text
15
+ v-if="title || $slots.title"
16
+ class="title"
17
+ :style="{ ...titleStyle, 'border-top-left-radius': borderRadius, 'border-top-right-radius': borderRadius }"
18
+ >{{ title }}</text
19
+ >
15
20
  </slot>
16
21
  <div class="midea-actionsheet-content">
17
22
  <div
18
- v-bind:class="[index == 0 && !title ? 'midea-actionsheet-list-first' : 'midea-actionsheet-list']"
23
+ v-bind:class="['midea-actionsheet-list']"
19
24
  v-for="(item, index) in items"
20
25
  :key="index"
21
26
  @click="actionsheetItemClick(item, index)"
22
- :style="itemStyle"
27
+ :style="{
28
+ ...itemStyle,
29
+ 'border-top-left-radius': index == 0 && !title ? borderRadius : '0px',
30
+ 'border-top-right-radius': index == 0 && !title ? borderRadius : '0px'
31
+ }"
23
32
  >
24
33
  <slot :name="'item-' + index">
25
34
  <div class="midea-actionsheet-textWrapper">
@@ -44,6 +53,7 @@
44
53
  .dof-popup {
45
54
  position: fixed;
46
55
  width: 750px;
56
+ overflow: hidden;
47
57
  }
48
58
 
49
59
  .title {
@@ -53,8 +63,6 @@
53
63
  color: #8a8a8f;
54
64
  line-height: 48px;
55
65
  background-color: #ffffff;
56
- border-top-left-radius: 32px;
57
- border-top-right-radius: 32px;
58
66
  }
59
67
 
60
68
  .midea-actionsheet-content {
@@ -63,8 +71,8 @@
63
71
  /* background-color: #ffffff; */
64
72
  }
65
73
  .midea-actionsheet-list-first {
66
- border-top-left-radius: 32px;
67
- border-top-right-radius: 32px;
74
+ /* border-top-left-radius: 32px;
75
+ border-top-right-radius: 32px; */
68
76
  background-color: #ffffff;
69
77
  }
70
78
  .midea-actionsheet-list-first:active {
@@ -202,6 +210,10 @@ export default {
202
210
  itemStyle: {
203
211
  type: Object,
204
212
  default: () => {}
213
+ },
214
+ borderRadius: {
215
+ type: String,
216
+ default: '32px'
205
217
  }
206
218
  },
207
219
  data: () => ({
@@ -239,8 +251,8 @@ export default {
239
251
  if (pos === 'bottom') {
240
252
  style.bottom = '0px'
241
253
  style.transform = 'translateY(100%)'
242
- style.borderTopLeftRadius = '32px'
243
- style.borderTopRightRadius = '32px'
254
+ style.borderTopLeftRadius = this.borderRadius
255
+ style.borderTopRightRadius = this.borderRadius
244
256
  }
245
257
  return style
246
258
  },
@@ -228,6 +228,15 @@ export default {
228
228
  .dof-btn-highlight-gray-plain:active {
229
229
  background-color: rgba(124, 135, 155, 0.1);
230
230
  }
231
+ .dof-btn-highlight-colmo-default:active {
232
+ background-color: #743d2a;
233
+ }
234
+ .dof-btn-highlight-colmo-base:active {
235
+ background-color: rgba(0, 0, 0, 0.3);
236
+ }
237
+ .dof-btn-highlight-colmo-plain:active {
238
+ background-color: rgba(179, 83, 54, 0.2);
239
+ }
231
240
 
232
241
  .btn-text {
233
242
  font-family: PingFangSC-Medium;
@@ -185,6 +185,23 @@ export const STYLE_MAP = {
185
185
  backgroundColor: '#FFFFFF',
186
186
  borderWidth: 0
187
187
  }
188
+ },
189
+ colmo: {
190
+ default: {
191
+ backgroundColor: '#B35336'
192
+ },
193
+ base: {
194
+ backgroundColor: '#3D3D42'
195
+ },
196
+ plain: {
197
+ backgroundColor: 'transparent',
198
+ borderWidth: '2px',
199
+ borderColor: '#B35336'
200
+ },
201
+ text: {
202
+ backgroundColor: 'transparent',
203
+ borderWidth: 0
204
+ }
188
205
  }
189
206
  }
190
207
 
@@ -342,6 +359,20 @@ export const TEXT_STYLE_MAP = {
342
359
  text: {
343
360
  color: '#86696B'
344
361
  }
362
+ },
363
+ colmo: {
364
+ default: {
365
+ color: '#FFFFFF'
366
+ },
367
+ base: {
368
+ color: '#FFFFFF'
369
+ },
370
+ plain: {
371
+ color: '#B35336'
372
+ },
373
+ text: {
374
+ color: '#B35336'
375
+ }
345
376
  }
346
377
  }
347
378
 
@@ -0,0 +1 @@
1
+ export default 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAASCAYAAABB7B6eAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAEgAAAACohW0MAAABKUlEQVQ4EdXSOy+DURwH4JImHWpgKYZGFwmLoZOFwYSYxWzzEXwBkVjxAbCzYyQ2l8llEgaJRCISEZHUc0SH932dlPIOmjxpz//y6+W0UPivj0ajMUctl88veJY35v/8DYRO8cpiHuFjgp9ZziO8LviR9TzChwXfs0Vn4g0U+plJFH9wsFvjlh2KmVXFBcKlTGeaLQp2+rhij1J0XHOJcDnj0aFUw2wPZxxSTrWzR0NrhEuqZ7vJipkujjihO9mNnAx2sEG4rKHIWEGvxD4XVGJzX9YtFNnmhoH00Gc/XOY11XT/W2eL4RPucklvc8nr8A03uWOwWW/rWUCZA075+I09r/LASFuh6aUQzDHhX7LCE6PpuV+dBVY454WJX4XFlgVXmYz1W9XfAaRQL/XLZXCaAAAAAElFTkSuQmCC'
@@ -1,14 +1,17 @@
1
1
  <template>
2
- <div class="dof-card">
3
- <div class="dof-card-header" @click="onSelect">
4
- <image
2
+ <div class="dof-card" :style="_cardStyle">
3
+ <div class="dof-card-header" @click="onSelect" :style="{ 'backgroundColor:active': touchColor ? touchColor : '' }">
4
+ <!-- <image
5
5
  v-if="isActive"
6
6
  :class="[
7
7
  'dof-card-header-stamp',
8
8
  tag === 'right' ? 'dof-card-header-stamp--right' : 'dof-card-header-stamp--left'
9
9
  ]"
10
10
  :src="stampSrc"
11
- ></image>
11
+ ></image> -->
12
+ <div v-if="isActive" class="dof-card-header-tag" :style="{ backgroundColor: tagBg }">
13
+ <image class="dof-card-header-tag-confirm" :src="confirm"></image>
14
+ </div>
12
15
  <div class="dof-card-header-content">
13
16
  <slot></slot>
14
17
  </div>
@@ -19,6 +22,11 @@
19
22
  <div v-if="collapsable" ref="body" class="dof-card-body">
20
23
  <slot name="body"></slot>
21
24
  </div>
25
+ <div
26
+ v-if="dotConfig.normalColor && dotConfig.clickedColor"
27
+ :style="{ backgroundColor: clicked_ ? dotConfig.clickedColor : dotConfig.normalColor }"
28
+ class="dof-card-dot"
29
+ ></div>
22
30
  </div>
23
31
  </template>
24
32
 
@@ -27,6 +35,7 @@ import { mixSelectableChild } from '../utils/mix-selectable-child.js'
27
35
  import { Transition } from '../utils/transition.js'
28
36
  import { getBoundingClientRect } from '../utils/dom.js'
29
37
  import arrowUp from './imgs/arrow_up'
38
+ import confirm from './imgs/confirm'
30
39
  export default {
31
40
  mixins: [mixSelectableChild('dof-card-group')],
32
41
  props: {
@@ -49,6 +58,32 @@ export default {
49
58
  tag: {
50
59
  type: String,
51
60
  default: 'right'
61
+ },
62
+ // 标签背景色
63
+ tagBg: {
64
+ type: String,
65
+ default: '#3c7cf6'
66
+ },
67
+ // 卡片样式
68
+ cardStyle: {
69
+ type: Object,
70
+ default: () => ({})
71
+ },
72
+ // 右上角标记配置,normalColor常态颜色,clickedColor选中态颜色
73
+ dotConfig: {
74
+ type: Object,
75
+ default: () => ({})
76
+ },
77
+ // 是否选中态
78
+ clicked: {
79
+ type: Boolean,
80
+ default: false
81
+ },
82
+ // 点击颜色
83
+ touchColor: {
84
+ type: String,
85
+ required: false,
86
+ default: ''
52
87
  }
53
88
  },
54
89
  model: {
@@ -59,8 +94,11 @@ export default {
59
94
  return {
60
95
  active_: false,
61
96
  collapsed_: this.collapsed,
97
+ clicked_: this.clicked,
62
98
  bodyHeight: 0,
63
- arrowUp
99
+ arrowUp,
100
+ confirm,
101
+ isTouching: false
64
102
  }
65
103
  },
66
104
  computed: {
@@ -71,6 +109,15 @@ export default {
71
109
  },
72
110
  isActive() {
73
111
  return (this.selectable && this.selected) || this.isSelected
112
+ },
113
+ _cardStyle() {
114
+ let style = {
115
+ borderRadius: '32px',
116
+ backgroundColor: '#fff',
117
+ ...this.cardStyle
118
+ }
119
+ if (this.touchColor && this.isTouching) style.backgroundColor = this.touchColor
120
+ return style
74
121
  }
75
122
  },
76
123
  mounted() {
@@ -96,6 +143,8 @@ export default {
96
143
  onSelect() {
97
144
  this.$emit('select', !this.selected)
98
145
  this.triggerSelect()
146
+
147
+ this.$emit('clicked', (this.clicked_ = !this.clicked_))
99
148
  },
100
149
  onCollapse() {
101
150
  this.collapsed_ = !this.collapsed_
@@ -140,9 +189,10 @@ export default {
140
189
 
141
190
  <style scoped>
142
191
  .dof-card {
143
- border-radius: 32px;
192
+ /* border-radius: 32px; */
144
193
  overflow: hidden;
145
- background-color: #ffffff;
194
+ position: relative;
195
+ /* background-color: #ffffff; */
146
196
  }
147
197
 
148
198
  .dof-card--active {
@@ -157,6 +207,26 @@ export default {
157
207
  padding-right: 32px;
158
208
  padding-top: 32px;
159
209
  padding-bottom: 32px;
210
+ overflow: hidden;
211
+ }
212
+
213
+ .dof-card-header-tag {
214
+ position: absolute;
215
+ width: 90px;
216
+ height: 90px;
217
+ right: -45px;
218
+ top: -45px;
219
+ transform-origin: center;
220
+ transform: rotateZ(45deg);
221
+ }
222
+ .dof-card-header-tag-confirm {
223
+ position: absolute;
224
+ width: 18px;
225
+ height: 18px;
226
+ left: 35px;
227
+ top: 66px;
228
+ transform-origin: center;
229
+ transform: rotateZ(-45deg);
160
230
  }
161
231
 
162
232
  .dof-card-header-stamp {
@@ -200,4 +270,12 @@ export default {
200
270
  position: relative;
201
271
  overflow: hidden;
202
272
  }
273
+ .dof-card-dot {
274
+ position: absolute;
275
+ width: 16px;
276
+ height: 16px;
277
+ right: 16px;
278
+ top: 16px;
279
+ border-radius: 8px;
280
+ }
203
281
  </style>
@@ -0,0 +1 @@
1
+ export { default } from './index.vue'
@@ -0,0 +1,299 @@
1
+ <template>
2
+ <div class="dof-diamond-tab">
3
+ <div class="dof-diamond-tab-box" :style="{ borderRadius }">
4
+ <div
5
+ v-for="(tab, i) in tabData"
6
+ :key="i"
7
+ :class="['dof-diamond-tab-item']"
8
+ @click="clickTabItem(i)"
9
+ @touchstart="touchTabItem(i)"
10
+ @touchend="touchEnd"
11
+ :style="{ left: -i + 'px' }"
12
+ >
13
+ <div
14
+ :class="[
15
+ 'dof-diamond-tab-item-label',
16
+ i === 0 ? 'first-tab' : '',
17
+ i === tabData.length - 1 ? 'last-tab' : ''
18
+ ]"
19
+ :style="{
20
+ 'border-color': tabActive === i ? activeBorderColor : borderColor,
21
+ 'background-color': touchActive === i ? touchColor : bgColor,
22
+ height: itemHeight + 'px',
23
+ 'border-top-left-radius': i === 0 ? borderRadius : '0px',
24
+ 'border-bottom-left-radius': i === 0 ? borderRadius : '0px',
25
+ 'border-top-right-radius': i === tabData.length - 1 ? borderRadius : '0px',
26
+ 'border-bottom-right-radius': i === tabData.length - 1 ? borderRadius : '0px'
27
+ }"
28
+ >
29
+ <text
30
+ class="label-text"
31
+ :style="{
32
+ fontSize: textFontSize,
33
+ color: tabActive === i || touchActive === i ? activeTextColor : textColor,
34
+ borderColor: touchActive === i ? touchColor : bgColor
35
+ }"
36
+ >{{ tab.label.length > labelMaxLen ? tab.label.slice(0, labelMaxLen) + '...' : tab.label }}</text
37
+ >
38
+ </div>
39
+ <!-- 模拟斜杆 -->
40
+ <div
41
+ v-if="i !== tabData.length - 1"
42
+ class="tabLine"
43
+ :style="{
44
+ ...tabLineStyle,
45
+ backgroundColor: bgColor,
46
+ // 'background-color': touchActive === i ? touchColor : bgColor,
47
+ 'border-left-color': touchActive === i ? touchColor : 'transparent',
48
+ 'border-right-color': touchActive - 1 === i ? touchColor : 'transparent',
49
+ 'border-left-width': !(tabActive === i || tabActive - 1 === i) ? '0px' : '2px',
50
+ 'border-right-width': !(tabActive === i || tabActive - 1 === i) ? '0px' : '3px'
51
+ }"
52
+ >
53
+ <div
54
+ class="tabLineMaskDown"
55
+ :style="{
56
+ ...maskStyle,
57
+ 'border-color': tabActive === i || tabActive - 1 === i ? activeBorderColor : 'transparent',
58
+ 'background-color': touchActive - 1 === i ? touchColor : bgColor
59
+ }"
60
+ ></div>
61
+ <div
62
+ class="tabLineMaskUp"
63
+ :style="{
64
+ ...maskStyle,
65
+ 'background-color': touchActive === i ? touchColor : bgColor
66
+ }"
67
+ ></div>
68
+ <div
69
+ class="border-top"
70
+ :style="{
71
+ 'border-color': tabActive === i ? activeBorderColor : borderColor,
72
+ // 优化边缘显示
73
+ width: tabActive - 1 === i ? itemHeight / 4 - 1 + 'px' : itemHeight / 4 + 3 + 'px'
74
+ }"
75
+ ></div>
76
+ <div
77
+ class="border-bottom"
78
+ :style="{ ...fakeBorderStyle, 'background-color': tabActive - 1 === i ? activeBorderColor : borderColor }"
79
+ ></div>
80
+ </div>
81
+ </div>
82
+ </div>
83
+ </div>
84
+ </template>
85
+
86
+ <script>
87
+ export default {
88
+ props: {
89
+ tabData: {
90
+ type: Array,
91
+ required: false,
92
+ default: () => []
93
+ },
94
+ active: {
95
+ type: Number,
96
+ required: false,
97
+ default: null
98
+ },
99
+ // 背景色
100
+ bgColor: {
101
+ type: String,
102
+ required: false,
103
+ default: '#000'
104
+ },
105
+ // 选择状态边框颜色
106
+ activeBorderColor: {
107
+ type: String,
108
+ required: false,
109
+ default: '#b35336'
110
+ },
111
+ // 字体大小
112
+ textFontSize: {
113
+ type: String,
114
+ required: false,
115
+ default: '24px'
116
+ },
117
+ // 字体颜色
118
+ textColor: {
119
+ type: String,
120
+ required: false,
121
+ default: '#71717a'
122
+ },
123
+ // 选中态字体颜色
124
+ activeTextColor: {
125
+ type: String,
126
+ required: false,
127
+ default: '#ffffff'
128
+ },
129
+ // 常规边框颜色
130
+ borderColor: {
131
+ type: String,
132
+ required: false,
133
+ default: 'rgba(61, 61, 66, 1)'
134
+ },
135
+ // 点击颜色
136
+ touchColor: {
137
+ type: String,
138
+ required: false,
139
+ default: '#1A1A1C'
140
+ },
141
+ // 高度
142
+ itemHeight: {
143
+ type: Number,
144
+ default: 64
145
+ }
146
+ },
147
+ computed: {
148
+ labelMaxLen() {
149
+ // 超过3个标签字数最多2个字
150
+ if (this.tabData.length > 3) return 2
151
+ // 默认4个字
152
+ return 4
153
+ },
154
+ borderRadius() {
155
+ return this.itemHeight / 2 + 'px'
156
+ },
157
+ tabLineStyle() {
158
+ return {
159
+ width: this.itemHeight / 4 + 1 + 'px',
160
+ height: this.itemHeight + 'px'
161
+ }
162
+ },
163
+ maskStyle() {
164
+ return {
165
+ width: this.itemHeight + 2 + 'px',
166
+ height: this.itemHeight + 2 + 'px'
167
+ }
168
+ },
169
+ fakeBorderStyle() {
170
+ return {
171
+ width: this.itemHeight / 4 + 2 + 'px'
172
+ }
173
+ }
174
+ },
175
+ watch: {
176
+ active: {
177
+ handler(val, oldVal) {
178
+ this.tabActive = val
179
+ }
180
+ },
181
+ tabActive(val) {
182
+ this.$emit('tabActiveChange', val)
183
+ }
184
+ },
185
+ data() {
186
+ return {
187
+ tabActive: this.active,
188
+ touchActive: null
189
+ }
190
+ },
191
+ mounted() {},
192
+ methods: {
193
+ clickTabItem(i) {
194
+ this.tabActive = i
195
+ },
196
+ touchTabItem(i) {
197
+ this.touchActive = i
198
+ },
199
+ touchEnd() {
200
+ this.touchActive = null
201
+ }
202
+ }
203
+ }
204
+ </script>
205
+
206
+ <style scoped>
207
+ .dof-diamond-tab {
208
+ display: flex;
209
+ flex-direction: row;
210
+ justify-content: center;
211
+ }
212
+ .dof-diamond-tab-box {
213
+ display: flex;
214
+ flex-direction: row;
215
+ justify-content: center;
216
+ /* border-radius: 32px; */
217
+ }
218
+ .dof-diamond-tab-item {
219
+ display: flex;
220
+ flex-direction: row;
221
+ position: relative;
222
+ }
223
+ .dof-diamond-tab-item-label {
224
+ /* height: 64px; */
225
+ display: flex;
226
+ flex-direction: row;
227
+ align-items: center;
228
+ justify-content: center;
229
+ padding-left: 24px;
230
+ padding-right: 24px;
231
+ /* border-width: 2px;
232
+ border-left-width: 0px;
233
+ border-right-width: 0px; */
234
+ border-top-width: 2px;
235
+ border-bottom-width: 2px;
236
+ }
237
+ .label-text {
238
+ font-family: PingFangSC-Regular;
239
+ /* 使用border解决鸿蒙显示多1像素问题 */
240
+ border-width: 1px;
241
+ }
242
+ .label-text-active {
243
+ }
244
+ .first-tab {
245
+ border-left-width: 2px;
246
+ padding-left: 32px;
247
+ /* border-radius: 32px 0px 0px 32px; */
248
+ }
249
+ .last-tab {
250
+ border-right-width: 2px;
251
+ padding-right: 32px;
252
+ /* border-radius: 0px 32px 32px 0px; */
253
+ }
254
+
255
+ .tabLine {
256
+ /* width: 16px; */
257
+ /* height: 64px; */
258
+ overflow: hidden;
259
+ /* border: 2px solid transparent; */
260
+ border-top: 0;
261
+ border-bottom: 0;
262
+ position: relative;
263
+ }
264
+ .tabLineMaskDown {
265
+ /* width: 66x; */
266
+ /* height: 66px; */
267
+ position: absolute;
268
+ right: 0;
269
+ top: 0;
270
+ border-top: 2px solid transparent;
271
+ transform: rotateZ(-77deg);
272
+ transform-origin: right top;
273
+ }
274
+ .tabLineMaskUp {
275
+ /* width: 66x; */
276
+ /* height: 66px; */
277
+ position: absolute;
278
+ right: 0;
279
+ top: 0;
280
+ /* border-top: 2px solid transparent; */
281
+ transform: rotateZ(13deg);
282
+ transform-origin: right top;
283
+ }
284
+ .border-top {
285
+ /* width: 18px; */
286
+ /* height: 4px; */
287
+ /* 使用border解决ios显示多1像素问题 */
288
+ border-top-width: 4px;
289
+ top: -2px;
290
+ left: -3px;
291
+ position: absolute;
292
+ }
293
+ .border-bottom {
294
+ /* width: 18px; */
295
+ height: 4px;
296
+ bottom: -2px;
297
+ position: absolute;
298
+ }
299
+ </style>