dolphin-weex-ui 2.4.21 → 2.4.23
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/CHANGELOG.md +10 -0
- package/dist/index.native.js +105 -20
- package/dist/index.native.js.map +1 -1
- package/dist/index.web.js +108 -26
- package/dist/index.web.js.map +1 -1
- package/package.json +1 -1
- package/packages/dof-card/index.vue +14 -1
- package/packages/dof-checkbox/index.vue +12 -0
- package/packages/dof-collapse-item/index.vue +14 -0
- package/packages/dof-gear/index.vue +2 -1
- package/packages/dof-result/index.vue +21 -4
- package/packages/dof-slider-scale/index.vue +2 -1
- package/packages/utils/dom.js +4 -5
- package/packages/utils/index.js +15 -0
- package/packages/dof-actionsheet/dist/index.dev.js +0 -15
package/package.json
CHANGED
|
@@ -135,6 +135,9 @@ export default {
|
|
|
135
135
|
_tagBg() {
|
|
136
136
|
if (this.tagBg) return this.tagBg
|
|
137
137
|
return this._isColmo ? '#B35336' : '#00A4F2'
|
|
138
|
+
},
|
|
139
|
+
isHarmony() {
|
|
140
|
+
return weex.config.env.platform == 'harmony'
|
|
138
141
|
}
|
|
139
142
|
},
|
|
140
143
|
mounted() {
|
|
@@ -146,7 +149,8 @@ export default {
|
|
|
146
149
|
return
|
|
147
150
|
}
|
|
148
151
|
this.$nextTick(() => {
|
|
149
|
-
|
|
152
|
+
const dom = weex.requireModule('dom')
|
|
153
|
+
getBoundingClientRect(dom, this.$refs.body, res => {
|
|
150
154
|
this.bodyHeight = res.size.height
|
|
151
155
|
if (this.collapsed_) {
|
|
152
156
|
this.collapseBody(0)
|
|
@@ -166,6 +170,10 @@ export default {
|
|
|
166
170
|
this.$emit('clicked', (this.clicked_ = !this.clicked_))
|
|
167
171
|
},
|
|
168
172
|
onCollapse() {
|
|
173
|
+
if (this.isHarmony) {
|
|
174
|
+
if (this.clickLock) return
|
|
175
|
+
this.clickLock = true
|
|
176
|
+
}
|
|
169
177
|
this.collapsed_ = !this.collapsed_
|
|
170
178
|
this.$emit('collapse', this.collapsed_)
|
|
171
179
|
if (this.collapsed_) {
|
|
@@ -175,6 +183,11 @@ export default {
|
|
|
175
183
|
this.expandeBody()
|
|
176
184
|
this.expandeArrow()
|
|
177
185
|
}
|
|
186
|
+
if (this.isHarmony) {
|
|
187
|
+
setTimeout(() => {
|
|
188
|
+
this.clickLock = false
|
|
189
|
+
}, 100)
|
|
190
|
+
}
|
|
178
191
|
},
|
|
179
192
|
collapseBody(duration = 360) {
|
|
180
193
|
Transition.Default()
|
|
@@ -344,16 +344,28 @@ export default {
|
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
return {}
|
|
347
|
+
},
|
|
348
|
+
isHarmony() {
|
|
349
|
+
return weex.config.env.platform == 'harmony'
|
|
347
350
|
}
|
|
348
351
|
},
|
|
349
352
|
|
|
350
353
|
methods: {
|
|
351
354
|
dofCellClick() {
|
|
355
|
+
if (this.isHarmony) {
|
|
356
|
+
if (this.clickLock) return
|
|
357
|
+
this.clickLock = true
|
|
358
|
+
}
|
|
352
359
|
const { disabled, innerChecked, value } = this
|
|
353
360
|
if (!disabled) {
|
|
354
361
|
this.innerChecked = !innerChecked
|
|
355
362
|
this.$emit('dofCheckBoxItemChecked', { value, checked: this.innerChecked })
|
|
356
363
|
}
|
|
364
|
+
if (this.isHarmony) {
|
|
365
|
+
setTimeout(() => {
|
|
366
|
+
this.clickLock = false
|
|
367
|
+
}, 100)
|
|
368
|
+
}
|
|
357
369
|
},
|
|
358
370
|
dynamicIsOverflow() {
|
|
359
371
|
// ios下面 对于这个动态的设置flex=1,或者max-width都会 偶现不生效。
|
|
@@ -64,7 +64,9 @@ export default {
|
|
|
64
64
|
created() {},
|
|
65
65
|
mounted() {
|
|
66
66
|
this.$nextTick(() => {
|
|
67
|
+
const dom = weex.requireModule('dom')
|
|
67
68
|
getBoundingClientRect(
|
|
69
|
+
dom,
|
|
68
70
|
this.$refs.slotBody,
|
|
69
71
|
res => {
|
|
70
72
|
if (res.result) {
|
|
@@ -84,6 +86,9 @@ export default {
|
|
|
84
86
|
computed: {
|
|
85
87
|
accordion() {
|
|
86
88
|
return this._activeData.accordion
|
|
89
|
+
},
|
|
90
|
+
isHarmony() {
|
|
91
|
+
return weex.config.env.platform == 'harmony'
|
|
87
92
|
}
|
|
88
93
|
},
|
|
89
94
|
watch: {
|
|
@@ -119,6 +124,10 @@ export default {
|
|
|
119
124
|
},
|
|
120
125
|
methods: {
|
|
121
126
|
onCollapseHandler() {
|
|
127
|
+
if (this.isHarmony) {
|
|
128
|
+
if (this.clickLock) return
|
|
129
|
+
this.clickLock = true
|
|
130
|
+
}
|
|
122
131
|
this.collapsed_ = !this.collapsed_
|
|
123
132
|
//手风琴-发送通知
|
|
124
133
|
this.$parent.collapseClick({ collapsed: this.collapsed_, name: this.name })
|
|
@@ -131,6 +140,11 @@ export default {
|
|
|
131
140
|
this.expandeArrow()
|
|
132
141
|
}
|
|
133
142
|
}
|
|
143
|
+
if (this.isHarmony) {
|
|
144
|
+
setTimeout(() => {
|
|
145
|
+
this.clickLock = false
|
|
146
|
+
}, 100)
|
|
147
|
+
}
|
|
134
148
|
},
|
|
135
149
|
collapseBody(duration = 360) {
|
|
136
150
|
Transition.Default()
|
|
@@ -120,9 +120,10 @@ export default {
|
|
|
120
120
|
},
|
|
121
121
|
methods: {
|
|
122
122
|
initRect() {
|
|
123
|
+
const dom = weex.requireModule('dom')
|
|
123
124
|
this.ranges.forEach((range, i) => {
|
|
124
125
|
if (range.gear) {
|
|
125
|
-
getBoundingClientRectBase(this.$refs['bar'][i], res => {
|
|
126
|
+
getBoundingClientRectBase(dom, this.$refs['bar'][i], res => {
|
|
126
127
|
this.rects.push({
|
|
127
128
|
...range,
|
|
128
129
|
left: res.size.left,
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="wrapper" v-if="show" :style="wrapStyle">
|
|
3
3
|
<div class="dof-result" :style="{ top: setPaddingTop, backgroundColor: bgColor_ }">
|
|
4
|
-
<image
|
|
4
|
+
<image
|
|
5
|
+
:class="[isNewVersion ? 'result-image-new' : 'result-image']"
|
|
6
|
+
:aria-hidden="true"
|
|
7
|
+
:src="resultType.pic"
|
|
8
|
+
:style="imgStyle"
|
|
9
|
+
></image>
|
|
5
10
|
<slot name="text">
|
|
6
11
|
<div class="result-content" v-if="resultType.content">
|
|
7
12
|
<text class="content-text">{{ resultType.content }}</text>
|
|
@@ -48,6 +53,11 @@
|
|
|
48
53
|
height: 320px;
|
|
49
54
|
}
|
|
50
55
|
|
|
56
|
+
.result-image-new {
|
|
57
|
+
width: 460x;
|
|
58
|
+
height: 384px;
|
|
59
|
+
}
|
|
60
|
+
|
|
51
61
|
.result-content {
|
|
52
62
|
margin-top: 0px;
|
|
53
63
|
align-items: center;
|
|
@@ -91,19 +101,23 @@ import DofButton from '../dof-button'
|
|
|
91
101
|
import imgs from './imgs'
|
|
92
102
|
import ColmoMixin from '../../mixins/colmo'
|
|
93
103
|
import DiabloMixin from '../../mixins/diablo'
|
|
104
|
+
import Utils from '../utils/index.js'
|
|
105
|
+
|
|
106
|
+
const defaultPicBaseUrl = imageName => `meiju://common/emptyImage?imageName=${imageName}`
|
|
107
|
+
const isNewVersion = Utils.compareVersionNew('11.4.15')
|
|
94
108
|
const Types = {
|
|
95
109
|
noNetwork: {
|
|
96
|
-
pic: imgs['noNetwork'],
|
|
110
|
+
pic: isNewVersion ? defaultPicBaseUrl('img_empty_02_disconnection') : imgs['noNetwork'],
|
|
97
111
|
content: '网络异常,请检查您的网络设置'
|
|
98
112
|
// button: '刷新'
|
|
99
113
|
},
|
|
100
114
|
noUpdate: {
|
|
101
|
-
pic: imgs['noUpdate'],
|
|
115
|
+
pic: isNewVersion ? defaultPicBaseUrl('img_empty_03_update') : imgs['noUpdate'],
|
|
102
116
|
content: '当前版本较低',
|
|
103
117
|
desc: '请更新到最新版APP'
|
|
104
118
|
},
|
|
105
119
|
noPage: {
|
|
106
|
-
pic: imgs['noPage'],
|
|
120
|
+
pic: isNewVersion ? defaultPicBaseUrl('img_empty_04_content') : imgs['noPage'],
|
|
107
121
|
content: '找不到页面'
|
|
108
122
|
},
|
|
109
123
|
colmo: {
|
|
@@ -143,6 +157,9 @@ export default {
|
|
|
143
157
|
}
|
|
144
158
|
},
|
|
145
159
|
computed: {
|
|
160
|
+
isNewVersion() {
|
|
161
|
+
return Utils.compareVersionNew('11.4.15')
|
|
162
|
+
},
|
|
146
163
|
type_() {
|
|
147
164
|
if (this.type) return this.type
|
|
148
165
|
return this._isColmo ? 'colmo' : 'noPage'
|
|
@@ -86,8 +86,9 @@ export default {
|
|
|
86
86
|
},
|
|
87
87
|
methods: {
|
|
88
88
|
initElWidth() {
|
|
89
|
+
const dom = weex.requireModule('dom')
|
|
89
90
|
const el = this.$refs['dof-slider-scale']
|
|
90
|
-
getBoundingClientRect(el, res => {
|
|
91
|
+
getBoundingClientRect(dom, el, res => {
|
|
91
92
|
res.result && (this.elWidth = res.size.width)
|
|
92
93
|
})
|
|
93
94
|
}
|
package/packages/utils/dom.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
export function getBoundingClientRectBase(element, func) {
|
|
1
|
+
const domModule = weex.requireModule('dom')
|
|
2
|
+
export function getBoundingClientRectBase(dom, element, func) {
|
|
4
3
|
dom && dom.getComponentRect(element, func)
|
|
5
4
|
}
|
|
6
5
|
|
|
7
|
-
export function getBoundingClientRect(element, func, delay = 50) {
|
|
6
|
+
export function getBoundingClientRect(dom, element, func, delay = 50) {
|
|
8
7
|
setTimeout(() => dom && dom.getComponentRect(element, func), delay)
|
|
9
8
|
}
|
|
10
9
|
|
|
11
|
-
export function getBoundingClientRectAsync(element) {
|
|
10
|
+
export function getBoundingClientRectAsync(dom, element) {
|
|
12
11
|
return new Promise(resolve => {
|
|
13
12
|
setTimeout(() => dom && dom.getComponentRect(element, res => res.result && resolve(res.size)), 0)
|
|
14
13
|
})
|
package/packages/utils/index.js
CHANGED
|
@@ -277,6 +277,21 @@ const Utils = {
|
|
|
277
277
|
}
|
|
278
278
|
return false
|
|
279
279
|
},
|
|
280
|
+
toNum(a) {
|
|
281
|
+
a = a.toString()
|
|
282
|
+
var c = a.split('.')
|
|
283
|
+
var r = ['0000', '000', '00', '0', '']
|
|
284
|
+
for (var i = 0; i < c.length; i++) {
|
|
285
|
+
var len = c[i].length
|
|
286
|
+
c[i] = r[len] + c[i]
|
|
287
|
+
}
|
|
288
|
+
var res = c.join('')
|
|
289
|
+
return res
|
|
290
|
+
},
|
|
291
|
+
compareVersionNew(a) {
|
|
292
|
+
// 判断当前版本是否大于等于比较的版本
|
|
293
|
+
return this.toNum(weex.config.env.appVersion) >= this.toNum(a)
|
|
294
|
+
},
|
|
280
295
|
/**
|
|
281
296
|
* 分割数组
|
|
282
297
|
* @param arr 被分割数组
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "default", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _index["default"];
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
var _index = _interopRequireDefault(require("./index.vue"));
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|