@10yun/cv-mobile-ui 0.4.1 → 0.4.2
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/ui-cv/cv-badge/{uni-badge.vue → cv-badge.vue} +2 -2
- package/ui-cv/cv-calendar/calendar.js +762 -345
- package/ui-cv/cv-calendar/cv-calendar-item.vue +198 -0
- package/ui-cv/cv-calendar/cv-calendar.vue +508 -0
- package/ui-cv/cv-card/cv-card.vue +427 -0
- package/ui-cv/cv-col/cv-col.vue +2965 -0
- package/ui-cv/cv-collapse/cv-collapse.vue +146 -0
- package/ui-cv/cv-collapse-item/cv-collapse-item.vue +395 -0
- package/ui-cv/cv-combox/cv-combox.vue +250 -0
- package/ui-cv/cv-countdown/cv-countdown.vue +245 -0
- package/ui-cv/cv-data-checkbox/cv-data-checkbox.vue +841 -0
- package/ui-cv/cv-data-indexed-list/cv-data-indexed-list-item.vue +154 -0
- package/ui-cv/cv-data-indexed-list/cv-data-indexed-list.vue +376 -0
- package/ui-cv/cv-data-picker/cv-data-picker.vue +486 -0
- package/ui-cv/cv-data-pickerview/{uni-data-picker.js → cv-data-picker.js} +0 -0
- package/ui-cv/cv-data-pickerview/cv-data-pickerview.vue +304 -0
- package/ui-cv/cv-dateformat/cv-dateformat.vue +86 -0
- package/ui-cv/cv-datetime-picker/calendar.vue +752 -738
- package/ui-cv/cv-datetime-picker/cv-datetime-picker.vue +958 -0
- package/ui-cv/cv-datetime-picker/time-picker.vue +900 -892
- package/ui-cv/cv-easyinput/cv-easyinput.vue +514 -0
- package/ui-cv/cv-fab/cv-fab.vue +465 -0
- package/ui-cv/cv-fab/{uni-fab.vue.bak → cv-fab.vue.bak} +2 -2
- package/ui-cv/cv-fav/cv-fav.vue +150 -0
- package/ui-cv/cv-file-picker/cv-file-picker.vue +619 -0
- package/ui-cv/cv-form-item/cv-form-item.vue +1 -1
- package/ui-cv/cv-goods-nav/{uni-goods-nav.vue → cv-goods-nav.vue} +1 -1
- package/ui-cv/{cv-icons2/cv-icons2.vue → cv-icon2/cv-icon2.vue} +3 -3
- package/ui-cv/{cv-icons2 → cv-icon2}/icons.js +0 -0
- package/ui-cv/{cv-icons2 → cv-icon2}/uni.ttf +0 -0
- package/ui-cv/cv-indexed-list/cv-indexed-list-item.vue +154 -0
- package/ui-cv/cv-indexed-list/cv-indexed-list.vue +371 -0
- package/ui-cv/cv-input-password/cv-input-password.vue +2 -2
- package/ui-cv/{cv-link/uni-link.vue → cv-link2/cv-link2.vue} +1 -1
- package/ui-cv/cv-list/cv-list.vue +107 -0
- package/ui-cv/cv-list/cv-refresh.vue +65 -0
- package/ui-cv/cv-list-ad/cv-list-ad.vue +113 -0
- package/ui-cv/cv-list-chat/{uni-list-chat.scss → cv-list-chat.scss} +0 -0
- package/ui-cv/cv-list-chat/{uni-list-chat.vue → cv-list-chat.vue} +0 -0
- package/ui-cv/cv-list-item/cv-list-item.vue +449 -0
- package/ui-cv/cv-nav-bar/cv-nav-bar.vue +256 -0
- package/ui-cv/cv-nav-bar/{uni-status-bar.vue → cv-status-bar.vue} +0 -0
- package/ui-cv/cv-notice-bar/cv-notice-bar.vue +453 -0
- package/ui-cv/cv-number-box/cv-number-box.vue +223 -0
- package/ui-cv/cv-pagination/cv-pagination.vue +397 -0
- package/ui-cv/cv-popup/cv-popup.vue +429 -0
- package/ui-cv/cv-popup-dialog/{uni-popup-dialog.vue → cv-popup-dialog.vue} +0 -0
- package/ui-cv/cv-popup-message/cv-popup-message.vue +143 -0
- package/ui-cv/cv-popup-share/{uni-popup-share.vue → cv-popup-share.vue} +0 -0
- package/ui-cv/cv-row/{uni-row.vue → cv-row.vue} +1 -1
- package/ui-cv/cv-search-bar/cv-search-bar.vue +280 -0
- package/ui-cv/cv-section/{uni-section.vue → cv-section.vue} +0 -0
- package/ui-cv/cv-segmented-control/{uni-segmented-control.vue → cv-segmented-control.vue} +0 -0
- package/ui-cv/cv-status-bar/{uni-status-bar.vue → cv-status-bar.vue} +0 -0
- package/ui-cv/cv-steps/cv-steps.vue +293 -0
- package/ui-cv/cv-swipe-action/{uni-swipe-action.vue → cv-swipe-action.vue} +0 -0
- package/ui-cv/cv-swipe-action-item/{uni-swipe-action-item.vue → cv-swipe-action-item.vue} +0 -0
- package/ui-cv/cv-swiper-dot/cv-swiper-dot.vue +255 -0
- package/ui-cv/cv-table/cv-table.vue +460 -0
- package/ui-cv/cv-tag/cv-tag.vue +276 -0
- package/ui-cv/cv-tbody/cv-tbody.vue +28 -0
- package/ui-cv/cv-td/cv-td.vue +93 -0
- package/ui-cv/cv-test/{uni-test.vue → cv-test.vue} +0 -0
- package/ui-cv/cv-th/cv-th.vue +270 -0
- package/ui-cv/cv-thead/cv-thead.vue +114 -0
- package/ui-cv/cv-title/cv-title.vue +168 -0
- package/ui-cv/cv-tr/cv-tr.vue +166 -0
- package/ui-cv/cv-transition/cv-transition.vue +279 -0
- package/ui-cv/cv-calendar/uni-calendar-item.vue +0 -171
- package/ui-cv/cv-calendar/uni-calendar.vue +0 -504
- package/ui-cv/cv-card/uni-card.vue +0 -420
- package/ui-cv/cv-col/uni-col.vue +0 -2968
- package/ui-cv/cv-collapse/uni-collapse.vue +0 -146
- package/ui-cv/cv-collapse-item/uni-collapse-item.vue +0 -378
- package/ui-cv/cv-combox/uni-combox.vue +0 -237
- package/ui-cv/cv-countdown/uni-countdown.vue +0 -234
- package/ui-cv/cv-data-checkbox/uni-data-checkbox.vue +0 -792
- package/ui-cv/cv-data-indexed-list/uni-data-indexed-list-item.vue +0 -142
- package/ui-cv/cv-data-indexed-list/uni-data-indexed-list.vue +0 -364
- package/ui-cv/cv-data-picker/uni-data-picker.vue +0 -468
- package/ui-cv/cv-data-pickerview/uni-data-pickerview.vue +0 -298
- package/ui-cv/cv-dateformat/uni-dateformat.vue +0 -88
- package/ui-cv/cv-datetime-picker/uni-datetime-picker.vue +0 -874
- package/ui-cv/cv-easyinput/uni-easyinput.vue +0 -438
- package/ui-cv/cv-fab/uni-fab.vue +0 -443
- package/ui-cv/cv-fav/uni-fav.vue +0 -136
- package/ui-cv/cv-file-picker/uni-file-picker.vue +0 -614
- package/ui-cv/cv-indexed-list/uni-indexed-list-item.vue +0 -142
- package/ui-cv/cv-indexed-list/uni-indexed-list.vue +0 -357
- package/ui-cv/cv-list/uni-list.vue +0 -107
- package/ui-cv/cv-list/uni-refresh.vue +0 -65
- package/ui-cv/cv-list-ad/uni-list-ad.vue +0 -106
- package/ui-cv/cv-list-item/uni-list-item.vue +0 -428
- package/ui-cv/cv-nav-bar/uni-nav-bar.vue +0 -244
- package/ui-cv/cv-notice-bar/uni-notice-bar.vue +0 -394
- package/ui-cv/cv-number-box/uni-number-box.vue +0 -224
- package/ui-cv/cv-pagination/uni-pagination.vue +0 -376
- package/ui-cv/cv-popup/uni-popup.vue +0 -412
- package/ui-cv/cv-popup-message/uni-popup-message.vue +0 -143
- package/ui-cv/cv-search-bar/uni-search-bar.vue +0 -262
- package/ui-cv/cv-steps/uni-steps.vue +0 -250
- package/ui-cv/cv-swiper-dot/uni-swiper-dot.vue +0 -205
- package/ui-cv/cv-table/uni-table.vue +0 -455
- package/ui-cv/cv-tag/uni-tag.vue +0 -283
- package/ui-cv/cv-tbody/uni-tbody.vue +0 -30
- package/ui-cv/cv-td/uni-td.vue +0 -88
- package/ui-cv/cv-th/uni-th.vue +0 -259
- package/ui-cv/cv-thead/uni-thead.vue +0 -114
- package/ui-cv/cv-title/uni-title.vue +0 -171
- package/ui-cv/cv-tr/uni-tr.vue +0 -156
- package/ui-cv/cv-transition/uni-transition.vue +0 -287
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view>
|
|
3
|
-
<view v-if="loaded || list.itemIndex < 15" class="uni-indexed-list__title-wrapper">
|
|
4
|
-
<text v-if="list.items && list.items.length > 0" class="uni-indexed-list__title">{{ list.key }}</text>
|
|
5
|
-
</view>
|
|
6
|
-
<view v-if="(loaded || list.itemIndex < 15) && list.items && list.items.length > 0" class="uni-indexed-list__list">
|
|
7
|
-
<view v-for="(item, index) in list.items" :key="index" class="uni-indexed-list__item" hover-class="uni-indexed-list__item--hover">
|
|
8
|
-
<view class="uni-indexed-list__item-container" @click="onClick(idx, index)">
|
|
9
|
-
<view class="uni-indexed-list__item-border" :class="{'uni-indexed-list__item-border--last':index===list.items.length-1}">
|
|
10
|
-
<view v-if="showSelect" style="margin-right: 20rpx;">
|
|
11
|
-
<uni-icons :type="item.checked ? 'checkbox-filled' : 'circle'" :color="item.checked ? '#007aff' : '#aaa'" size="24" />
|
|
12
|
-
</view>
|
|
13
|
-
<text class="uni-indexed-list__item-content">{{ item.name }}</text>
|
|
14
|
-
</view>
|
|
15
|
-
</view>
|
|
16
|
-
</view>
|
|
17
|
-
</view>
|
|
18
|
-
</view>
|
|
19
|
-
</template>
|
|
20
|
-
|
|
21
|
-
<script>
|
|
22
|
-
export default {
|
|
23
|
-
name: 'UniIndexedList',
|
|
24
|
-
emits: ['itemClick'],
|
|
25
|
-
props: {
|
|
26
|
-
loaded: {
|
|
27
|
-
type: Boolean,
|
|
28
|
-
default: false
|
|
29
|
-
},
|
|
30
|
-
idx: {
|
|
31
|
-
type: Number,
|
|
32
|
-
default: 0
|
|
33
|
-
},
|
|
34
|
-
list: {
|
|
35
|
-
type: Object,
|
|
36
|
-
default () {
|
|
37
|
-
return {}
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
showSelect: {
|
|
41
|
-
type: Boolean,
|
|
42
|
-
default: false
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
methods: {
|
|
46
|
-
onClick(idx, index) {
|
|
47
|
-
this.$emit("itemClick", {
|
|
48
|
-
idx,
|
|
49
|
-
index
|
|
50
|
-
})
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
</script>
|
|
55
|
-
|
|
56
|
-
<style scoped>
|
|
57
|
-
.uni-indexed-list__list {
|
|
58
|
-
background-color: #ffffff;
|
|
59
|
-
/* #ifndef APP-NVUE */
|
|
60
|
-
display: flex;
|
|
61
|
-
/* #endif */
|
|
62
|
-
flex-direction: column;
|
|
63
|
-
border-top-style: solid;
|
|
64
|
-
border-top-width: 1px;
|
|
65
|
-
border-top-color: #e5e5e5;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.uni-indexed-list__item {
|
|
69
|
-
font-size: 16px;
|
|
70
|
-
/* #ifndef APP-NVUE */
|
|
71
|
-
display: flex;
|
|
72
|
-
/* #endif */
|
|
73
|
-
flex: 1;
|
|
74
|
-
flex-direction: row;
|
|
75
|
-
justify-content: space-between;
|
|
76
|
-
align-items: center;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.uni-indexed-list__item-container {
|
|
80
|
-
padding-left: 15px;
|
|
81
|
-
flex: 1;
|
|
82
|
-
position: relative;
|
|
83
|
-
/* #ifndef APP-NVUE */
|
|
84
|
-
display: flex;
|
|
85
|
-
box-sizing: border-box;
|
|
86
|
-
/* #endif */
|
|
87
|
-
flex-direction: row;
|
|
88
|
-
justify-content: space-between;
|
|
89
|
-
align-items: center;
|
|
90
|
-
/* #ifdef H5 */
|
|
91
|
-
cursor: pointer;
|
|
92
|
-
/* #endif */
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.uni-indexed-list__item-border {
|
|
96
|
-
flex: 1;
|
|
97
|
-
position: relative;
|
|
98
|
-
/* #ifndef APP-NVUE */
|
|
99
|
-
display: flex;
|
|
100
|
-
box-sizing: border-box;
|
|
101
|
-
/* #endif */
|
|
102
|
-
flex-direction: row;
|
|
103
|
-
justify-content: space-between;
|
|
104
|
-
align-items: center;
|
|
105
|
-
height: 50px;
|
|
106
|
-
padding: 15px;
|
|
107
|
-
padding-left: 0;
|
|
108
|
-
border-bottom-style: solid;
|
|
109
|
-
border-bottom-width: 1px;
|
|
110
|
-
border-bottom-color: #e5e5e5;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.uni-indexed-list__item-border--last {
|
|
114
|
-
border-bottom-width: 0px;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.uni-indexed-list__item-content {
|
|
118
|
-
flex: 1;
|
|
119
|
-
font-size: 14px;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.uni-indexed-list {
|
|
123
|
-
/* #ifndef APP-NVUE */
|
|
124
|
-
display: flex;
|
|
125
|
-
/* #endif */
|
|
126
|
-
flex-direction: row;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.uni-indexed-list__title-wrapper {
|
|
130
|
-
/* #ifndef APP-NVUE */
|
|
131
|
-
display: flex;
|
|
132
|
-
width: 100%;
|
|
133
|
-
/* #endif */
|
|
134
|
-
background-color: #f7f7f7;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.uni-indexed-list__title {
|
|
138
|
-
padding: 6px 12px;
|
|
139
|
-
line-height: 24px;
|
|
140
|
-
font-size: 12px;
|
|
141
|
-
}
|
|
142
|
-
</style>
|
|
@@ -1,357 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="uni-indexed-list" ref="list" id="list">
|
|
3
|
-
<!-- #ifdef APP-NVUE -->
|
|
4
|
-
<list class="uni-indexed-list__scroll" scrollable="true" show-scrollbar="false">
|
|
5
|
-
<cell v-for="(list, idx) in lists" :key="idx" :ref="'uni-indexed-list-' + idx">
|
|
6
|
-
<!-- #endif -->
|
|
7
|
-
<!-- #ifndef APP-NVUE -->
|
|
8
|
-
<scroll-view :scroll-into-view="scrollViewId" class="uni-indexed-list__scroll" scroll-y>
|
|
9
|
-
<view v-for="(list, idx) in lists" :key="idx" :id="'uni-indexed-list-' + idx">
|
|
10
|
-
<!-- #endif -->
|
|
11
|
-
<indexed-list-item :list="list" :loaded="loaded" :idx="idx" :showSelect="showSelect" @itemClick="onClick"></indexed-list-item>
|
|
12
|
-
<!-- #ifndef APP-NVUE -->
|
|
13
|
-
</view>
|
|
14
|
-
</scroll-view>
|
|
15
|
-
<!-- #endif -->
|
|
16
|
-
<!-- #ifdef APP-NVUE -->
|
|
17
|
-
</cell>
|
|
18
|
-
</list>
|
|
19
|
-
<!-- #endif -->
|
|
20
|
-
<view class="uni-indexed-list__menu" :class="touchmove ? 'uni-indexed-list__menu--active' : ''" @touchstart="touchStart" @touchmove.stop.prevent="touchMove" @touchend="touchEnd" @mousedown.stop="mousedown" @mousemove.stop.prevent="mousemove" @mouseleave.stop="mouseleave">
|
|
21
|
-
<view v-for="(list, key) in lists" :key="key" class="uni-indexed-list__menu-item">
|
|
22
|
-
<text class="uni-indexed-list__menu-text" :class="touchmoveIndex == key ? 'uni-indexed-list__menu-text--active' : ''">{{ list.key }}</text>
|
|
23
|
-
</view>
|
|
24
|
-
</view>
|
|
25
|
-
<view v-if="touchmove" class="uni-indexed-list__alert-wrapper">
|
|
26
|
-
<text class="uni-indexed-list__alert">{{ lists[touchmoveIndex].key }}</text>
|
|
27
|
-
</view>
|
|
28
|
-
</view>
|
|
29
|
-
</template>
|
|
30
|
-
<script>
|
|
31
|
-
import indexedListItem from './uni-indexed-list-item.vue'
|
|
32
|
-
// #ifdef APP-NVUE
|
|
33
|
-
const dom = weex.requireModule('dom');
|
|
34
|
-
// #endif
|
|
35
|
-
// #ifdef APP-PLUS
|
|
36
|
-
function throttle(func, delay) {
|
|
37
|
-
var prev = Date.now();
|
|
38
|
-
return function() {
|
|
39
|
-
var context = this;
|
|
40
|
-
var args = arguments;
|
|
41
|
-
var now = Date.now();
|
|
42
|
-
if (now - prev >= delay) {
|
|
43
|
-
func.apply(context, args);
|
|
44
|
-
prev = Date.now();
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function touchMove(e) {
|
|
50
|
-
let pageY = e.touches[0].pageY
|
|
51
|
-
let index = Math.floor((pageY - this.winOffsetY) / this.itemHeight)
|
|
52
|
-
if (this.touchmoveIndex === index) {
|
|
53
|
-
return false
|
|
54
|
-
}
|
|
55
|
-
let item = this.lists[index]
|
|
56
|
-
if (item) {
|
|
57
|
-
// #ifndef APP-NVUE
|
|
58
|
-
this.scrollViewId = 'uni-indexed-list-' + index
|
|
59
|
-
this.touchmoveIndex = index
|
|
60
|
-
// #endif
|
|
61
|
-
// #ifdef APP-NVUE
|
|
62
|
-
dom.scrollToElement(this.$refs['uni-indexed-list-' + index][0], {
|
|
63
|
-
animated: false
|
|
64
|
-
})
|
|
65
|
-
this.touchmoveIndex = index
|
|
66
|
-
// #endif
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
const throttleTouchMove = throttle(touchMove, 40)
|
|
70
|
-
// #endif
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* IndexedList 索引列表
|
|
74
|
-
* @description 用于展示索引列表
|
|
75
|
-
* @tutorial https://ext.dcloud.net.cn/plugin?id=375
|
|
76
|
-
* @property {Boolean} showSelect = [true|false] 展示模式
|
|
77
|
-
* @value true 展示模式
|
|
78
|
-
* @value false 选择模式
|
|
79
|
-
* @property {Object} options 索引列表需要的数据对象
|
|
80
|
-
* @event {Function} click 点击列表事件 ,返回当前选择项的事件对象
|
|
81
|
-
* @example <uni-indexed-list options="" showSelect="false" @click=""></uni-indexed-list>
|
|
82
|
-
*/
|
|
83
|
-
export default {
|
|
84
|
-
name: 'UniIndexedList',
|
|
85
|
-
components: {
|
|
86
|
-
indexedListItem
|
|
87
|
-
},
|
|
88
|
-
emits: ['click'],
|
|
89
|
-
props: {
|
|
90
|
-
options: {
|
|
91
|
-
type: Array,
|
|
92
|
-
default () {
|
|
93
|
-
return []
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
showSelect: {
|
|
97
|
-
type: Boolean,
|
|
98
|
-
default: false
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
data() {
|
|
102
|
-
return {
|
|
103
|
-
lists: [],
|
|
104
|
-
winHeight: 0,
|
|
105
|
-
itemHeight: 0,
|
|
106
|
-
winOffsetY: 0,
|
|
107
|
-
touchmove: false,
|
|
108
|
-
touchmoveIndex: -1,
|
|
109
|
-
scrollViewId: '',
|
|
110
|
-
touchmovable: true,
|
|
111
|
-
loaded: false,
|
|
112
|
-
isPC: false
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
watch: {
|
|
116
|
-
options: {
|
|
117
|
-
handler: function() {
|
|
118
|
-
this.setList()
|
|
119
|
-
},
|
|
120
|
-
deep: true
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
mounted() {
|
|
124
|
-
// #ifdef H5
|
|
125
|
-
this.isPC = this.IsPC()
|
|
126
|
-
// #endif
|
|
127
|
-
setTimeout(() => {
|
|
128
|
-
this.setList()
|
|
129
|
-
}, 50)
|
|
130
|
-
setTimeout(() => {
|
|
131
|
-
this.loaded = true
|
|
132
|
-
}, 300);
|
|
133
|
-
},
|
|
134
|
-
methods: {
|
|
135
|
-
setList() {
|
|
136
|
-
let index = 0;
|
|
137
|
-
this.lists = []
|
|
138
|
-
this.options.forEach((value, index) => {
|
|
139
|
-
if (value.data.length === 0) {
|
|
140
|
-
return
|
|
141
|
-
}
|
|
142
|
-
let indexBefore = index
|
|
143
|
-
let items = value.data.map(item => {
|
|
144
|
-
let obj = {}
|
|
145
|
-
obj['key'] = value.letter
|
|
146
|
-
obj['name'] = item
|
|
147
|
-
obj['itemIndex'] = index
|
|
148
|
-
index++
|
|
149
|
-
obj.checked = item.checked ? item.checked : false
|
|
150
|
-
return obj
|
|
151
|
-
})
|
|
152
|
-
this.lists.push({
|
|
153
|
-
title: value.letter,
|
|
154
|
-
key: value.letter,
|
|
155
|
-
items: items,
|
|
156
|
-
itemIndex: indexBefore
|
|
157
|
-
})
|
|
158
|
-
})
|
|
159
|
-
// #ifndef APP-NVUE
|
|
160
|
-
uni.createSelectorQuery()
|
|
161
|
-
.in(this)
|
|
162
|
-
.select('#list')
|
|
163
|
-
.boundingClientRect()
|
|
164
|
-
.exec(ret => {
|
|
165
|
-
this.winOffsetY = ret[0].top
|
|
166
|
-
this.winHeight = ret[0].height
|
|
167
|
-
this.itemHeight = this.winHeight / this.lists.length
|
|
168
|
-
})
|
|
169
|
-
// #endif
|
|
170
|
-
// #ifdef APP-NVUE
|
|
171
|
-
dom.getComponentRect(this.$refs['list'], (res) => {
|
|
172
|
-
this.winOffsetY = res.size.top
|
|
173
|
-
this.winHeight = res.size.height
|
|
174
|
-
this.itemHeight = this.winHeight / this.lists.length
|
|
175
|
-
})
|
|
176
|
-
// #endif
|
|
177
|
-
},
|
|
178
|
-
touchStart(e) {
|
|
179
|
-
this.touchmove = true
|
|
180
|
-
let pageY = this.isPC ? e.pageY : e.touches[0].pageY
|
|
181
|
-
let index = Math.floor((pageY - this.winOffsetY) / this.itemHeight)
|
|
182
|
-
let item = this.lists[index]
|
|
183
|
-
if (item) {
|
|
184
|
-
this.scrollViewId = 'uni-indexed-list-' + index
|
|
185
|
-
this.touchmoveIndex = index
|
|
186
|
-
// #ifdef APP-NVUE
|
|
187
|
-
dom.scrollToElement(this.$refs['uni-indexed-list-' + index][0], {
|
|
188
|
-
animated: false
|
|
189
|
-
})
|
|
190
|
-
// #endif
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
|
-
touchMove(e) {
|
|
194
|
-
// #ifndef APP-PLUS
|
|
195
|
-
let pageY = this.isPC ? e.pageY : e.touches[0].pageY
|
|
196
|
-
let index = Math.floor((pageY - this.winOffsetY) / this.itemHeight)
|
|
197
|
-
if (this.touchmoveIndex === index) {
|
|
198
|
-
return false
|
|
199
|
-
}
|
|
200
|
-
let item = this.lists[index]
|
|
201
|
-
if (item) {
|
|
202
|
-
this.scrollViewId = 'uni-indexed-list-' + index
|
|
203
|
-
this.touchmoveIndex = index
|
|
204
|
-
}
|
|
205
|
-
// #endif
|
|
206
|
-
// #ifdef APP-PLUS
|
|
207
|
-
throttleTouchMove.call(this, e)
|
|
208
|
-
// #endif
|
|
209
|
-
},
|
|
210
|
-
touchEnd() {
|
|
211
|
-
this.touchmove = false
|
|
212
|
-
this.touchmoveIndex = -1
|
|
213
|
-
},
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* 兼容 PC @tian
|
|
217
|
-
*/
|
|
218
|
-
|
|
219
|
-
mousedown(e) {
|
|
220
|
-
if (!this.isPC) return
|
|
221
|
-
this.touchStart(e)
|
|
222
|
-
},
|
|
223
|
-
mousemove(e) {
|
|
224
|
-
if (!this.isPC) return
|
|
225
|
-
this.touchMove(e)
|
|
226
|
-
},
|
|
227
|
-
mouseleave(e) {
|
|
228
|
-
if (!this.isPC) return
|
|
229
|
-
this.touchEnd(e)
|
|
230
|
-
},
|
|
231
|
-
|
|
232
|
-
// #ifdef H5
|
|
233
|
-
IsPC() {
|
|
234
|
-
var userAgentInfo = navigator.userAgent;
|
|
235
|
-
var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
|
|
236
|
-
var flag = true;
|
|
237
|
-
for (let v = 0; v < Agents.length - 1; v++) {
|
|
238
|
-
if (userAgentInfo.indexOf(Agents[v]) > 0) {
|
|
239
|
-
flag = false;
|
|
240
|
-
break;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
return flag;
|
|
244
|
-
},
|
|
245
|
-
// #endif
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
onClick(e) {
|
|
249
|
-
let {
|
|
250
|
-
idx,
|
|
251
|
-
index
|
|
252
|
-
} = e
|
|
253
|
-
let obj = {}
|
|
254
|
-
for (let key in this.lists[idx].items[index]) {
|
|
255
|
-
obj[key] = this.lists[idx].items[index][key]
|
|
256
|
-
}
|
|
257
|
-
let select = []
|
|
258
|
-
if (this.showSelect) {
|
|
259
|
-
this.lists[idx].items[index].checked = !this.lists[idx].items[index].checked
|
|
260
|
-
this.lists.forEach((value, idx) => {
|
|
261
|
-
value.items.forEach((item, index) => {
|
|
262
|
-
if (item.checked) {
|
|
263
|
-
let obj = {}
|
|
264
|
-
for (let key in this.lists[idx].items[index]) {
|
|
265
|
-
obj[key] = this.lists[idx].items[index][key]
|
|
266
|
-
}
|
|
267
|
-
select.push(obj)
|
|
268
|
-
}
|
|
269
|
-
})
|
|
270
|
-
})
|
|
271
|
-
}
|
|
272
|
-
this.$emit('click', {
|
|
273
|
-
item: obj,
|
|
274
|
-
select: select
|
|
275
|
-
})
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
</script>
|
|
280
|
-
<style scoped>
|
|
281
|
-
.uni-indexed-list {
|
|
282
|
-
position: absolute;
|
|
283
|
-
left: 0;
|
|
284
|
-
top: 0;
|
|
285
|
-
right: 0;
|
|
286
|
-
bottom: 0;
|
|
287
|
-
/* #ifndef APP-NVUE */
|
|
288
|
-
display: flex;
|
|
289
|
-
/* #endif */
|
|
290
|
-
flex-direction: row;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
.uni-indexed-list__scroll {
|
|
294
|
-
flex: 1;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
.uni-indexed-list__menu {
|
|
298
|
-
width: 24px;
|
|
299
|
-
background-color: lightgrey;
|
|
300
|
-
/* #ifndef APP-NVUE */
|
|
301
|
-
display: flex;
|
|
302
|
-
/* #endif */
|
|
303
|
-
flex-direction: column;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
.uni-indexed-list__menu-item {
|
|
307
|
-
/* #ifndef APP-NVUE */
|
|
308
|
-
display: flex;
|
|
309
|
-
/* #endif */
|
|
310
|
-
flex: 1;
|
|
311
|
-
align-items: center;
|
|
312
|
-
justify-content: center;
|
|
313
|
-
/* #ifdef H5 */
|
|
314
|
-
cursor: pointer;
|
|
315
|
-
/* #endif */
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
.uni-indexed-list__menu-text {
|
|
319
|
-
line-height: 20px;
|
|
320
|
-
font-size: 12px;
|
|
321
|
-
text-align: center;
|
|
322
|
-
color: #aaa;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
.uni-indexed-list__menu--active {
|
|
326
|
-
background-color: #c8c8c8;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
.uni-indexed-list__menu-text--active {
|
|
330
|
-
color: #007aff;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
.uni-indexed-list__alert-wrapper {
|
|
334
|
-
position: absolute;
|
|
335
|
-
left: 0;
|
|
336
|
-
top: 0;
|
|
337
|
-
right: 0;
|
|
338
|
-
bottom: 0;
|
|
339
|
-
/* #ifndef APP-NVUE */
|
|
340
|
-
display: flex;
|
|
341
|
-
/* #endif */
|
|
342
|
-
flex-direction: row;
|
|
343
|
-
align-items: center;
|
|
344
|
-
justify-content: center;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
.uni-indexed-list__alert {
|
|
348
|
-
width: 80px;
|
|
349
|
-
height: 80px;
|
|
350
|
-
border-radius: 80px;
|
|
351
|
-
text-align: center;
|
|
352
|
-
line-height: 80px;
|
|
353
|
-
font-size: 35px;
|
|
354
|
-
color: #fff;
|
|
355
|
-
background-color: rgba(0, 0, 0, 0.5);
|
|
356
|
-
}
|
|
357
|
-
</style>
|
|
@@ -1,107 +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 class="uni-list" :class="{ 'uni-list--border': border }" :enableBackToTop="enableBackToTop" loadmoreoffset="15">
|
|
11
|
-
<slot />
|
|
12
|
-
</list>
|
|
13
|
-
<!-- #endif -->
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script>
|
|
17
|
-
/**
|
|
18
|
-
* List 列表
|
|
19
|
-
* @description 列表组件
|
|
20
|
-
* @tutorial https://ext.dcloud.net.cn/plugin?id=24
|
|
21
|
-
* @property {String} border = [true|false] 标题
|
|
22
|
-
*/
|
|
23
|
-
export default {
|
|
24
|
-
name: 'uniList',
|
|
25
|
-
'mp-weixin': {
|
|
26
|
-
options: {
|
|
27
|
-
multipleSlots: false
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
props: {
|
|
31
|
-
enableBackToTop: {
|
|
32
|
-
type: [Boolean, String],
|
|
33
|
-
default: false
|
|
34
|
-
},
|
|
35
|
-
scrollY: {
|
|
36
|
-
type: [Boolean, String],
|
|
37
|
-
default: false
|
|
38
|
-
},
|
|
39
|
-
border: {
|
|
40
|
-
type: Boolean,
|
|
41
|
-
default: true
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
// provide() {
|
|
45
|
-
// return {
|
|
46
|
-
// list: this
|
|
47
|
-
// };
|
|
48
|
-
// },
|
|
49
|
-
created() {
|
|
50
|
-
this.firstChildAppend = false;
|
|
51
|
-
},
|
|
52
|
-
methods: {
|
|
53
|
-
loadMore(e) {
|
|
54
|
-
this.$emit('scrolltolower');
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
</script>
|
|
59
|
-
<style scoped>
|
|
60
|
-
.uni-list {
|
|
61
|
-
/* #ifndef APP-NVUE */
|
|
62
|
-
display: flex;
|
|
63
|
-
/* #endif */
|
|
64
|
-
background-color: #ffffff;
|
|
65
|
-
position: relative;
|
|
66
|
-
flex-direction: column;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.uni-list--border {
|
|
70
|
-
position: relative;
|
|
71
|
-
/* #ifdef APP-NVUE */
|
|
72
|
-
border-top-color: #e5e5e5;
|
|
73
|
-
border-top-style: solid;
|
|
74
|
-
border-top-width: 0.5px;
|
|
75
|
-
border-bottom-color: #e5e5e5;
|
|
76
|
-
border-bottom-style: solid;
|
|
77
|
-
border-bottom-width: 0.5px;
|
|
78
|
-
/* #endif */
|
|
79
|
-
z-index: -1;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/* #ifndef APP-NVUE */
|
|
83
|
-
.uni-list--border-top {
|
|
84
|
-
position: absolute;
|
|
85
|
-
top: 0;
|
|
86
|
-
right: 0;
|
|
87
|
-
left: 0;
|
|
88
|
-
height: 1px;
|
|
89
|
-
-webkit-transform: scaleY(0.5);
|
|
90
|
-
transform: scaleY(0.5);
|
|
91
|
-
background-color: #e5e5e5;
|
|
92
|
-
z-index: 1;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.uni-list--border-bottom {
|
|
96
|
-
position: absolute;
|
|
97
|
-
bottom: 0;
|
|
98
|
-
right: 0;
|
|
99
|
-
left: 0;
|
|
100
|
-
height: 1px;
|
|
101
|
-
-webkit-transform: scaleY(0.5);
|
|
102
|
-
transform: scaleY(0.5);
|
|
103
|
-
background-color: #e5e5e5;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/* #endif */
|
|
107
|
-
</style>
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- #ifdef APP-NVUE -->
|
|
3
|
-
<refresh :display="display" @refresh="onrefresh" @pullingdown="onpullingdown">
|
|
4
|
-
<slot />
|
|
5
|
-
</refresh>
|
|
6
|
-
<!-- #endif -->
|
|
7
|
-
<!-- #ifndef APP-NVUE -->
|
|
8
|
-
<view ref="uni-refresh" class="uni-refresh" v-show="isShow">
|
|
9
|
-
<slot />
|
|
10
|
-
</view>
|
|
11
|
-
<!-- #endif -->
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script>
|
|
15
|
-
export default {
|
|
16
|
-
name: 'UniRefresh',
|
|
17
|
-
props: {
|
|
18
|
-
display: {
|
|
19
|
-
type: [String],
|
|
20
|
-
default: "hide"
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
data() {
|
|
24
|
-
return {
|
|
25
|
-
pulling: false
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
computed: {
|
|
29
|
-
isShow() {
|
|
30
|
-
if (this.display === "show" || this.pulling === true) {
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
created() {},
|
|
37
|
-
methods: {
|
|
38
|
-
onchange(value) {
|
|
39
|
-
this.pulling = value;
|
|
40
|
-
},
|
|
41
|
-
onrefresh(e) {
|
|
42
|
-
this.$emit("refresh", e);
|
|
43
|
-
},
|
|
44
|
-
onpullingdown(e) {
|
|
45
|
-
// #ifdef APP-NVUE
|
|
46
|
-
this.$emit("pullingdown", e);
|
|
47
|
-
// #endif
|
|
48
|
-
// #ifndef APP-NVUE
|
|
49
|
-
var detail = {
|
|
50
|
-
viewHeight: 90,
|
|
51
|
-
pullingDistance: e.height
|
|
52
|
-
}
|
|
53
|
-
this.$emit("pullingdown", detail);
|
|
54
|
-
// #endif
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
</script>
|
|
59
|
-
|
|
60
|
-
<style scoped>
|
|
61
|
-
.uni-refresh {
|
|
62
|
-
height: 0;
|
|
63
|
-
overflow: hidden;
|
|
64
|
-
}
|
|
65
|
-
</style>
|