dolphin-weex-ui 1.2.0 → 1.2.2

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": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "inteligense cross platform frame",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -1,41 +1,50 @@
1
1
  <template>
2
2
  <div>
3
- <div @touchend="handleTouchEnd">
4
- <dof-overlay ref="overlay"
5
- v-if="show"
6
- :show="haveOverlay && isOverShow"
7
- v-bind="overlayCfg"
8
- v-on:dofOverlayBodyClicked="dofOverlayBodyClicking">
9
- </dof-overlay>
10
- </div>
11
- <div ref="dof-confirm"
12
- v-if="show"
13
- :height="_height"
14
- :hack="isNeedShow"
15
- :class="['dof-confirm', pos]"
16
- :style="padStyle">
17
- <!-- add slot by hairong -->
18
- <slot name="confirmContent"></slot>
3
+ <div @touchend="handleTouchEnd">
4
+ <dof-overlay
5
+ ref="overlay"
6
+ v-if="show"
7
+ :show="haveOverlay && isOverShow"
8
+ v-bind="overlayCfg"
9
+ v-on:dofOverlayBodyClicked="dofOverlayBodyClicking"
10
+ >
11
+ </dof-overlay>
12
+ </div>
13
+ <div
14
+ ref="dof-confirm"
15
+ v-if="show"
16
+ :height="_height"
17
+ :hack="isNeedShow"
18
+ :class="['dof-confirm', pos]"
19
+ :style="padStyle"
20
+ >
21
+ <!-- add slot by hairong -->
22
+ <slot name="confirmContent"></slot>
19
23
 
20
- <text v-if="title" class="confirm-title">{{title}}</text>
21
- <div class="confirm-content-wrapper">
22
- <text class="confirm-content">{{content}}</text>
23
- </div>
24
- <div class="confirm-buttons">
25
- <div class="confirm-button-left" @click="leftBtnClick"><text class="left-button">{{leftBtnText}}</text></div>
26
- <div class="confirm-button-right" @click="rightBtnClick"><text class="right-button">{{rightBtnText}}</text></div>
27
- </div>
28
- <!-- add by lau 解决iPhonex xr xs等机型的低栏问题 留白 -->
29
- <div :style="{height:isipx?'68px':'0px','background-color': '#ffffff'}"></div>
24
+ <text v-if="title" class="confirm-title">{{ title }}</text>
25
+ <div class="confirm-content-wrapper">
26
+ <text class="confirm-content">{{ content }}</text>
27
+ </div>
28
+ <div class="confirm-buttons">
29
+ <div class="confirm-button-left" @click="leftBtnClick">
30
+ <text class="left-button">{{ leftBtnText }}</text>
31
+ </div>
32
+ <div class="confirm-button-right" @click="rightBtnClick">
33
+ <text class="right-button">{{ rightBtnText }}</text>
34
+ </div>
30
35
  </div>
36
+ <!-- add by lau 解决iPhonex xr xs等机型的低栏问题 留白 -->
37
+ <div :style="{ height: isipx ? '68px' : '0px', 'background-color': '#ffffff' }"></div>
38
+ </div>
31
39
  </div>
32
40
  </template>
33
41
 
34
42
  <script>
35
- const animation = weex.requireModule('animation');
36
- const { platform } = weex.config.env;
37
- const isWeb = typeof (window) === 'object' && platform.toLowerCase() === 'web';
38
- import dofOverlay from '../dof-overlay';
43
+ const animation = weex.requireModule('animation')
44
+ const { platform } = weex.config.env
45
+ const isWeb = typeof window === 'object' && platform.toLowerCase() === 'web'
46
+ import dofOverlay from '../dof-overlay'
47
+ import { Bridge } from 'dolphin-native-bridge'
39
48
  export default {
40
49
  components: { dofOverlay },
41
50
  props: {
@@ -92,128 +101,141 @@ export default {
92
101
  },
93
102
  data: () => ({
94
103
  haveOverlay: true,
95
- isOverShow: true
104
+ isOverShow: true,
105
+ bottomArc: 0
96
106
  }),
97
107
 
98
108
  computed: {
99
109
  // add by lau
100
- isipx: function () {
101
- return weex && (
102
- weex.config.env.deviceModel === 'iPhone10,3' || weex.config.env.deviceModel === 'iPhone10,6' || // iphoneX
103
- weex.config.env.deviceModel === 'iPhone11,8' || // iPhone XR
104
- weex.config.env.deviceModel === 'iPhone11,2' || // iPhone XS
105
- weex.config.env.deviceModel === 'iPhone11,4' || weex.config.env.deviceModel === 'iPhone11,6' // iPhone XS Max
106
- );
110
+ isipx: function() {
111
+ if (this.bottomArc) return true
112
+ return (
113
+ weex &&
114
+ (weex.config.env.deviceModel === 'iPhone10,3' ||
115
+ weex.config.env.deviceModel === 'iPhone10,6' || // iphoneX
116
+ weex.config.env.deviceModel === 'iPhone11,8' || // iPhone XR
117
+ weex.config.env.deviceModel === 'iPhone11,2' || // iPhone XS
118
+ weex.config.env.deviceModel === 'iPhone11,4' ||
119
+ weex.config.env.deviceModel === 'iPhone11,6') // iPhone XS Max
120
+ )
107
121
  },
108
122
 
109
- isNeedShow () {
123
+ isNeedShow() {
110
124
  setTimeout(() => {
111
- this.appearPopup(this.show);
112
- }, 50);
113
- return this.show;
125
+ this.appearPopup(this.show)
126
+ }, 50)
127
+ return this.show
114
128
  },
115
- _height () {
116
- this.appearPopup(this.show, 150);
117
- return this.height;
129
+ _height() {
130
+ this.appearPopup(this.show, 150)
131
+ return this.height
118
132
  },
119
- transformValue () {
120
- return this.getTransform(this.pos, this.width, this.height, true);
133
+ transformValue() {
134
+ return this.getTransform(this.pos, this.width, this.height, true)
121
135
  },
122
- padStyle () {
123
- const { pos, width, height, popupColor } = this;
136
+ padStyle() {
137
+ const { pos, width, height, popupColor } = this
124
138
  let style = {
125
139
  width: `${width}px`,
126
140
  backgroundColor: popupColor
127
- };
128
- pos === 'bottom' && (style = {
129
- ...style,
130
- bottom: `${-height}px`,
131
- height: `${height}px`
132
- });
133
- return style;
141
+ }
142
+ pos === 'bottom' &&
143
+ (style = {
144
+ ...style,
145
+ bottom: `${-height}px`,
146
+ height: `${height}px`
147
+ })
148
+ return style
134
149
  }
135
150
  },
136
151
 
137
- created(){
138
- console.log("weeks", weex)
152
+ created() {
153
+ console.log('weeks', weex)
154
+ Bridge.getAllBarHeight().then(res => {
155
+ this.bottomArc = res.bottomArc || 0
156
+ })
139
157
  },
140
158
  methods: {
141
- leftBtnClick () {
142
- this.appearPopup(false);
143
- this.$emit('leftBtnClick', false);
159
+ leftBtnClick() {
160
+ this.appearPopup(false)
161
+ this.$emit('leftBtnClick', false)
144
162
  },
145
- rightBtnClick () {
146
- this.appearPopup(false);
147
- this.$emit('rightBtnClick', true);
163
+ rightBtnClick() {
164
+ this.appearPopup(false)
165
+ this.$emit('rightBtnClick', true)
148
166
  },
149
- handleTouchEnd (e) {
150
- // 在支付宝上面有点击穿透问题
151
- const { platform } = weex.config.env;
152
- platform === 'Web' && e.preventDefault && e.preventDefault();
167
+ handleTouchEnd(e) {
168
+ // 在支付宝上面有点击穿透问题
169
+ const { platform } = weex.config.env
170
+ platform === 'Web' && e.preventDefault && e.preventDefault()
153
171
  },
154
- hide () {
155
- this.appearPopup(false);
156
- this.$refs.overlay.appearOverlay(false);
172
+ hide() {
173
+ this.appearPopup(false)
174
+ this.$refs.overlay.appearOverlay(false)
157
175
  },
158
- dofOverlayBodyClicking () {
159
- this.isShow && this.appearPopup(false);
176
+ dofOverlayBodyClicking() {
177
+ this.isShow && this.appearPopup(false)
160
178
  },
161
179
 
162
- appearPopup (bool, duration = 300) {
180
+ appearPopup(bool, duration = 300) {
163
181
  // 解决iphonex,xr,xs.11机型低栏的问题
164
- var height = this.isipx?this.height+68:this.height;
165
- this.isShow = bool;
166
- const popupEl = this.$refs['dof-confirm'];
182
+ var height = this.isipx ? this.height + 68 : this.height
183
+ this.isShow = bool
184
+ const popupEl = this.$refs['dof-confirm']
167
185
  if (!popupEl) {
168
- return;
186
+ return
169
187
  }
170
- animation.transition(popupEl, {
171
- styles: {
172
- transform: this.getTransform(this.pos, this.width, height, !bool)
188
+ animation.transition(
189
+ popupEl,
190
+ {
191
+ styles: {
192
+ transform: this.getTransform(this.pos, this.width, height, !bool)
193
+ },
194
+ duration,
195
+ delay: 0,
196
+ ...this.animation
173
197
  },
174
- duration,
175
- delay: 0,
176
- ...this.animation
177
- }, () => {
178
- if (!bool) {
179
- this.$emit('dofPopupOverlayClicked', { pos: this.pos });
198
+ () => {
199
+ if (!bool) {
200
+ this.$emit('dofPopupOverlayClicked', { pos: this.pos })
201
+ }
180
202
  }
181
- });
203
+ )
182
204
  },
183
- getTransform (pos, width, height, bool) {
184
- let _size = pos === 'top' || pos === 'bottom' ? height : width;
185
- let _transform;
205
+ getTransform(pos, width, height, bool) {
206
+ let _size = pos === 'top' || pos === 'bottom' ? height : width
207
+ let _transform
186
208
  if (isWeb) {
187
- _size -= this.standOut;
209
+ _size -= this.standOut
188
210
  }
189
- bool && (_size = 0);
211
+ bool && (_size = 0)
190
212
  switch (pos) {
191
- case 'top':
192
- _transform = `translateY(${_size}px)`;
193
- break;
194
- case 'bottom':
195
- _transform = `translateY(-${_size}px)`;
196
- break;
197
- case 'left':
198
- _transform = `translateX(${_size}px)`;
199
- break;
200
- case 'right':
201
- _transform = `translateX(-${_size}px)`;
202
- break;
213
+ case 'top':
214
+ _transform = `translateY(${_size}px)`
215
+ break
216
+ case 'bottom':
217
+ _transform = `translateY(-${_size}px)`
218
+ break
219
+ case 'left':
220
+ _transform = `translateX(${_size}px)`
221
+ break
222
+ case 'right':
223
+ _transform = `translateX(-${_size}px)`
224
+ break
203
225
  }
204
- return _transform;
226
+ return _transform
205
227
  }
206
228
  }
207
- };
229
+ }
208
230
  </script>
209
231
 
210
232
  <style scoped>
211
233
  .dof-confirm {
212
234
  position: fixed;
213
235
  width: 750px;
214
- background: #FFFFFF;
215
- border-top-left-radius:32px;
216
- border-top-right-radius:32px;
236
+ background: #ffffff;
237
+ border-top-left-radius: 32px;
238
+ border-top-right-radius: 32px;
217
239
  }
218
240
 
219
241
  .bottom {
@@ -228,8 +250,8 @@ export default {
228
250
  color: #000000;
229
251
  font-size: 36px;
230
252
  background-color: #ffffff;
231
- border-top-left-radius:32px;
232
- border-top-right-radius:32px;
253
+ border-top-left-radius: 32px;
254
+ border-top-right-radius: 32px;
233
255
  }
234
256
 
235
257
  .confirm-content-wrapper {
@@ -243,7 +265,7 @@ export default {
243
265
  }
244
266
 
245
267
  .confirm-content {
246
- color: #020F13;
268
+ color: #020f13;
247
269
  font-size: 28px;
248
270
  line-height: 30px;
249
271
  /* text-align: justify;
@@ -251,7 +273,7 @@ export default {
251
273
  justify-content: space-between; */
252
274
  }
253
275
 
254
- .confirm-content::after{
276
+ .confirm-content::after {
255
277
  content: '';
256
278
  display: inline-block;
257
279
  width: 100%;
@@ -264,13 +286,14 @@ export default {
264
286
  background-color: #f2f2f2;
265
287
  text-align: center;
266
288
  font-size: 36px;
267
- flex-direction:row;
289
+ flex-direction: row;
268
290
  }
269
291
 
270
- .confirm-button-left, .confirm-button-right {
292
+ .confirm-button-left,
293
+ .confirm-button-right {
271
294
  width: 375px;
272
295
  text-align: center;
273
- flex:1;
296
+ flex: 1;
274
297
  align-items: center;
275
298
  justify-content: center;
276
299
  text-align: center;
@@ -279,7 +302,7 @@ export default {
279
302
 
280
303
  .confirm-button-left {
281
304
  border-right-width: 1px;
282
- border-right-color: #E5E5E5;
305
+ border-right-color: #e5e5e5;
283
306
  }
284
307
 
285
308
  .left-button {
@@ -294,4 +317,3 @@ export default {
294
317
  color: #000000;
295
318
  }
296
319
  </style>
297
-
@@ -1,8 +1,14 @@
1
1
  <template>
2
2
  <div v-if="show" class="bg" @click="cancel">
3
- <div class="dof-confirm-box-wrap" ref="boxWrap" :style="{height: wrapHeight, bottom:'0px'}">
4
- <text v-if='title' class="title">{{title}}</text>
5
- <dof-image src="../../assets/img/check/disuncheked.png" @click="cancel" class="closeIcon" width="40px" height="40px"></dof-image>
3
+ <div class="dof-confirm-box-wrap" ref="boxWrap" :style="{ height: wrapHeight, bottom: '0px' }">
4
+ <text v-if="title" class="title">{{ title }}</text>
5
+ <dof-image
6
+ src="../../assets/img/check/disuncheked.png"
7
+ @click="cancel"
8
+ class="closeIcon"
9
+ width="40px"
10
+ height="40px"
11
+ ></dof-image>
6
12
  <div class="slot-floor">
7
13
  <slot></slot>
8
14
  </div>
@@ -11,20 +17,19 @@
11
17
  <text class="right-button" @click="rightBtnClick">{{rightBtnText}}</text>
12
18
  </div> -->
13
19
 
14
- <div :class="[isipx?'bottom-offset-padding':'']"></div>
20
+ <div :class="[isipx ? 'bottom-offset-padding' : '']"></div>
15
21
  </div>
16
22
  </div>
17
23
  </template>
18
24
 
19
-
20
-
21
25
  <script>
22
- import DofImage from '../dof-image';
26
+ import DofImage from '../dof-image'
23
27
  // import { DofImage, DofMinibar } from "../../index";
24
- var animation = weex.requireModule('animation');
28
+ var animation = weex.requireModule('animation')
29
+ import { Bridge } from 'dolphin-native-bridge'
25
30
 
26
31
  export default {
27
- components:{DofImage},
32
+ components: { DofImage },
28
33
  props: {
29
34
  show: {
30
35
  type: Boolean,
@@ -51,31 +56,33 @@ export default {
51
56
  },
52
57
  data() {
53
58
  return {
54
- };
55
- },
56
-
57
- watch:{
58
-
59
+ bottomArc: 0
60
+ }
59
61
  },
60
62
 
63
+ watch: {},
61
64
 
62
65
  computed: {
63
- isipx: function () {
64
- return weex && (
65
- weex.config.env.deviceModel === 'iPhone10,3' || weex.config.env.deviceModel === 'iPhone10,6' || // iphoneX
66
+ isipx: function() {
67
+ if (this.bottomArc) return true
68
+ return (
69
+ weex &&
70
+ (weex.config.env.deviceModel === 'iPhone10,3' ||
71
+ weex.config.env.deviceModel === 'iPhone10,6' || // iphoneX
66
72
  weex.config.env.deviceModel === 'iPhone11,8' || // iPhone XR
67
73
  weex.config.env.deviceModel === 'iPhone11,2' || // iPhone XS
68
- weex.config.env.deviceModel === 'iPhone11,4' || weex.config.env.deviceModel === 'iPhone11,6' // iPhone XS Max
69
- );
74
+ weex.config.env.deviceModel === 'iPhone11,4' ||
75
+ weex.config.env.deviceModel === 'iPhone11,6') // iPhone XS Max
76
+ )
70
77
  },
71
78
  wrapHeight: function() {
72
- let tmp = '';
79
+ let tmp = ''
73
80
  if (this.isipx) {
74
- tmp = this.height + 34;
81
+ tmp = this.height + 34
75
82
  } else {
76
- tmp = this.height;
83
+ tmp = this.height
77
84
  }
78
- return tmp + 'px';
85
+ return tmp + 'px'
79
86
  }
80
87
  },
81
88
  methods: {
@@ -84,119 +91,129 @@ export default {
84
91
  // this.$emit('dofPopupOverlayClicked');
85
92
  // },
86
93
 
87
- open(){
94
+ open() {
88
95
  var _this = this
89
- console.log("open")
90
- var el = this.$refs.boxWrap;
91
- var translate = 'translate(0px, 0px)';
92
- _this.animationFn(el, translate, 'cubic-bezier( 1.0, 0.25, 0.1, 0.25)', function () {
93
- _this.show = true; // overlay show = false
94
- _this.$emit('dofPopupOverlayClicked');
95
- });
96
+ console.log('open')
97
+ var el = this.$refs.boxWrap
98
+ var translate = 'translate(0px, 0px)'
99
+ _this.animationFn(el, translate, 'cubic-bezier( 1.0, 0.25, 0.1, 0.25)', function() {
100
+ _this.show = true // overlay show = false
101
+ _this.$emit('dofPopupOverlayClicked')
102
+ })
96
103
  },
97
104
 
98
105
  cancel() {
99
106
  var _this = this
100
- console.log("cancel")
101
- var el = this.$refs.boxWrap;
102
- var translate = 'translate(0px, ' + (this.height) + 'px)';
103
- _this.animationFn(el, translate, 'cubic-bezier( 1.0, 0.25, 0.1, 0.25)', function () {
104
- _this.show = false; // overlay show = false
105
- _this.$emit('dofPopupOverlayClicked');
106
- });
107
+ console.log('cancel')
108
+ var el = this.$refs.boxWrap
109
+ var translate = 'translate(0px, ' + this.height + 'px)'
110
+ _this.animationFn(el, translate, 'cubic-bezier( 1.0, 0.25, 0.1, 0.25)', function() {
111
+ _this.show = false // overlay show = false
112
+ _this.$emit('dofPopupOverlayClicked')
113
+ })
107
114
  },
108
115
 
109
- leftBtnClick () {
110
- this.$emit('leftBtnClick');
116
+ leftBtnClick() {
117
+ this.$emit('leftBtnClick')
111
118
  },
112
- rightBtnClick () {
113
- this.$emit('rightBtnClick');
119
+ rightBtnClick() {
120
+ this.$emit('rightBtnClick')
114
121
  },
115
122
 
116
123
  animationFn(el, translate, timing, fn) {
117
- animation.transition(el, {
118
- styles: {
119
- transform: translate,
120
- transformOrigin: 'center center'
124
+ animation.transition(
125
+ el,
126
+ {
127
+ styles: {
128
+ transform: translate,
129
+ transformOrigin: 'center center'
130
+ },
131
+ duration: 300, // ms
132
+ timingFunction: timing,
133
+ delay: 0 // ms
121
134
  },
122
- duration: 300, // ms
123
- timingFunction: timing,
124
- delay: 0 // ms
125
- }, function () {
126
- fn && fn();
127
- });
135
+ function() {
136
+ fn && fn()
137
+ }
138
+ )
128
139
  }
129
140
  },
130
- mounted() {
131
- },
141
+ mounted() {},
132
142
  created() {
143
+ Bridge.getAllBarHeight().then(res => {
144
+ this.bottomArc = res.bottomArc || 0
145
+ })
133
146
  }
134
- };
147
+ }
135
148
  </script>
136
149
 
137
150
  <style>
138
- .bg{
139
- position: fixed;
140
- top: 0;
141
- bottom: 0;
142
- left: 0;
143
- right: 0;
144
- background-color: rgba(0,0,0, 0.3)
151
+ .bg {
152
+ position: fixed;
153
+ top: 0;
154
+ bottom: 0;
155
+ left: 0;
156
+ right: 0;
157
+ background-color: rgba(0, 0, 0, 0.3);
158
+ }
159
+ .dof-confirm-box-wrap {
160
+ background-color: #ffffff;
161
+ width: 750px;
162
+ position: fixed;
163
+ bottom: 0;
164
+ border-top-left-radius: 32px;
165
+ border-top-right-radius: 32px;
166
+ overflow: hidden;
167
+ transition: ease-in-out all 0.5s;
168
+ /* padding: 16px; */
145
169
  }
146
- .dof-confirm-box-wrap{
147
- background-color: #ffffff;
148
- width:750px;
149
- position: fixed;
150
- bottom: 0;
151
- border-top-left-radius: 32px;
152
- border-top-right-radius: 32px;
153
- overflow: hidden;
154
- transition: ease-in-out all 0.5s;
155
- /* padding: 16px; */
170
+ .slot-floor {
171
+ /* width: 750px; */
172
+ /* height: 500px; */
173
+ background-color: #ffffff;
174
+ font-size: 28px;
175
+ border-top-left-radius: 32px;
176
+ border-top-right-radius: 32px;
156
177
  }
157
- .slot-floor{
158
- /* width: 750px; */
159
- /* height: 500px; */
160
- background-color: #ffffff;
161
- font-size: 28px;
162
- border-top-left-radius: 32px;
163
- border-top-right-radius: 32px;
178
+ .row-sb {
179
+ flex-direction: row;
180
+ justify-content: space-between;
164
181
  }
165
- .row-sb{ flex-direction: row; justify-content: space-between; }
166
- .confirm-buttons{
167
- position: fixed;
168
- bottom: 0;
169
- left: 0;
170
- right: 0;
171
- padding-top: 16px;
172
- background-color: #f2f2f2;
182
+ .confirm-buttons {
183
+ position: fixed;
184
+ bottom: 0;
185
+ left: 0;
186
+ right: 0;
187
+ padding-top: 16px;
188
+ background-color: #f2f2f2;
173
189
  }
174
- .left-button, .right-button {
175
- width: 375px;
176
- line-height: 96px;
177
- flex:1;
178
- text-align: center;
179
- background-color: #ffffff;
190
+ .left-button,
191
+ .right-button {
192
+ width: 375px;
193
+ line-height: 96px;
194
+ flex: 1;
195
+ text-align: center;
196
+ background-color: #ffffff;
180
197
  }
181
198
  .left-button {
182
- font-size: 32px;
183
- color: #666666;
184
- border-right-width: 1px;
185
- border-right-color: #e5e5e5;
199
+ font-size: 32px;
200
+ color: #666666;
201
+ border-right-width: 1px;
202
+ border-right-color: #e5e5e5;
186
203
  }
187
204
  .right-button {
188
- font-size: 32px;
189
- color: #000000;
205
+ font-size: 32px;
206
+ color: #000000;
190
207
  }
191
- .bottom-offset{
192
- height: 154px;
208
+ .bottom-offset {
209
+ height: 154px;
193
210
  }
194
211
 
195
- .bottom-offset-padding{
212
+ .bottom-offset-padding {
196
213
  height: 68px;
197
214
  }
198
215
 
199
- .title{
216
+ .title {
200
217
  color: #000000;
201
218
  font-size: 32px;
202
219
  line-height: 106px;
@@ -207,7 +224,7 @@ export default {
207
224
  padding-left: 32px;
208
225
  }
209
226
 
210
- .closeIcon{
227
+ .closeIcon {
211
228
  position: absolute;
212
229
  top: 37px;
213
230
  right: 37px;