cbvirtua 1.0.116 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -5
- package/valid.txt +468 -0
- package/vue3-hash-calendar-main.zip +0 -0
- package/vv.txt +10442 -0
- package/1.zip +0 -0
- package/7.zip +0 -0
- package/888.zip +0 -0
- package/Checkbox Checked-1.png +0 -0
- package/_/345/217/267 (1).svg" +0 -1
- package/_/345/217/267.svg +0 -1
- package/a.png +0 -0
- package/babel-plugin-async-lock-master.zip +0 -0
- package/build-own-react-main.zip +0 -0
- package/check_box.svg +0 -1
- package/check_box_outline_blank.svg +0 -1
- package/checkbox_unchecked.svg +0 -1
- package/floating-vue-main.zip +0 -0
- package/font_2009600_gpzp7pxtnw.zip +0 -0
- package/font_2553510_ciljc7axaw7.woff +0 -0
- package/font_2553510_ciljc7axaw7.woff2 +0 -0
- package/leetcode-javascript-master.zip +0 -0
- package/loginDemo-master.zip +0 -0
- package/mi.txt +0 -374
- package/mitt-main.zip +0 -0
- package/mp-weixin-back-main.zip +0 -0
- package/pdfsss.txt +0 -900
- package/sms-check-code-master.zip +0 -0
- package/sss.txt +0 -2
- package/study-summarize-master.zip +0 -0
- package/tool.txt +0 -19
- package/v-dropdown-menu-master.zip +0 -0
- package/v-track-master/v-track-master/.browserslistrc +0 -3
- package/v-track-master/v-track-master/.eslintignore +0 -3
- package/v-track-master/v-track-master/.eslintrc.js +0 -15
- package/v-track-master/v-track-master/.gitattributes +0 -1
- package/v-track-master/v-track-master/.github/FUNDING.yml +0 -12
- package/v-track-master/v-track-master/.github/workflows/node.js.yml +0 -29
- package/v-track-master/v-track-master/.travis.yml +0 -22
- package/v-track-master/v-track-master/.yarnrc +0 -1
- package/v-track-master/v-track-master/LICENSE +0 -21
- package/v-track-master/v-track-master/README.md +0 -131
- package/v-track-master/v-track-master/babel.config.js +0 -25
- package/v-track-master/v-track-master/build/rollup.config.base.js +0 -14
- package/v-track-master/v-track-master/build/rollup.config.browser.js +0 -21
- package/v-track-master/v-track-master/build/rollup.config.es.js +0 -11
- package/v-track-master/v-track-master/docs/.babelrc +0 -5
- package/v-track-master/v-track-master/docs/App.vue +0 -61
- package/v-track-master/v-track-master/docs/assets/app.scss +0 -197
- package/v-track-master/v-track-master/docs/assets/index.scss +0 -10
- package/v-track-master/v-track-master/docs/assets/mixins.scss +0 -64
- package/v-track-master/v-track-master/docs/assets/normalize.scss +0 -349
- package/v-track-master/v-track-master/docs/components/button.vue +0 -15
- package/v-track-master/v-track-master/docs/components/code-snippet.vue +0 -72
- package/v-track-master/v-track-master/docs/dist/css/app.2e14d2d6.css +0 -4
- package/v-track-master/v-track-master/docs/dist/css/chunk-vendors.c687a9b2.css +0 -1
- package/v-track-master/v-track-master/docs/dist/favicon.ico +0 -0
- package/v-track-master/v-track-master/docs/dist/fonts/element-icons.535877f5.woff +0 -0
- package/v-track-master/v-track-master/docs/dist/fonts/element-icons.732389de.ttf +0 -0
- package/v-track-master/v-track-master/docs/dist/js/app.efe84ade.js +0 -2
- package/v-track-master/v-track-master/docs/dist/js/app.efe84ade.js.map +0 -1
- package/v-track-master/v-track-master/docs/dist/js/chunk-vendors.c94e27ba.js +0 -13
- package/v-track-master/v-track-master/docs/dist/js/chunk-vendors.c94e27ba.js.map +0 -1
- package/v-track-master/v-track-master/docs/index.html +0 -1
- package/v-track-master/v-track-master/docs/main.js +0 -78
- package/v-track-master/v-track-master/docs/pages/block-show.vue +0 -177
- package/v-track-master/v-track-master/docs/pages/custom-events.vue +0 -291
- package/v-track-master/v-track-master/docs/pages/home.vue +0 -269
- package/v-track-master/v-track-master/docs/pages/started.vue +0 -151
- package/v-track-master/v-track-master/docs/pages/track-view.vue +0 -234
- package/v-track-master/v-track-master/docs/tracks/action.js +0 -37
- package/v-track-master/v-track-master/docs/tracks/events.js +0 -140
- package/v-track-master/v-track-master/docs/tracks/index.js +0 -13
- package/v-track-master/v-track-master/docs/utils/date.js +0 -219
- package/v-track-master/v-track-master/docs/utils/dom.js +0 -26
- package/v-track-master/v-track-master/jest.config.js +0 -18
- package/v-track-master/v-track-master/package.json +0 -67
- package/v-track-master/v-track-master/postcss.config.js +0 -5
- package/v-track-master/v-track-master/public/favicon.ico +0 -0
- package/v-track-master/v-track-master/public/index.html +0 -18
- package/v-track-master/v-track-master/src/hooks/index.js +0 -217
- package/v-track-master/v-track-master/src/index.js +0 -79
- package/v-track-master/v-track-master/src/utils/debug.js +0 -13
- package/v-track-master/v-track-master/src/utils/dom.js +0 -73
- package/v-track-master/v-track-master/src/utils/helper.js +0 -122
- package/v-track-master/v-track-master/src/utils/vis-monitor.js +0 -183
- package/v-track-master/v-track-master/tests/helper.js +0 -37
- package/v-track-master/v-track-master/tests/unit/.eslintrc.js +0 -5
- package/v-track-master/v-track-master/tests/unit/track-click-async.spec.js +0 -52
- package/v-track-master/v-track-master/tests/unit/track-click-delay.spec.js +0 -46
- package/v-track-master/v-track-master/tests/unit/track-click-native.spec.js +0 -84
- package/v-track-master/v-track-master/tests/unit/track-click-param.spec.js +0 -55
- package/v-track-master/v-track-master/tests/unit/track-click.spec.js +0 -47
- package/v-track-master/v-track-master/tests/unit/track-custom-event-async.spec.js +0 -61
- package/v-track-master/v-track-master/tests/unit/track-custom-event-delay.spec.js +0 -59
- package/v-track-master/v-track-master/tests/unit/track-custom-event-param.spec.js +0 -68
- package/v-track-master/v-track-master/tests/unit/track-custom-event.spec.js +0 -55
- package/v-track-master/v-track-master/tests/unit/track-show-custom-scroll-once.spec.js +0 -62
- package/v-track-master/v-track-master/tests/unit/track-show-custom-scroll.spec.js +0 -62
- package/v-track-master/v-track-master/tests/unit/track-show-once.spec.js +0 -55
- package/v-track-master/v-track-master/tests/unit/track-show-param.spec.js +0 -51
- package/v-track-master/v-track-master/tests/unit/track-show.spec.js +0 -55
- package/v-track-master/v-track-master/tests/unit/track-view-vif.spec.js +0 -54
- package/v-track-master/v-track-master/tests/unit/track-view-watch-delay.spec.js +0 -63
- package/v-track-master/v-track-master/tests/unit/track-view-watch.spec.js +0 -61
- package/v-track-master/v-track-master/tests/unit/track-view.spec.js +0 -32
- package/v-track-master/v-track-master/vue.config.js +0 -45
- package/v-track-master/v-track-master/yarn.lock +0 -10186
- package/v-track-master.zip +0 -0
- package/vant-weapp-dev.zip +0 -0
- package/vue-autosize-input-master.zip +0 -0
- package/vue-awesome-dropdown-master.zip +0 -0
- package/vue-codemod-main.zip +0 -0
- package/vue-collapsed-main.zip +0 -0
- package/vue-input-code-master.zip +0 -0
- package/vue-jscodeshift-adapter-master.zip +0 -0
- package/vue-verify-master.zip +0 -0
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/.hbuilderx/launch.json +0 -11
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/App.vue +0 -17
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/README.md +0 -13
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/components/xiaolu-tree/code.js +0 -408
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/components/xiaolu-tree/css/icon.css +0 -342
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/components/xiaolu-tree/css/style.scss +0 -119
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/components/xiaolu-tree/search/index.vue +0 -66
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/components/xiaolu-tree/tree.vue +0 -70
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/main.js +0 -11
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/manifest.json +0 -78
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/pages/chooseUser/chooseUser.vue +0 -69
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/pages/chooseUser/data.js +0 -96
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/pages/index/index.vue +0 -122
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/pages.json +0 -25
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/changelog.md +0 -80
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/i18n/en.json +0 -7
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/i18n/index.js +0 -8
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json +0 -7
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json +0 -7
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/keypress.js +0 -45
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/popup.js +0 -26
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/uni-popup.uvue +0 -90
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup/uni-popup.vue +0 -496
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup-dialog/keypress.js +0 -45
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue +0 -313
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue +0 -143
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue +0 -187
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/package.json +0 -87
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-popup/readme.md +0 -17
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/changelog.md +0 -8
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/index.scss +0 -1
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/package.json +0 -82
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/readme.md +0 -4
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/index.scss +0 -7
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_border.scss +0 -3
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_color.scss +0 -66
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_radius.scss +0 -55
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_space.scss +0 -56
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_styles.scss +0 -167
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_text.scss +0 -24
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/setting/_variables.scss +0 -146
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/styles/tools/functions.scss +0 -19
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/theme.scss +0 -31
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-scss/variables.scss +0 -62
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-transition/changelog.md +0 -22
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-transition/components/uni-transition/createAnimation.js +0 -131
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-transition/components/uni-transition/uni-transition.vue +0 -286
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-transition/package.json +0 -84
- package/xiaolu-tree-plugin-main/xiaolu-tree-plugin-main/uni_modules/uni-transition/readme.md +0 -11
- package//346/224/266/347/274/251/344/270/212/347/256/255/345/244/264 (1).svg" +0 -1
- package//346/224/266/347/274/251/344/270/212/347/256/255/345/244/264.svg +0 -1
- package//346/224/266/347/274/251/344/270/213/347/256/255/345/244/264.svg +0 -1
- package//346/224/266/347/274/251/347/256/255/345/244/264.svg +0 -1
- package//346/226/260/345/273/272 /346/226/207/346/234/254/346/226/207/346/241/243 (2).txt" +0 -90
- package//346/226/260/345/273/272 /346/226/207/346/234/254/346/226/207/346/241/243 (3).txt" +0 -142
- package//346/226/260/345/273/272 /346/226/207/346/234/254/346/226/207/346/241/243 (3).zip +0 -0
- package//346/226/260/345/273/272 /346/226/207/346/234/254/346/226/207/346/241/243.txt" +0 -59
- package//351/227/256/345/217/267.svg +0 -1
|
@@ -1,496 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view v-if="showPopup" class="uni-popup" :class="[popupstyle, isDesktop ? 'fixforpc-z-index' : '']">
|
|
3
|
-
<view @touchstart="touchstart">
|
|
4
|
-
<uni-transition key="1" v-if="maskShow" name="mask" mode-class="fade" :styles="maskClass"
|
|
5
|
-
:duration="duration" :show="showTrans" @click="onTap" />
|
|
6
|
-
<uni-transition key="2" :mode-class="ani" name="content" :styles="transClass" :duration="duration"
|
|
7
|
-
:show="showTrans" @click="onTap">
|
|
8
|
-
<view class="uni-popup__wrapper" :style="getStyles" :class="[popupstyle]" @click="clear">
|
|
9
|
-
<slot />
|
|
10
|
-
</view>
|
|
11
|
-
</uni-transition>
|
|
12
|
-
</view>
|
|
13
|
-
<!-- #ifdef H5 -->
|
|
14
|
-
<keypress v-if="maskShow" @esc="onTap" />
|
|
15
|
-
<!-- #endif -->
|
|
16
|
-
</view>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<script>
|
|
20
|
-
// #ifdef H5
|
|
21
|
-
import keypress from './keypress.js'
|
|
22
|
-
// #endif
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* PopUp 弹出层
|
|
26
|
-
* @description 弹出层组件,为了解决遮罩弹层的问题
|
|
27
|
-
* @tutorial https://ext.dcloud.net.cn/plugin?id=329
|
|
28
|
-
* @property {String} type = [top|center|bottom|left|right|message|dialog|share] 弹出方式
|
|
29
|
-
* @value top 顶部弹出
|
|
30
|
-
* @value center 中间弹出
|
|
31
|
-
* @value bottom 底部弹出
|
|
32
|
-
* @value left 左侧弹出
|
|
33
|
-
* @value right 右侧弹出
|
|
34
|
-
* @value message 消息提示
|
|
35
|
-
* @value dialog 对话框
|
|
36
|
-
* @value share 底部分享示例
|
|
37
|
-
* @property {Boolean} animation = [true|false] 是否开启动画
|
|
38
|
-
* @property {Boolean} maskClick = [true|false] 蒙版点击是否关闭弹窗(废弃)
|
|
39
|
-
* @property {Boolean} isMaskClick = [true|false] 蒙版点击是否关闭弹窗
|
|
40
|
-
* @property {String} backgroundColor 主窗口背景色
|
|
41
|
-
* @property {String} maskBackgroundColor 蒙版颜色
|
|
42
|
-
* @property {Boolean} safeArea 是否适配底部安全区
|
|
43
|
-
* @event {Function} change 打开关闭弹窗触发,e={show: false}
|
|
44
|
-
* @event {Function} maskClick 点击遮罩触发
|
|
45
|
-
*/
|
|
46
|
-
|
|
47
|
-
export default {
|
|
48
|
-
name: 'uniPopup',
|
|
49
|
-
components: {
|
|
50
|
-
// #ifdef H5
|
|
51
|
-
keypress
|
|
52
|
-
// #endif
|
|
53
|
-
},
|
|
54
|
-
emits: ['change', 'maskClick'],
|
|
55
|
-
props: {
|
|
56
|
-
// 开启动画
|
|
57
|
-
animation: {
|
|
58
|
-
type: Boolean,
|
|
59
|
-
default: true
|
|
60
|
-
},
|
|
61
|
-
// 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
|
|
62
|
-
// message: 消息提示 ; dialog : 对话框
|
|
63
|
-
type: {
|
|
64
|
-
type: String,
|
|
65
|
-
default: 'center'
|
|
66
|
-
},
|
|
67
|
-
// maskClick
|
|
68
|
-
isMaskClick: {
|
|
69
|
-
type: Boolean,
|
|
70
|
-
default: null
|
|
71
|
-
},
|
|
72
|
-
// TODO 2 个版本后废弃属性 ,使用 isMaskClick
|
|
73
|
-
maskClick: {
|
|
74
|
-
type: Boolean,
|
|
75
|
-
default: null
|
|
76
|
-
},
|
|
77
|
-
backgroundColor: {
|
|
78
|
-
type: String,
|
|
79
|
-
default: 'none'
|
|
80
|
-
},
|
|
81
|
-
safeArea: {
|
|
82
|
-
type: Boolean,
|
|
83
|
-
default: true
|
|
84
|
-
},
|
|
85
|
-
maskBackgroundColor: {
|
|
86
|
-
type: String,
|
|
87
|
-
default: 'rgba(0, 0, 0, 0.4)'
|
|
88
|
-
},
|
|
89
|
-
borderRadius:{
|
|
90
|
-
type: String,
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
watch: {
|
|
95
|
-
/**
|
|
96
|
-
* 监听type类型
|
|
97
|
-
*/
|
|
98
|
-
type: {
|
|
99
|
-
handler: function(type) {
|
|
100
|
-
if (!this.config[type]) return
|
|
101
|
-
this[this.config[type]](true)
|
|
102
|
-
},
|
|
103
|
-
immediate: true
|
|
104
|
-
},
|
|
105
|
-
isDesktop: {
|
|
106
|
-
handler: function(newVal) {
|
|
107
|
-
if (!this.config[newVal]) return
|
|
108
|
-
this[this.config[this.type]](true)
|
|
109
|
-
},
|
|
110
|
-
immediate: true
|
|
111
|
-
},
|
|
112
|
-
/**
|
|
113
|
-
* 监听遮罩是否可点击
|
|
114
|
-
* @param {Object} val
|
|
115
|
-
*/
|
|
116
|
-
maskClick: {
|
|
117
|
-
handler: function(val) {
|
|
118
|
-
this.mkclick = val
|
|
119
|
-
},
|
|
120
|
-
immediate: true
|
|
121
|
-
},
|
|
122
|
-
isMaskClick: {
|
|
123
|
-
handler: function(val) {
|
|
124
|
-
this.mkclick = val
|
|
125
|
-
},
|
|
126
|
-
immediate: true
|
|
127
|
-
},
|
|
128
|
-
// H5 下禁止底部滚动
|
|
129
|
-
showPopup(show) {
|
|
130
|
-
// #ifdef H5
|
|
131
|
-
// fix by mehaotian 处理 h5 滚动穿透的问题
|
|
132
|
-
document.getElementsByTagName('body')[0].style.overflow = show ? 'hidden' : 'visible'
|
|
133
|
-
// #endif
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
data() {
|
|
137
|
-
return {
|
|
138
|
-
duration: 300,
|
|
139
|
-
ani: [],
|
|
140
|
-
showPopup: false,
|
|
141
|
-
showTrans: false,
|
|
142
|
-
popupWidth: 0,
|
|
143
|
-
popupHeight: 0,
|
|
144
|
-
config: {
|
|
145
|
-
top: 'top',
|
|
146
|
-
bottom: 'bottom',
|
|
147
|
-
center: 'center',
|
|
148
|
-
left: 'left',
|
|
149
|
-
right: 'right',
|
|
150
|
-
message: 'top',
|
|
151
|
-
dialog: 'center',
|
|
152
|
-
share: 'bottom'
|
|
153
|
-
},
|
|
154
|
-
maskClass: {
|
|
155
|
-
position: 'fixed',
|
|
156
|
-
bottom: 0,
|
|
157
|
-
top: 0,
|
|
158
|
-
left: 0,
|
|
159
|
-
right: 0,
|
|
160
|
-
backgroundColor: 'rgba(0, 0, 0, 0.4)'
|
|
161
|
-
},
|
|
162
|
-
transClass: {
|
|
163
|
-
backgroundColor: 'transparent',
|
|
164
|
-
borderRadius: this.borderRadius || "0",
|
|
165
|
-
position: 'fixed',
|
|
166
|
-
left: 0,
|
|
167
|
-
right: 0
|
|
168
|
-
},
|
|
169
|
-
maskShow: true,
|
|
170
|
-
mkclick: true,
|
|
171
|
-
popupstyle: 'top'
|
|
172
|
-
}
|
|
173
|
-
},
|
|
174
|
-
computed: {
|
|
175
|
-
getStyles() {
|
|
176
|
-
let res = { backgroundColor: this.bg };
|
|
177
|
-
if (this.borderRadius || "0") {
|
|
178
|
-
res = Object.assign(res, { borderRadius: this.borderRadius })
|
|
179
|
-
}
|
|
180
|
-
return res;
|
|
181
|
-
},
|
|
182
|
-
isDesktop() {
|
|
183
|
-
return this.popupWidth >= 500 && this.popupHeight >= 500
|
|
184
|
-
},
|
|
185
|
-
bg() {
|
|
186
|
-
if (this.backgroundColor === '' || this.backgroundColor === 'none') {
|
|
187
|
-
return 'transparent'
|
|
188
|
-
}
|
|
189
|
-
return this.backgroundColor
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
mounted() {
|
|
193
|
-
const fixSize = () => {
|
|
194
|
-
const {
|
|
195
|
-
windowWidth,
|
|
196
|
-
windowHeight,
|
|
197
|
-
windowTop,
|
|
198
|
-
safeArea,
|
|
199
|
-
screenHeight,
|
|
200
|
-
safeAreaInsets
|
|
201
|
-
} = uni.getSystemInfoSync()
|
|
202
|
-
this.popupWidth = windowWidth
|
|
203
|
-
this.popupHeight = windowHeight + (windowTop || 0)
|
|
204
|
-
// TODO fix by mehaotian 是否适配底部安全区 ,目前微信ios 、和 app ios 计算有差异,需要框架修复
|
|
205
|
-
if (safeArea && this.safeArea) {
|
|
206
|
-
// #ifdef MP-WEIXIN
|
|
207
|
-
this.safeAreaInsets = screenHeight - safeArea.bottom
|
|
208
|
-
// #endif
|
|
209
|
-
// #ifndef MP-WEIXIN
|
|
210
|
-
this.safeAreaInsets = safeAreaInsets.bottom
|
|
211
|
-
// #endif
|
|
212
|
-
} else {
|
|
213
|
-
this.safeAreaInsets = 0
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
fixSize()
|
|
217
|
-
// #ifdef H5
|
|
218
|
-
// window.addEventListener('resize', fixSize)
|
|
219
|
-
// this.$once('hook:beforeDestroy', () => {
|
|
220
|
-
// window.removeEventListener('resize', fixSize)
|
|
221
|
-
// })
|
|
222
|
-
// #endif
|
|
223
|
-
},
|
|
224
|
-
// #ifndef VUE3
|
|
225
|
-
// TODO vue2
|
|
226
|
-
destroyed() {
|
|
227
|
-
this.setH5Visible()
|
|
228
|
-
},
|
|
229
|
-
// #endif
|
|
230
|
-
// #ifdef VUE3
|
|
231
|
-
// TODO vue3
|
|
232
|
-
unmounted() {
|
|
233
|
-
this.setH5Visible()
|
|
234
|
-
},
|
|
235
|
-
// #endif
|
|
236
|
-
created() {
|
|
237
|
-
// this.mkclick = this.isMaskClick || this.maskClick
|
|
238
|
-
if (this.isMaskClick === null && this.maskClick === null) {
|
|
239
|
-
this.mkclick = true
|
|
240
|
-
} else {
|
|
241
|
-
this.mkclick = this.isMaskClick !== null ? this.isMaskClick : this.maskClick
|
|
242
|
-
}
|
|
243
|
-
if (this.animation) {
|
|
244
|
-
this.duration = 300
|
|
245
|
-
} else {
|
|
246
|
-
this.duration = 0
|
|
247
|
-
}
|
|
248
|
-
// TODO 处理 message 组件生命周期异常的问题
|
|
249
|
-
this.messageChild = null
|
|
250
|
-
// TODO 解决头条冒泡的问题
|
|
251
|
-
this.clearPropagation = false
|
|
252
|
-
this.maskClass.backgroundColor = this.maskBackgroundColor
|
|
253
|
-
},
|
|
254
|
-
methods: {
|
|
255
|
-
setH5Visible() {
|
|
256
|
-
// #ifdef H5
|
|
257
|
-
// fix by mehaotian 处理 h5 滚动穿透的问题
|
|
258
|
-
document.getElementsByTagName('body')[0].style.overflow = 'visible'
|
|
259
|
-
// #endif
|
|
260
|
-
},
|
|
261
|
-
/**
|
|
262
|
-
* 公用方法,不显示遮罩层
|
|
263
|
-
*/
|
|
264
|
-
closeMask() {
|
|
265
|
-
this.maskShow = false
|
|
266
|
-
},
|
|
267
|
-
/**
|
|
268
|
-
* 公用方法,遮罩层禁止点击
|
|
269
|
-
*/
|
|
270
|
-
disableMask() {
|
|
271
|
-
this.mkclick = false
|
|
272
|
-
},
|
|
273
|
-
// TODO nvue 取消冒泡
|
|
274
|
-
clear(e) {
|
|
275
|
-
// #ifndef APP-NVUE
|
|
276
|
-
e.stopPropagation()
|
|
277
|
-
// #endif
|
|
278
|
-
this.clearPropagation = true
|
|
279
|
-
},
|
|
280
|
-
|
|
281
|
-
open(direction) {
|
|
282
|
-
// fix by mehaotian 处理快速打开关闭的情况
|
|
283
|
-
if (this.showPopup) {
|
|
284
|
-
return
|
|
285
|
-
}
|
|
286
|
-
let innerType = ['top', 'center', 'bottom', 'left', 'right', 'message', 'dialog', 'share']
|
|
287
|
-
if (!(direction && innerType.indexOf(direction) !== -1)) {
|
|
288
|
-
direction = this.type
|
|
289
|
-
}
|
|
290
|
-
if (!this.config[direction]) {
|
|
291
|
-
console.error('缺少类型:', direction)
|
|
292
|
-
return
|
|
293
|
-
}
|
|
294
|
-
this[this.config[direction]]()
|
|
295
|
-
this.$emit('change', {
|
|
296
|
-
show: true,
|
|
297
|
-
type: direction
|
|
298
|
-
})
|
|
299
|
-
},
|
|
300
|
-
close(type) {
|
|
301
|
-
this.showTrans = false
|
|
302
|
-
this.$emit('change', {
|
|
303
|
-
show: false,
|
|
304
|
-
type: this.type
|
|
305
|
-
})
|
|
306
|
-
clearTimeout(this.timer)
|
|
307
|
-
// // 自定义关闭事件
|
|
308
|
-
// this.customOpen && this.customClose()
|
|
309
|
-
this.timer = setTimeout(() => {
|
|
310
|
-
this.showPopup = false
|
|
311
|
-
}, 300)
|
|
312
|
-
},
|
|
313
|
-
// TODO 处理冒泡事件,头条的冒泡事件有问题 ,先这样兼容
|
|
314
|
-
touchstart() {
|
|
315
|
-
this.clearPropagation = false
|
|
316
|
-
},
|
|
317
|
-
|
|
318
|
-
onTap() {
|
|
319
|
-
if (this.clearPropagation) {
|
|
320
|
-
// fix by mehaotian 兼容 nvue
|
|
321
|
-
this.clearPropagation = false
|
|
322
|
-
return
|
|
323
|
-
}
|
|
324
|
-
this.$emit('maskClick')
|
|
325
|
-
if (!this.mkclick) return
|
|
326
|
-
this.close()
|
|
327
|
-
},
|
|
328
|
-
/**
|
|
329
|
-
* 顶部弹出样式处理
|
|
330
|
-
*/
|
|
331
|
-
top(type) {
|
|
332
|
-
this.popupstyle = this.isDesktop ? 'fixforpc-top' : 'top'
|
|
333
|
-
this.ani = ['slide-top']
|
|
334
|
-
this.transClass = {
|
|
335
|
-
position: 'fixed',
|
|
336
|
-
left: 0,
|
|
337
|
-
right: 0,
|
|
338
|
-
backgroundColor: this.bg,
|
|
339
|
-
borderRadius:this.borderRadius || "0"
|
|
340
|
-
}
|
|
341
|
-
// TODO 兼容 type 属性 ,后续会废弃
|
|
342
|
-
if (type) return
|
|
343
|
-
this.showPopup = true
|
|
344
|
-
this.showTrans = true
|
|
345
|
-
this.$nextTick(() => {
|
|
346
|
-
if (this.messageChild && this.type === 'message') {
|
|
347
|
-
this.messageChild.timerClose()
|
|
348
|
-
}
|
|
349
|
-
})
|
|
350
|
-
},
|
|
351
|
-
/**
|
|
352
|
-
* 底部弹出样式处理
|
|
353
|
-
*/
|
|
354
|
-
bottom(type) {
|
|
355
|
-
this.popupstyle = 'bottom'
|
|
356
|
-
this.ani = ['slide-bottom']
|
|
357
|
-
this.transClass = {
|
|
358
|
-
position: 'fixed',
|
|
359
|
-
left: 0,
|
|
360
|
-
right: 0,
|
|
361
|
-
bottom: 0,
|
|
362
|
-
paddingBottom: this.safeAreaInsets + 'px',
|
|
363
|
-
backgroundColor: this.bg,
|
|
364
|
-
borderRadius:this.borderRadius || "0",
|
|
365
|
-
}
|
|
366
|
-
// TODO 兼容 type 属性 ,后续会废弃
|
|
367
|
-
if (type) return
|
|
368
|
-
this.showPopup = true
|
|
369
|
-
this.showTrans = true
|
|
370
|
-
},
|
|
371
|
-
/**
|
|
372
|
-
* 中间弹出样式处理
|
|
373
|
-
*/
|
|
374
|
-
center(type) {
|
|
375
|
-
this.popupstyle = 'center'
|
|
376
|
-
//微信小程序下,组合动画会出现文字向上闪动问题,再此做特殊处理
|
|
377
|
-
// #ifdef MP-WEIXIN
|
|
378
|
-
this.ani = ['fade']
|
|
379
|
-
// #endif
|
|
380
|
-
// #ifndef MP-WEIXIN
|
|
381
|
-
this.ani = ['zoom-out', 'fade']
|
|
382
|
-
// #endif
|
|
383
|
-
this.transClass = {
|
|
384
|
-
position: 'fixed',
|
|
385
|
-
/* #ifndef APP-NVUE */
|
|
386
|
-
display: 'flex',
|
|
387
|
-
flexDirection: 'column',
|
|
388
|
-
/* #endif */
|
|
389
|
-
bottom: 0,
|
|
390
|
-
left: 0,
|
|
391
|
-
right: 0,
|
|
392
|
-
top: 0,
|
|
393
|
-
justifyContent: 'center',
|
|
394
|
-
alignItems: 'center',
|
|
395
|
-
borderRadius:this.borderRadius || "0"
|
|
396
|
-
}
|
|
397
|
-
// TODO 兼容 type 属性 ,后续会废弃
|
|
398
|
-
if (type) return
|
|
399
|
-
this.showPopup = true
|
|
400
|
-
this.showTrans = true
|
|
401
|
-
},
|
|
402
|
-
left(type) {
|
|
403
|
-
this.popupstyle = 'left'
|
|
404
|
-
this.ani = ['slide-left']
|
|
405
|
-
this.transClass = {
|
|
406
|
-
position: 'fixed',
|
|
407
|
-
left: 0,
|
|
408
|
-
bottom: 0,
|
|
409
|
-
top: 0,
|
|
410
|
-
backgroundColor: this.bg,
|
|
411
|
-
borderRadius:this.borderRadius || "0",
|
|
412
|
-
/* #ifndef APP-NVUE */
|
|
413
|
-
display: 'flex',
|
|
414
|
-
flexDirection: 'column'
|
|
415
|
-
/* #endif */
|
|
416
|
-
}
|
|
417
|
-
// TODO 兼容 type 属性 ,后续会废弃
|
|
418
|
-
if (type) return
|
|
419
|
-
this.showPopup = true
|
|
420
|
-
this.showTrans = true
|
|
421
|
-
},
|
|
422
|
-
right(type) {
|
|
423
|
-
this.popupstyle = 'right'
|
|
424
|
-
this.ani = ['slide-right']
|
|
425
|
-
this.transClass = {
|
|
426
|
-
position: 'fixed',
|
|
427
|
-
bottom: 0,
|
|
428
|
-
right: 0,
|
|
429
|
-
top: 0,
|
|
430
|
-
backgroundColor: this.bg,
|
|
431
|
-
borderRadius:this.borderRadius || "0",
|
|
432
|
-
/* #ifndef APP-NVUE */
|
|
433
|
-
display: 'flex',
|
|
434
|
-
flexDirection: 'column'
|
|
435
|
-
/* #endif */
|
|
436
|
-
}
|
|
437
|
-
// TODO 兼容 type 属性 ,后续会废弃
|
|
438
|
-
if (type) return
|
|
439
|
-
this.showPopup = true
|
|
440
|
-
this.showTrans = true
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
</script>
|
|
445
|
-
<style lang="scss">
|
|
446
|
-
.uni-popup {
|
|
447
|
-
position: fixed;
|
|
448
|
-
/* #ifndef APP-NVUE */
|
|
449
|
-
z-index: 99;
|
|
450
|
-
|
|
451
|
-
/* #endif */
|
|
452
|
-
&.top,
|
|
453
|
-
&.left,
|
|
454
|
-
&.right {
|
|
455
|
-
/* #ifdef H5 */
|
|
456
|
-
top: var(--window-top);
|
|
457
|
-
/* #endif */
|
|
458
|
-
/* #ifndef H5 */
|
|
459
|
-
top: 0;
|
|
460
|
-
/* #endif */
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
.uni-popup__wrapper {
|
|
464
|
-
/* #ifndef APP-NVUE */
|
|
465
|
-
display: block;
|
|
466
|
-
/* #endif */
|
|
467
|
-
position: relative;
|
|
468
|
-
|
|
469
|
-
/* iphonex 等安全区设置,底部安全区适配 */
|
|
470
|
-
/* #ifndef APP-NVUE */
|
|
471
|
-
// padding-bottom: constant(safe-area-inset-bottom);
|
|
472
|
-
// padding-bottom: env(safe-area-inset-bottom);
|
|
473
|
-
/* #endif */
|
|
474
|
-
&.left,
|
|
475
|
-
&.right {
|
|
476
|
-
/* #ifdef H5 */
|
|
477
|
-
padding-top: var(--window-top);
|
|
478
|
-
/* #endif */
|
|
479
|
-
/* #ifndef H5 */
|
|
480
|
-
padding-top: 0;
|
|
481
|
-
/* #endif */
|
|
482
|
-
flex: 1;
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
.fixforpc-z-index {
|
|
488
|
-
/* #ifndef APP-NVUE */
|
|
489
|
-
z-index: 999;
|
|
490
|
-
/* #endif */
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
.fixforpc-top {
|
|
494
|
-
top: 0;
|
|
495
|
-
}
|
|
496
|
-
</style>
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// #ifdef H5
|
|
2
|
-
export default {
|
|
3
|
-
name: 'Keypress',
|
|
4
|
-
props: {
|
|
5
|
-
disable: {
|
|
6
|
-
type: Boolean,
|
|
7
|
-
default: false
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
|
-
mounted () {
|
|
11
|
-
const keyNames = {
|
|
12
|
-
esc: ['Esc', 'Escape'],
|
|
13
|
-
tab: 'Tab',
|
|
14
|
-
enter: 'Enter',
|
|
15
|
-
space: [' ', 'Spacebar'],
|
|
16
|
-
up: ['Up', 'ArrowUp'],
|
|
17
|
-
left: ['Left', 'ArrowLeft'],
|
|
18
|
-
right: ['Right', 'ArrowRight'],
|
|
19
|
-
down: ['Down', 'ArrowDown'],
|
|
20
|
-
delete: ['Backspace', 'Delete', 'Del']
|
|
21
|
-
}
|
|
22
|
-
const listener = ($event) => {
|
|
23
|
-
if (this.disable) {
|
|
24
|
-
return
|
|
25
|
-
}
|
|
26
|
-
const keyName = Object.keys(keyNames).find(key => {
|
|
27
|
-
const keyName = $event.key
|
|
28
|
-
const value = keyNames[key]
|
|
29
|
-
return value === keyName || (Array.isArray(value) && value.includes(keyName))
|
|
30
|
-
})
|
|
31
|
-
if (keyName) {
|
|
32
|
-
// 避免和其他按键事件冲突
|
|
33
|
-
setTimeout(() => {
|
|
34
|
-
this.$emit(keyName, {})
|
|
35
|
-
}, 0)
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
document.addEventListener('keyup', listener)
|
|
39
|
-
this.$once('hook:beforeDestroy', () => {
|
|
40
|
-
document.removeEventListener('keyup', listener)
|
|
41
|
-
})
|
|
42
|
-
},
|
|
43
|
-
render: () => {}
|
|
44
|
-
}
|
|
45
|
-
// #endif
|