@zfqh/uniapp 0.1.1
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 +16 -0
- package/LICENSE +21 -0
- package/README.md +39 -0
- package/docs/api/apis/core.md +189 -0
- package/docs/api/apis/index.md +82 -0
- package/docs/api/apis/request.md +369 -0
- package/docs/api/configs/api.md +32 -0
- package/docs/api/configs/app.md +43 -0
- package/docs/api/configs/brand.md +43 -0
- package/docs/api/configs/cdn.md +35 -0
- package/docs/api/configs/color.md +144 -0
- package/docs/api/configs/env.md +120 -0
- package/docs/api/configs/index.md +394 -0
- package/docs/api/configs/link.md +33 -0
- package/docs/api/configs/log.md +27 -0
- package/docs/api/configs/mp.md +34 -0
- package/docs/api/configs/navigate.md +27 -0
- package/docs/api/configs/page.md +32 -0
- package/docs/api/configs/path.md +27 -0
- package/docs/api/configs/storage.md +24 -0
- package/docs/api/configs/tabbar.md +29 -0
- package/docs/api/configs/toast.md +35 -0
- package/docs/api/configs/update.md +25 -0
- package/docs/api/configs/upload.md +45 -0
- package/docs/api/configs/ver.md +32 -0
- package/docs/api/configs/web.md +28 -0
- package/docs/api/hooks/index.md +182 -0
- package/docs/api/hooks/useI18n.md +27 -0
- package/docs/api/hooks/useOverlay.md +37 -0
- package/docs/api/hooks/usePopup.md +35 -0
- package/docs/api/hooks/useVersion.md +23 -0
- package/docs/api/index.md +269 -0
- package/docs/api/mixins/app.md +29 -0
- package/docs/api/mixins/badge.md +23 -0
- package/docs/api/mixins/debounce.md +32 -0
- package/docs/api/mixins/deep.md +29 -0
- package/docs/api/mixins/index.md +23 -0
- package/docs/api/mixins/login.md +22 -0
- package/docs/api/mixins/model.md +26 -0
- package/docs/api/mixins/redirect.md +26 -0
- package/docs/api/mixins/share.md +29 -0
- package/docs/api/mixins/show.md +27 -0
- package/docs/api/mixins/webview.md +27 -0
- package/docs/api/modules/app.md +30 -0
- package/docs/api/modules/dict.md +28 -0
- package/docs/api/modules/im.md +22 -0
- package/docs/api/modules/index.md +44 -0
- package/docs/api/modules/launch.md +26 -0
- package/docs/api/modules/location.md +25 -0
- package/docs/api/modules/login.md +35 -0
- package/docs/api/modules/network.md +26 -0
- package/docs/api/modules/system.md +29 -0
- package/docs/api/utils/audio.md +84 -0
- package/docs/api/utils/consts.md +201 -0
- package/docs/api/utils/cos.md +269 -0
- package/docs/api/utils/debounce.md +89 -0
- package/docs/api/utils/file.md +78 -0
- package/docs/api/utils/index.md +547 -0
- package/docs/api/utils/locale.md +32 -0
- package/docs/api/utils/message.md +81 -0
- package/docs/api/utils/navigate.md +267 -0
- package/docs/api/utils/pages.md +205 -0
- package/docs/api/utils/permission.md +28 -0
- package/docs/api/utils/permit.md +62 -0
- package/docs/api/utils/query.md +89 -0
- package/docs/api/utils/request.md +34 -0
- package/docs/api/utils/storage.md +145 -0
- package/docs/api/utils/subscribe.md +77 -0
- package/docs/api/utils/throttle.md +101 -0
- package/docs/api/utils/toast.md +164 -0
- package/docs/api/utils/uni.md +28 -0
- package/docs/api/utils/update.md +165 -0
- package/docs/components/g-back-button.md +76 -0
- package/docs/components/g-checkbox-list.md +101 -0
- package/docs/components/g-container.md +93 -0
- package/docs/components/g-data-list.md +106 -0
- package/docs/components/g-dot-text.md +79 -0
- package/docs/components/g-env.md +75 -0
- package/docs/components/g-float.md +83 -0
- package/docs/components/g-grid-image.md +91 -0
- package/docs/components/g-grid-swiper.md +99 -0
- package/docs/components/g-icon.md +106 -0
- package/docs/components/g-mask.md +82 -0
- package/docs/components/g-money.md +90 -0
- package/docs/components/g-more.md +78 -0
- package/docs/components/g-page-container.md +170 -0
- package/docs/components/g-permission-popup.md +117 -0
- package/docs/components/g-polyline-chat.md +102 -0
- package/docs/components/g-polyline-view.md +67 -0
- package/docs/components/g-popup.md +144 -0
- package/docs/components/g-refresh-view.md +118 -0
- package/docs/components/g-render-image.md +83 -0
- package/docs/components/g-search.md +120 -0
- package/docs/components/g-share-photo.md +77 -0
- package/docs/components/g-share-view.md +83 -0
- package/docs/components/g-share-weixin.md +81 -0
- package/docs/components/g-skeleton-view.md +71 -0
- package/docs/components/g-skeleton.md +64 -0
- package/docs/components/g-tag-editor.md +134 -0
- package/docs/components/g-timer.md +72 -0
- package/docs/components/g-trtc-room.md +116 -0
- package/docs/components/g-trtc-tui.md +84 -0
- package/docs/components/g-trtc.md +124 -0
- package/docs/components/g-upload.md +117 -0
- package/docs/components/g-waterfall.md +84 -0
- package/docs/components/index.md +109 -0
- package/docs/components/styles/base-styles.md +367 -0
- package/docs/components/styles/global-vars.md +150 -0
- package/docs/components/usage.md +112 -0
- package/docs/faq/index.md +78 -0
- package/docs/guide/getting-started.md +195 -0
- package/docs/guide/project-frame.md +297 -0
- package/docs/index.md +80 -0
- package/lib/apis/core.d.ts +12 -0
- package/lib/apis/core.js +13 -0
- package/lib/apis/index.d.ts +2 -0
- package/lib/apis/index.js +2 -0
- package/lib/apis/request.d.ts +4 -0
- package/lib/apis/request.js +27 -0
- package/lib/components/g-back-button/g-back-button.vue +141 -0
- package/lib/components/g-checkbox-list/g-checkbox-list.vue +156 -0
- package/lib/components/g-container/g-container.vue +159 -0
- package/lib/components/g-data-list/g-data-list.vue +192 -0
- package/lib/components/g-dot-text/g-dot-text.vue +114 -0
- package/lib/components/g-env/g-env.vue +123 -0
- package/lib/components/g-float/g-float.vue +131 -0
- package/lib/components/g-grid-image/g-grid-image.vue +84 -0
- package/lib/components/g-grid-swiper/g-grid-swiper.vue +224 -0
- package/lib/components/g-icon/g-icon.vue +72 -0
- package/lib/components/g-mask/g-mask.vue +126 -0
- package/lib/components/g-money/g-money.vue +174 -0
- package/lib/components/g-more/g-more.vue +68 -0
- package/lib/components/g-page-container/g-page-container.vue +470 -0
- package/lib/components/g-permission-popup/g-permission-popup.vue +80 -0
- package/lib/components/g-polyline-chat/g-polyline-chat.vue +255 -0
- package/lib/components/g-polyline-view/g-polyline-view.vue +104 -0
- package/lib/components/g-popup/g-popup.vue +449 -0
- package/lib/components/g-refresh-view/g-refresh-view.vue +213 -0
- package/lib/components/g-render-image/g-render-image.vue +222 -0
- package/lib/components/g-search/g-search.vue +274 -0
- package/lib/components/g-share-photo/g-share-photo.vue +75 -0
- package/lib/components/g-share-view/g-share-view.vue +157 -0
- package/lib/components/g-share-weixin/g-share-weixin.vue +106 -0
- package/lib/components/g-skeleton/g-skeleton.vue +55 -0
- package/lib/components/g-skeleton-view/g-skeleton-view.vue +78 -0
- package/lib/components/g-tag-editor/g-tag-editor.vue +482 -0
- package/lib/components/g-timer/g-timer.vue +61 -0
- package/lib/components/g-trtc/g-trtc.vue +347 -0
- package/lib/components/g-trtc-room/g-trtc-room.vue +524 -0
- package/lib/components/g-trtc-room/iconfont.scss +59 -0
- package/lib/components/g-trtc-tui/g-trtc-tui.vue +245 -0
- package/lib/components/g-upload/g-upload.vue +294 -0
- package/lib/components/g-waterfall/g-waterfall.vue +101 -0
- package/lib/configs/api.d.ts +7 -0
- package/lib/configs/api.js +6 -0
- package/lib/configs/app.d.ts +26 -0
- package/lib/configs/app.js +50 -0
- package/lib/configs/brand.d.ts +22 -0
- package/lib/configs/brand.js +26 -0
- package/lib/configs/cdn.d.ts +13 -0
- package/lib/configs/cdn.js +12 -0
- package/lib/configs/color.d.ts +62 -0
- package/lib/configs/color.js +66 -0
- package/lib/configs/env.d.ts +37 -0
- package/lib/configs/env.js +71 -0
- package/lib/configs/index.d.ts +170 -0
- package/lib/configs/index.js +82 -0
- package/lib/configs/link.d.ts +11 -0
- package/lib/configs/link.js +3 -0
- package/lib/configs/log.d.ts +9 -0
- package/lib/configs/log.js +8 -0
- package/lib/configs/mp.d.ts +15 -0
- package/lib/configs/mp.js +9 -0
- package/lib/configs/navigate.d.ts +17 -0
- package/lib/configs/navigate.js +5 -0
- package/lib/configs/page.d.ts +18 -0
- package/lib/configs/page.js +14 -0
- package/lib/configs/path.d.ts +11 -0
- package/lib/configs/path.js +10 -0
- package/lib/configs/storage.d.ts +7 -0
- package/lib/configs/storage.js +6 -0
- package/lib/configs/tabbar.d.ts +7 -0
- package/lib/configs/tabbar.js +6 -0
- package/lib/configs/toast.d.ts +18 -0
- package/lib/configs/toast.js +29 -0
- package/lib/configs/update.d.ts +45 -0
- package/lib/configs/update.js +6 -0
- package/lib/configs/upload.d.ts +30 -0
- package/lib/configs/upload.js +7 -0
- package/lib/configs/ver.d.ts +8 -0
- package/lib/configs/ver.js +28 -0
- package/lib/configs/web.d.ts +5 -0
- package/lib/configs/web.js +2 -0
- package/lib/hooks/index.d.ts +4 -0
- package/lib/hooks/index.js +4 -0
- package/lib/hooks/useI18n.d.ts +2 -0
- package/lib/hooks/useI18n.js +19 -0
- package/lib/hooks/useOverlay.d.ts +1 -0
- package/lib/hooks/useOverlay.js +17 -0
- package/lib/hooks/usePopup.d.ts +1 -0
- package/lib/hooks/usePopup.js +14 -0
- package/lib/hooks/useVersion.d.ts +6 -0
- package/lib/hooks/useVersion.js +21 -0
- package/lib/index.d.ts +26 -0
- package/lib/index.js +33 -0
- package/lib/mixins/app.d.ts +14 -0
- package/lib/mixins/app.js +105 -0
- package/lib/mixins/badge.d.ts +24 -0
- package/lib/mixins/badge.js +44 -0
- package/lib/mixins/debounce.d.ts +6 -0
- package/lib/mixins/debounce.js +11 -0
- package/lib/mixins/deep.d.ts +6 -0
- package/lib/mixins/deep.js +8 -0
- package/lib/mixins/index.d.ts +8 -0
- package/lib/mixins/index.js +8 -0
- package/lib/mixins/login.d.ts +4 -0
- package/lib/mixins/login.js +25 -0
- package/lib/mixins/model.d.ts +22 -0
- package/lib/mixins/model.js +29 -0
- package/lib/mixins/redirect.d.ts +8 -0
- package/lib/mixins/redirect.js +94 -0
- package/lib/mixins/share.d.ts +15 -0
- package/lib/mixins/share.js +55 -0
- package/lib/mixins/show.d.ts +9 -0
- package/lib/mixins/show.js +16 -0
- package/lib/mixins/webview.d.ts +26 -0
- package/lib/mixins/webview.js +225 -0
- package/lib/modules/app.d.ts +5 -0
- package/lib/modules/app.js +19 -0
- package/lib/modules/dict.d.ts +8 -0
- package/lib/modules/dict.js +43 -0
- package/lib/modules/im.d.ts +6 -0
- package/lib/modules/im.js +105 -0
- package/lib/modules/index.d.ts +8 -0
- package/lib/modules/index.js +8 -0
- package/lib/modules/launch.d.ts +5 -0
- package/lib/modules/launch.js +32 -0
- package/lib/modules/location.d.ts +5 -0
- package/lib/modules/location.js +57 -0
- package/lib/modules/login.d.ts +5 -0
- package/lib/modules/login.js +72 -0
- package/lib/modules/network.d.ts +5 -0
- package/lib/modules/network.js +39 -0
- package/lib/modules/system.d.ts +5 -0
- package/lib/modules/system.js +65 -0
- package/lib/styles/animate-vue.scss +3 -0
- package/lib/styles/animate.scss +27 -0
- package/lib/styles/bg-vue.scss +21 -0
- package/lib/styles/bg.scss +93 -0
- package/lib/styles/border.scss +218 -0
- package/lib/styles/flex-nvue.scss +64 -0
- package/lib/styles/flex-vue.scss +75 -0
- package/lib/styles/font.scss +59 -0
- package/lib/styles/index.scss +25 -0
- package/lib/styles/layout-nvue.scss +24 -0
- package/lib/styles/layout-vue.scss +30 -0
- package/lib/styles/layout.scss +76 -0
- package/lib/styles/opacity.scss +10 -0
- package/lib/styles/reset-vue.scss +46 -0
- package/lib/styles/shadow.scss +12 -0
- package/lib/styles/sizing-vue.scss +21 -0
- package/lib/styles/sizing.scss +21 -0
- package/lib/styles/spacing.scss +234 -0
- package/lib/styles/text-nvue.scss +21 -0
- package/lib/styles/text-vue.scss +70 -0
- package/lib/styles/text.scss +122 -0
- package/lib/styles/var.module.scss +29 -0
- package/lib/utils/audio.d.ts +14 -0
- package/lib/utils/audio.js +43 -0
- package/lib/utils/consts.d.ts +30 -0
- package/lib/utils/consts.js +52 -0
- package/lib/utils/cos.d.ts +15 -0
- package/lib/utils/cos.js +140 -0
- package/lib/utils/debounce.d.ts +2 -0
- package/lib/utils/debounce.js +30 -0
- package/lib/utils/file.d.ts +28 -0
- package/lib/utils/file.js +292 -0
- package/lib/utils/index.d.ts +166 -0
- package/lib/utils/index.js +485 -0
- package/lib/utils/locale.d.ts +6 -0
- package/lib/utils/locale.js +19 -0
- package/lib/utils/message.d.ts +9 -0
- package/lib/utils/message.js +63 -0
- package/lib/utils/navigate.d.ts +27 -0
- package/lib/utils/navigate.js +183 -0
- package/lib/utils/pages.d.ts +21 -0
- package/lib/utils/pages.js +79 -0
- package/lib/utils/permission.d.ts +16 -0
- package/lib/utils/permission.js +291 -0
- package/lib/utils/permit.d.ts +30 -0
- package/lib/utils/permit.js +181 -0
- package/lib/utils/query.d.ts +13 -0
- package/lib/utils/query.js +14 -0
- package/lib/utils/request.d.ts +8 -0
- package/lib/utils/request.js +126 -0
- package/lib/utils/storage.d.ts +53 -0
- package/lib/utils/storage.js +145 -0
- package/lib/utils/subscribe.d.ts +7 -0
- package/lib/utils/subscribe.js +94 -0
- package/lib/utils/throttle.d.ts +2 -0
- package/lib/utils/throttle.js +32 -0
- package/lib/utils/toast.d.ts +17 -0
- package/lib/utils/toast.js +66 -0
- package/lib/utils/uni.d.ts +1 -0
- package/lib/utils/uni.js +147 -0
- package/lib/utils/update.d.ts +9 -0
- package/lib/utils/update.js +376 -0
- package/package.json +49 -0
- package/types/index.d.ts +25 -0
- package/types/virtual.d.ts +1 -0
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="container" :style="[containerStyle]">
|
|
3
|
+
<view v-if="showHeader" class="header" id="page_header" :style="[_headerStyle]">
|
|
4
|
+
<view v-if="showNavbar" class="flex justify-center" :style="[_navbarStyle]">
|
|
5
|
+
<view :style="[_leftStyle]">
|
|
6
|
+
<g-back-button
|
|
7
|
+
v-if="showBack"
|
|
8
|
+
:showHome="showHome"
|
|
9
|
+
:iconType="iconType"
|
|
10
|
+
:iconFont="iconFont"
|
|
11
|
+
:iconName="iconName"
|
|
12
|
+
:homeIconName="homeIconName"
|
|
13
|
+
:iconSize="iconSize"
|
|
14
|
+
:homeIconSize="homeIconSize"
|
|
15
|
+
:color="iconColor"
|
|
16
|
+
:fixed="false"
|
|
17
|
+
/>
|
|
18
|
+
<slot v-else name="left"></slot>
|
|
19
|
+
</view>
|
|
20
|
+
<view v-if="title !== false" :style="[_titleStyle]">
|
|
21
|
+
<slot name="title">
|
|
22
|
+
{{ title }}
|
|
23
|
+
</slot>
|
|
24
|
+
</view>
|
|
25
|
+
<view :style="[rightStyle]">
|
|
26
|
+
<slot name="right"></slot>
|
|
27
|
+
</view>
|
|
28
|
+
</view>
|
|
29
|
+
<slot v-if="showExtra" name="extra"></slot>
|
|
30
|
+
</view>
|
|
31
|
+
<view class="flex-1 h-0 main">
|
|
32
|
+
<g-refresh-view
|
|
33
|
+
height="100%"
|
|
34
|
+
:enabled="refreshEnabled"
|
|
35
|
+
:triggered="trigger"
|
|
36
|
+
:mode="refreshMode"
|
|
37
|
+
:loadingStyle="_loadingStyle"
|
|
38
|
+
:scrollTop="scroll_top"
|
|
39
|
+
:spinnerColor="spinnerColor"
|
|
40
|
+
:animation="animation"
|
|
41
|
+
:completeText="completeText"
|
|
42
|
+
@refresh="refresh"
|
|
43
|
+
@scroll="scroll"
|
|
44
|
+
@pulling="pulling = true"
|
|
45
|
+
@restore="pulling = false"
|
|
46
|
+
@abort="pulling = false"
|
|
47
|
+
@scrolltop="scrolltop"
|
|
48
|
+
@scrollbottom="scrollbottom"
|
|
49
|
+
>
|
|
50
|
+
<view class="content" :class="{ hasBg }" :style="[_contentStyle]">
|
|
51
|
+
<slot name="content">
|
|
52
|
+
<view class="flex-1 w-full">
|
|
53
|
+
<slot name="default"></slot>
|
|
54
|
+
</view>
|
|
55
|
+
</slot>
|
|
56
|
+
<slot name="bottom"></slot>
|
|
57
|
+
</view>
|
|
58
|
+
</g-refresh-view>
|
|
59
|
+
</view>
|
|
60
|
+
<view v-if="showFooter" :style="[_footerStyle]" :class="{ 'uv-border-top': footerBorder }">
|
|
61
|
+
<slot name="footer"></slot>
|
|
62
|
+
</view>
|
|
63
|
+
</view>
|
|
64
|
+
</template>
|
|
65
|
+
|
|
66
|
+
<script>
|
|
67
|
+
import system from '../../modules/system';
|
|
68
|
+
import color from '../../configs/color';
|
|
69
|
+
|
|
70
|
+
export default {
|
|
71
|
+
props: {
|
|
72
|
+
triggered: Boolean,
|
|
73
|
+
spinnerColor: String,
|
|
74
|
+
title: {
|
|
75
|
+
type: [String, Boolean],
|
|
76
|
+
default: '',
|
|
77
|
+
},
|
|
78
|
+
loading: {
|
|
79
|
+
type: [String, Boolean],
|
|
80
|
+
default: false,
|
|
81
|
+
},
|
|
82
|
+
refreshEnabled: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: false,
|
|
85
|
+
},
|
|
86
|
+
showNavbar: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
default: true,
|
|
89
|
+
},
|
|
90
|
+
showHeader: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
default: false,
|
|
93
|
+
},
|
|
94
|
+
showFooter: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
default: false,
|
|
97
|
+
},
|
|
98
|
+
showBack: {
|
|
99
|
+
type: Boolean,
|
|
100
|
+
default: false,
|
|
101
|
+
},
|
|
102
|
+
showHome: {
|
|
103
|
+
type: Boolean,
|
|
104
|
+
default: false,
|
|
105
|
+
},
|
|
106
|
+
showExtra: {
|
|
107
|
+
type: Boolean,
|
|
108
|
+
default: true,
|
|
109
|
+
},
|
|
110
|
+
hasNavbar: {
|
|
111
|
+
type: Boolean,
|
|
112
|
+
default: false,
|
|
113
|
+
},
|
|
114
|
+
hasTabbar: {
|
|
115
|
+
type: Boolean,
|
|
116
|
+
default: false,
|
|
117
|
+
},
|
|
118
|
+
bgColor: {
|
|
119
|
+
type: String,
|
|
120
|
+
default: () => color.bgColor,
|
|
121
|
+
},
|
|
122
|
+
titleColor: {
|
|
123
|
+
type: String,
|
|
124
|
+
default: '#fff',
|
|
125
|
+
},
|
|
126
|
+
titleSize: {
|
|
127
|
+
type: [String, Number],
|
|
128
|
+
default: 18,
|
|
129
|
+
},
|
|
130
|
+
titleBold: {
|
|
131
|
+
type: [String, Number],
|
|
132
|
+
default: 500,
|
|
133
|
+
},
|
|
134
|
+
titleStyle: {
|
|
135
|
+
type: Object,
|
|
136
|
+
default: () => ({}),
|
|
137
|
+
},
|
|
138
|
+
headerStyle: {
|
|
139
|
+
type: Object,
|
|
140
|
+
default: () => ({}),
|
|
141
|
+
},
|
|
142
|
+
navbarStyle: {
|
|
143
|
+
type: Object,
|
|
144
|
+
default: () => ({}),
|
|
145
|
+
},
|
|
146
|
+
footerStyle: {
|
|
147
|
+
type: Object,
|
|
148
|
+
default: () => ({}),
|
|
149
|
+
},
|
|
150
|
+
footerBorder: {
|
|
151
|
+
type: Boolean,
|
|
152
|
+
default: true,
|
|
153
|
+
},
|
|
154
|
+
// 是否显示footer阴影
|
|
155
|
+
footerShadow: {
|
|
156
|
+
type: Boolean,
|
|
157
|
+
default: false,
|
|
158
|
+
},
|
|
159
|
+
contentStyle: {
|
|
160
|
+
type: Object,
|
|
161
|
+
default: () => ({}),
|
|
162
|
+
},
|
|
163
|
+
customStyle: {
|
|
164
|
+
type: Object,
|
|
165
|
+
default: () => ({}),
|
|
166
|
+
},
|
|
167
|
+
loadingStyle: {
|
|
168
|
+
type: Object,
|
|
169
|
+
default: () => ({}),
|
|
170
|
+
},
|
|
171
|
+
backgroundStyle: {
|
|
172
|
+
type: Object,
|
|
173
|
+
default: () => ({}),
|
|
174
|
+
},
|
|
175
|
+
leftStyle: {
|
|
176
|
+
type: Object,
|
|
177
|
+
default: () => ({}),
|
|
178
|
+
},
|
|
179
|
+
rightStyle: {
|
|
180
|
+
type: Object,
|
|
181
|
+
default: () => ({}),
|
|
182
|
+
},
|
|
183
|
+
footerSafeArea: {
|
|
184
|
+
type: Boolean,
|
|
185
|
+
default: true,
|
|
186
|
+
},
|
|
187
|
+
animation: {
|
|
188
|
+
type: Boolean,
|
|
189
|
+
default: false,
|
|
190
|
+
},
|
|
191
|
+
completeText: {
|
|
192
|
+
type: String,
|
|
193
|
+
default: '刷新成功',
|
|
194
|
+
},
|
|
195
|
+
iconColor: {
|
|
196
|
+
type: String,
|
|
197
|
+
default: '#fff',
|
|
198
|
+
},
|
|
199
|
+
iconType: {
|
|
200
|
+
type: String,
|
|
201
|
+
default: '',
|
|
202
|
+
},
|
|
203
|
+
iconFont: {
|
|
204
|
+
type: String,
|
|
205
|
+
default: '',
|
|
206
|
+
},
|
|
207
|
+
iconSize: {
|
|
208
|
+
type: [String, Number],
|
|
209
|
+
default: 0,
|
|
210
|
+
},
|
|
211
|
+
homeIconSize: {
|
|
212
|
+
type: [String, Number],
|
|
213
|
+
default: 0,
|
|
214
|
+
},
|
|
215
|
+
iconName: {
|
|
216
|
+
type: String,
|
|
217
|
+
default: 'arrow-left',
|
|
218
|
+
},
|
|
219
|
+
homeIconName: {
|
|
220
|
+
type: String,
|
|
221
|
+
default: 'home-fill',
|
|
222
|
+
},
|
|
223
|
+
refreshMode: {
|
|
224
|
+
type: String,
|
|
225
|
+
default: 'none',
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
data() {
|
|
229
|
+
return {
|
|
230
|
+
trigger: this.triggered,
|
|
231
|
+
scroll_top: 0,
|
|
232
|
+
scrollTop: 0,
|
|
233
|
+
pulling: false,
|
|
234
|
+
headerRect: {
|
|
235
|
+
height: this.showHeader ? system.state.info.topBarTitleHeight : 0,
|
|
236
|
+
},
|
|
237
|
+
};
|
|
238
|
+
},
|
|
239
|
+
computed: {
|
|
240
|
+
systemInfo() {
|
|
241
|
+
return this.$store.state.system.info;
|
|
242
|
+
},
|
|
243
|
+
topBarTitleHeight() {
|
|
244
|
+
return this.systemInfo.topBarTitleHeight;
|
|
245
|
+
},
|
|
246
|
+
hasBg() {
|
|
247
|
+
if (this.showHeader) {
|
|
248
|
+
return this.scrollTop > 0 && !this.pulling && !this.trigger;
|
|
249
|
+
}
|
|
250
|
+
return false;
|
|
251
|
+
},
|
|
252
|
+
containerStyle() {
|
|
253
|
+
return Object.assign(
|
|
254
|
+
{
|
|
255
|
+
backgroundColor: this.bgColor,
|
|
256
|
+
},
|
|
257
|
+
this.backgroundStyle,
|
|
258
|
+
this.customStyle,
|
|
259
|
+
);
|
|
260
|
+
},
|
|
261
|
+
_titleStyle() {
|
|
262
|
+
return Object.assign(
|
|
263
|
+
{
|
|
264
|
+
fontSize: uni.$uv.addUnit(this.titleSize),
|
|
265
|
+
fontWeight: this.titleBold,
|
|
266
|
+
},
|
|
267
|
+
this.titleStyle,
|
|
268
|
+
);
|
|
269
|
+
},
|
|
270
|
+
_navbarStyle() {
|
|
271
|
+
return Object.assign(
|
|
272
|
+
{
|
|
273
|
+
height: `${this.systemInfo.titleHeight}px`,
|
|
274
|
+
color: this.titleColor,
|
|
275
|
+
},
|
|
276
|
+
this.navbarStyle,
|
|
277
|
+
);
|
|
278
|
+
},
|
|
279
|
+
_leftStyle() {
|
|
280
|
+
const style = {
|
|
281
|
+
left: '-12rpx',
|
|
282
|
+
};
|
|
283
|
+
if (this.showHome && this.showBack) {
|
|
284
|
+
return {
|
|
285
|
+
left: 0,
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
return Object.assign(style, this.leftStyle);
|
|
289
|
+
},
|
|
290
|
+
_loadingStyle() {
|
|
291
|
+
return Object.assign(
|
|
292
|
+
{
|
|
293
|
+
transform: `translateY(8rpx)`,
|
|
294
|
+
},
|
|
295
|
+
this.loadingStyle,
|
|
296
|
+
);
|
|
297
|
+
},
|
|
298
|
+
_headerStyle() {
|
|
299
|
+
return Object.assign(
|
|
300
|
+
this.hasNavbar
|
|
301
|
+
? {}
|
|
302
|
+
: {
|
|
303
|
+
paddingTop: `${this.systemInfo.topStatusBarHeight}px`,
|
|
304
|
+
},
|
|
305
|
+
this.backgroundStyle,
|
|
306
|
+
this.headerStyle,
|
|
307
|
+
);
|
|
308
|
+
},
|
|
309
|
+
_contentStyle() {
|
|
310
|
+
let style = {};
|
|
311
|
+
if (this.hasBg) {
|
|
312
|
+
style.backgroundColor = this.bgColor;
|
|
313
|
+
style.backgroundPosition = `center -${this.headerRect.height || 0}px`;
|
|
314
|
+
} else {
|
|
315
|
+
style.backgroundImage = 'none';
|
|
316
|
+
}
|
|
317
|
+
return Object.assign({}, this.backgroundStyle, this.contentStyle, style);
|
|
318
|
+
},
|
|
319
|
+
_footerStyle() {
|
|
320
|
+
const footerStyle = Object.assign(
|
|
321
|
+
{
|
|
322
|
+
padding: '16rpx 32rpx',
|
|
323
|
+
backgroundColor: '#fff',
|
|
324
|
+
},
|
|
325
|
+
this.footerStyle,
|
|
326
|
+
);
|
|
327
|
+
if (this.footerShadow) {
|
|
328
|
+
footerStyle.boxShadow = '0rpx -4rpx 10rpx 0rpx rgba(0,0,0,0.05)';
|
|
329
|
+
}
|
|
330
|
+
if (this.footerSafeArea && !this.hasTabbar && this.systemInfo.safeAreaInsets.bottom > 0) {
|
|
331
|
+
footerStyle.paddingBottom = `${this.systemInfo.safeAreaInsets.bottom}px !important`;
|
|
332
|
+
}
|
|
333
|
+
return footerStyle;
|
|
334
|
+
},
|
|
335
|
+
},
|
|
336
|
+
watch: {
|
|
337
|
+
showHeader() {
|
|
338
|
+
this.$nextTick(() => {
|
|
339
|
+
this.getRect();
|
|
340
|
+
});
|
|
341
|
+
},
|
|
342
|
+
showNavbar() {
|
|
343
|
+
this.$nextTick(() => {
|
|
344
|
+
this.getRect();
|
|
345
|
+
});
|
|
346
|
+
},
|
|
347
|
+
showExtra() {
|
|
348
|
+
this.$nextTick(() => {
|
|
349
|
+
this.getRect();
|
|
350
|
+
});
|
|
351
|
+
},
|
|
352
|
+
topBarTitleHeight() {
|
|
353
|
+
this.$nextTick(() => {
|
|
354
|
+
this.getRect();
|
|
355
|
+
});
|
|
356
|
+
},
|
|
357
|
+
triggered(e) {
|
|
358
|
+
this.trigger = e;
|
|
359
|
+
},
|
|
360
|
+
loading(value) {
|
|
361
|
+
this.setLoading(value);
|
|
362
|
+
},
|
|
363
|
+
},
|
|
364
|
+
methods: {
|
|
365
|
+
setLoading(loading) {
|
|
366
|
+
if (loading) {
|
|
367
|
+
uni.showLoading({
|
|
368
|
+
title: typeof loading === 'string' ? loading : '',
|
|
369
|
+
mask: true,
|
|
370
|
+
});
|
|
371
|
+
} else if (!loading) {
|
|
372
|
+
uni.hideLoading();
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
refresh() {
|
|
376
|
+
this.$emit('refresh');
|
|
377
|
+
},
|
|
378
|
+
scroll(e) {
|
|
379
|
+
this.scrollTop = e.detail.scrollTop;
|
|
380
|
+
this.$emit('scroll', e);
|
|
381
|
+
},
|
|
382
|
+
scrolltop() {
|
|
383
|
+
this.$emit('scrolltop');
|
|
384
|
+
},
|
|
385
|
+
scrollbottom() {
|
|
386
|
+
this.$emit('scrollbottom');
|
|
387
|
+
},
|
|
388
|
+
scrollTo(e) {
|
|
389
|
+
// 强制更新
|
|
390
|
+
if (!this._top) {
|
|
391
|
+
this._top = 0.1;
|
|
392
|
+
} else {
|
|
393
|
+
this._top = 0;
|
|
394
|
+
}
|
|
395
|
+
this.scroll_top = e + this._top;
|
|
396
|
+
},
|
|
397
|
+
getRect() {
|
|
398
|
+
try {
|
|
399
|
+
const query = uni.createSelectorQuery().in(this);
|
|
400
|
+
query
|
|
401
|
+
.select(`#page_header`)
|
|
402
|
+
.boundingClientRect((data) => {
|
|
403
|
+
this.headerRect = data || {};
|
|
404
|
+
})
|
|
405
|
+
.exec();
|
|
406
|
+
} catch (e) {}
|
|
407
|
+
},
|
|
408
|
+
},
|
|
409
|
+
beforeMount() {
|
|
410
|
+
if (this.loading) {
|
|
411
|
+
this.setLoading(this.loading);
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
mounted() {
|
|
415
|
+
if (this.showHeader) {
|
|
416
|
+
this.getRect();
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
};
|
|
420
|
+
</script>
|
|
421
|
+
|
|
422
|
+
<style lang="scss" scoped>
|
|
423
|
+
.container,
|
|
424
|
+
.content,
|
|
425
|
+
.header {
|
|
426
|
+
background-repeat: no-repeat;
|
|
427
|
+
background-position: center top;
|
|
428
|
+
background-size: 100% auto;
|
|
429
|
+
}
|
|
430
|
+
.container {
|
|
431
|
+
height: calc(100vh - var(--window-top) - var(--window-bottom));
|
|
432
|
+
display: flex;
|
|
433
|
+
flex-direction: column;
|
|
434
|
+
}
|
|
435
|
+
.header {
|
|
436
|
+
padding: 0 32rpx;
|
|
437
|
+
& > view {
|
|
438
|
+
position: relative;
|
|
439
|
+
& > view {
|
|
440
|
+
&:first-child,
|
|
441
|
+
&:last-child {
|
|
442
|
+
position: absolute;
|
|
443
|
+
top: 50%;
|
|
444
|
+
transform: translateY(-50%);
|
|
445
|
+
}
|
|
446
|
+
&:first-child {
|
|
447
|
+
left: 0;
|
|
448
|
+
}
|
|
449
|
+
&:last-child {
|
|
450
|
+
right: 0;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
.content {
|
|
456
|
+
position: relative;
|
|
457
|
+
min-height: 100%;
|
|
458
|
+
display: flex;
|
|
459
|
+
flex-direction: column;
|
|
460
|
+
align-items: center;
|
|
461
|
+
justify-content: center;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/* #ifdef H5 */
|
|
465
|
+
// 修复ios下popup被遮挡问题
|
|
466
|
+
.main ::v-deep > .scroll-view > .uni-scroll-view > .uni-scroll-view {
|
|
467
|
+
-webkit-overflow-scrolling: auto;
|
|
468
|
+
}
|
|
469
|
+
/* #endif */
|
|
470
|
+
</style>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view v-if="visible" :style="[style]" class="popup">
|
|
3
|
+
<view class="font-bold text-32rpx"> 申请权限 </view>
|
|
4
|
+
<view class="mt-12rpx text-30rpx"> {{ content }} </view>
|
|
5
|
+
</view>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
export default {
|
|
10
|
+
props: {
|
|
11
|
+
customStyle: {
|
|
12
|
+
type: Object,
|
|
13
|
+
default: () => ({}),
|
|
14
|
+
},
|
|
15
|
+
hasNavbar: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: true,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
data() {
|
|
21
|
+
return {
|
|
22
|
+
active: true,
|
|
23
|
+
visible: false,
|
|
24
|
+
content: '',
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
computed: {
|
|
28
|
+
style({ hasNavbar }) {
|
|
29
|
+
return Object.assign(
|
|
30
|
+
{
|
|
31
|
+
top: `calc(${hasNavbar ? '0px' : '44px + var(--status-bar-height)'} + 8px)`,
|
|
32
|
+
},
|
|
33
|
+
this.customStyle,
|
|
34
|
+
);
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
methods: {
|
|
38
|
+
requestPermission(e) {
|
|
39
|
+
if (this.active) {
|
|
40
|
+
if (e) {
|
|
41
|
+
this.visible = true;
|
|
42
|
+
Object.assign(this, e);
|
|
43
|
+
} else {
|
|
44
|
+
this.visible = false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
deactivated() {
|
|
50
|
+
this.active = false;
|
|
51
|
+
},
|
|
52
|
+
activated() {
|
|
53
|
+
this.active = true;
|
|
54
|
+
},
|
|
55
|
+
beforeMount() {
|
|
56
|
+
uni.$on('requestPermission', this.requestPermission);
|
|
57
|
+
},
|
|
58
|
+
beforeUnmount() {
|
|
59
|
+
uni.$off('requestPermission', this.requestPermission);
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<style lang="scss" scoped>
|
|
65
|
+
.popup {
|
|
66
|
+
position: fixed;
|
|
67
|
+
top: 8px;
|
|
68
|
+
left: 50%;
|
|
69
|
+
transform: translateX(-50%);
|
|
70
|
+
width: 720rpx;
|
|
71
|
+
max-width: 96vw;
|
|
72
|
+
z-index: 999999;
|
|
73
|
+
background-color: #fff;
|
|
74
|
+
box-sizing: border-box;
|
|
75
|
+
box-shadow: 0rpx 8rpx 30rpx rgba(0, 0, 0, 0.06);
|
|
76
|
+
line-height: 40rpx;
|
|
77
|
+
padding: 30rpx;
|
|
78
|
+
border-radius: 20rpx;
|
|
79
|
+
}
|
|
80
|
+
</style>
|