dolphin-weex-ui 2.4.21 → 2.4.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dolphin-weex-ui",
3
- "version": "2.4.21",
3
+ "version": "2.4.22",
4
4
  "description": "inteligense cross platform frame",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -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
- getBoundingClientRect(this.$refs.body, res => {
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,
@@ -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
  }
@@ -1,14 +1,13 @@
1
- const dom = weex.requireModule('dom')
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
  })
@@ -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 }; }