@10yun/cv-mobile-ui 0.5.19 → 0.5.21
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/other/mpvue-picker/mpvuePicker.vue +402 -0
- package/{uni-ui/lib → other}/mpvue-picker/style.css +0 -1
- package/{uni-ui/lib → other}/tab-nvue/style.css +0 -1
- package/other/uParse/components/style.css +1 -0
- package/other/uParse/components/wxParseAudio.vue +1 -0
- package/other/uParse/components/wxParseImg.vue +86 -0
- package/other/uParse/components/wxParseTable.vue +54 -0
- package/other/uParse/components/wxParseTemplate0.vue +98 -0
- package/other/uParse/components/wxParseTemplate1.vue +81 -0
- package/other/uParse/components/wxParseTemplate10.vue +81 -0
- package/other/uParse/components/wxParseTemplate11.vue +79 -0
- package/other/uParse/components/wxParseTemplate2.vue +81 -0
- package/other/uParse/components/wxParseTemplate3.vue +81 -0
- package/other/uParse/components/wxParseTemplate4.vue +81 -0
- package/other/uParse/components/wxParseTemplate5.vue +81 -0
- package/other/uParse/components/wxParseTemplate6.vue +81 -0
- package/other/uParse/components/wxParseTemplate7.vue +81 -0
- package/other/uParse/components/wxParseTemplate8.vue +81 -0
- package/other/uParse/components/wxParseTemplate9.vue +81 -0
- package/other/uParse/components/wxParseVideo.vue +14 -0
- package/other/uParse/editor.css +495 -0
- package/{uni-ui/lib/uParse/src → other/uParse}/libs/html2json.js +19 -22
- package/{uni-ui/lib/uParse/src → other/uParse}/libs/htmlparser.js +12 -5
- package/{uni-ui/lib/uParse/src → other/uParse}/libs/wxDiscode.js +2 -2
- package/other/uParse/wxParse.vue +196 -0
- package/package.json +1 -1
- package/plugins/map/amqp-wx.js +173 -0
- package/{uni-ui/lib/mpvueGestureLock/index.vue → ui-cv/components/cv-draw-gesture-lock/cv-draw-gesture-lock.vue} +4 -1
- package/ui-cv/components/cv-draw-gesture-lock/gestureLock.js +169 -0
- package/{uni-ui/lib/mpvueGestureLock → ui-cv/components/cv-draw-gesture-lock}/style.css +0 -1
- package/{uni-ui/lib/mpvue-citypicker → ui-cv/components/cv-geo-region}/style.css +0 -1
- package/ui-cv/components/cv-grid-item/cv-grid-item.vue +1 -1
- package/uni-ui/lib/uni-badge/uni-badge.vue +150 -1
- package/uni-ui/lib/uni-breadcrumb/uni-breadcrumb.vue +37 -1
- package/uni-ui/lib/uni-breadcrumb-item/uni-breadcrumb-item.vue +83 -1
- package/uni-ui/lib/uni-calendar/uni-calendar-item.vue +122 -1
- package/uni-ui/lib/uni-calendar/uni-calendar.vue +366 -1
- package/uni-ui/lib/uni-card/uni-card.vue +124 -1
- package/uni-ui/lib/uni-col/uni-col.vue +1 -1
- package/uni-ui/lib/uni-collapse/uni-collapse.vue +135 -1
- package/uni-ui/lib/uni-collapse-item/uni-collapse-item.vue +266 -1
- package/uni-ui/lib/uni-combox/uni-combox.vue +1 -1
- package/uni-ui/lib/uni-countdown/uni-countdown.vue +239 -1
- package/uni-ui/lib/uni-data-checkbox/uni-data-checkbox.vue +487 -1
- package/uni-ui/lib/uni-data-picker/uni-data-picker.vue +530 -1
- package/uni-ui/lib/uni-data-pickerview/uni-data-picker.js +157 -150
- package/uni-ui/lib/uni-data-pickerview/uni-data-pickerview.vue +166 -1
- package/uni-ui/lib/uni-data-select/uni-data-select.vue +289 -1
- package/uni-ui/lib/uni-datetime-picker/calendar-item.vue +70 -1
- package/uni-ui/lib/uni-datetime-picker/calendar.vue +629 -1
- package/uni-ui/lib/uni-datetime-picker/time-picker.vue +741 -1
- package/uni-ui/lib/uni-datetime-picker/uni-datetime-picker.vue +847 -1
- package/uni-ui/lib/uni-drawer/uni-drawer.vue +115 -1
- package/uni-ui/lib/uni-easyinput/uni-easyinput.vue +515 -1
- package/uni-ui/lib/uni-fab/uni-fab.vue +257 -1
- package/uni-ui/lib/uni-fav/uni-fav.vue +123 -1
- package/uni-ui/lib/uni-file-picker/uni-file-picker.vue +642 -1
- package/uni-ui/lib/uni-file-picker/upload-file.vue +177 -1
- package/uni-ui/lib/uni-file-picker/upload-image.vue +176 -1
- package/uni-ui/lib/uni-forms/uni-forms.vue +375 -1
- package/uni-ui/lib/uni-forms-item/uni-forms-item.vue +429 -1
- package/uni-ui/lib/uni-goods-nav/uni-goods-nav.vue +129 -1
- package/uni-ui/lib/uni-grid/uni-grid.vue +115 -1
- package/uni-ui/lib/uni-grid-item/uni-grid-item.vue +78 -1
- package/uni-ui/lib/uni-group/uni-group.vue +85 -1
- package/uni-ui/lib/uni-icons/uni-icons.vue +85 -1
- package/uni-ui/lib/uni-indexed-list/uni-indexed-list-item.vue +68 -1
- package/uni-ui/lib/uni-indexed-list/uni-indexed-list.vue +294 -1
- package/uni-ui/lib/uni-list/uni-list.vue +81 -1
- package/uni-ui/lib/uni-list-ad/uni-list-ad.vue +77 -1
- package/uni-ui/lib/uni-list-chat/uni-list-chat.vue +294 -1
- package/uni-ui/lib/uni-list-item/uni-list-item.vue +346 -1
- package/uni-ui/lib/uni-load-more/uni-load-more.vue +172 -1
- package/uni-ui/lib/uni-nav-bar/uni-nav-bar.vue +205 -1
- package/uni-ui/lib/uni-nav-bar/uni-status-bar.vue +18 -1
- package/uni-ui/lib/uni-notice-bar/uni-notice-bar.vue +331 -1
- package/uni-ui/lib/uni-number-box/uni-number-box.vue +166 -1
- package/uni-ui/lib/uni-pagination/uni-pagination.vue +323 -1
- package/uni-ui/lib/uni-popup/uni-popup.vue +1 -1
- package/uni-ui/lib/uni-popup-dialog/uni-popup-dialog.vue +173 -1
- package/uni-ui/lib/uni-popup-message/uni-popup-message.vue +74 -1
- package/uni-ui/lib/uni-popup-share/uni-popup-share.vue +106 -1
- package/uni-ui/lib/uni-rate/uni-rate.vue +322 -1
- package/uni-ui/lib/uni-row/uni-row.vue +1 -1
- package/uni-ui/lib/uni-search-bar/uni-search-bar.vue +236 -1
- package/uni-ui/lib/uni-section/uni-section.vue +109 -1
- package/uni-ui/lib/uni-segmented-control/uni-segmented-control.vue +103 -1
- package/uni-ui/lib/uni-status-bar/uni-status-bar.vue +1 -1
- package/uni-ui/lib/uni-steps/uni-steps.vue +120 -1
- package/uni-ui/lib/uni-swipe-action-item/uni-swipe-action-item.vue +226 -3
- package/uni-ui/lib/uni-swiper-dot/uni-swiper-dot.vue +167 -1
- package/uni-ui/lib/uni-table/uni-table.vue +297 -1
- package/uni-ui/lib/uni-tag/uni-tag.vue +100 -1
- package/uni-ui/lib/uni-td/uni-td.vue +78 -1
- package/uni-ui/lib/uni-th/filter-dropdown.vue +1 -1
- package/uni-ui/lib/uni-th/uni-th.vue +224 -1
- package/uni-ui/lib/uni-thead/uni-thead.vue +77 -1
- package/uni-ui/lib/uni-tr/table-checkbox.vue +79 -1
- package/uni-ui/lib/uni-tr/uni-tr.vue +135 -1
- package/uni-ui/lib/amap-wx/js/util.js +0 -181
- package/uni-ui/lib/marked/index.js +0 -1
- package/uni-ui/lib/mpvue-citypicker/city-data/area.js +0 -12542
- package/uni-ui/lib/mpvue-citypicker/city-data/city.js +0 -1503
- package/uni-ui/lib/mpvue-citypicker/city-data/province.js +0 -139
- package/uni-ui/lib/mpvue-picker/mpvuePicker.vue +0 -3
- package/uni-ui/lib/mpvueGestureLock/gestureLock.js +0 -175
- package/uni-ui/lib/uParse/src/components/style.css +0 -2
- package/uni-ui/lib/uParse/src/components/wxParseAudio.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseImg.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTable.vue +0 -3
- package/uni-ui/lib/uParse/src/components/wxParseTemplate0.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate1.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate10.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate11.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate2.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate3.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate4.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate5.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate6.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate7.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate8.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseTemplate9.vue +0 -1
- package/uni-ui/lib/uParse/src/components/wxParseVideo.vue +0 -1
- package/uni-ui/lib/uParse/src/editor.css +0 -495
- package/uni-ui/lib/uParse/src/wxParse.vue +0 -1
- /package/{uni-ui/lib → other}/api-set-tabbar.nvue +0 -0
- /package/{uni-ui/lib → other}/mpvue-echarts/src/echarts.vue +0 -0
- /package/{uni-ui/lib → other}/mpvue-echarts/src/style.css +0 -0
- /package/{uni-ui/lib → other}/mpvue-echarts/src/wx-canvas.js +0 -0
- /package/{uni-ui/lib → other}/product.vue +0 -0
- /package/{uni-ui/lib → other}/style.css +0 -0
- /package/{uni-ui/lib → other}/tab-nvue/mediaList.vue +0 -0
- /package/{uni-ui/lib → other}/u-charts/u-charts.js +0 -0
- /package/{uni-ui/lib/uParse/src → other/uParse}/wxParse.css +0 -0
- /package/{uni-ui/lib/amap-wx → plugins/map}/lib/amap-wx.js +0 -0
- /package/{uni-ui/lib/mpvue-citypicker → ui-cv/components/cv-geo-region}/mpvueCityPicker.vue +0 -0
- /package/{uni-ui/lib/marked → ui-cv/components/cv-markdown-show}/lib/marked.js +0 -0
|
@@ -1 +1,205 @@
|
|
|
1
|
-
<template>
|
|
2
1
|
<view class="uni-navbar" :class="{ 'uni-dark': dark, 'uni-nvue-fixed': fixed }">
|
|
3
2
|
<view
|
|
4
3
|
class="uni-navbar__content"
|
|
5
4
|
:class="{ 'uni-navbar--fixed': fixed, 'uni-navbar--shadow': shadow, 'uni-navbar--border': border }"
|
|
6
5
|
:style="{ 'background-color': themeBgColor, 'border-bottom-color': themeColor }"
|
|
7
6
|
>
|
|
8
7
|
<status-bar v-if="statusBar" />
|
|
9
8
|
<view :style="{ color: themeColor, backgroundColor: themeBgColor, height: navbarHeight }" class="uni-navbar__header">
|
|
10
9
|
<view @tap="onClickLeft" class="uni-navbar__header-btns uni-navbar__header-btns-left" :style="{ width: leftIconWidth }">
|
|
11
10
|
<slot name="left">
|
|
12
11
|
<view class="uni-navbar__content_view" v-if="leftIcon.length > 0">
|
|
13
12
|
<uni-icons :color="themeColor" :type="leftIcon" size="20" />
|
|
14
13
|
</view>
|
|
15
14
|
<view
|
|
16
15
|
:class="{ 'uni-navbar-btn-icon-left': !leftIcon.length > 0 }"
|
|
17
16
|
class="uni-navbar-btn-text"
|
|
18
17
|
v-if="leftText.length"
|
|
19
18
|
>
|
|
20
19
|
<text :style="{ color: themeColor, fontSize: '12px' }">{{ leftText }}</text>
|
|
21
20
|
</view>
|
|
22
21
|
</slot>
|
|
23
22
|
</view>
|
|
24
23
|
<view class="uni-navbar__header-container" @tap="onClickTitle">
|
|
25
24
|
<slot>
|
|
26
25
|
<view class="uni-navbar__header-container-inner" v-if="title.length > 0">
|
|
27
26
|
<text class="uni-nav-bar-text uni-ellipsis-1" :style="{ color: themeColor }">{{ title }}</text>
|
|
28
27
|
</view>
|
|
29
28
|
</slot>
|
|
30
29
|
</view>
|
|
31
30
|
<view
|
|
32
31
|
@click="onClickRight"
|
|
33
32
|
class="uni-navbar__header-btns uni-navbar__header-btns-right"
|
|
34
33
|
:style="{ width: rightIconWidth }"
|
|
35
34
|
>
|
|
36
35
|
<slot name="right">
|
|
37
36
|
<view v-if="rightIcon.length">
|
|
38
37
|
<uni-icons :color="themeColor" :type="rightIcon" size="22" />
|
|
39
38
|
</view>
|
|
40
39
|
<view class="uni-navbar-btn-text" v-if="rightText.length && !rightIcon.length">
|
|
41
40
|
<text class="uni-nav-bar-right-text" :style="{ color: themeColor }">{{ rightText }}</text>
|
|
42
41
|
</view>
|
|
43
42
|
</slot>
|
|
44
43
|
</view>
|
|
45
44
|
</view>
|
|
46
45
|
</view>
|
|
47
46
|
<!-- #ifndef APP-NVUE -->
|
|
48
47
|
<view class="uni-navbar__placeholder" v-if="fixed">
|
|
49
48
|
<status-bar v-if="statusBar" />
|
|
50
49
|
<view class="uni-navbar__placeholder-view" :style="{ height: navbarHeight }" />
|
|
51
50
|
</view>
|
|
52
51
|
<!-- #endif -->
|
|
53
52
|
</view>
|
|
54
53
|
*
|
|
55
54
|
*
|
|
56
55
|
* NavBar 自定义导航栏
|
|
57
56
|
* @description 导航栏组件,主要用于头部导航
|
|
58
57
|
* @tutorial https://ext.dcloud.net.cn/plugin?id=52
|
|
59
58
|
* @property {Boolean} dark 开启黑暗模式
|
|
60
59
|
* @property {String} title 标题文字
|
|
61
60
|
* @property {String} leftText 左侧按钮文本
|
|
62
61
|
* @property {String} rightText 右侧按钮文本
|
|
63
62
|
* @property {String} leftIcon 左侧按钮图标(图标类型参考 [Icon 图标](http://ext.dcloud.net.cn/plugin?id=28) type 属性)
|
|
64
63
|
* @property {String} rightIcon 右侧按钮图标(图标类型参考 [Icon 图标](http://ext.dcloud.net.cn/plugin?id=28) type 属性)
|
|
65
64
|
* @property {String} color 图标和文字颜色
|
|
66
65
|
* @property {String} backgroundColor 导航栏背景颜色
|
|
67
66
|
* @property {Boolean} fixed = [true|false] 是否固定顶部
|
|
68
67
|
* @property {Boolean} statusBar = [true|false] 是否包含状态栏
|
|
69
68
|
* @property {Boolean} shadow = [true|false] 导航栏下是否有阴影
|
|
70
69
|
* @property {Boolean} stat 是否开启统计标题上报
|
|
71
70
|
* @event {Function} clickLeft 左侧按钮点击时触发
|
|
72
71
|
* @event {Function} clickRight 右侧按钮点击时触发
|
|
73
72
|
* @event {Function} clickTitle 中间标题点击时触发
|
|
74
73
|
*/
|
|
75
74
|
name: 'UniNavBar',
|
|
76
75
|
components: {
|
|
77
76
|
statusBar
|
|
78
77
|
},
|
|
79
78
|
emits: ['clickLeft', 'clickRight', 'clickTitle'],
|
|
80
79
|
props: {
|
|
81
80
|
dark: {
|
|
82
81
|
type: Boolean,
|
|
83
82
|
default: false
|
|
84
83
|
},
|
|
85
84
|
title: {
|
|
86
85
|
type: String,
|
|
87
86
|
default: ''
|
|
88
87
|
},
|
|
89
88
|
leftText: {
|
|
90
89
|
type: String,
|
|
91
90
|
default: ''
|
|
92
91
|
},
|
|
93
92
|
rightText: {
|
|
94
93
|
type: String,
|
|
95
94
|
default: ''
|
|
96
95
|
},
|
|
97
96
|
leftIcon: {
|
|
98
97
|
type: String,
|
|
99
98
|
default: ''
|
|
100
99
|
},
|
|
101
100
|
rightIcon: {
|
|
102
101
|
type: String,
|
|
103
102
|
default: ''
|
|
104
103
|
},
|
|
105
104
|
fixed: {
|
|
106
105
|
type: [Boolean, String],
|
|
107
106
|
default: false
|
|
108
107
|
},
|
|
109
108
|
color: {
|
|
110
109
|
type: String,
|
|
111
110
|
default: ''
|
|
112
111
|
},
|
|
113
112
|
backgroundColor: {
|
|
114
113
|
type: String,
|
|
115
114
|
default: ''
|
|
116
115
|
},
|
|
117
116
|
statusBar: {
|
|
118
117
|
type: [Boolean, String],
|
|
119
118
|
default: false
|
|
120
119
|
},
|
|
121
120
|
shadow: {
|
|
122
121
|
type: [Boolean, String],
|
|
123
122
|
default: false
|
|
124
123
|
},
|
|
125
124
|
border: {
|
|
126
125
|
type: [Boolean, String],
|
|
127
126
|
default: true
|
|
128
127
|
},
|
|
129
128
|
height: {
|
|
130
129
|
type: [Number, String],
|
|
131
130
|
default: 44
|
|
132
131
|
},
|
|
133
132
|
leftWidth: {
|
|
134
133
|
type: [Number, String],
|
|
135
134
|
default: 60
|
|
136
135
|
},
|
|
137
136
|
rightWidth: {
|
|
138
137
|
type: [Number, String],
|
|
139
138
|
default: 60
|
|
140
139
|
},
|
|
141
140
|
stat: {
|
|
142
141
|
type: [Boolean, String],
|
|
143
142
|
default: ''
|
|
144
143
|
}
|
|
145
144
|
},
|
|
146
145
|
computed: {
|
|
147
146
|
themeBgColor() {
|
|
148
147
|
if (this.dark) {
|
|
149
148
|
// 默认值
|
|
150
149
|
if (this.backgroundColor) {
|
|
151
150
|
return this.backgroundColor;
|
|
152
151
|
} else {
|
|
153
152
|
return this.dark ? '#333' : '#FFF';
|
|
154
153
|
}
|
|
155
154
|
}
|
|
156
155
|
return this.backgroundColor || '#FFF';
|
|
157
156
|
},
|
|
158
157
|
themeColor() {
|
|
159
158
|
if (this.dark) {
|
|
160
159
|
// 默认值
|
|
161
160
|
if (this.color) {
|
|
162
161
|
return this.color;
|
|
163
162
|
} else {
|
|
164
163
|
return this.dark ? '#fff' : '#333';
|
|
165
164
|
}
|
|
166
165
|
}
|
|
167
166
|
return this.color || '#333';
|
|
168
167
|
},
|
|
169
168
|
navbarHeight() {
|
|
170
169
|
return getVal(this.height);
|
|
171
170
|
},
|
|
172
171
|
leftIconWidth() {
|
|
173
172
|
return getVal(this.leftWidth);
|
|
174
173
|
},
|
|
175
174
|
rightIconWidth() {
|
|
176
175
|
return getVal(this.rightWidth);
|
|
177
176
|
}
|
|
178
177
|
},
|
|
179
178
|
mounted() {
|
|
180
179
|
if (uni.report && this.stat && this.title !== '') {
|
|
181
180
|
uni.report('title', this.title);
|
|
182
181
|
}
|
|
183
182
|
},
|
|
184
183
|
methods: {
|
|
185
184
|
onClickLeft() {
|
|
186
185
|
this.$emit('clickLeft');
|
|
187
186
|
},
|
|
188
187
|
onClickRight() {
|
|
189
188
|
this.$emit('clickRight');
|
|
190
189
|
},
|
|
191
190
|
onClickTitle() {
|
|
192
191
|
this.$emit('clickTitle');
|
|
193
192
|
}
|
|
194
193
|
}
|
|
194
|
+
<template>
|
|
195
|
+
<view class="uni-navbar" :class="{ 'uni-dark': dark, 'uni-nvue-fixed': fixed }">
|
|
196
|
+
<view
|
|
197
|
+
class="uni-navbar__content"
|
|
198
|
+
:class="{ 'uni-navbar--fixed': fixed, 'uni-navbar--shadow': shadow, 'uni-navbar--border': border }"
|
|
199
|
+
:style="{ 'background-color': themeBgColor, 'border-bottom-color': themeColor }"
|
|
200
|
+
>
|
|
201
|
+
<status-bar v-if="statusBar" />
|
|
202
|
+
<view :style="{ color: themeColor, backgroundColor: themeBgColor, height: navbarHeight }" class="uni-navbar__header">
|
|
203
|
+
<view @tap="onClickLeft" class="uni-navbar__header-btns uni-navbar__header-btns-left" :style="{ width: leftIconWidth }">
|
|
204
|
+
<slot name="left">
|
|
205
|
+
<view class="uni-navbar__content_view" v-if="leftIcon.length > 0">
|
|
206
|
+
<uni-icons :color="themeColor" :type="leftIcon" size="20" />
|
|
207
|
+
</view>
|
|
208
|
+
<view
|
|
209
|
+
:class="{ 'uni-navbar-btn-icon-left': !leftIcon.length > 0 }"
|
|
210
|
+
class="uni-navbar-btn-text"
|
|
211
|
+
v-if="leftText.length"
|
|
212
|
+
>
|
|
213
|
+
<text :style="{ color: themeColor, fontSize: '12px' }">{{ leftText }}</text>
|
|
214
|
+
</view>
|
|
215
|
+
</slot>
|
|
216
|
+
</view>
|
|
217
|
+
<view class="uni-navbar__header-container" @tap="onClickTitle">
|
|
218
|
+
<slot>
|
|
219
|
+
<view class="uni-navbar__header-container-inner" v-if="title.length > 0">
|
|
220
|
+
<text class="uni-nav-bar-text uni-ellipsis-1" :style="{ color: themeColor }">{{ title }}</text>
|
|
221
|
+
</view>
|
|
222
|
+
</slot>
|
|
223
|
+
</view>
|
|
224
|
+
<view
|
|
225
|
+
@click="onClickRight"
|
|
226
|
+
class="uni-navbar__header-btns uni-navbar__header-btns-right"
|
|
227
|
+
:style="{ width: rightIconWidth }"
|
|
228
|
+
>
|
|
229
|
+
<slot name="right">
|
|
230
|
+
<view v-if="rightIcon.length">
|
|
231
|
+
<uni-icons :color="themeColor" :type="rightIcon" size="22" />
|
|
232
|
+
</view>
|
|
233
|
+
<view class="uni-navbar-btn-text" v-if="rightText.length && !rightIcon.length">
|
|
234
|
+
<text class="uni-nav-bar-right-text" :style="{ color: themeColor }">{{ rightText }}</text>
|
|
235
|
+
</view>
|
|
236
|
+
</slot>
|
|
237
|
+
</view>
|
|
238
|
+
</view>
|
|
239
|
+
</view>
|
|
240
|
+
<!-- #ifndef APP-NVUE -->
|
|
241
|
+
<view class="uni-navbar__placeholder" v-if="fixed">
|
|
242
|
+
<status-bar v-if="statusBar" />
|
|
243
|
+
<view class="uni-navbar__placeholder-view" :style="{ height: navbarHeight }" />
|
|
244
|
+
</view>
|
|
245
|
+
<!-- #endif -->
|
|
246
|
+
</view>
|
|
247
|
+
</template>
|
|
248
|
+
<script>
|
|
249
|
+
import statusBar from './uni-status-bar.vue';
|
|
250
|
+
const getVal = (val) => (typeof val === 'number' ? val + 'px' : val);
|
|
251
|
+
/**
|
|
252
|
+
*
|
|
253
|
+
*
|
|
254
|
+
* NavBar 自定义导航栏
|
|
255
|
+
* @description 导航栏组件,主要用于头部导航
|
|
256
|
+
* @tutorial https://ext.dcloud.net.cn/plugin?id=52
|
|
257
|
+
* @property {Boolean} dark 开启黑暗模式
|
|
258
|
+
* @property {String} title 标题文字
|
|
259
|
+
* @property {String} leftText 左侧按钮文本
|
|
260
|
+
* @property {String} rightText 右侧按钮文本
|
|
261
|
+
* @property {String} leftIcon 左侧按钮图标(图标类型参考 [Icon 图标](http://ext.dcloud.net.cn/plugin?id=28) type 属性)
|
|
262
|
+
* @property {String} rightIcon 右侧按钮图标(图标类型参考 [Icon 图标](http://ext.dcloud.net.cn/plugin?id=28) type 属性)
|
|
263
|
+
* @property {String} color 图标和文字颜色
|
|
264
|
+
* @property {String} backgroundColor 导航栏背景颜色
|
|
265
|
+
* @property {Boolean} fixed = [true|false] 是否固定顶部
|
|
266
|
+
* @property {Boolean} statusBar = [true|false] 是否包含状态栏
|
|
267
|
+
* @property {Boolean} shadow = [true|false] 导航栏下是否有阴影
|
|
268
|
+
* @property {Boolean} stat 是否开启统计标题上报
|
|
269
|
+
* @event {Function} clickLeft 左侧按钮点击时触发
|
|
270
|
+
* @event {Function} clickRight 右侧按钮点击时触发
|
|
271
|
+
* @event {Function} clickTitle 中间标题点击时触发
|
|
272
|
+
*/
|
|
273
|
+
export default {
|
|
274
|
+
name: 'UniNavBar',
|
|
275
|
+
components: {
|
|
276
|
+
statusBar
|
|
277
|
+
},
|
|
278
|
+
emits: ['clickLeft', 'clickRight', 'clickTitle'],
|
|
279
|
+
props: {
|
|
280
|
+
dark: {
|
|
281
|
+
type: Boolean,
|
|
282
|
+
default: false
|
|
283
|
+
},
|
|
284
|
+
title: {
|
|
285
|
+
type: String,
|
|
286
|
+
default: ''
|
|
287
|
+
},
|
|
288
|
+
leftText: {
|
|
289
|
+
type: String,
|
|
290
|
+
default: ''
|
|
291
|
+
},
|
|
292
|
+
rightText: {
|
|
293
|
+
type: String,
|
|
294
|
+
default: ''
|
|
295
|
+
},
|
|
296
|
+
leftIcon: {
|
|
297
|
+
type: String,
|
|
298
|
+
default: ''
|
|
299
|
+
},
|
|
300
|
+
rightIcon: {
|
|
301
|
+
type: String,
|
|
302
|
+
default: ''
|
|
303
|
+
},
|
|
304
|
+
fixed: {
|
|
305
|
+
type: [Boolean, String],
|
|
306
|
+
default: false
|
|
307
|
+
},
|
|
308
|
+
color: {
|
|
309
|
+
type: String,
|
|
310
|
+
default: ''
|
|
311
|
+
},
|
|
312
|
+
backgroundColor: {
|
|
313
|
+
type: String,
|
|
314
|
+
default: ''
|
|
315
|
+
},
|
|
316
|
+
statusBar: {
|
|
317
|
+
type: [Boolean, String],
|
|
318
|
+
default: false
|
|
319
|
+
},
|
|
320
|
+
shadow: {
|
|
321
|
+
type: [Boolean, String],
|
|
322
|
+
default: false
|
|
323
|
+
},
|
|
324
|
+
border: {
|
|
325
|
+
type: [Boolean, String],
|
|
326
|
+
default: true
|
|
327
|
+
},
|
|
328
|
+
height: {
|
|
329
|
+
type: [Number, String],
|
|
330
|
+
default: 44
|
|
331
|
+
},
|
|
332
|
+
leftWidth: {
|
|
333
|
+
type: [Number, String],
|
|
334
|
+
default: 60
|
|
335
|
+
},
|
|
336
|
+
rightWidth: {
|
|
337
|
+
type: [Number, String],
|
|
338
|
+
default: 60
|
|
339
|
+
},
|
|
340
|
+
stat: {
|
|
341
|
+
type: [Boolean, String],
|
|
342
|
+
default: ''
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
computed: {
|
|
346
|
+
themeBgColor() {
|
|
347
|
+
if (this.dark) {
|
|
348
|
+
// 默认值
|
|
349
|
+
if (this.backgroundColor) {
|
|
350
|
+
return this.backgroundColor;
|
|
351
|
+
} else {
|
|
352
|
+
return this.dark ? '#333' : '#FFF';
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
return this.backgroundColor || '#FFF';
|
|
356
|
+
},
|
|
357
|
+
themeColor() {
|
|
358
|
+
if (this.dark) {
|
|
359
|
+
// 默认值
|
|
360
|
+
if (this.color) {
|
|
361
|
+
return this.color;
|
|
362
|
+
} else {
|
|
363
|
+
return this.dark ? '#fff' : '#333';
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
return this.color || '#333';
|
|
367
|
+
},
|
|
368
|
+
navbarHeight() {
|
|
369
|
+
return getVal(this.height);
|
|
370
|
+
},
|
|
371
|
+
leftIconWidth() {
|
|
372
|
+
return getVal(this.leftWidth);
|
|
373
|
+
},
|
|
374
|
+
rightIconWidth() {
|
|
375
|
+
return getVal(this.rightWidth);
|
|
376
|
+
}
|
|
377
|
+
},
|
|
378
|
+
mounted() {
|
|
379
|
+
if (uni.report && this.stat && this.title !== '') {
|
|
380
|
+
uni.report('title', this.title);
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
methods: {
|
|
384
|
+
onClickLeft() {
|
|
385
|
+
this.$emit('clickLeft');
|
|
386
|
+
},
|
|
387
|
+
onClickRight() {
|
|
388
|
+
this.$emit('clickRight');
|
|
389
|
+
},
|
|
390
|
+
onClickTitle() {
|
|
391
|
+
this.$emit('clickTitle');
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
</script>
|
|
396
|
+
<style scoped>
|
|
397
|
+
@import 'style.css';
|
|
398
|
+
</style>
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
<template>
|
|
2
1
|
<view :style="{ height: statusBarHeight }" class="uni-status-bar">
|
|
3
2
|
<slot />
|
|
4
3
|
</view>
|
|
5
4
|
name: 'UniStatusBar',
|
|
6
5
|
data() {
|
|
7
6
|
return {
|
|
8
7
|
statusBarHeight: uni.getSystemInfoSync().statusBarHeight + 'px'
|
|
9
8
|
};
|
|
10
9
|
}
|
|
10
|
+
<template>
|
|
11
|
+
<view :style="{ height: statusBarHeight }" class="uni-status-bar">
|
|
12
|
+
<slot />
|
|
13
|
+
</view>
|
|
14
|
+
</template>
|
|
15
|
+
<script>
|
|
16
|
+
export default {
|
|
17
|
+
name: 'UniStatusBar',
|
|
18
|
+
data() {
|
|
19
|
+
return {
|
|
20
|
+
statusBarHeight: uni.getSystemInfoSync().statusBarHeight + 'px'
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
</script>
|
|
25
|
+
<style>
|
|
26
|
+
@import 'style.css';
|
|
27
|
+
</style>
|