@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,449 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<uv-popup
|
|
3
|
+
ref="popup"
|
|
4
|
+
:mode="opts.mode"
|
|
5
|
+
:duration="opts.duration"
|
|
6
|
+
:overlay="opts.overlay"
|
|
7
|
+
:overlayStyle="opts.overlayStyle"
|
|
8
|
+
:overlayOpacity="opts.overlayOpacity"
|
|
9
|
+
:closeOnClickOverlay="opts.closeOnClickOverlay"
|
|
10
|
+
:zIndex="opts.zIndex"
|
|
11
|
+
:closeable="opts.closeable"
|
|
12
|
+
:closeIconPos="opts.closeIconPos"
|
|
13
|
+
:bgColor="opts.bgColor"
|
|
14
|
+
:round="opts.round"
|
|
15
|
+
:zoom="opts.zoom"
|
|
16
|
+
:safeAreaInsetBottom="opts.safeAreaInsetBottom && opts.mode === 'bottom'"
|
|
17
|
+
@close="close"
|
|
18
|
+
@change="change"
|
|
19
|
+
>
|
|
20
|
+
<view :style="[_customStyle]">
|
|
21
|
+
<slot v-if="opts.showHeader" name="header">
|
|
22
|
+
<view
|
|
23
|
+
class="flex"
|
|
24
|
+
:class="[{ 'border-b': opts.headerBorder }, { 'justify-start': opts.titleAlign === 'left', 'justify-end': opts.titleAlign === 'right', 'justify-center': opts.titleAlign === 'center', 'justify-between': opts.titleAlign === 'between', 'justify-around': opts.titleAlign === 'around' }]"
|
|
25
|
+
:style="[_headerStyle]"
|
|
26
|
+
>
|
|
27
|
+
<text v-if="opts.showTitle" :class="{ 'font-bold': opts.titleBold }" :style="[_titleStyle]">
|
|
28
|
+
{{ opts.title }}
|
|
29
|
+
</text>
|
|
30
|
+
</view>
|
|
31
|
+
</slot>
|
|
32
|
+
<slot v-if="opts.showContent" name="content">
|
|
33
|
+
<scroll-view scroll-y :style="[_scrollStyle]">
|
|
34
|
+
<view class="flex justify-center break-all" :class="[{ 'text-left': opts.align === 'left', 'text-right': opts.align === 'right', 'text-center': opts.align === 'center' }]" :style="[_contentStyle]">
|
|
35
|
+
<slot name="default">
|
|
36
|
+
<rich-text :nodes="opts.content" />
|
|
37
|
+
</slot>
|
|
38
|
+
</view>
|
|
39
|
+
</scroll-view>
|
|
40
|
+
</slot>
|
|
41
|
+
<slot v-if="opts.showFooter" name="footer">
|
|
42
|
+
<view
|
|
43
|
+
v-if="opts.showConfirm || opts.showCancel"
|
|
44
|
+
class="flex justify-center footer"
|
|
45
|
+
:class="{ 'border-t': opts.footerBorder }"
|
|
46
|
+
:style="[_footerStyle]"
|
|
47
|
+
>
|
|
48
|
+
<uv-button
|
|
49
|
+
v-if="opts.showCancel"
|
|
50
|
+
:type="_cancelProps.type || 'primary'"
|
|
51
|
+
:size="_cancelProps.size || opts.size"
|
|
52
|
+
:shape="_cancelProps.shape || 'square'"
|
|
53
|
+
:plain="_cancelProps.plain || true"
|
|
54
|
+
:hairline="_cancelProps.hairline || false"
|
|
55
|
+
:disabled="_cancelProps.disabled || false"
|
|
56
|
+
:customStyle="_cancelProps.customStyle"
|
|
57
|
+
@click="cancel"
|
|
58
|
+
>
|
|
59
|
+
{{ opts.cancelText }}
|
|
60
|
+
</uv-button>
|
|
61
|
+
<view v-if="opts.showConfirm && opts.showCancel" :style="[style.gap]" />
|
|
62
|
+
<uv-button
|
|
63
|
+
v-if="opts.showConfirm"
|
|
64
|
+
:type="_confirmProps.type || 'primary'"
|
|
65
|
+
:size="_confirmProps.size || opts.size"
|
|
66
|
+
:shape="_cancelProps.shape || 'square'"
|
|
67
|
+
:plain="_cancelProps.plain || false"
|
|
68
|
+
:hairline="_confirmProps.hairline || false"
|
|
69
|
+
:disabled="_confirmProps.disabled || false"
|
|
70
|
+
:loading="_confirmProps.loading || false"
|
|
71
|
+
:loadingMode="_confirmProps.loadingMode || 'spinner'"
|
|
72
|
+
:customStyle="_confirmProps.customStyle"
|
|
73
|
+
@click="confirm"
|
|
74
|
+
>
|
|
75
|
+
{{ opts.confirmText }}
|
|
76
|
+
</uv-button>
|
|
77
|
+
</view>
|
|
78
|
+
</slot>
|
|
79
|
+
</view>
|
|
80
|
+
</uv-popup>
|
|
81
|
+
</template>
|
|
82
|
+
|
|
83
|
+
<script>
|
|
84
|
+
import model from '../../mixins/model';
|
|
85
|
+
import deep from '../../mixins/deep';
|
|
86
|
+
|
|
87
|
+
export default {
|
|
88
|
+
mixins: [
|
|
89
|
+
deep,
|
|
90
|
+
model({
|
|
91
|
+
type: Boolean,
|
|
92
|
+
default: false,
|
|
93
|
+
}),
|
|
94
|
+
],
|
|
95
|
+
props: {
|
|
96
|
+
size: {
|
|
97
|
+
type: String,
|
|
98
|
+
default: 'normal',
|
|
99
|
+
},
|
|
100
|
+
content: {
|
|
101
|
+
type: String,
|
|
102
|
+
default: '',
|
|
103
|
+
},
|
|
104
|
+
showHeader: {
|
|
105
|
+
type: Boolean,
|
|
106
|
+
default: true,
|
|
107
|
+
},
|
|
108
|
+
showTitle: {
|
|
109
|
+
type: Boolean,
|
|
110
|
+
default: true,
|
|
111
|
+
},
|
|
112
|
+
showContent: {
|
|
113
|
+
type: Boolean,
|
|
114
|
+
default: true,
|
|
115
|
+
},
|
|
116
|
+
showFooter: {
|
|
117
|
+
type: Boolean,
|
|
118
|
+
default: true,
|
|
119
|
+
},
|
|
120
|
+
showCancel: {
|
|
121
|
+
type: Boolean,
|
|
122
|
+
default: true,
|
|
123
|
+
},
|
|
124
|
+
showConfirm: {
|
|
125
|
+
type: Boolean,
|
|
126
|
+
default: true,
|
|
127
|
+
},
|
|
128
|
+
title: {
|
|
129
|
+
type: String,
|
|
130
|
+
default: '提示',
|
|
131
|
+
},
|
|
132
|
+
titleAlign: {
|
|
133
|
+
type: String,
|
|
134
|
+
default: 'center',
|
|
135
|
+
},
|
|
136
|
+
titleBorder: {
|
|
137
|
+
type: Boolean,
|
|
138
|
+
default: false,
|
|
139
|
+
},
|
|
140
|
+
titleBold: {
|
|
141
|
+
type: Boolean,
|
|
142
|
+
default: true,
|
|
143
|
+
},
|
|
144
|
+
align: {
|
|
145
|
+
type: String,
|
|
146
|
+
default: 'left',
|
|
147
|
+
},
|
|
148
|
+
width: {
|
|
149
|
+
type: [String, Number],
|
|
150
|
+
default: 325,
|
|
151
|
+
},
|
|
152
|
+
duration: {
|
|
153
|
+
type: [String, Number],
|
|
154
|
+
default: 300,
|
|
155
|
+
},
|
|
156
|
+
round: {
|
|
157
|
+
type: [Number, String],
|
|
158
|
+
default: 8,
|
|
159
|
+
},
|
|
160
|
+
zoom: {
|
|
161
|
+
type: Boolean,
|
|
162
|
+
default: true,
|
|
163
|
+
},
|
|
164
|
+
bgColor: {
|
|
165
|
+
type: String,
|
|
166
|
+
default: '#fff',
|
|
167
|
+
},
|
|
168
|
+
closeOnClickOverlay: {
|
|
169
|
+
type: Boolean,
|
|
170
|
+
default: true,
|
|
171
|
+
},
|
|
172
|
+
overlayOpacity: {
|
|
173
|
+
type: [Number, String],
|
|
174
|
+
default: 0.5,
|
|
175
|
+
},
|
|
176
|
+
overlay: {
|
|
177
|
+
type: Boolean,
|
|
178
|
+
default: true,
|
|
179
|
+
},
|
|
180
|
+
closeIconPos: {
|
|
181
|
+
type: String,
|
|
182
|
+
default: 'top-right',
|
|
183
|
+
},
|
|
184
|
+
zIndex: {
|
|
185
|
+
type: [Number, String],
|
|
186
|
+
default: 10075,
|
|
187
|
+
},
|
|
188
|
+
mode: {
|
|
189
|
+
type: String,
|
|
190
|
+
default: 'center',
|
|
191
|
+
},
|
|
192
|
+
cancelText: {
|
|
193
|
+
type: [String, Boolean],
|
|
194
|
+
default: '取 消',
|
|
195
|
+
},
|
|
196
|
+
confirmText: {
|
|
197
|
+
type: [String, Boolean],
|
|
198
|
+
default: '确 定',
|
|
199
|
+
},
|
|
200
|
+
closeable: {
|
|
201
|
+
type: Boolean,
|
|
202
|
+
default: true,
|
|
203
|
+
},
|
|
204
|
+
safeAreaInsetBottom: {
|
|
205
|
+
type: Boolean,
|
|
206
|
+
default: true,
|
|
207
|
+
},
|
|
208
|
+
headerBorder: {
|
|
209
|
+
type: Boolean,
|
|
210
|
+
default: false,
|
|
211
|
+
},
|
|
212
|
+
footerBorder: {
|
|
213
|
+
type: Boolean,
|
|
214
|
+
default: false,
|
|
215
|
+
},
|
|
216
|
+
closeOnConfirm: {
|
|
217
|
+
type: Boolean,
|
|
218
|
+
default: true,
|
|
219
|
+
},
|
|
220
|
+
closeOnCancel: {
|
|
221
|
+
type: Boolean,
|
|
222
|
+
default: true,
|
|
223
|
+
},
|
|
224
|
+
cancelProps: {
|
|
225
|
+
type: Object,
|
|
226
|
+
default: () => ({}),
|
|
227
|
+
},
|
|
228
|
+
confirmProps: {
|
|
229
|
+
type: Object,
|
|
230
|
+
default: () => ({}),
|
|
231
|
+
},
|
|
232
|
+
buttonProps: {
|
|
233
|
+
type: Object,
|
|
234
|
+
default: () => ({}),
|
|
235
|
+
},
|
|
236
|
+
headerStyle: {
|
|
237
|
+
type: Object,
|
|
238
|
+
default: () => ({}),
|
|
239
|
+
},
|
|
240
|
+
titleStyle: {
|
|
241
|
+
type: Object,
|
|
242
|
+
default: () => ({}),
|
|
243
|
+
},
|
|
244
|
+
footerStyle: {
|
|
245
|
+
type: Object,
|
|
246
|
+
default: () => ({}),
|
|
247
|
+
},
|
|
248
|
+
scrollStyle: {
|
|
249
|
+
type: Object,
|
|
250
|
+
default: () => ({}),
|
|
251
|
+
},
|
|
252
|
+
contentStyle: {
|
|
253
|
+
type: Object,
|
|
254
|
+
default: () => ({}),
|
|
255
|
+
},
|
|
256
|
+
customStyle: {
|
|
257
|
+
type: Object,
|
|
258
|
+
default: () => ({}),
|
|
259
|
+
},
|
|
260
|
+
overlayStyle: {
|
|
261
|
+
type: Object,
|
|
262
|
+
default: () => ({}),
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
data() {
|
|
266
|
+
return {
|
|
267
|
+
opts: {},
|
|
268
|
+
visible: false,
|
|
269
|
+
resolve: null,
|
|
270
|
+
reject: null,
|
|
271
|
+
};
|
|
272
|
+
},
|
|
273
|
+
computed: {
|
|
274
|
+
style({ opts }) {
|
|
275
|
+
if (opts.size === 'mini') {
|
|
276
|
+
const size = '24rpx';
|
|
277
|
+
return {
|
|
278
|
+
title: {
|
|
279
|
+
fontSize: size,
|
|
280
|
+
},
|
|
281
|
+
header: {
|
|
282
|
+
padding: size,
|
|
283
|
+
},
|
|
284
|
+
content: {
|
|
285
|
+
padding: size,
|
|
286
|
+
fontSize: '24rpx',
|
|
287
|
+
lineHeight: '30rpx',
|
|
288
|
+
},
|
|
289
|
+
footer: {
|
|
290
|
+
padding: size,
|
|
291
|
+
},
|
|
292
|
+
gap: {
|
|
293
|
+
width: '18rpx',
|
|
294
|
+
},
|
|
295
|
+
};
|
|
296
|
+
} else if (opts.size === 'large') {
|
|
297
|
+
const size = '36rpx';
|
|
298
|
+
return {
|
|
299
|
+
title: {
|
|
300
|
+
fontSize: size,
|
|
301
|
+
},
|
|
302
|
+
header: {
|
|
303
|
+
padding: size,
|
|
304
|
+
},
|
|
305
|
+
content: {
|
|
306
|
+
padding: size,
|
|
307
|
+
fontSize: '32rpx',
|
|
308
|
+
lineHeight: '48rpx',
|
|
309
|
+
},
|
|
310
|
+
footer: {
|
|
311
|
+
padding: size,
|
|
312
|
+
},
|
|
313
|
+
gap: {
|
|
314
|
+
width: '32rpx',
|
|
315
|
+
},
|
|
316
|
+
};
|
|
317
|
+
} else {
|
|
318
|
+
const size = '32rpx';
|
|
319
|
+
return {
|
|
320
|
+
title: {
|
|
321
|
+
fontSize: size,
|
|
322
|
+
},
|
|
323
|
+
header: {
|
|
324
|
+
padding: size,
|
|
325
|
+
},
|
|
326
|
+
content: {
|
|
327
|
+
padding: size,
|
|
328
|
+
fontSize: '28rpx',
|
|
329
|
+
lineHeight: '40rpx',
|
|
330
|
+
},
|
|
331
|
+
footer: {
|
|
332
|
+
padding: size,
|
|
333
|
+
},
|
|
334
|
+
gap: {
|
|
335
|
+
width: '24rpx',
|
|
336
|
+
},
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
options() {
|
|
341
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
342
|
+
const { value, modelValue, ...options } = this.$props;
|
|
343
|
+
return options;
|
|
344
|
+
},
|
|
345
|
+
_headerStyle({ opts, style }) {
|
|
346
|
+
return Object.assign(style.header, opts.headerStyle);
|
|
347
|
+
},
|
|
348
|
+
_titleStyle({ opts, style }) {
|
|
349
|
+
return Object.assign(style.title, opts.titleStyle);
|
|
350
|
+
},
|
|
351
|
+
_footerStyle({ opts, style }) {
|
|
352
|
+
return Object.assign(style.footer, opts.footerStyle);
|
|
353
|
+
},
|
|
354
|
+
_contentStyle({ opts, style }) {
|
|
355
|
+
return Object.assign(style.content, opts.contentStyle);
|
|
356
|
+
},
|
|
357
|
+
_scrollStyle({ opts }) {
|
|
358
|
+
return Object.assign(
|
|
359
|
+
{
|
|
360
|
+
maxHeight: '60vh',
|
|
361
|
+
},
|
|
362
|
+
opts.scrollStyle,
|
|
363
|
+
);
|
|
364
|
+
},
|
|
365
|
+
_cancelProps({ opts }) {
|
|
366
|
+
return Object.assign({}, opts.buttonProps, opts.cancelProps, {
|
|
367
|
+
customStyle: Object.assign({}, opts.buttonProps.customStyle, opts.cancelProps.customStyle),
|
|
368
|
+
});
|
|
369
|
+
},
|
|
370
|
+
_confirmProps({ opts }) {
|
|
371
|
+
return Object.assign({}, opts.buttonProps, opts.confirmProps, {
|
|
372
|
+
customStyle: Object.assign({}, opts.buttonProps.customStyle, opts.confirmProps.customStyle),
|
|
373
|
+
});
|
|
374
|
+
},
|
|
375
|
+
_customStyle({ opts }) {
|
|
376
|
+
const style = {};
|
|
377
|
+
if (opts.mode === 'center') {
|
|
378
|
+
style.width = uni.$uv.addUnit(opts.width);
|
|
379
|
+
}
|
|
380
|
+
return Object.assign(style, opts.customStyle);
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
watch: {
|
|
384
|
+
options: {
|
|
385
|
+
immediate: true,
|
|
386
|
+
handler(e) {
|
|
387
|
+
this.opts = e;
|
|
388
|
+
},
|
|
389
|
+
},
|
|
390
|
+
value(e) {
|
|
391
|
+
this.visible = e;
|
|
392
|
+
},
|
|
393
|
+
visible(e) {
|
|
394
|
+
this.updateModel(e);
|
|
395
|
+
if (this.$refs.popup) {
|
|
396
|
+
this.$refs.popup[e ? 'open' : 'close']();
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
},
|
|
400
|
+
methods: {
|
|
401
|
+
change(e) {
|
|
402
|
+
this.$emit(e.show ? 'open' : 'close');
|
|
403
|
+
this.$emit('change', e);
|
|
404
|
+
},
|
|
405
|
+
close() {
|
|
406
|
+
this.visible = false;
|
|
407
|
+
this.resolve && this.resolve({ close: true });
|
|
408
|
+
this.resolve = null;
|
|
409
|
+
},
|
|
410
|
+
open(opts = {}) {
|
|
411
|
+
this.opts = Object.assign({}, this.options, opts);
|
|
412
|
+
return new Promise((res, rej) => {
|
|
413
|
+
this.resolve = res;
|
|
414
|
+
this.reject = rej;
|
|
415
|
+
this.visible = true;
|
|
416
|
+
});
|
|
417
|
+
},
|
|
418
|
+
cancel() {
|
|
419
|
+
if (this.closeOnCancel) {
|
|
420
|
+
this.visible = false;
|
|
421
|
+
}
|
|
422
|
+
this.$emit('cancel');
|
|
423
|
+
this.resolve && this.resolve({ cancel: true });
|
|
424
|
+
this.resolve = null;
|
|
425
|
+
},
|
|
426
|
+
confirm() {
|
|
427
|
+
if (this.closeOnConfirm) {
|
|
428
|
+
this.visible = false;
|
|
429
|
+
}
|
|
430
|
+
this.$emit('confirm');
|
|
431
|
+
this.resolve && this.resolve({ confirm: true });
|
|
432
|
+
this.resolve = null;
|
|
433
|
+
},
|
|
434
|
+
},
|
|
435
|
+
mounted() {
|
|
436
|
+
if (this.value) {
|
|
437
|
+
this.visible = true;
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
};
|
|
441
|
+
</script>
|
|
442
|
+
|
|
443
|
+
<style lang="scss" scoped>
|
|
444
|
+
.footer {
|
|
445
|
+
::v-deep .uv-button-wrapper {
|
|
446
|
+
flex: 1;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
</style>
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<scroll-view
|
|
3
|
+
class="scroll-view"
|
|
4
|
+
:refresher-default-style="mode"
|
|
5
|
+
:refresher-enabled="enabled"
|
|
6
|
+
:scroll-with-animation="animation"
|
|
7
|
+
:refresher-triggered="refreshing"
|
|
8
|
+
:scroll-y="true"
|
|
9
|
+
:refresher-threshold="threshold"
|
|
10
|
+
:style="[{ height }]"
|
|
11
|
+
:scroll-top="scrollTop"
|
|
12
|
+
:refresher-background="refresherBackground"
|
|
13
|
+
@refresherrefresh="refresherrefresh"
|
|
14
|
+
@refresherpulling="refresherpulling"
|
|
15
|
+
@scroll="scroll"
|
|
16
|
+
@scrolltoupper="scrolltoupper"
|
|
17
|
+
@scrolltolower="scrolltolower"
|
|
18
|
+
@refresherrestore="refresherrestore"
|
|
19
|
+
@refresherabort="refresherabort"
|
|
20
|
+
>
|
|
21
|
+
<slot v-if="mode === 'none' && enabled" name="refresher">
|
|
22
|
+
<view class="w-full flex flex-col justify-center text-tips" :style="[_loadingStyle]">
|
|
23
|
+
<slot v-if="completed" name="completeText" :text="completeText">
|
|
24
|
+
<text> {{ completeText }} </text>
|
|
25
|
+
</slot>
|
|
26
|
+
<slot v-else name="spinner">
|
|
27
|
+
<view class="spinner">
|
|
28
|
+
<text class="bounce1" :style="[spinnerStyle]"></text>
|
|
29
|
+
<text class="bounce2" :style="[spinnerStyle]"></text>
|
|
30
|
+
<text class="bounce3" :style="[spinnerStyle]"></text>
|
|
31
|
+
</view>
|
|
32
|
+
</slot>
|
|
33
|
+
</view>
|
|
34
|
+
</slot>
|
|
35
|
+
<slot name="default"></slot>
|
|
36
|
+
</scroll-view>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script>
|
|
40
|
+
export default {
|
|
41
|
+
props: {
|
|
42
|
+
enabled: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: true,
|
|
45
|
+
},
|
|
46
|
+
triggered: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: false,
|
|
49
|
+
},
|
|
50
|
+
completeText: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: '刷新成功',
|
|
53
|
+
},
|
|
54
|
+
loadingStyle: {
|
|
55
|
+
type: Object,
|
|
56
|
+
default: () => ({}),
|
|
57
|
+
},
|
|
58
|
+
mode: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: 'none',
|
|
61
|
+
},
|
|
62
|
+
height: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: '100%',
|
|
65
|
+
},
|
|
66
|
+
scrollTop: {
|
|
67
|
+
type: Number,
|
|
68
|
+
default: 0,
|
|
69
|
+
},
|
|
70
|
+
threshold: {
|
|
71
|
+
type: Number,
|
|
72
|
+
default: 40,
|
|
73
|
+
},
|
|
74
|
+
background: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: 'transparent',
|
|
77
|
+
},
|
|
78
|
+
spinnerColor: {
|
|
79
|
+
type: String,
|
|
80
|
+
default: '',
|
|
81
|
+
},
|
|
82
|
+
animation: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: false,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
data() {
|
|
88
|
+
return {
|
|
89
|
+
refreshing: false,
|
|
90
|
+
completed: false,
|
|
91
|
+
pulling: false,
|
|
92
|
+
opacity: 0,
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
computed: {
|
|
96
|
+
spinnerStyle() {
|
|
97
|
+
if (this.spinnerColor) {
|
|
98
|
+
return {
|
|
99
|
+
backgroundColor: this.spinnerColor,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
return {};
|
|
103
|
+
},
|
|
104
|
+
_loadingStyle() {
|
|
105
|
+
return Object.assign(
|
|
106
|
+
{
|
|
107
|
+
opacity: this.opacity,
|
|
108
|
+
height: `${this.threshold}px`,
|
|
109
|
+
marginTop: `-${this.threshold}px`,
|
|
110
|
+
fontSize: '13px',
|
|
111
|
+
},
|
|
112
|
+
this.loadingStyle,
|
|
113
|
+
);
|
|
114
|
+
},
|
|
115
|
+
refresherBackground() {
|
|
116
|
+
let background = this.background;
|
|
117
|
+
// #ifdef H5
|
|
118
|
+
background = `${background} !important`;
|
|
119
|
+
// #endif
|
|
120
|
+
return background;
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
watch: {
|
|
124
|
+
triggered(e) {
|
|
125
|
+
if (e) {
|
|
126
|
+
this.refreshing = true;
|
|
127
|
+
this.pulling = true;
|
|
128
|
+
this.completed = false;
|
|
129
|
+
} else {
|
|
130
|
+
this.completed = true;
|
|
131
|
+
setTimeout(() => {
|
|
132
|
+
this.refreshing = false;
|
|
133
|
+
}, 1000);
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
pulling(e) {
|
|
137
|
+
if (e) {
|
|
138
|
+
this.opacity = 1;
|
|
139
|
+
} else {
|
|
140
|
+
setTimeout(() => {
|
|
141
|
+
this.opacity = 0;
|
|
142
|
+
}, 300);
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
methods: {
|
|
147
|
+
refresherpulling(e) {
|
|
148
|
+
this.pulling = true;
|
|
149
|
+
this.completed = false;
|
|
150
|
+
this.$emit('pulling', e);
|
|
151
|
+
},
|
|
152
|
+
refresherrefresh(e) {
|
|
153
|
+
this.$emit('refresh', e);
|
|
154
|
+
},
|
|
155
|
+
refresherrestore(e) {
|
|
156
|
+
this.pulling = false;
|
|
157
|
+
this.$emit('restore', e);
|
|
158
|
+
},
|
|
159
|
+
refresherabort(e) {
|
|
160
|
+
this.pulling = false;
|
|
161
|
+
this.$emit('abort', e);
|
|
162
|
+
},
|
|
163
|
+
scroll(e) {
|
|
164
|
+
this.$emit('scroll', e);
|
|
165
|
+
},
|
|
166
|
+
scrolltoupper() {
|
|
167
|
+
this.$emit('scrolltop');
|
|
168
|
+
},
|
|
169
|
+
scrolltolower() {
|
|
170
|
+
this.$emit('scrollbottom');
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
</script>
|
|
175
|
+
|
|
176
|
+
<style lang="scss" scoped>
|
|
177
|
+
.spinner {
|
|
178
|
+
display: flex;
|
|
179
|
+
& > text {
|
|
180
|
+
width: 12rpx;
|
|
181
|
+
height: 12rpx;
|
|
182
|
+
margin: 0 8rpx;
|
|
183
|
+
background-color: $uv-primary;
|
|
184
|
+
border-radius: 100%;
|
|
185
|
+
-webkit-animation: bouncedelay 1.4s infinite ease-in-out;
|
|
186
|
+
animation: bouncedelay 1.4s infinite ease-in-out;
|
|
187
|
+
-webkit-animation-fill-mode: both;
|
|
188
|
+
animation-fill-mode: both;
|
|
189
|
+
}
|
|
190
|
+
& > .bounce1 {
|
|
191
|
+
-webkit-animation-delay: -0.32s;
|
|
192
|
+
animation-delay: -0.32s;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
& > .bounce2 {
|
|
196
|
+
-webkit-animation-delay: -0.16s;
|
|
197
|
+
animation-delay: -0.16s;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
@keyframes bouncedelay {
|
|
202
|
+
0%,
|
|
203
|
+
80%,
|
|
204
|
+
100% {
|
|
205
|
+
transform: scale(0);
|
|
206
|
+
-webkit-transform: scale(0);
|
|
207
|
+
}
|
|
208
|
+
40% {
|
|
209
|
+
transform: scale(1);
|
|
210
|
+
-webkit-transform: scale(1);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
</style>
|