@10yun/cv-mobile-ui 0.4.6 → 0.4.8
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 +1 -1
- package/plugins/MessageBox.js +87 -0
- package/plugins/MessageTip.js +56 -0
- package/plugins/jumps.js +0 -7
- package/plugins/request.js +7 -5
- package/plugins/storage.js +89 -80
- package/plugins/storage2.js +181 -0
- package/plugins/uni-upgrade.js +19 -10
- package/plugins/uni-upgrade3.js +5 -5
- package/ui-cv/cv-button/cv-button.vue +5 -12
- package/ui-cv/cv-checkbox-group/cv-checkbox-group.vue +9 -13
- package/ui-cv/cv-lists-swiper/cv-lists-swiper.vue +0 -2
- package/ui-cv/cv-picker1/cv-picker1.vue +2 -17
- package/ui-cv/cv-picker2/cv-picker2.vue +2 -17
- package/ui-cv/cv-picker3/cv-picker3.vue +2 -17
- package/ui-cv/cv-radio-group/cv-radio-group.vue +30 -42
- package/ui-cv/cv-tab-lists/cv-tab-lists.vue +1 -1
- package/ui-uni/uni-drawer/keypress.js +14 -14
- package/ui-uni/uni-drawer/uni-drawer.vue +172 -165
- package/ui-uni/uni-popup/keypress.js +14 -14
- package/ui-uni/uni-popup/popup.js +23 -26
- package/ui-uni/uni-popup/uni-popup.vue +411 -394
- package/plugins/message.js +0 -76
- package/plugins/uni-im.js +0 -31
- package/ui-cv/cv-info/cv-info.vue +0 -55
|
@@ -1,178 +1,185 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
<view v-if="visibleSync" :class="{ 'uni-drawer--visible': showDrawer }" class="uni-drawer" @touchmove.stop.prevent="clear">
|
|
3
|
+
<view class="uni-drawer__mask" :class="{ 'uni-drawer__mask--visible': showDrawer && mask }" @tap="close('mask')" />
|
|
4
|
+
<view
|
|
5
|
+
class="uni-drawer__content"
|
|
6
|
+
:class="{ 'uni-drawer--right': rightMode, 'uni-drawer--left': !rightMode, 'uni-drawer__content--visible': showDrawer }"
|
|
7
|
+
:style="{ width: drawerWidth + 'px' }"
|
|
8
|
+
>
|
|
9
|
+
<slot />
|
|
10
|
+
</view>
|
|
11
|
+
<!-- #ifdef H5 -->
|
|
12
|
+
<keypress @esc="close('mask')" />
|
|
13
|
+
<!-- #endif -->
|
|
14
|
+
</view>
|
|
11
15
|
</template>
|
|
12
16
|
|
|
13
17
|
<script>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
18
|
+
// #ifdef H5
|
|
19
|
+
import keypress from './keypress.js';
|
|
20
|
+
// #endif
|
|
21
|
+
/**
|
|
22
|
+
* Drawer 抽屉
|
|
23
|
+
* @description 抽屉侧滑菜单
|
|
24
|
+
* @tutorial https://ext.dcloud.net.cn/plugin?id=26
|
|
25
|
+
* @property {Boolean} mask = [true | false] 是否显示遮罩
|
|
26
|
+
* @property {Boolean} maskClick = [true | false] 点击遮罩是否关闭
|
|
27
|
+
* @property {Boolean} mode = [left | right] Drawer 滑出位置
|
|
28
|
+
* @value left 从左侧滑出
|
|
29
|
+
* @value right 从右侧侧滑出
|
|
30
|
+
* @property {Number} width 抽屉的宽度 ,仅 vue 页面生效
|
|
31
|
+
* @event {Function} close 组件关闭时触发事件
|
|
32
|
+
*/
|
|
33
|
+
export default {
|
|
34
|
+
name: 'UniDrawer',
|
|
35
|
+
components: {
|
|
36
|
+
// #ifdef H5
|
|
37
|
+
keypress
|
|
38
|
+
// #endif
|
|
39
|
+
},
|
|
40
|
+
emits: ['change'],
|
|
41
|
+
props: {
|
|
42
|
+
/**
|
|
43
|
+
* 显示模式(左、右),只在初始化生效
|
|
44
|
+
*/
|
|
45
|
+
mode: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: ''
|
|
48
|
+
},
|
|
49
|
+
/**
|
|
50
|
+
* 蒙层显示状态
|
|
51
|
+
*/
|
|
52
|
+
mask: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: true
|
|
55
|
+
},
|
|
56
|
+
/**
|
|
57
|
+
* 遮罩是否可点击关闭
|
|
58
|
+
*/
|
|
59
|
+
maskClick: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: true
|
|
62
|
+
},
|
|
63
|
+
/**
|
|
64
|
+
* 抽屉宽度
|
|
65
|
+
*/
|
|
66
|
+
width: {
|
|
67
|
+
type: Number,
|
|
68
|
+
default: 220
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
data() {
|
|
72
|
+
return {
|
|
73
|
+
visibleSync: false,
|
|
74
|
+
showDrawer: false,
|
|
75
|
+
rightMode: false,
|
|
76
|
+
watchTimer: null,
|
|
77
|
+
drawerWidth: 220
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
created() {
|
|
81
|
+
// #ifndef APP-NVUE
|
|
82
|
+
this.drawerWidth = this.width;
|
|
83
|
+
// #endif
|
|
84
|
+
this.rightMode = this.mode === 'right';
|
|
85
|
+
},
|
|
86
|
+
methods: {
|
|
87
|
+
clear() {},
|
|
88
|
+
close(type) {
|
|
89
|
+
// fixed by mehaotian 抽屉尚未完全关闭或遮罩禁止点击时不触发以下逻辑
|
|
90
|
+
if ((type === 'mask' && !this.maskClick) || !this.visibleSync) return;
|
|
91
|
+
this._change('showDrawer', 'visibleSync', false);
|
|
92
|
+
},
|
|
93
|
+
open() {
|
|
94
|
+
// fixed by mehaotian 处理重复点击打开的事件
|
|
95
|
+
if (this.visibleSync) return;
|
|
96
|
+
this._change('visibleSync', 'showDrawer', true);
|
|
97
|
+
},
|
|
98
|
+
_change(param1, param2, status) {
|
|
99
|
+
this[param1] = status;
|
|
100
|
+
if (this.watchTimer) {
|
|
101
|
+
clearTimeout(this.watchTimer);
|
|
102
|
+
}
|
|
103
|
+
this.watchTimer = setTimeout(
|
|
104
|
+
() => {
|
|
105
|
+
this[param2] = status;
|
|
106
|
+
this.$emit('change', status);
|
|
107
|
+
},
|
|
108
|
+
status ? 50 : 300
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
106
113
|
</script>
|
|
107
114
|
|
|
108
115
|
<style scoped>
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
116
|
+
.uni-drawer {
|
|
117
|
+
/* #ifndef APP-NVUE */
|
|
118
|
+
display: block;
|
|
119
|
+
/* #endif */
|
|
120
|
+
position: fixed;
|
|
121
|
+
top: 0;
|
|
122
|
+
left: 0;
|
|
123
|
+
right: 0;
|
|
124
|
+
bottom: 0;
|
|
125
|
+
overflow: hidden;
|
|
126
|
+
z-index: 999;
|
|
127
|
+
}
|
|
121
128
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
.uni-drawer__content {
|
|
130
|
+
/* #ifndef APP-NVUE */
|
|
131
|
+
display: block;
|
|
132
|
+
/* #endif */
|
|
133
|
+
position: absolute;
|
|
134
|
+
top: 0;
|
|
135
|
+
width: 220px;
|
|
136
|
+
bottom: 0;
|
|
137
|
+
background-color: #ffffff;
|
|
138
|
+
transition: transform 0.3s ease;
|
|
139
|
+
}
|
|
133
140
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
.uni-drawer--left {
|
|
142
|
+
left: 0;
|
|
143
|
+
/* #ifdef APP-NVUE */
|
|
144
|
+
transform: translateX(-220px);
|
|
145
|
+
/* #endif */
|
|
146
|
+
/* #ifndef APP-NVUE */
|
|
147
|
+
transform: translateX(-100%);
|
|
148
|
+
/* #endif */
|
|
149
|
+
}
|
|
143
150
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
.uni-drawer--right {
|
|
152
|
+
right: 0;
|
|
153
|
+
/* #ifdef APP-NVUE */
|
|
154
|
+
transform: translateX(220px);
|
|
155
|
+
/* #endif */
|
|
156
|
+
/* #ifndef APP-NVUE */
|
|
157
|
+
transform: translateX(100%);
|
|
158
|
+
/* #endif */
|
|
159
|
+
}
|
|
153
160
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
161
|
+
.uni-drawer__content--visible {
|
|
162
|
+
transform: translateX(0px);
|
|
163
|
+
}
|
|
157
164
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
165
|
+
.uni-drawer__mask {
|
|
166
|
+
/* #ifndef APP-NVUE */
|
|
167
|
+
display: block;
|
|
168
|
+
/* #endif */
|
|
169
|
+
opacity: 0;
|
|
170
|
+
position: absolute;
|
|
171
|
+
top: 0;
|
|
172
|
+
left: 0;
|
|
173
|
+
bottom: 0;
|
|
174
|
+
right: 0;
|
|
175
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
176
|
+
transition: opacity 0.3s;
|
|
177
|
+
}
|
|
171
178
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
</style>
|
|
179
|
+
.uni-drawer__mask--visible {
|
|
180
|
+
/* #ifndef APP-NVUE */
|
|
181
|
+
display: block;
|
|
182
|
+
/* #endif */
|
|
183
|
+
opacity: 1;
|
|
184
|
+
}
|
|
185
|
+
</style>
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
default: false
|
|
8
8
|
}
|
|
9
9
|
},
|
|
10
|
-
mounted
|
|
10
|
+
mounted() {
|
|
11
11
|
const keyNames = {
|
|
12
12
|
esc: ['Esc', 'Escape'],
|
|
13
13
|
tab: 'Tab',
|
|
@@ -18,28 +18,28 @@ export default {
|
|
|
18
18
|
right: ['Right', 'ArrowRight'],
|
|
19
19
|
down: ['Down', 'ArrowDown'],
|
|
20
20
|
delete: ['Backspace', 'Delete', 'Del']
|
|
21
|
-
}
|
|
21
|
+
};
|
|
22
22
|
const listener = ($event) => {
|
|
23
23
|
if (this.disable) {
|
|
24
|
-
return
|
|
24
|
+
return;
|
|
25
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
|
-
})
|
|
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
31
|
if (keyName) {
|
|
32
32
|
// 避免和其他按键事件冲突
|
|
33
33
|
setTimeout(() => {
|
|
34
|
-
this.$emit(keyName, {})
|
|
35
|
-
}, 0)
|
|
34
|
+
this.$emit(keyName, {});
|
|
35
|
+
}, 0);
|
|
36
36
|
}
|
|
37
|
-
}
|
|
38
|
-
document.addEventListener('keyup', listener)
|
|
37
|
+
};
|
|
38
|
+
document.addEventListener('keyup', listener);
|
|
39
39
|
// this.$once('hook:beforeDestroy', () => {
|
|
40
40
|
// document.removeEventListener('keyup', listener)
|
|
41
41
|
// })
|
|
42
42
|
},
|
|
43
|
-
|
|
44
|
-
}
|
|
43
|
+
render: () => {}
|
|
44
|
+
};
|
|
45
45
|
// #endif
|
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
}
|
|
26
|
-
}
|
|
1
|
+
export default {
|
|
2
|
+
data() {
|
|
3
|
+
return {};
|
|
4
|
+
},
|
|
5
|
+
created() {
|
|
6
|
+
this.popup = this.getParent();
|
|
7
|
+
},
|
|
8
|
+
methods: {
|
|
9
|
+
/**
|
|
10
|
+
* 获取父元素实例
|
|
11
|
+
*/
|
|
12
|
+
getParent(name = 'uniPopup') {
|
|
13
|
+
let parent = this.$parent;
|
|
14
|
+
let parentName = parent.$options.name;
|
|
15
|
+
while (parentName !== name) {
|
|
16
|
+
parent = parent.$parent;
|
|
17
|
+
if (!parent) return false;
|
|
18
|
+
parentName = parent.$options.name;
|
|
19
|
+
}
|
|
20
|
+
return parent;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|