@dcloudio/uni-h5 2.0.0 → 2.0.1-32920211122002
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/dist/automator.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.umd.min.js +1 -1
- package/lib/apis.js +14 -4
- package/lib/h5/uni.automator.js +1 -1
- package/lib/modules.json +4 -1
- package/manifest.json +49 -0
- package/package.json +2 -3
- package/src/core/helpers/api.js +1 -1
- package/src/core/helpers/constants.js +1 -0
- package/src/core/helpers/i18n/en.json +4 -2
- package/src/core/helpers/i18n/es.json +4 -1
- package/src/core/helpers/i18n/fr.json +4 -1
- package/src/core/helpers/i18n/index.js +155 -4
- package/src/core/helpers/i18n/zh-Hans.json +4 -1
- package/src/core/helpers/i18n/zh-Hant.json +4 -1
- package/src/core/helpers/index.js +1 -1
- package/src/core/helpers/interceptor.js +19 -15
- package/src/core/helpers/promise.js +1 -1
- package/src/core/helpers/protocol/device/set-clipboard-data.js +11 -2
- package/src/core/helpers/protocol/network/request.js +14 -1
- package/src/core/helpers/protocol/network/upload-file.js +1 -1
- package/src/core/helpers/protocol/ui/popup.js +2 -2
- package/src/core/runtime/base.js +2 -0
- package/src/core/runtime/locale.js +37 -0
- package/src/core/runtime/web-view/index.js +4 -0
- package/src/core/runtime/wrapper/create-subpackage-app.js +7 -6
- package/src/core/runtime/wrapper/util.js +6 -1
- package/src/core/service/api/base/interceptor.js +1 -1
- package/src/core/service/api/context/canvas.js +3 -2
- package/src/core/service/api/context/create-map-context.js +8 -1
- package/src/core/service/api/ui/locale.js +50 -0
- package/src/core/service/plugins/app/create-app.js +8 -3
- package/src/core/service/plugins/app/index.js +2 -2
- package/src/core/service/plugins/index.js +8 -2
- package/src/core/view/bridge/subscribe/api/request-component-observer.js +16 -1
- package/src/core/view/components/canvas/index.vue +3 -1
- package/src/core/view/components/editor/formats/image.js +3 -1
- package/src/core/view/components/editor/formats/index.js +3 -1
- package/src/core/view/components/editor/formats/link.js +9 -0
- package/src/core/view/components/editor/index.vue +33 -3
- package/src/core/view/components/image/index.vue +4 -5
- package/src/core/view/components/input/index.vue +53 -25
- package/src/core/view/components/picker-view-column/index.vue +1 -0
- package/src/core/view/components/progress/index.vue +20 -13
- package/src/core/view/components/rich-text/index.vue +13 -1
- package/src/core/view/components/rich-text/nodes-parser.js +23 -4
- package/src/core/view/components/scroll-view/index.vue +253 -122
- package/src/core/view/components/slider/index.vue +1 -1
- package/src/core/view/components/swiper/index.vue +3 -0
- package/src/core/view/components/textarea/index.vue +7 -3
- package/src/core/view/index.css +4 -0
- package/src/core/view/mixins/field.js +27 -9
- package/src/core/view/mixins/interact.js +13 -11
- package/src/core/view/mixins/keyboard.js +42 -26
- package/src/core/view/mixins/touchtrack.js +2 -2
- package/src/core/view/plugins/index.js +1 -1
- package/src/platforms/app-plus/constants.js +1 -0
- package/src/platforms/app-plus/helpers/get-real-path.js +7 -4
- package/src/platforms/app-plus/helpers/uuid.js +1 -1
- package/src/platforms/app-plus/service/api/ad/ad-base.js +159 -0
- package/src/platforms/app-plus/service/api/ad/ad.js +4 -8
- package/src/platforms/app-plus/service/api/ad/full-screen-video-ad.js +5 -98
- package/src/platforms/app-plus/service/api/ad/interactive-ad.js +257 -0
- package/src/platforms/app-plus/service/api/ad/interstitial-ad.js +15 -0
- package/src/platforms/app-plus/service/api/ad/rewarded-video-ad.js +15 -2
- package/src/platforms/app-plus/service/api/device/system.js +3 -2
- package/src/platforms/app-plus/service/api/file/open-document.js +7 -15
- package/src/platforms/app-plus/service/api/index.js +2 -0
- package/src/platforms/app-plus/service/api/location/get-location.js +8 -7
- package/src/platforms/app-plus/service/api/media/choose-image.js +22 -51
- package/src/platforms/app-plus/service/api/media/choose-video.js +19 -36
- package/src/platforms/app-plus/service/api/media/compress-video.js +2 -2
- package/src/platforms/app-plus/service/api/media/get-video-info.js +5 -2
- package/src/platforms/app-plus/service/api/network/request.js +27 -1
- package/src/platforms/app-plus/service/api/network/upload-file.js +1 -1
- package/src/platforms/app-plus/service/api/plugin/oauth.js +140 -8
- package/src/platforms/app-plus/service/api/storage/storage.js +1 -1
- package/src/platforms/app-plus/service/api/ui/popup.js +21 -11
- package/src/platforms/app-plus/service/api/ui/tab-bar.js +3 -2
- package/src/platforms/app-plus/service/api/util.js +5 -1
- package/src/platforms/app-plus/service/framework/app.js +21 -5
- package/src/platforms/app-plus/service/framework/config.js +1 -0
- package/src/platforms/app-plus/service/framework/plugins/index.js +8 -2
- package/src/platforms/app-plus/service/framework/plugins/lifecycle.js +2 -2
- package/src/platforms/app-plus/service/framework/subscribe-handlers/index.js +1 -1
- package/src/platforms/app-plus/service/framework/tab-bar.js +12 -2
- package/src/platforms/app-plus/service/framework/webview/index.js +2 -2
- package/src/platforms/app-plus/service/framework/webview/parser/title-nview-parser.js +73 -30
- package/src/platforms/app-plus/service/framework/webview/parser/webview-style-parser.js +16 -16
- package/src/platforms/app-plus/service/index.js +10 -3
- package/src/platforms/app-plus/service/publish-handler.js +3 -0
- package/src/platforms/app-plus/view/bridge/subscribe/index.js +5 -3
- package/src/platforms/app-plus/view/components/ad/index.vue +53 -44
- package/src/platforms/app-plus/view/components/cover-view/index.vue +13 -7
- package/src/platforms/app-plus/view/components/map/index.vue +29 -27
- package/src/platforms/app-plus/view/components/video/index.vue +40 -24
- package/src/platforms/app-plus/view/framework/plugins/gesture.js +17 -0
- package/src/platforms/app-plus/view/framework/plugins/index.js +3 -1
- package/src/platforms/app-plus/view/index.css +4 -0
- package/src/platforms/app-plus/view/mixins/cover.js +10 -15
- package/src/platforms/app-plus/view/mixins/native.js +45 -3
- package/src/platforms/app-plus-nvue/service/api/context/operate-map-player.js +3 -0
- package/src/platforms/h5/components/app/observable.js +3 -2
- package/src/platforms/h5/components/app/popup/mixins/modal.js +3 -3
- package/src/platforms/h5/components/app/popup/modal.vue +38 -2
- package/src/platforms/h5/components/app/popup/toast.vue +9 -1
- package/src/platforms/h5/components/app/tabBar.vue +39 -17
- package/src/platforms/h5/components/page/index.vue +5 -3
- package/src/platforms/h5/components/page/pageHead.vue +94 -75
- package/src/platforms/h5/components/system-routes/choose-location/index.vue +127 -66
- package/src/platforms/h5/components/system-routes/open-location/index.vue +193 -38
- package/src/platforms/h5/helpers/location.js +26 -0
- package/src/platforms/h5/helpers/todo-api.js +2 -2
- package/src/platforms/h5/service/api/device/clipboard.js +41 -0
- package/src/platforms/h5/service/api/device/get-system-info.js +75 -0
- package/src/platforms/h5/service/api/location/get-location.js +47 -18
- package/src/platforms/h5/service/api/media/MIMEType.js +53 -0
- package/src/platforms/h5/service/api/media/choose-file.js +9 -1
- package/src/platforms/h5/service/api/media/choose-image.js +9 -2
- package/src/platforms/h5/service/api/media/choose-video.js +9 -1
- package/src/platforms/h5/service/api/media/create_input.js +12 -3
- package/src/platforms/h5/service/api/ui/popup.js +3 -5
- package/src/platforms/h5/service/api/ui/tab-bar.js +1 -1
- package/src/platforms/h5/service/index.js +5 -0
- package/src/platforms/h5/view/bridge/subscribe/index.js +3 -2
- package/src/platforms/h5/view/components/ad/index.vue +112 -69
- package/src/platforms/h5/view/components/map/index.vue +96 -349
- package/src/platforms/h5/view/components/map/map-marker.js +287 -0
- package/src/platforms/h5/view/components/map/maps/callout.js +117 -0
- package/src/platforms/h5/view/components/map/maps/index.js +55 -0
- package/src/platforms/h5/view/components/video/index.vue +1 -1
- package/src/platforms/h5/view/index.css +4 -0
- package/src/platforms/mp-alipay/runtime/api/protocols.js +30 -3
- package/src/platforms/mp-baidu/runtime/api/protocols.js +5 -0
- package/src/platforms/mp-baidu/runtime/wrapper/component-parser.js +20 -18
- package/src/platforms/mp-baidu/runtime/wrapper/util.js +2 -1
- package/src/platforms/mp-kuaishou/runtime/api/protocols.js +3 -1
- package/src/platforms/mp-kuaishou/runtime/wrapper/component-parser.js +21 -1
- package/src/platforms/mp-lark/runtime/api/index.js +0 -0
- package/src/platforms/mp-lark/runtime/api/protocols.js +68 -0
- package/src/platforms/mp-lark/runtime/api/providers.js +6 -0
- package/src/platforms/mp-lark/runtime/index.js +1 -0
- package/src/platforms/mp-lark/runtime/web-view.js +11 -0
- package/src/platforms/mp-lark/runtime/wrapper/app-parser.js +33 -0
- package/src/platforms/mp-lark/runtime/wrapper/component-parser.js +50 -0
- package/src/platforms/mp-lark/runtime/wrapper/page-parser.js +39 -0
- package/src/platforms/mp-lark/runtime/wrapper/util.js +64 -0
- package/src/platforms/mp-qq/runtime/api/protocols.js +3 -1
- package/src/platforms/mp-toutiao/runtime/api/protocols.js +2 -0
- package/src/platforms/mp-toutiao/runtime/wrapper/component-parser.js +35 -19
- package/src/platforms/mp-weixin/helpers/get-user-profile.js +6 -0
- package/src/platforms/mp-weixin/runtime/index.js +6 -7
- package/src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js +197 -126
- package/src/platforms/mp-weixin/runtime/wrapper/fix-set-data.js +37 -0
- package/src/shared/uni-id-mixin.js +77 -0
- package/src/shared/util.js +2 -0
|
@@ -15,7 +15,16 @@
|
|
|
15
15
|
v-text="title"
|
|
16
16
|
/>
|
|
17
17
|
</div>
|
|
18
|
+
<textarea
|
|
19
|
+
v-if="editable"
|
|
20
|
+
ref="editContent"
|
|
21
|
+
class="uni-modal__textarea"
|
|
22
|
+
rows="1"
|
|
23
|
+
:placeholder="placeholderText"
|
|
24
|
+
:value="content"
|
|
25
|
+
/>
|
|
18
26
|
<div
|
|
27
|
+
v-else
|
|
19
28
|
class="uni-modal__bd"
|
|
20
29
|
@touchmove.stop
|
|
21
30
|
v-text="content"
|
|
@@ -41,7 +50,7 @@
|
|
|
41
50
|
<keypress
|
|
42
51
|
:disable="!visible"
|
|
43
52
|
@esc="_close('cancel')"
|
|
44
|
-
@enter="_close('confirm')"
|
|
53
|
+
@enter="!editable && _close('confirm')"
|
|
45
54
|
/>
|
|
46
55
|
</uni-modal>
|
|
47
56
|
</transition>
|
|
@@ -86,11 +95,25 @@ export default {
|
|
|
86
95
|
visible: {
|
|
87
96
|
type: Boolean,
|
|
88
97
|
default: false
|
|
98
|
+
},
|
|
99
|
+
editable: {
|
|
100
|
+
type: Boolean,
|
|
101
|
+
default: false
|
|
102
|
+
},
|
|
103
|
+
placeholderText: {
|
|
104
|
+
type: String,
|
|
105
|
+
default: ''
|
|
89
106
|
}
|
|
90
107
|
},
|
|
91
108
|
methods: {
|
|
92
109
|
_close (type) {
|
|
93
|
-
|
|
110
|
+
const res = {
|
|
111
|
+
[type]: true
|
|
112
|
+
}
|
|
113
|
+
if (this.editable && type === 'confirm') {
|
|
114
|
+
res.content = this.$refs.editContent.value
|
|
115
|
+
}
|
|
116
|
+
this.$emit('close', res)
|
|
94
117
|
}
|
|
95
118
|
}
|
|
96
119
|
}
|
|
@@ -156,6 +179,19 @@ export default {
|
|
|
156
179
|
overflow-y: auto;
|
|
157
180
|
}
|
|
158
181
|
|
|
182
|
+
uni-modal .uni-modal__textarea {
|
|
183
|
+
resize: none;
|
|
184
|
+
border: 0;
|
|
185
|
+
margin: 0;
|
|
186
|
+
width: 90%;
|
|
187
|
+
padding: 10px;
|
|
188
|
+
font-size: 20px;
|
|
189
|
+
outline: none;
|
|
190
|
+
border: none;
|
|
191
|
+
background-color: #eee;
|
|
192
|
+
text-decoration: inherit;
|
|
193
|
+
}
|
|
194
|
+
|
|
159
195
|
uni-modal .uni-modal__ft {
|
|
160
196
|
position: relative;
|
|
161
197
|
line-height: 48px;
|
|
@@ -52,7 +52,7 @@ export default {
|
|
|
52
52
|
icon: {
|
|
53
53
|
default: 'success',
|
|
54
54
|
validator (value) {
|
|
55
|
-
return ['success', 'loading', 'none'].indexOf(value) !== -1
|
|
55
|
+
return ['success', 'loading', 'error', 'none'].indexOf(value) !== -1
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
image: {
|
|
@@ -80,6 +80,9 @@ export default {
|
|
|
80
80
|
if (this.icon === 'loading') {
|
|
81
81
|
return 'uni-loading'
|
|
82
82
|
}
|
|
83
|
+
if (this.icon === 'error') {
|
|
84
|
+
return 'uni-icon-error'
|
|
85
|
+
}
|
|
83
86
|
return ''
|
|
84
87
|
}
|
|
85
88
|
},
|
|
@@ -168,6 +171,11 @@ uni-toast .uni-icon_toast.uni-icon-success-no-circle:before {
|
|
|
168
171
|
font-size: 55px;
|
|
169
172
|
}
|
|
170
173
|
|
|
174
|
+
uni-toast .uni-icon_toast.uni-icon-error:before {
|
|
175
|
+
color: #ffffff;
|
|
176
|
+
font-size: 50px;
|
|
177
|
+
}
|
|
178
|
+
|
|
171
179
|
uni-toast .uni-icon_toast.uni-loading {
|
|
172
180
|
margin: 20px 0 0;
|
|
173
181
|
width: 38px;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
class="uni-tabbar-border"
|
|
13
13
|
/>
|
|
14
14
|
<div
|
|
15
|
-
v-for="(item,index) in
|
|
15
|
+
v-for="(item,index) in visibleList"
|
|
16
16
|
:key="item.isMidButton ? index : item.pagePath"
|
|
17
17
|
:style="item.isMidButton ? {flex:'0 0 ' + item.width,position:'relative'} : {}"
|
|
18
18
|
class="uni-tabbar__item"
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
:style="{height:height}"
|
|
37
37
|
>
|
|
38
38
|
<div
|
|
39
|
-
v-if="item.iconPath || item.isMidButton"
|
|
39
|
+
v-if="getIconPath(item,index) || item.iconPath || item.isMidButton"
|
|
40
40
|
:class="{'uni-tabbar__icon__diff':!item.text}"
|
|
41
41
|
class="uni-tabbar__icon"
|
|
42
42
|
:style="{width: iconWidth,height:iconWidth}"
|
|
43
43
|
>
|
|
44
44
|
<img
|
|
45
45
|
v-if="!item.isMidButton"
|
|
46
|
-
:src="_getRealPath(
|
|
46
|
+
:src="_getRealPath(getIconPath(item,index))"
|
|
47
47
|
>
|
|
48
48
|
<div
|
|
49
49
|
v-if="item.redDot"
|
|
@@ -287,7 +287,8 @@ export default {
|
|
|
287
287
|
},
|
|
288
288
|
data () {
|
|
289
289
|
return {
|
|
290
|
-
selectedIndex: 0
|
|
290
|
+
selectedIndex: 0,
|
|
291
|
+
visibleList: []
|
|
291
292
|
}
|
|
292
293
|
},
|
|
293
294
|
computed: {
|
|
@@ -319,25 +320,45 @@ export default {
|
|
|
319
320
|
watch: {
|
|
320
321
|
$route: {
|
|
321
322
|
immediate: true,
|
|
322
|
-
handler (
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
323
|
+
handler () {
|
|
324
|
+
// 只在此做一次 visibleList 的初始化
|
|
325
|
+
if (!this.visibleList.length) this._initVisibleList()
|
|
326
|
+
this.setSelectedIndex()
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
list: {
|
|
330
|
+
deep: true,
|
|
331
|
+
handler () {
|
|
332
|
+
this._initVisibleList()
|
|
333
|
+
this.setSelectedIndex()
|
|
330
334
|
}
|
|
331
335
|
}
|
|
332
336
|
},
|
|
333
337
|
created () {
|
|
334
|
-
this.
|
|
338
|
+
this.list.forEach(item => {
|
|
339
|
+
if (item.visible === undefined) {
|
|
340
|
+
this.$set(item, 'visible', true)
|
|
341
|
+
}
|
|
342
|
+
})
|
|
335
343
|
},
|
|
336
344
|
beforeCreate () {
|
|
337
345
|
this.__path__ = this.$route.path
|
|
338
346
|
},
|
|
339
347
|
methods: {
|
|
340
|
-
|
|
348
|
+
getIconPath (item, index) {
|
|
349
|
+
return (this.selectedIndex === index ? item.selectedIconPath || item.iconPath : item.iconPath) || ''
|
|
350
|
+
},
|
|
351
|
+
setSelectedIndex () {
|
|
352
|
+
if (this.$route.meta.isTabBar) {
|
|
353
|
+
this.__path__ = this.$route.path
|
|
354
|
+
const index = this.visibleList.findIndex(item => this.$route.meta.pagePath === item.pagePath)
|
|
355
|
+
this.selectedIndex = index
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
_initVisibleList () {
|
|
359
|
+
this.visibleList = this._initMidButton(this.list.filter(item => item.visible !== false))
|
|
360
|
+
},
|
|
361
|
+
_getRealPath (filePath = '') {
|
|
341
362
|
const SCHEME_RE = /^([a-z-]+:)?\/\//i
|
|
342
363
|
const DATA_RE = /^data:.*,.*/
|
|
343
364
|
if (!(SCHEME_RE.test(filePath) || DATA_RE.test(filePath)) && filePath.indexOf('/') !== 0) {
|
|
@@ -375,8 +396,8 @@ export default {
|
|
|
375
396
|
UniServiceJSBridge.emit('onTabItemTap', detail)
|
|
376
397
|
}
|
|
377
398
|
},
|
|
378
|
-
_initMidButton () {
|
|
379
|
-
const listLength =
|
|
399
|
+
_initMidButton (list) {
|
|
400
|
+
const listLength = list.length
|
|
380
401
|
// 偶数则添加midButton
|
|
381
402
|
if (listLength % 2 === 0 && isPlainObject(this.midButton)) {
|
|
382
403
|
// 给midButton赋值默认值
|
|
@@ -388,8 +409,9 @@ export default {
|
|
|
388
409
|
for (const key in DefaultMidButton) {
|
|
389
410
|
this.midButton[key] = this.midButton[key] || DefaultMidButton[key]
|
|
390
411
|
}
|
|
391
|
-
|
|
412
|
+
list.splice(~~(listLength / 2), 0, Object.assign({}, this.midButton, { isMidButton: true }))
|
|
392
413
|
}
|
|
414
|
+
return list
|
|
393
415
|
},
|
|
394
416
|
_uniTabbarBdStyle (item) {
|
|
395
417
|
return Object.assign({}, {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<page-refresh
|
|
8
8
|
v-if="enablePullDownRefresh"
|
|
9
9
|
ref="refresh"
|
|
10
|
-
:color="refreshOptions.color"
|
|
10
|
+
:color="refreshOptions.color"
|
|
11
11
|
:offset="refreshOptions.offset"
|
|
12
12
|
/>
|
|
13
13
|
<page-body
|
|
@@ -35,7 +35,9 @@
|
|
|
35
35
|
import {
|
|
36
36
|
upx2px
|
|
37
37
|
} from 'uni-helpers/index'
|
|
38
|
-
|
|
38
|
+
import {
|
|
39
|
+
initNavigationBarI18n
|
|
40
|
+
} from 'uni-helpers/i18n'
|
|
39
41
|
import {
|
|
40
42
|
NAVBAR_HEIGHT
|
|
41
43
|
} from 'uni-helpers/constants'
|
|
@@ -216,7 +218,7 @@ export default {
|
|
|
216
218
|
titlePenetrate: yesNoParseList[this.titlePenetrate]
|
|
217
219
|
}, titleNView)
|
|
218
220
|
navigationBar.shadow = this.navigationBarShadow
|
|
219
|
-
|
|
221
|
+
initNavigationBarI18n(navigationBar)
|
|
220
222
|
const refreshOptions = Object.assign({
|
|
221
223
|
support: true,
|
|
222
224
|
color: '#2BD009',
|
|
@@ -1,110 +1,117 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<uni-page-head :uni-page-head-type="type">
|
|
3
|
-
<div
|
|
3
|
+
<div
|
|
4
4
|
:style="{transitionDuration:duration,transitionTimingFunction:timingFunc,backgroundColor:bgColor,color:textColor}"
|
|
5
|
-
:class="headClass"
|
|
6
|
-
class="uni-page-head"
|
|
5
|
+
:class="headClass"
|
|
6
|
+
class="uni-page-head"
|
|
7
7
|
>
|
|
8
8
|
<div class="uni-page-head-hd">
|
|
9
|
-
<div
|
|
10
|
-
v-show="backButton"
|
|
11
|
-
class="uni-page-head-btn"
|
|
12
|
-
@click="_back"
|
|
9
|
+
<div
|
|
10
|
+
v-show="backButton"
|
|
11
|
+
class="uni-page-head-btn"
|
|
12
|
+
@click="_back"
|
|
13
13
|
>
|
|
14
|
-
<i
|
|
15
|
-
:style="{color:color,fontSize:'27px'}"
|
|
16
|
-
class="uni-btn-icon"
|
|
14
|
+
<i
|
|
15
|
+
:style="{color:color,fontSize:'27px'}"
|
|
16
|
+
class="uni-btn-icon"
|
|
17
17
|
></i>
|
|
18
18
|
</div>
|
|
19
|
-
<
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
19
|
+
<div class="uni-page-head-ft">
|
|
20
|
+
<template v-for="(btn,index) in btns">
|
|
21
|
+
<div
|
|
22
|
+
v-if="btn.float === 'left'"
|
|
23
|
+
:key="index"
|
|
24
|
+
:style="{backgroundColor: type==='transparent'?btn.background:'transparent',width:btn.width}"
|
|
25
|
+
:badge-text="btn.badgeText"
|
|
26
|
+
:class="{'uni-page-head-btn-red-dot':btn.redDot||btn.badgeText,'uni-page-head-btn-select':btn.select}"
|
|
27
|
+
class="uni-page-head-btn"
|
|
28
|
+
>
|
|
29
|
+
<i
|
|
30
|
+
:style="_formatBtnStyle(btn)"
|
|
31
|
+
class="uni-btn-icon"
|
|
32
|
+
@click="_onBtnClick(index)"
|
|
33
|
+
v-html="_formatBtnFontText(btn)"
|
|
34
|
+
/>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
</div>
|
|
36
38
|
</div>
|
|
37
|
-
<div
|
|
38
|
-
v-if="!searchInput"
|
|
39
|
-
class="uni-page-head-bd"
|
|
39
|
+
<div
|
|
40
|
+
v-if="!searchInput"
|
|
41
|
+
class="uni-page-head-bd"
|
|
40
42
|
>
|
|
41
|
-
<div
|
|
42
|
-
:style="{fontSize:titleSize,opacity:type==='transparent'?0:1}"
|
|
43
|
-
class="uni-page-head__title"
|
|
43
|
+
<div
|
|
44
|
+
:style="{fontSize:titleSize,opacity:type==='transparent'?0:1}"
|
|
45
|
+
class="uni-page-head__title"
|
|
44
46
|
>
|
|
45
|
-
<i
|
|
46
|
-
v-if="loading"
|
|
47
|
-
class="uni-loading"
|
|
47
|
+
<i
|
|
48
|
+
v-if="loading"
|
|
49
|
+
class="uni-loading"
|
|
48
50
|
/>
|
|
49
|
-
<img
|
|
50
|
-
v-if="titleImage!==''"
|
|
51
|
-
:src="titleImage"
|
|
52
|
-
class="uni-page-head__title_image"
|
|
51
|
+
<img
|
|
52
|
+
v-if="titleImage!==''"
|
|
53
|
+
:src="titleImage"
|
|
54
|
+
class="uni-page-head__title_image"
|
|
53
55
|
>
|
|
54
56
|
<template v-else>
|
|
55
57
|
{{ titleText }}
|
|
56
58
|
</template>
|
|
57
59
|
</div>
|
|
58
60
|
</div>
|
|
59
|
-
<div
|
|
60
|
-
v-if="searchInput"
|
|
61
|
+
<div
|
|
62
|
+
v-if="searchInput"
|
|
61
63
|
:style="{'border-radius':searchInput.borderRadius,'background-color':searchInput.backgroundColor}"
|
|
62
|
-
class="uni-page-head-search"
|
|
64
|
+
class="uni-page-head-search"
|
|
63
65
|
>
|
|
64
|
-
<div
|
|
65
|
-
:style="{color:searchInput.placeholderColor}"
|
|
66
|
-
:class="[`uni-page-head-search-placeholder-${focus ||
|
|
67
|
-
class="uni-page-head-search-placeholder"
|
|
68
|
-
v-text="
|
|
66
|
+
<div
|
|
67
|
+
:style="{color:searchInput.placeholderColor}"
|
|
68
|
+
:class="[`uni-page-head-search-placeholder-${focus || showPlaceholder ? 'left' : searchInput.align}`]"
|
|
69
|
+
class="uni-page-head-search-placeholder"
|
|
70
|
+
v-text="showPlaceholder || composing ? '' : searchInput.placeholder"
|
|
69
71
|
/>
|
|
70
|
-
<v-uni-input
|
|
71
|
-
ref="input"
|
|
72
|
-
v-model="text"
|
|
73
|
-
:focus="searchInput.autoFocus"
|
|
74
|
-
:disabled="searchInput.disabled"
|
|
72
|
+
<v-uni-input
|
|
73
|
+
ref="input"
|
|
74
|
+
v-model="text"
|
|
75
|
+
:focus="searchInput.autoFocus"
|
|
76
|
+
:disabled="searchInput.disabled"
|
|
75
77
|
:style="{color:searchInput.color}"
|
|
76
|
-
:placeholder-style="`color:${searchInput.placeholderColor}`"
|
|
77
|
-
class="uni-page-head-search-input"
|
|
78
|
+
:placeholder-style="`color:${searchInput.placeholderColor}`"
|
|
79
|
+
class="uni-page-head-search-input"
|
|
78
80
|
confirm-type="search"
|
|
79
|
-
@focus="_focus"
|
|
80
|
-
@blur="_blur"
|
|
81
|
-
@update:value="_input"
|
|
81
|
+
@focus="_focus"
|
|
82
|
+
@blur="_blur"
|
|
83
|
+
@update:value="_input"
|
|
84
|
+
/>
|
|
85
|
+
<i
|
|
86
|
+
v-if="text"
|
|
87
|
+
class="uni-icon-clear"
|
|
88
|
+
@click="_clearInput"
|
|
82
89
|
/>
|
|
83
90
|
</div>
|
|
84
91
|
<div class="uni-page-head-ft">
|
|
85
92
|
<template v-for="(btn,index) in btns">
|
|
86
|
-
<div
|
|
87
|
-
v-if="btn.float !== 'left'"
|
|
88
|
-
:key="index"
|
|
93
|
+
<div
|
|
94
|
+
v-if="btn.float !== 'left'"
|
|
95
|
+
:key="index"
|
|
89
96
|
:style="{backgroundColor: type==='transparent'?btn.background:'transparent',width:btn.width}"
|
|
90
|
-
:badge-text="btn.badgeText"
|
|
97
|
+
:badge-text="btn.badgeText"
|
|
91
98
|
:class="{'uni-page-head-btn-red-dot':btn.redDot||btn.badgeText,'uni-page-head-btn-select':btn.select}"
|
|
92
|
-
class="uni-page-head-btn"
|
|
99
|
+
class="uni-page-head-btn"
|
|
93
100
|
>
|
|
94
|
-
<i
|
|
95
|
-
:style="_formatBtnStyle(btn)"
|
|
96
|
-
class="uni-btn-icon"
|
|
97
|
-
@click="_onBtnClick(index)"
|
|
98
|
-
v-html="_formatBtnFontText(btn)"
|
|
101
|
+
<i
|
|
102
|
+
:style="_formatBtnStyle(btn)"
|
|
103
|
+
class="uni-btn-icon"
|
|
104
|
+
@click="_onBtnClick(index)"
|
|
105
|
+
v-html="_formatBtnFontText(btn)"
|
|
99
106
|
/>
|
|
100
107
|
</div>
|
|
101
108
|
</template>
|
|
102
109
|
</div>
|
|
103
110
|
</div>
|
|
104
|
-
<div
|
|
105
|
-
v-if="type!=='transparent'&&type!=='float'"
|
|
106
|
-
:class="{'uni-placeholder-titlePenetrate': titlePenetrate}"
|
|
107
|
-
class="uni-placeholder"
|
|
111
|
+
<div
|
|
112
|
+
v-if="type!=='transparent'&&type!=='float'"
|
|
113
|
+
:class="{'uni-placeholder-titlePenetrate': titlePenetrate}"
|
|
114
|
+
class="uni-placeholder"
|
|
108
115
|
/>
|
|
109
116
|
</uni-page-head>
|
|
110
117
|
</template>
|
|
@@ -174,7 +181,6 @@
|
|
|
174
181
|
left: 70px;
|
|
175
182
|
right: 70px;
|
|
176
183
|
min-width: 0;
|
|
177
|
-
user-select: auto;
|
|
178
184
|
}
|
|
179
185
|
|
|
180
186
|
.uni-page-head-btn {
|
|
@@ -347,6 +353,11 @@
|
|
|
347
353
|
uni-page-head .uni-page-head-shadow-yellow::after {
|
|
348
354
|
background-image: url("https://cdn.dcloud.net.cn/img/shadow-yellow.png");
|
|
349
355
|
}
|
|
356
|
+
|
|
357
|
+
uni-page-head .uni-icon-clear {
|
|
358
|
+
align-self: center;
|
|
359
|
+
padding-right: 5px;
|
|
360
|
+
}
|
|
350
361
|
</style>
|
|
351
362
|
<script>
|
|
352
363
|
import appendCss from 'uni-platform/helpers/append-css'
|
|
@@ -442,7 +453,8 @@ export default {
|
|
|
442
453
|
return {
|
|
443
454
|
focus: false,
|
|
444
455
|
text: '',
|
|
445
|
-
composing: false
|
|
456
|
+
composing: false,
|
|
457
|
+
showPlaceholder: false
|
|
446
458
|
}
|
|
447
459
|
},
|
|
448
460
|
computed: {
|
|
@@ -497,6 +509,9 @@ export default {
|
|
|
497
509
|
input.$watch('composing', val => {
|
|
498
510
|
this.composing = val
|
|
499
511
|
})
|
|
512
|
+
input.$watch('valueSync', val => {
|
|
513
|
+
this.showPlaceholder = !!val
|
|
514
|
+
})
|
|
500
515
|
if (this.searchInput.disabled) {
|
|
501
516
|
input.$el.addEventListener('click', () => {
|
|
502
517
|
UniServiceJSBridge.emit('onNavigationBarSearchInputClicked', '')
|
|
@@ -568,7 +583,11 @@ export default {
|
|
|
568
583
|
UniServiceJSBridge.emit('onNavigationBarSearchInputChanged', {
|
|
569
584
|
text
|
|
570
585
|
})
|
|
586
|
+
},
|
|
587
|
+
_clearInput () {
|
|
588
|
+
this.text = ''
|
|
589
|
+
this._input(this.text)
|
|
571
590
|
}
|
|
572
591
|
}
|
|
573
592
|
}
|
|
574
|
-
</script>
|
|
593
|
+
</script>
|