@vtj/materials 0.13.16 → 0.13.18
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/dist/assets/antdv/index.umd.js +2 -2
- package/dist/assets/charts/index.umd.js +2 -2
- package/dist/assets/element/index.umd.js +3 -3
- package/dist/assets/icons/index.umd.js +2 -2
- package/dist/assets/ui/index.umd.js +2 -2
- package/dist/assets/uni-h5/index.umd.js +2 -2
- package/dist/assets/uni-ui/index.umd.js +2 -2
- package/dist/assets/vant/index.umd.js +2 -2
- package/dist/deps/@vtj/charts/index.umd.js +2 -2
- package/dist/deps/@vtj/icons/index.umd.js +2 -2
- package/dist/deps/@vtj/ui/index.umd.js +4 -4
- package/dist/deps/@vtj/ui/style.css +1 -1
- package/dist/deps/@vtj/utils/index.umd.js +28 -33
- package/dist/deps/@vueuse/core/index.iife.min.js +1 -1
- package/dist/deps/element-plus/index.css +1 -1
- package/dist/deps/element-plus/index.full.min.js +14 -14
- package/dist/deps/element-plus/zh-cn.js +1 -1
- package/dist/deps/uni-app/index.umd.js +1 -1
- package/dist/deps/uni-h5/index.umd.js +8 -8
- package/dist/deps/uni-h5/style.css +1 -1
- package/dist/deps/uni-h5-vue/index.umd.js +1 -1
- package/dist/deps/uni-ui/index.umd.js +1 -1
- package/dist/deps/uni-ui/style.css +1 -1
- package/dist/deps/vue/vue.global.js +88 -53
- package/dist/deps/vue/vue.global.prod.js +9 -9
- package/package.json +12 -12
- package/src/antdv/image.ts +1 -1
- package/src/element/image.ts +1 -1
- package/src/element/virtualizedTable.ts +6 -6
- package/src/manifest.json +69 -0
- package/src/pages/index.vue +2 -0
- package/src/pages.json +19 -0
- package/src/uni-ui/index.ts +88 -58
- package/src/{uni-ui/lib/uni.scss → uni.scss} +4 -0
- package/src/version.ts +2 -2
- package/src/uni-ui/lib/uni-col/uni-col.vue +0 -324
- package/src/uni-ui/lib/uni-collapse/uni-collapse.vue +0 -153
- package/src/uni-ui/lib/uni-collapse-item/uni-collapse-item.vue +0 -425
- package/src/uni-ui/lib/uni-data-picker/keypress.js +0 -45
- package/src/uni-ui/lib/uni-data-picker/uni-data-picker.vue +0 -604
- package/src/uni-ui/lib/uni-data-pickerview/uni-data-picker.js +0 -622
- package/src/uni-ui/lib/uni-data-pickerview/uni-data-pickerview.css +0 -76
- package/src/uni-ui/lib/uni-data-pickerview/uni-data-pickerview.vue +0 -335
- package/src/uni-ui/lib/uni-data-select/uni-data-select.vue +0 -590
- package/src/uni-ui/lib/uni-datetime-picker/calendar-item.vue +0 -188
- package/src/uni-ui/lib/uni-datetime-picker/calendar.vue +0 -985
- package/src/uni-ui/lib/uni-datetime-picker/i18n/en.json +0 -22
- package/src/uni-ui/lib/uni-datetime-picker/i18n/index.js +0 -8
- package/src/uni-ui/lib/uni-datetime-picker/i18n/zh-Hans.json +0 -22
- package/src/uni-ui/lib/uni-datetime-picker/i18n/zh-Hant.json +0 -22
- package/src/uni-ui/lib/uni-datetime-picker/time-picker.vue +0 -1032
- package/src/uni-ui/lib/uni-datetime-picker/uni-datetime-picker.vue +0 -1230
- package/src/uni-ui/lib/uni-datetime-picker/util.js +0 -448
- package/src/uni-ui/lib/uni-easyinput/common.js +0 -54
- package/src/uni-ui/lib/uni-easyinput/uni-easyinput.vue +0 -790
- package/src/uni-ui/lib/uni-fav/i18n/en.json +0 -4
- package/src/uni-ui/lib/uni-fav/i18n/index.js +0 -8
- package/src/uni-ui/lib/uni-fav/i18n/zh-Hans.json +0 -4
- package/src/uni-ui/lib/uni-fav/i18n/zh-Hant.json +0 -4
- package/src/uni-ui/lib/uni-fav/uni-fav.vue +0 -170
- package/src/uni-ui/lib/uni-file-picker/choose-and-upload-file.js +0 -280
- package/src/uni-ui/lib/uni-file-picker/uni-file-picker.vue +0 -668
- package/src/uni-ui/lib/uni-file-picker/upload-file.vue +0 -325
- package/src/uni-ui/lib/uni-file-picker/upload-image.vue +0 -292
- package/src/uni-ui/lib/uni-file-picker/utils.js +0 -110
- package/src/uni-ui/lib/uni-forms/uni-forms.vue +0 -416
- package/src/uni-ui/lib/uni-forms/utils.js +0 -293
- package/src/uni-ui/lib/uni-forms/validate.js +0 -486
- package/src/uni-ui/lib/uni-forms-item/uni-forms-item.vue +0 -630
- package/src/uni-ui/lib/uni-goods-nav/i18n/en.json +0 -6
- package/src/uni-ui/lib/uni-goods-nav/i18n/index.js +0 -8
- package/src/uni-ui/lib/uni-goods-nav/i18n/zh-Hans.json +0 -6
- package/src/uni-ui/lib/uni-goods-nav/i18n/zh-Hant.json +0 -6
- package/src/uni-ui/lib/uni-goods-nav/uni-goods-nav.vue +0 -231
- package/src/uni-ui/lib/uni-grid/uni-grid.vue +0 -148
- package/src/uni-ui/lib/uni-icons/uni-icons.uvue +0 -91
- package/src/uni-ui/lib/uni-icons/uni-icons.vue +0 -114
- package/src/uni-ui/lib/uni-icons/uniicons.css +0 -664
- package/src/uni-ui/lib/uni-icons/uniicons.ttf +0 -0
- package/src/uni-ui/lib/uni-icons/uniicons_file.ts +0 -664
- package/src/uni-ui/lib/uni-icons/uniicons_file_vue.js +0 -649
- package/src/uni-ui/lib/uni-indexed-list/uni-indexed-list-item.vue +0 -168
- package/src/uni-ui/lib/uni-indexed-list/uni-indexed-list.vue +0 -404
- package/src/uni-ui/lib/uni-list/uni-list.vue +0 -123
- package/src/uni-ui/lib/uni-list/uni-refresh.vue +0 -65
- package/src/uni-ui/lib/uni-list/uni-refresh.wxs +0 -87
- package/src/uni-ui/lib/uni-load-more/i18n/en.json +0 -5
- package/src/uni-ui/lib/uni-load-more/i18n/index.js +0 -8
- package/src/uni-ui/lib/uni-load-more/i18n/zh-Hans.json +0 -5
- package/src/uni-ui/lib/uni-load-more/i18n/zh-Hant.json +0 -5
- package/src/uni-ui/lib/uni-load-more/uni-load-more.vue +0 -456
- package/src/uni-ui/lib/uni-notice-bar/uni-notice-bar.vue +0 -484
- package/src/uni-ui/lib/uni-popup/i18n/en.json +0 -7
- package/src/uni-ui/lib/uni-popup/i18n/index.js +0 -8
- package/src/uni-ui/lib/uni-popup/i18n/zh-Hans.json +0 -7
- package/src/uni-ui/lib/uni-popup/i18n/zh-Hant.json +0 -7
- package/src/uni-ui/lib/uni-popup/keypress.js +0 -45
- package/src/uni-ui/lib/uni-popup/popup.js +0 -26
- package/src/uni-ui/lib/uni-popup/uni-popup.uvue +0 -90
- package/src/uni-ui/lib/uni-popup/uni-popup.vue +0 -552
- package/src/uni-ui/lib/uni-popup-dialog/keypress.js +0 -45
- package/src/uni-ui/lib/uni-popup-dialog/uni-popup-dialog.vue +0 -324
- package/src/uni-ui/lib/uni-popup-message/uni-popup-message.vue +0 -149
- package/src/uni-ui/lib/uni-rate/uni-rate.vue +0 -380
- package/src/uni-ui/lib/uni-row/uni-row.vue +0 -193
- package/src/uni-ui/lib/uni-search-bar/i18n/en.json +0 -4
- package/src/uni-ui/lib/uni-search-bar/i18n/index.js +0 -8
- package/src/uni-ui/lib/uni-search-bar/i18n/zh-Hans.json +0 -4
- package/src/uni-ui/lib/uni-search-bar/i18n/zh-Hant.json +0 -4
- package/src/uni-ui/lib/uni-search-bar/uni-search-bar.vue +0 -339
- package/src/uni-ui/lib/uni-swipe-action-item/bindingx.js +0 -311
- package/src/uni-ui/lib/uni-swipe-action-item/isPC.js +0 -12
- package/src/uni-ui/lib/uni-swipe-action-item/mpalipay.js +0 -195
- package/src/uni-ui/lib/uni-swipe-action-item/mpother.js +0 -260
- package/src/uni-ui/lib/uni-swipe-action-item/mpwxs.js +0 -84
- package/src/uni-ui/lib/uni-swipe-action-item/render.js +0 -270
- package/src/uni-ui/lib/uni-swipe-action-item/uni-swipe-action-item.vue +0 -493
- package/src/uni-ui/lib/uni-swipe-action-item/wx.wxs +0 -341
- package/src/uni-ui/lib/uni-table/uni-table.vue +0 -496
- package/src/uni-ui/lib/uni-td/uni-td.vue +0 -99
- package/src/uni-ui/lib/uni-th/filter-dropdown.vue +0 -559
- package/src/uni-ui/lib/uni-th/uni-th.vue +0 -322
- package/src/uni-ui/lib/uni-tr/table-checkbox.vue +0 -181
- package/src/uni-ui/lib/uni-tr/uni-tr.vue +0 -208
- package/src/uni-ui/lib/uni-transition/createAnimation.js +0 -131
- package/src/uni-ui/lib/uni-transition/uni-transition.vue +0 -310
- package/src/uni-ui/polyfill.ts +0 -41
@@ -1,168 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<view>
|
3
|
-
<view
|
4
|
-
v-if="loaded || list.itemIndex < 15"
|
5
|
-
class="uni-indexed-list__title-wrapper">
|
6
|
-
<text
|
7
|
-
v-if="list.items && list.items.length > 0"
|
8
|
-
class="uni-indexed-list__title"
|
9
|
-
>{{ list.key }}</text
|
10
|
-
>
|
11
|
-
</view>
|
12
|
-
<view
|
13
|
-
v-if="
|
14
|
-
(loaded || list.itemIndex < 15) && list.items && list.items.length > 0
|
15
|
-
"
|
16
|
-
class="uni-indexed-list__list">
|
17
|
-
<view
|
18
|
-
v-for="(item, index) in list.items"
|
19
|
-
:key="index"
|
20
|
-
class="uni-indexed-list__item"
|
21
|
-
hover-class="uni-indexed-list__item--hover">
|
22
|
-
<view
|
23
|
-
class="uni-indexed-list__item-container"
|
24
|
-
@click="onClick(idx, index)">
|
25
|
-
<view
|
26
|
-
class="uni-indexed-list__item-border"
|
27
|
-
:class="{
|
28
|
-
'uni-indexed-list__item-border--last':
|
29
|
-
index === list.items.length - 1
|
30
|
-
}">
|
31
|
-
<view v-if="showSelect" style="margin-right: 20rpx">
|
32
|
-
<uni-icons
|
33
|
-
:type="item.checked ? 'checkbox-filled' : 'circle'"
|
34
|
-
:color="item.checked ? '#007aff' : '#C0C0C0'"
|
35
|
-
size="24" />
|
36
|
-
</view>
|
37
|
-
<text class="uni-indexed-list__item-content">{{ item.name }}</text>
|
38
|
-
</view>
|
39
|
-
</view>
|
40
|
-
</view>
|
41
|
-
</view>
|
42
|
-
</view>
|
43
|
-
</template>
|
44
|
-
|
45
|
-
<script>
|
46
|
-
export default {
|
47
|
-
name: 'UniIndexedList',
|
48
|
-
emits: ['itemClick'],
|
49
|
-
props: {
|
50
|
-
loaded: {
|
51
|
-
type: Boolean,
|
52
|
-
default: false
|
53
|
-
},
|
54
|
-
idx: {
|
55
|
-
type: Number,
|
56
|
-
default: 0
|
57
|
-
},
|
58
|
-
list: {
|
59
|
-
type: Object,
|
60
|
-
default() {
|
61
|
-
return {};
|
62
|
-
}
|
63
|
-
},
|
64
|
-
showSelect: {
|
65
|
-
type: Boolean,
|
66
|
-
default: false
|
67
|
-
}
|
68
|
-
},
|
69
|
-
methods: {
|
70
|
-
onClick(idx, index) {
|
71
|
-
this.$emit('itemClick', {
|
72
|
-
idx,
|
73
|
-
index
|
74
|
-
});
|
75
|
-
}
|
76
|
-
}
|
77
|
-
};
|
78
|
-
</script>
|
79
|
-
|
80
|
-
<style lang="scss" scoped>
|
81
|
-
.uni-indexed-list__list {
|
82
|
-
background-color: $uni-bg-color;
|
83
|
-
/* #ifndef APP-NVUE */
|
84
|
-
display: flex;
|
85
|
-
/* #endif */
|
86
|
-
flex-direction: column;
|
87
|
-
border-top-style: solid;
|
88
|
-
border-top-width: 1px;
|
89
|
-
border-top-color: #dedede;
|
90
|
-
}
|
91
|
-
|
92
|
-
.uni-indexed-list__item {
|
93
|
-
font-size: 14px;
|
94
|
-
/* #ifndef APP-NVUE */
|
95
|
-
display: flex;
|
96
|
-
/* #endif */
|
97
|
-
flex: 1;
|
98
|
-
flex-direction: row;
|
99
|
-
justify-content: space-between;
|
100
|
-
align-items: center;
|
101
|
-
}
|
102
|
-
|
103
|
-
.uni-indexed-list__item-container {
|
104
|
-
padding-left: 15px;
|
105
|
-
flex: 1;
|
106
|
-
position: relative;
|
107
|
-
/* #ifndef APP-NVUE */
|
108
|
-
display: flex;
|
109
|
-
box-sizing: border-box;
|
110
|
-
/* #endif */
|
111
|
-
flex-direction: row;
|
112
|
-
justify-content: space-between;
|
113
|
-
align-items: center;
|
114
|
-
/* #ifdef H5 */
|
115
|
-
cursor: pointer;
|
116
|
-
/* #endif */
|
117
|
-
}
|
118
|
-
|
119
|
-
.uni-indexed-list__item-border {
|
120
|
-
flex: 1;
|
121
|
-
position: relative;
|
122
|
-
/* #ifndef APP-NVUE */
|
123
|
-
display: flex;
|
124
|
-
box-sizing: border-box;
|
125
|
-
/* #endif */
|
126
|
-
flex-direction: row;
|
127
|
-
justify-content: space-between;
|
128
|
-
align-items: center;
|
129
|
-
height: 50px;
|
130
|
-
padding: 25px;
|
131
|
-
padding-left: 0;
|
132
|
-
border-bottom-style: solid;
|
133
|
-
border-bottom-width: 1px;
|
134
|
-
border-bottom-color: #dedede;
|
135
|
-
}
|
136
|
-
|
137
|
-
.uni-indexed-list__item-border--last {
|
138
|
-
border-bottom-width: 0px;
|
139
|
-
}
|
140
|
-
|
141
|
-
.uni-indexed-list__item-content {
|
142
|
-
flex: 1;
|
143
|
-
font-size: 14px;
|
144
|
-
color: #191919;
|
145
|
-
}
|
146
|
-
|
147
|
-
.uni-indexed-list {
|
148
|
-
/* #ifndef APP-NVUE */
|
149
|
-
display: flex;
|
150
|
-
/* #endif */
|
151
|
-
flex-direction: row;
|
152
|
-
}
|
153
|
-
|
154
|
-
.uni-indexed-list__title-wrapper {
|
155
|
-
/* #ifndef APP-NVUE */
|
156
|
-
display: flex;
|
157
|
-
width: 100%;
|
158
|
-
/* #endif */
|
159
|
-
background-color: #f7f7f7;
|
160
|
-
}
|
161
|
-
|
162
|
-
.uni-indexed-list__title {
|
163
|
-
padding: 6px 12px;
|
164
|
-
line-height: 24px;
|
165
|
-
font-size: 16px;
|
166
|
-
font-weight: 500;
|
167
|
-
}
|
168
|
-
</style>
|
@@ -1,404 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<view class="uni-indexed-list" ref="list" id="list">
|
3
|
-
<!-- #ifdef APP-NVUE -->
|
4
|
-
<!-- <list
|
5
|
-
class="uni-indexed-list__scroll"
|
6
|
-
scrollable="true"
|
7
|
-
show-scrollbar="false">
|
8
|
-
<cell
|
9
|
-
v-for="(list, idx) in lists"
|
10
|
-
:key="idx"
|
11
|
-
:ref="'uni-indexed-list-' + idx"> -->
|
12
|
-
<!-- #endif -->
|
13
|
-
<!-- #ifndef APP-NVUE -->
|
14
|
-
<scroll-view
|
15
|
-
:scroll-into-view="scrollViewId"
|
16
|
-
class="uni-indexed-list__scroll"
|
17
|
-
scroll-y>
|
18
|
-
<view
|
19
|
-
v-for="(list, idx) in lists"
|
20
|
-
:key="idx"
|
21
|
-
:id="'uni-indexed-list-' + idx">
|
22
|
-
<!-- #endif -->
|
23
|
-
<indexed-list-item
|
24
|
-
:list="list"
|
25
|
-
:loaded="loaded"
|
26
|
-
:idx="idx"
|
27
|
-
:showSelect="showSelect"
|
28
|
-
@itemClick="onClick"></indexed-list-item>
|
29
|
-
<!-- #ifndef APP-NVUE -->
|
30
|
-
</view>
|
31
|
-
</scroll-view>
|
32
|
-
<!-- #endif -->
|
33
|
-
<!-- #ifdef APP-NVUE -->
|
34
|
-
<!-- </cell>
|
35
|
-
</list> -->
|
36
|
-
<!-- #endif -->
|
37
|
-
<view
|
38
|
-
class="uni-indexed-list__menu"
|
39
|
-
@touchstart="touchStart"
|
40
|
-
@touchmove.stop.prevent="touchMove"
|
41
|
-
@touchend="touchEnd"
|
42
|
-
@mousedown.stop="mousedown"
|
43
|
-
@mousemove.stop.prevent="mousemove"
|
44
|
-
@mouseleave.stop="mouseleave">
|
45
|
-
<view
|
46
|
-
v-for="(list, key) in lists"
|
47
|
-
:key="key"
|
48
|
-
class="uni-indexed-list__menu-item"
|
49
|
-
:class="touchmoveIndex == key ? 'uni-indexed-list__menu--active' : ''">
|
50
|
-
<text
|
51
|
-
class="uni-indexed-list__menu-text"
|
52
|
-
:class="
|
53
|
-
touchmoveIndex == key ? 'uni-indexed-list__menu-text--active' : ''
|
54
|
-
"
|
55
|
-
>{{ list.key }}</text
|
56
|
-
>
|
57
|
-
</view>
|
58
|
-
</view>
|
59
|
-
<view v-if="touchmove" class="uni-indexed-list__alert-wrapper">
|
60
|
-
<text class="uni-indexed-list__alert">{{
|
61
|
-
lists[touchmoveIndex].key
|
62
|
-
}}</text>
|
63
|
-
</view>
|
64
|
-
</view>
|
65
|
-
</template>
|
66
|
-
<script>
|
67
|
-
import indexedListItem from './uni-indexed-list-item.vue';
|
68
|
-
// #ifdef APP-NVUE
|
69
|
-
// const dom = weex.requireModule('dom');
|
70
|
-
// #endif
|
71
|
-
// #ifdef APP-PLUS
|
72
|
-
// function throttle(func, delay) {
|
73
|
-
// var prev = Date.now();
|
74
|
-
// return function () {
|
75
|
-
// var context = this;
|
76
|
-
// var args = arguments;
|
77
|
-
// var now = Date.now();
|
78
|
-
// if (now - prev >= delay) {
|
79
|
-
// func.apply(context, args);
|
80
|
-
// prev = Date.now();
|
81
|
-
// }
|
82
|
-
// };
|
83
|
-
// }
|
84
|
-
|
85
|
-
function touchMove(e) {
|
86
|
-
let pageY = e.touches[0].pageY;
|
87
|
-
let index = Math.floor((pageY - this.winOffsetY) / this.itemHeight);
|
88
|
-
if (this.touchmoveIndex === index) {
|
89
|
-
return false;
|
90
|
-
}
|
91
|
-
let item = this.lists[index];
|
92
|
-
if (item) {
|
93
|
-
// #ifndef APP-NVUE
|
94
|
-
this.scrollViewId = 'uni-indexed-list-' + index;
|
95
|
-
this.touchmoveIndex = index;
|
96
|
-
// #endif
|
97
|
-
// #ifdef APP-NVUE
|
98
|
-
// dom.scrollToElement(this.$refs['uni-indexed-list-' + index][0], {
|
99
|
-
// animated: false
|
100
|
-
// });
|
101
|
-
// this.touchmoveIndex = index;
|
102
|
-
// #endif
|
103
|
-
}
|
104
|
-
}
|
105
|
-
// const throttleTouchMove = throttle(touchMove, 40);
|
106
|
-
// #endif
|
107
|
-
|
108
|
-
/**
|
109
|
-
* IndexedList 索引列表
|
110
|
-
* @description 用于展示索引列表
|
111
|
-
* @tutorial https://ext.dcloud.net.cn/plugin?id=375
|
112
|
-
* @property {Boolean} showSelect = [true|false] 展示模式
|
113
|
-
* @value true 展示模式
|
114
|
-
* @value false 选择模式
|
115
|
-
* @property {Object} options 索引列表需要的数据对象
|
116
|
-
* @event {Function} click 点击列表事件 ,返回当前选择项的事件对象
|
117
|
-
* @example <uni-indexed-list options="" showSelect="false" @click=""></uni-indexed-list>
|
118
|
-
*/
|
119
|
-
export default {
|
120
|
-
name: 'UniIndexedList',
|
121
|
-
components: {
|
122
|
-
indexedListItem
|
123
|
-
},
|
124
|
-
emits: ['click'],
|
125
|
-
props: {
|
126
|
-
options: {
|
127
|
-
type: Array,
|
128
|
-
default() {
|
129
|
-
return [];
|
130
|
-
}
|
131
|
-
},
|
132
|
-
showSelect: {
|
133
|
-
type: Boolean,
|
134
|
-
default: false
|
135
|
-
}
|
136
|
-
},
|
137
|
-
data() {
|
138
|
-
return {
|
139
|
-
lists: [],
|
140
|
-
winHeight: 0,
|
141
|
-
itemHeight: 0,
|
142
|
-
winOffsetY: 0,
|
143
|
-
touchmove: false,
|
144
|
-
touchmoveIndex: -1,
|
145
|
-
scrollViewId: '',
|
146
|
-
touchmovable: true,
|
147
|
-
loaded: false,
|
148
|
-
isPC: false
|
149
|
-
};
|
150
|
-
},
|
151
|
-
watch: {
|
152
|
-
options: {
|
153
|
-
handler: function () {
|
154
|
-
this.setList();
|
155
|
-
},
|
156
|
-
deep: true
|
157
|
-
}
|
158
|
-
},
|
159
|
-
mounted() {
|
160
|
-
// #ifdef H5
|
161
|
-
this.isPC = this.IsPC();
|
162
|
-
// #endif
|
163
|
-
setTimeout(() => {
|
164
|
-
this.setList();
|
165
|
-
}, 50);
|
166
|
-
setTimeout(() => {
|
167
|
-
this.loaded = true;
|
168
|
-
}, 300);
|
169
|
-
},
|
170
|
-
methods: {
|
171
|
-
setList() {
|
172
|
-
let index = 0;
|
173
|
-
this.lists = [];
|
174
|
-
this.options.forEach((value, index) => {
|
175
|
-
if (value.data.length === 0) {
|
176
|
-
return;
|
177
|
-
}
|
178
|
-
let indexBefore = index;
|
179
|
-
let items = value.data.map((item) => {
|
180
|
-
let obj = {};
|
181
|
-
obj['key'] = value.letter;
|
182
|
-
obj['name'] = item;
|
183
|
-
obj['itemIndex'] = index;
|
184
|
-
index++;
|
185
|
-
obj.checked = item.checked ? item.checked : false;
|
186
|
-
return obj;
|
187
|
-
});
|
188
|
-
this.lists.push({
|
189
|
-
title: value.letter,
|
190
|
-
key: value.letter,
|
191
|
-
items: items,
|
192
|
-
itemIndex: indexBefore
|
193
|
-
});
|
194
|
-
});
|
195
|
-
// #ifndef APP-NVUE
|
196
|
-
uni
|
197
|
-
.createSelectorQuery()
|
198
|
-
.in(this)
|
199
|
-
.select('#list')
|
200
|
-
.boundingClientRect()
|
201
|
-
.exec((ret) => {
|
202
|
-
this.winOffsetY = ret[0].top;
|
203
|
-
this.winHeight = ret[0].height;
|
204
|
-
this.itemHeight = this.winHeight / this.lists.length;
|
205
|
-
});
|
206
|
-
// #endif
|
207
|
-
// #ifdef APP-NVUE
|
208
|
-
// dom.getComponentRect(this.$refs['list'], (res) => {
|
209
|
-
// this.winOffsetY = res.size.top;
|
210
|
-
// this.winHeight = res.size.height;
|
211
|
-
// this.itemHeight = this.winHeight / this.lists.length;
|
212
|
-
// });
|
213
|
-
// #endif
|
214
|
-
},
|
215
|
-
touchStart(e) {
|
216
|
-
this.touchmove = true;
|
217
|
-
let pageY = this.isPC ? e.pageY : e.touches[0].pageY;
|
218
|
-
let index = Math.floor((pageY - this.winOffsetY) / this.itemHeight);
|
219
|
-
let item = this.lists[index];
|
220
|
-
if (item) {
|
221
|
-
this.scrollViewId = 'uni-indexed-list-' + index;
|
222
|
-
this.touchmoveIndex = index;
|
223
|
-
// #ifdef APP-NVUE
|
224
|
-
// dom.scrollToElement(this.$refs['uni-indexed-list-' + index][0], {
|
225
|
-
// animated: false
|
226
|
-
// });
|
227
|
-
// #endif
|
228
|
-
}
|
229
|
-
},
|
230
|
-
touchMove(e) {
|
231
|
-
// #ifndef APP-PLUS
|
232
|
-
let pageY = this.isPC ? e.pageY : e.touches[0].pageY;
|
233
|
-
let index = Math.floor((pageY - this.winOffsetY) / this.itemHeight);
|
234
|
-
if (this.touchmoveIndex === index) {
|
235
|
-
return false;
|
236
|
-
}
|
237
|
-
let item = this.lists[index];
|
238
|
-
if (item) {
|
239
|
-
this.scrollViewId = 'uni-indexed-list-' + index;
|
240
|
-
this.touchmoveIndex = index;
|
241
|
-
}
|
242
|
-
// #endif
|
243
|
-
// #ifdef APP-PLUS
|
244
|
-
// throttleTouchMove.call(this, e);
|
245
|
-
// #endif
|
246
|
-
},
|
247
|
-
touchEnd() {
|
248
|
-
this.touchmove = false;
|
249
|
-
// this.touchmoveIndex = -1
|
250
|
-
},
|
251
|
-
|
252
|
-
/**
|
253
|
-
* 兼容 PC @tian
|
254
|
-
*/
|
255
|
-
|
256
|
-
mousedown(e) {
|
257
|
-
if (!this.isPC) return;
|
258
|
-
this.touchStart(e);
|
259
|
-
},
|
260
|
-
mousemove(e) {
|
261
|
-
if (!this.isPC) return;
|
262
|
-
this.touchMove(e);
|
263
|
-
},
|
264
|
-
mouseleave(e) {
|
265
|
-
if (!this.isPC) return;
|
266
|
-
this.touchEnd(e);
|
267
|
-
},
|
268
|
-
|
269
|
-
// #ifdef H5
|
270
|
-
IsPC() {
|
271
|
-
var userAgentInfo = navigator.userAgent;
|
272
|
-
var Agents = [
|
273
|
-
'Android',
|
274
|
-
'iPhone',
|
275
|
-
'SymbianOS',
|
276
|
-
'Windows Phone',
|
277
|
-
'iPad',
|
278
|
-
'iPod'
|
279
|
-
];
|
280
|
-
var flag = true;
|
281
|
-
for (let v = 0; v < Agents.length - 1; v++) {
|
282
|
-
if (userAgentInfo.indexOf(Agents[v]) > 0) {
|
283
|
-
flag = false;
|
284
|
-
break;
|
285
|
-
}
|
286
|
-
}
|
287
|
-
return flag;
|
288
|
-
},
|
289
|
-
// #endif
|
290
|
-
|
291
|
-
onClick(e) {
|
292
|
-
let { idx, index } = e;
|
293
|
-
let obj = {};
|
294
|
-
for (let key in this.lists[idx].items[index]) {
|
295
|
-
obj[key] = this.lists[idx].items[index][key];
|
296
|
-
}
|
297
|
-
let select = [];
|
298
|
-
if (this.showSelect) {
|
299
|
-
this.lists[idx].items[index].checked =
|
300
|
-
!this.lists[idx].items[index].checked;
|
301
|
-
this.lists.forEach((value, idx) => {
|
302
|
-
value.items.forEach((item, index) => {
|
303
|
-
if (item.checked) {
|
304
|
-
let obj = {};
|
305
|
-
for (let key in this.lists[idx].items[index]) {
|
306
|
-
obj[key] = this.lists[idx].items[index][key];
|
307
|
-
}
|
308
|
-
select.push(obj);
|
309
|
-
}
|
310
|
-
});
|
311
|
-
});
|
312
|
-
}
|
313
|
-
this.$emit('click', {
|
314
|
-
item: obj,
|
315
|
-
select: select
|
316
|
-
});
|
317
|
-
}
|
318
|
-
}
|
319
|
-
};
|
320
|
-
</script>
|
321
|
-
<style lang="scss" scoped>
|
322
|
-
.uni-indexed-list {
|
323
|
-
position: absolute;
|
324
|
-
left: 0;
|
325
|
-
top: 0;
|
326
|
-
right: 0;
|
327
|
-
bottom: 0;
|
328
|
-
/* #ifndef APP-NVUE */
|
329
|
-
display: flex;
|
330
|
-
/* #endif */
|
331
|
-
flex-direction: row;
|
332
|
-
}
|
333
|
-
|
334
|
-
.uni-indexed-list__scroll {
|
335
|
-
flex: 1;
|
336
|
-
}
|
337
|
-
|
338
|
-
.uni-indexed-list__menu {
|
339
|
-
width: 24px;
|
340
|
-
/* #ifndef APP-NVUE */
|
341
|
-
display: flex;
|
342
|
-
/* #endif */
|
343
|
-
flex-direction: column;
|
344
|
-
}
|
345
|
-
|
346
|
-
.uni-indexed-list__menu-item {
|
347
|
-
/* #ifndef APP-NVUE */
|
348
|
-
display: flex;
|
349
|
-
/* #endif */
|
350
|
-
flex: 1;
|
351
|
-
align-items: center;
|
352
|
-
justify-content: center;
|
353
|
-
/* #ifdef H5 */
|
354
|
-
cursor: pointer;
|
355
|
-
/* #endif */
|
356
|
-
}
|
357
|
-
|
358
|
-
.uni-indexed-list__menu-text {
|
359
|
-
font-size: 12px;
|
360
|
-
text-align: center;
|
361
|
-
color: #aaa;
|
362
|
-
}
|
363
|
-
|
364
|
-
// .uni-indexed-list__menu--active {
|
365
|
-
// // background-color: rgb(200, 200, 200);
|
366
|
-
// }
|
367
|
-
|
368
|
-
// .uni-indexed-list__menu--active {
|
369
|
-
// }
|
370
|
-
|
371
|
-
.uni-indexed-list__menu-text--active {
|
372
|
-
border-radius: 16px;
|
373
|
-
width: 16px;
|
374
|
-
height: 16px;
|
375
|
-
line-height: 16px;
|
376
|
-
background-color: #007aff;
|
377
|
-
color: #fff;
|
378
|
-
}
|
379
|
-
|
380
|
-
.uni-indexed-list__alert-wrapper {
|
381
|
-
position: absolute;
|
382
|
-
left: 0;
|
383
|
-
top: 0;
|
384
|
-
right: 0;
|
385
|
-
bottom: 0;
|
386
|
-
/* #ifndef APP-NVUE */
|
387
|
-
display: flex;
|
388
|
-
/* #endif */
|
389
|
-
flex-direction: row;
|
390
|
-
align-items: center;
|
391
|
-
justify-content: center;
|
392
|
-
}
|
393
|
-
|
394
|
-
.uni-indexed-list__alert {
|
395
|
-
width: 80px;
|
396
|
-
height: 80px;
|
397
|
-
border-radius: 80px;
|
398
|
-
text-align: center;
|
399
|
-
line-height: 80px;
|
400
|
-
font-size: 35px;
|
401
|
-
color: #fff;
|
402
|
-
background-color: rgba(0, 0, 0, 0.5);
|
403
|
-
}
|
404
|
-
</style>
|
@@ -1,123 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<!-- #ifndef APP-NVUE -->
|
3
|
-
<view class="uni-list uni-border-top-bottom">
|
4
|
-
<view v-if="border" class="uni-list--border-top"></view>
|
5
|
-
<slot />
|
6
|
-
<view v-if="border" class="uni-list--border-bottom"></view>
|
7
|
-
</view>
|
8
|
-
<!-- #endif -->
|
9
|
-
<!-- #ifdef APP-NVUE -->
|
10
|
-
<!-- <list :bounce="false" :scrollable="true" show-scrollbar :render-reverse="renderReverse" @scroll="scroll" class="uni-list" :class="{ 'uni-list--border': border }" :enableBackToTop="enableBackToTop"
|
11
|
-
loadmoreoffset="15">
|
12
|
-
<slot />
|
13
|
-
</list> -->
|
14
|
-
<!-- #endif -->
|
15
|
-
</template>
|
16
|
-
|
17
|
-
<script>
|
18
|
-
/**
|
19
|
-
* List 列表
|
20
|
-
* @description 列表组件
|
21
|
-
* @tutorial https://ext.dcloud.net.cn/plugin?id=24
|
22
|
-
* @property {String} border = [true|false] 标题
|
23
|
-
*/
|
24
|
-
export default {
|
25
|
-
name: 'uniList',
|
26
|
-
'mp-weixin': {
|
27
|
-
options: {
|
28
|
-
multipleSlots: false
|
29
|
-
}
|
30
|
-
},
|
31
|
-
props: {
|
32
|
-
stackFromEnd: {
|
33
|
-
type: Boolean,
|
34
|
-
default: false
|
35
|
-
},
|
36
|
-
enableBackToTop: {
|
37
|
-
type: [Boolean, String],
|
38
|
-
default: false
|
39
|
-
},
|
40
|
-
scrollY: {
|
41
|
-
type: [Boolean, String],
|
42
|
-
default: false
|
43
|
-
},
|
44
|
-
border: {
|
45
|
-
type: Boolean,
|
46
|
-
default: true
|
47
|
-
},
|
48
|
-
renderReverse: {
|
49
|
-
type: Boolean,
|
50
|
-
default: false
|
51
|
-
}
|
52
|
-
},
|
53
|
-
// provide() {
|
54
|
-
// return {
|
55
|
-
// list: this
|
56
|
-
// };
|
57
|
-
// },
|
58
|
-
created() {
|
59
|
-
this.firstChildAppend = false;
|
60
|
-
},
|
61
|
-
methods: {
|
62
|
-
loadMore(e) {
|
63
|
-
this.$emit('scrolltolower');
|
64
|
-
},
|
65
|
-
scroll(e) {
|
66
|
-
this.$emit('scroll', e);
|
67
|
-
}
|
68
|
-
}
|
69
|
-
};
|
70
|
-
</script>
|
71
|
-
<style lang="scss">
|
72
|
-
$uni-bg-color: #ffffff;
|
73
|
-
$uni-border-color: #e5e5e5;
|
74
|
-
|
75
|
-
.uni-list {
|
76
|
-
/* #ifndef APP-NVUE */
|
77
|
-
display: flex;
|
78
|
-
/* #endif */
|
79
|
-
background-color: $uni-bg-color;
|
80
|
-
position: relative;
|
81
|
-
flex-direction: column;
|
82
|
-
}
|
83
|
-
|
84
|
-
.uni-list--border {
|
85
|
-
position: relative;
|
86
|
-
/* #ifdef APP-NVUE */
|
87
|
-
border-top-color: $uni-border-color;
|
88
|
-
border-top-style: solid;
|
89
|
-
border-top-width: 0.5px;
|
90
|
-
border-bottom-color: $uni-border-color;
|
91
|
-
border-bottom-style: solid;
|
92
|
-
border-bottom-width: 0.5px;
|
93
|
-
/* #endif */
|
94
|
-
z-index: -1;
|
95
|
-
}
|
96
|
-
|
97
|
-
/* #ifndef APP-NVUE */
|
98
|
-
|
99
|
-
.uni-list--border-top {
|
100
|
-
position: absolute;
|
101
|
-
top: 0;
|
102
|
-
right: 0;
|
103
|
-
left: 0;
|
104
|
-
height: 1px;
|
105
|
-
-webkit-transform: scaleY(0.5);
|
106
|
-
transform: scaleY(0.5);
|
107
|
-
background-color: $uni-border-color;
|
108
|
-
z-index: 1;
|
109
|
-
}
|
110
|
-
|
111
|
-
.uni-list--border-bottom {
|
112
|
-
position: absolute;
|
113
|
-
bottom: 0;
|
114
|
-
right: 0;
|
115
|
-
left: 0;
|
116
|
-
height: 1px;
|
117
|
-
-webkit-transform: scaleY(0.5);
|
118
|
-
transform: scaleY(0.5);
|
119
|
-
background-color: $uni-border-color;
|
120
|
-
}
|
121
|
-
|
122
|
-
/* #endif */
|
123
|
-
</style>
|