@kengic/uni 0.5.1 → 0.5.2-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/uni/uni-ui/uni-badge/uni-badge.vue +222 -219
- package/dist/uni/uni-ui/uni-breadcrumb/uni-breadcrumb.vue +29 -29
- package/dist/uni/uni-ui/uni-breadcrumb-item/uni-breadcrumb-item.vue +88 -88
- package/dist/uni/uni-ui/uni-calendar/calendar.js +936 -532
- package/dist/uni/uni-ui/uni-calendar/i18n/en.json +10 -10
- package/dist/uni/uni-ui/uni-calendar/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-calendar/i18n/zh-Hans.json +10 -10
- package/dist/uni/uni-ui/uni-calendar/i18n/zh-Hant.json +10 -10
- package/dist/uni/uni-ui/uni-calendar/uni-calendar-item.vue +190 -168
- package/dist/uni/uni-ui/uni-calendar/uni-calendar.vue +459 -459
- package/dist/uni/uni-ui/uni-calendar/util.js +324 -340
- package/dist/uni/uni-ui/uni-card/uni-card.vue +8 -1
- package/dist/uni/uni-ui/uni-col/uni-col.vue +294 -287
- package/dist/uni/uni-ui/uni-collapse/uni-collapse.vue +139 -140
- package/dist/uni/uni-ui/uni-collapse-item/uni-collapse-item.vue +381 -378
- package/dist/uni/uni-ui/uni-combox/uni-combox.vue +280 -272
- package/dist/uni/uni-ui/uni-countdown/i18n/en.json +4 -4
- package/dist/uni/uni-ui/uni-countdown/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-countdown/i18n/zh-Hans.json +4 -4
- package/dist/uni/uni-ui/uni-countdown/i18n/zh-Hant.json +4 -4
- package/dist/uni/uni-ui/uni-countdown/uni-countdown.vue +249 -257
- package/dist/uni/uni-ui/uni-data-checkbox/uni-data-checkbox.vue +832 -813
- package/dist/uni/uni-ui/uni-data-picker/keypress.js +42 -42
- package/dist/uni/uni-ui/uni-data-picker/uni-data-picker.vue +535 -516
- package/dist/uni/uni-ui/uni-data-pickerview/uni-data-picker.js +623 -618
- package/dist/uni/uni-ui/uni-data-pickerview/uni-data-pickerview.vue +293 -288
- package/dist/uni/uni-ui/uni-data-select/uni-data-select.vue +495 -509
- package/dist/uni/uni-ui/uni-dateformat/date-format.js +181 -184
- package/dist/uni/uni-ui/uni-dateformat/uni-dateformat.vue +81 -82
- package/dist/uni/uni-ui/uni-datetime-picker/calendar-item.vue +176 -170
- package/dist/uni/uni-ui/uni-datetime-picker/calendar.vue +926 -920
- package/dist/uni/uni-ui/uni-datetime-picker/i18n/en.json +20 -20
- package/dist/uni/uni-ui/uni-datetime-picker/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-datetime-picker/i18n/zh-Hans.json +21 -21
- package/dist/uni/uni-ui/uni-datetime-picker/i18n/zh-Hant.json +21 -21
- package/dist/uni/uni-ui/uni-datetime-picker/time-picker.vue +921 -926
- package/dist/uni/uni-ui/uni-datetime-picker/uni-datetime-picker.vue +1059 -1012
- package/dist/uni/uni-ui/uni-datetime-picker/util.js +366 -377
- package/dist/uni/uni-ui/uni-drawer/keypress.js +42 -42
- package/dist/uni/uni-ui/uni-drawer/uni-drawer.vue +176 -167
- package/dist/uni/uni-ui/uni-easyinput/common.js +40 -42
- package/dist/uni/uni-ui/uni-easyinput/uni-easyinput.vue +628 -547
- package/dist/uni/uni-ui/uni-fab/uni-fab.vue +507 -483
- package/dist/uni/uni-ui/uni-fav/i18n/en.json +2 -2
- package/dist/uni/uni-ui/uni-fav/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-fav/i18n/zh-Hans.json +2 -2
- package/dist/uni/uni-ui/uni-fav/i18n/zh-Hant.json +2 -2
- package/dist/uni/uni-ui/uni-fav/uni-fav.vue +155 -147
- package/dist/uni/uni-ui/uni-file-picker/choose-and-upload-file.js +172 -198
- package/dist/uni/uni-ui/uni-file-picker/uni-file-picker.vue +636 -634
- package/dist/uni/uni-ui/uni-file-picker/upload-file.vue +294 -293
- package/dist/uni/uni-ui/uni-file-picker/upload-image.vue +267 -270
- package/dist/uni/uni-ui/uni-file-picker/utils.js +81 -82
- package/dist/uni/uni-ui/uni-forms/uni-forms.vue +360 -372
- package/dist/uni/uni-ui/uni-forms/utils.js +170 -174
- package/dist/uni/uni-ui/uni-forms/validate.js +447 -456
- package/dist/uni/uni-ui/uni-forms-item/uni-forms-item.vue +497 -497
- package/dist/uni/uni-ui/uni-goods-nav/i18n/en.json +4 -4
- package/dist/uni/uni-ui/uni-goods-nav/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-goods-nav/i18n/zh-Hans.json +4 -4
- package/dist/uni/uni-ui/uni-goods-nav/i18n/zh-Hant.json +4 -4
- package/dist/uni/uni-ui/uni-goods-nav/uni-goods-nav.vue +238 -222
- package/dist/uni/uni-ui/uni-grid/uni-grid.vue +134 -134
- package/dist/uni/uni-ui/uni-grid-item/uni-grid-item.vue +121 -119
- package/dist/uni/uni-ui/uni-group/uni-group.vue +121 -121
- package/dist/uni/uni-ui/uni-icons/icons.js +1170 -1168
- package/dist/uni/uni-ui/uni-icons/uni-icons.vue +91 -86
- package/dist/uni/uni-ui/uni-icons/uniicons.css +166 -166
- package/dist/uni/uni-ui/uni-indexed-list/uni-indexed-list-item.vue +129 -129
- package/dist/uni/uni-ui/uni-indexed-list/uni-indexed-list.vue +352 -347
- package/dist/uni/uni-ui/uni-link/uni-link.vue +134 -119
- package/dist/uni/uni-ui/uni-list/uni-list.vue +119 -110
- package/dist/uni/uni-ui/uni-list/uni-refresh.vue +14 -14
- package/dist/uni/uni-ui/uni-list/uni-refresh.wxs +14 -14
- package/dist/uni/uni-ui/uni-list-ad/uni-list-ad.vue +101 -95
- package/dist/uni/uni-ui/uni-list-chat/uni-list-chat.scss +18 -18
- package/dist/uni/uni-ui/uni-list-chat/uni-list-chat.vue +602 -586
- package/dist/uni/uni-ui/uni-list-item/uni-list-item.vue +507 -503
- package/dist/uni/uni-ui/uni-load-more/i18n/en.json +3 -3
- package/dist/uni/uni-ui/uni-load-more/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-load-more/i18n/zh-Hans.json +3 -3
- package/dist/uni/uni-ui/uni-load-more/i18n/zh-Hant.json +3 -3
- package/dist/uni/uni-ui/uni-load-more/uni-load-more.vue +402 -392
- package/dist/uni/uni-ui/uni-nav-bar/uni-nav-bar.vue +328 -330
- package/dist/uni/uni-ui/uni-nav-bar/uni-status-bar.vue +17 -17
- package/dist/uni/uni-ui/uni-notice-bar/uni-notice-bar.vue +422 -401
- package/dist/uni/uni-ui/uni-number-box/uni-number-box.vue +211 -205
- package/dist/uni/uni-ui/uni-pagination/i18n/en.json +3 -3
- package/dist/uni/uni-ui/uni-pagination/i18n/es.json +3 -3
- package/dist/uni/uni-ui/uni-pagination/i18n/fr.json +3 -3
- package/dist/uni/uni-ui/uni-pagination/i18n/index.js +12 -11
- package/dist/uni/uni-ui/uni-pagination/i18n/zh-Hans.json +3 -3
- package/dist/uni/uni-ui/uni-pagination/i18n/zh-Hant.json +3 -3
- package/dist/uni/uni-ui/uni-pagination/uni-pagination.vue +450 -433
- package/dist/uni/uni-ui/uni-popup/uni-popup.vue +404 -404
- package/dist/uni/uni-ui/uni-popup-dialog/keypress.js +42 -42
- package/dist/uni/uni-ui/uni-popup-dialog/uni-popup-dialog.vue +1 -0
- package/dist/uni/uni-ui/uni-popup-message/uni-popup-message.vue +126 -125
- package/dist/uni/uni-ui/uni-popup-share/uni-popup-share.vue +172 -172
- package/dist/uni/uni-ui/uni-rate/uni-rate.vue +343 -347
- package/dist/uni/uni-ui/uni-row/uni-row.vue +180 -182
- package/dist/uni/uni-ui/uni-scss/changelog.md +11 -4
- package/dist/uni/uni-ui/uni-scss/package.json +73 -73
- package/dist/uni/uni-ui/uni-scss/readme.md +2 -1
- package/dist/uni/uni-ui/uni-scss/styles/setting/_border.scss +2 -2
- package/dist/uni/uni-ui/uni-scss/styles/setting/_color.scss +46 -47
- package/dist/uni/uni-ui/uni-scss/styles/setting/_radius.scss +49 -49
- package/dist/uni/uni-ui/uni-scss/styles/setting/_space.scss +52 -53
- package/dist/uni/uni-ui/uni-scss/styles/setting/_styles.scss +142 -147
- package/dist/uni/uni-ui/uni-scss/styles/setting/_text.scss +20 -20
- package/dist/uni/uni-ui/uni-scss/styles/setting/_variables.scss +111 -95
- package/dist/uni/uni-ui/uni-scss/styles/tools/functions.scss +28 -18
- package/dist/uni/uni-ui/uni-scss/theme.scss +10 -7
- package/dist/uni/uni-ui/uni-scss/variables.scss +42 -24
- package/dist/uni/uni-ui/uni-search-bar/i18n/en.json +3 -3
- package/dist/uni/uni-ui/uni-search-bar/i18n/index.js +8 -7
- package/dist/uni/uni-ui/uni-search-bar/i18n/zh-Hans.json +2 -2
- package/dist/uni/uni-ui/uni-search-bar/i18n/zh-Hant.json +2 -2
- package/dist/uni/uni-ui/uni-search-bar/uni-search-bar.vue +290 -281
- package/dist/uni/uni-ui/uni-section/uni-section.vue +149 -146
- package/dist/uni/uni-ui/uni-segmented-control/uni-segmented-control.vue +141 -131
- package/dist/uni/uni-ui/uni-steps/uni-steps.vue +255 -236
- package/dist/uni/uni-ui/uni-swipe-action/uni-swipe-action.vue +51 -51
- package/dist/uni/uni-ui/uni-swipe-action-item/bindingx.js +276 -282
- package/dist/uni/uni-ui/uni-swipe-action-item/isPC.js +10 -10
- package/dist/uni/uni-ui/uni-swipe-action-item/mpalipay.js +182 -187
- package/dist/uni/uni-ui/uni-swipe-action-item/mpother.js +235 -244
- package/dist/uni/uni-ui/uni-swipe-action-item/mpwxs.js +70 -75
- package/dist/uni/uni-ui/uni-swipe-action-item/render.js +238 -247
- package/dist/uni/uni-ui/uni-swipe-action-item/uni-swipe-action-item.vue +387 -313
- package/dist/uni/uni-ui/uni-swipe-action-item/wx.wxs +206 -215
- package/dist/uni/uni-ui/uni-swiper-dot/uni-swiper-dot.vue +241 -197
- package/dist/uni/uni-ui/uni-table/uni-table.vue +445 -447
- package/dist/uni/uni-ui/uni-tag/uni-tag.vue +234 -244
- package/dist/uni/uni-ui/uni-tbody/uni-tbody.vue +20 -23
- package/dist/uni/uni-ui/uni-td/uni-td.vue +79 -80
- package/dist/uni/uni-ui/uni-th/filter-dropdown.vue +510 -503
- package/dist/uni/uni-ui/uni-th/uni-th.vue +289 -273
- package/dist/uni/uni-ui/uni-thead/uni-thead.vue +115 -114
- package/dist/uni/uni-ui/uni-title/uni-title.vue +151 -154
- package/dist/uni/uni-ui/uni-tooltip/uni-tooltip.vue +55 -60
- package/dist/uni/uni-ui/uni-tr/table-checkbox.vue +162 -163
- package/dist/uni/uni-ui/uni-tr/uni-tr.vue +158 -157
- package/dist/uni/uni-ui/uni-transition/createAnimation.js +130 -113
- package/dist/uni/uni-ui/uni-transition/uni-transition.vue +274 -272
- package/package.json +1 -1
|
@@ -1,128 +1,143 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
<a
|
|
3
|
+
v-if="isShowA"
|
|
4
|
+
class="uni-link"
|
|
5
|
+
:href="href"
|
|
6
|
+
:class="{ 'uni-link--withline': showUnderLine === true || showUnderLine === 'true' }"
|
|
7
|
+
:style="{ color, fontSize: fontSize + 'px' }"
|
|
8
|
+
:download="download"
|
|
9
|
+
>
|
|
10
|
+
<slot>{{ text }}</slot>
|
|
11
|
+
</a>
|
|
12
|
+
<!-- #ifndef APP-NVUE -->
|
|
13
|
+
<text
|
|
14
|
+
v-else
|
|
15
|
+
class="uni-link"
|
|
16
|
+
:class="{ 'uni-link--withline': showUnderLine === true || showUnderLine === 'true' }"
|
|
17
|
+
:style="{ color, fontSize: fontSize + 'px' }"
|
|
18
|
+
@click="openURL"
|
|
19
|
+
>
|
|
20
|
+
<slot>{{ text }}</slot>
|
|
21
|
+
</text>
|
|
22
|
+
<!-- #endif -->
|
|
23
|
+
<!-- #ifdef APP-NVUE -->
|
|
24
|
+
<text
|
|
25
|
+
v-else
|
|
26
|
+
class="uni-link"
|
|
27
|
+
:class="{ 'uni-link--withline': showUnderLine === true || showUnderLine === 'true' }"
|
|
28
|
+
:style="{ color, fontSize: fontSize + 'px' }"
|
|
29
|
+
@click="openURL"
|
|
30
|
+
>
|
|
31
|
+
{{ text }}
|
|
32
|
+
</text>
|
|
33
|
+
<!-- #endif -->
|
|
19
34
|
</template>
|
|
20
35
|
|
|
21
36
|
<script>
|
|
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
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Link 外部网页超链接组件
|
|
39
|
+
* @description uni-link是一个外部网页超链接组件,在小程序内复制url,在app内打开外部浏览器,在h5端打开新网页
|
|
40
|
+
* @tutorial https://ext.dcloud.net.cn/plugin?id=1182
|
|
41
|
+
* @property {String} href 点击后打开的外部网页url
|
|
42
|
+
* @property {String} text 显示的文字
|
|
43
|
+
* @property {String} downlaod H5平台下载文件名
|
|
44
|
+
* @property {Boolean} showUnderLine 是否显示下划线
|
|
45
|
+
* @property {String} copyTips 在小程序端复制链接时显示的提示语
|
|
46
|
+
* @property {String} color 链接文字颜色
|
|
47
|
+
* @property {String} fontSize 链接文字大小
|
|
48
|
+
* @example * <uni-link href="https://ext.dcloud.net.cn" text="https://ext.dcloud.net.cn"></uni-link>
|
|
49
|
+
*/
|
|
50
|
+
export default {
|
|
51
|
+
name: 'uniLink',
|
|
52
|
+
props: {
|
|
53
|
+
href: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: '',
|
|
56
|
+
},
|
|
57
|
+
text: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: '',
|
|
60
|
+
},
|
|
61
|
+
download: {
|
|
62
|
+
type: String,
|
|
63
|
+
default: '',
|
|
64
|
+
},
|
|
65
|
+
showUnderLine: {
|
|
66
|
+
type: [Boolean, String],
|
|
67
|
+
default: true,
|
|
68
|
+
},
|
|
69
|
+
copyTips: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: '已自动复制网址,请在手机浏览器里粘贴该网址',
|
|
72
|
+
},
|
|
73
|
+
color: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: '#999999',
|
|
76
|
+
},
|
|
77
|
+
fontSize: {
|
|
78
|
+
type: [Number, String],
|
|
79
|
+
default: 14,
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
computed: {
|
|
83
|
+
isShowA() {
|
|
84
|
+
// #ifdef H5
|
|
85
|
+
this._isH5 = true;
|
|
86
|
+
// #endif
|
|
87
|
+
if ((this.isMail() || this.isTel()) && this._isH5 === true) {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
return false;
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
created() {
|
|
94
|
+
this._isH5 = null;
|
|
95
|
+
},
|
|
96
|
+
methods: {
|
|
97
|
+
isMail() {
|
|
98
|
+
return this.href.startsWith('mailto:');
|
|
99
|
+
},
|
|
100
|
+
isTel() {
|
|
101
|
+
return this.href.startsWith('tel:');
|
|
102
|
+
},
|
|
103
|
+
openURL() {
|
|
104
|
+
// #ifdef APP-PLUS
|
|
105
|
+
if (this.isTel()) {
|
|
106
|
+
this.makePhoneCall(this.href.replace('tel:', ''));
|
|
107
|
+
} else {
|
|
108
|
+
plus.runtime.openURL(this.href);
|
|
109
|
+
}
|
|
110
|
+
// #endif
|
|
111
|
+
// #ifdef H5
|
|
112
|
+
window.open(this.href);
|
|
113
|
+
// #endif
|
|
114
|
+
// #ifdef MP
|
|
115
|
+
uni.setClipboardData({
|
|
116
|
+
data: this.href,
|
|
117
|
+
});
|
|
118
|
+
uni.showModal({
|
|
119
|
+
content: this.copyTips,
|
|
120
|
+
showCancel: false,
|
|
121
|
+
});
|
|
122
|
+
// #endif
|
|
123
|
+
},
|
|
124
|
+
makePhoneCall(phoneNumber) {
|
|
125
|
+
uni.makePhoneCall({
|
|
126
|
+
phoneNumber,
|
|
127
|
+
});
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
};
|
|
116
131
|
</script>
|
|
117
132
|
|
|
118
133
|
<style>
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
134
|
+
/* #ifndef APP-NVUE */
|
|
135
|
+
.uni-link {
|
|
136
|
+
cursor: pointer;
|
|
137
|
+
}
|
|
123
138
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
139
|
+
/* #endif */
|
|
140
|
+
.uni-link--withline {
|
|
141
|
+
text-decoration: underline;
|
|
142
|
+
}
|
|
128
143
|
</style>
|
|
@@ -1,123 +1,132 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
|
11
|
+
:bounce="false"
|
|
12
|
+
:scrollable="true"
|
|
13
|
+
show-scrollbar
|
|
14
|
+
:render-reverse="renderReverse"
|
|
15
|
+
@scroll="scroll"
|
|
16
|
+
class="uni-list"
|
|
17
|
+
:class="{ 'uni-list--border': border }"
|
|
18
|
+
:enableBackToTop="enableBackToTop"
|
|
19
|
+
loadmoreoffset="15"
|
|
20
|
+
>
|
|
21
|
+
<slot />
|
|
22
|
+
</list>
|
|
23
|
+
<!-- #endif -->
|
|
15
24
|
</template>
|
|
16
25
|
|
|
17
26
|
<script>
|
|
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
|
-
|
|
27
|
+
/**
|
|
28
|
+
* List 列表
|
|
29
|
+
* @description 列表组件
|
|
30
|
+
* @tutorial https://ext.dcloud.net.cn/plugin?id=24
|
|
31
|
+
* @property {String} border = [true|false] 标题
|
|
32
|
+
*/
|
|
33
|
+
export default {
|
|
34
|
+
name: 'UniList',
|
|
35
|
+
'mp-weixin': {
|
|
36
|
+
options: {
|
|
37
|
+
multipleSlots: false,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
props: {
|
|
41
|
+
stackFromEnd: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false,
|
|
44
|
+
},
|
|
45
|
+
enableBackToTop: {
|
|
46
|
+
type: [Boolean, String],
|
|
47
|
+
default: false,
|
|
48
|
+
},
|
|
49
|
+
scrollY: {
|
|
50
|
+
type: [Boolean, String],
|
|
51
|
+
default: false,
|
|
52
|
+
},
|
|
53
|
+
border: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: true,
|
|
56
|
+
},
|
|
57
|
+
renderReverse: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: false,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
// provide() {
|
|
63
|
+
// return {
|
|
64
|
+
// list: this
|
|
65
|
+
// };
|
|
66
|
+
// },
|
|
67
|
+
created() {
|
|
68
|
+
this.firstChildAppend = false;
|
|
69
|
+
},
|
|
70
|
+
methods: {
|
|
71
|
+
loadMore(e) {
|
|
72
|
+
this.$emit('scrolltolower');
|
|
73
|
+
},
|
|
74
|
+
scroll(e) {
|
|
75
|
+
this.$emit('scroll', e);
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
};
|
|
70
79
|
</script>
|
|
71
80
|
<style lang="scss">
|
|
72
|
-
|
|
73
|
-
|
|
81
|
+
$uni-bg-color: #ffffff;
|
|
82
|
+
$uni-border-color: #e5e5e5;
|
|
74
83
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
84
|
+
.uni-list {
|
|
85
|
+
/* #ifndef APP-NVUE */
|
|
86
|
+
display: flex;
|
|
87
|
+
/* #endif */
|
|
88
|
+
background-color: $uni-bg-color;
|
|
89
|
+
position: relative;
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
}
|
|
83
92
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
.uni-list--border {
|
|
94
|
+
position: relative;
|
|
95
|
+
/* #ifdef APP-NVUE */
|
|
96
|
+
border-top-color: $uni-border-color;
|
|
97
|
+
border-top-style: solid;
|
|
98
|
+
border-top-width: 0.5px;
|
|
99
|
+
border-bottom-color: $uni-border-color;
|
|
100
|
+
border-bottom-style: solid;
|
|
101
|
+
border-bottom-width: 0.5px;
|
|
102
|
+
/* #endif */
|
|
103
|
+
z-index: -1;
|
|
104
|
+
}
|
|
96
105
|
|
|
97
|
-
|
|
106
|
+
/* #ifndef APP-NVUE */
|
|
98
107
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
.uni-list--border-top {
|
|
109
|
+
position: absolute;
|
|
110
|
+
top: 0;
|
|
111
|
+
right: 0;
|
|
112
|
+
left: 0;
|
|
113
|
+
height: 1px;
|
|
114
|
+
-webkit-transform: scaleY(0.5);
|
|
115
|
+
transform: scaleY(0.5);
|
|
116
|
+
background-color: $uni-border-color;
|
|
117
|
+
z-index: 1;
|
|
118
|
+
}
|
|
110
119
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
.uni-list--border-bottom {
|
|
121
|
+
position: absolute;
|
|
122
|
+
bottom: 0;
|
|
123
|
+
right: 0;
|
|
124
|
+
left: 0;
|
|
125
|
+
height: 1px;
|
|
126
|
+
-webkit-transform: scaleY(0.5);
|
|
127
|
+
transform: scaleY(0.5);
|
|
128
|
+
background-color: $uni-border-color;
|
|
129
|
+
}
|
|
121
130
|
|
|
122
|
-
|
|
131
|
+
/* #endif */
|
|
123
132
|
</style>
|
|
@@ -17,21 +17,21 @@
|
|
|
17
17
|
props: {
|
|
18
18
|
display: {
|
|
19
19
|
type: [String],
|
|
20
|
-
default:
|
|
21
|
-
}
|
|
20
|
+
default: 'hide',
|
|
21
|
+
},
|
|
22
22
|
},
|
|
23
23
|
data() {
|
|
24
24
|
return {
|
|
25
|
-
pulling: false
|
|
26
|
-
}
|
|
25
|
+
pulling: false,
|
|
26
|
+
};
|
|
27
27
|
},
|
|
28
28
|
computed: {
|
|
29
29
|
isShow() {
|
|
30
|
-
if (this.display ===
|
|
30
|
+
if (this.display === 'show' || this.pulling === true) {
|
|
31
31
|
return true;
|
|
32
32
|
}
|
|
33
33
|
return false;
|
|
34
|
-
}
|
|
34
|
+
},
|
|
35
35
|
},
|
|
36
36
|
created() {},
|
|
37
37
|
methods: {
|
|
@@ -39,22 +39,22 @@
|
|
|
39
39
|
this.pulling = value;
|
|
40
40
|
},
|
|
41
41
|
onrefresh(e) {
|
|
42
|
-
this.$emit(
|
|
42
|
+
this.$emit('refresh', e);
|
|
43
43
|
},
|
|
44
44
|
onpullingdown(e) {
|
|
45
45
|
// #ifdef APP-NVUE
|
|
46
|
-
this.$emit(
|
|
46
|
+
this.$emit('pullingdown', e);
|
|
47
47
|
// #endif
|
|
48
48
|
// #ifndef APP-NVUE
|
|
49
49
|
var detail = {
|
|
50
50
|
viewHeight: 90,
|
|
51
|
-
pullingDistance: e.height
|
|
52
|
-
}
|
|
53
|
-
this.$emit(
|
|
51
|
+
pullingDistance: e.height,
|
|
52
|
+
};
|
|
53
|
+
this.$emit('pullingdown', detail);
|
|
54
54
|
// #endif
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
58
|
</script>
|
|
59
59
|
|
|
60
60
|
<style>
|
|
@@ -3,11 +3,11 @@ var pullDown = {
|
|
|
3
3
|
maxHeight: 200,
|
|
4
4
|
callRefresh: 'onrefresh',
|
|
5
5
|
callPullingDown: 'onpullingdown',
|
|
6
|
-
refreshSelector: '.uni-refresh'
|
|
6
|
+
refreshSelector: '.uni-refresh',
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
function ready(newValue, oldValue, ownerInstance, instance) {
|
|
10
|
-
var state = instance.getState()
|
|
10
|
+
var state = instance.getState();
|
|
11
11
|
state.canPullDown = newValue;
|
|
12
12
|
// console.log(newValue);
|
|
13
13
|
}
|
|
@@ -15,9 +15,9 @@ function ready(newValue, oldValue, ownerInstance, instance) {
|
|
|
15
15
|
function touchStart(e, instance) {
|
|
16
16
|
var state = instance.getState();
|
|
17
17
|
state.refreshInstance = instance.selectComponent(pullDown.refreshSelector);
|
|
18
|
-
state.canPullDown =
|
|
18
|
+
state.canPullDown = state.refreshInstance != null && state.refreshInstance != undefined;
|
|
19
19
|
if (!state.canPullDown) {
|
|
20
|
-
return
|
|
20
|
+
return;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// console.log("touchStart");
|
|
@@ -25,16 +25,16 @@ function touchStart(e, instance) {
|
|
|
25
25
|
state.height = 0;
|
|
26
26
|
state.touchStartY = e.touches[0].pageY || e.changedTouches[0].pageY;
|
|
27
27
|
state.refreshInstance.setStyle({
|
|
28
|
-
|
|
28
|
+
height: 0,
|
|
29
29
|
});
|
|
30
|
-
state.refreshInstance.callMethod(
|
|
30
|
+
state.refreshInstance.callMethod('onchange', true);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
function touchMove(e, ownerInstance) {
|
|
34
34
|
var instance = e.instance;
|
|
35
35
|
var state = instance.getState();
|
|
36
36
|
if (!state.canPullDown) {
|
|
37
|
-
return
|
|
37
|
+
return;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
var oldHeight = state.height;
|
|
@@ -46,23 +46,23 @@ function touchMove(e, ownerInstance) {
|
|
|
46
46
|
|
|
47
47
|
var refreshInstance = state.refreshInstance;
|
|
48
48
|
refreshInstance.setStyle({
|
|
49
|
-
|
|
49
|
+
height: height + 'px',
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
height = height < pullDown.maxHeight ? height : pullDown.maxHeight;
|
|
53
53
|
state.height = height;
|
|
54
54
|
refreshInstance.callMethod(pullDown.callPullingDown, {
|
|
55
|
-
height: height
|
|
55
|
+
height: height,
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
function touchEnd(e, ownerInstance) {
|
|
60
60
|
var state = e.instance.getState();
|
|
61
61
|
if (!state.canPullDown) {
|
|
62
|
-
return
|
|
62
|
+
return;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
state.refreshInstance.callMethod(
|
|
65
|
+
state.refreshInstance.callMethod('onchange', false);
|
|
66
66
|
|
|
67
67
|
var refreshInstance = state.refreshInstance;
|
|
68
68
|
if (state.height > pullDown.threshold) {
|
|
@@ -71,7 +71,7 @@ function touchEnd(e, ownerInstance) {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
refreshInstance.setStyle({
|
|
74
|
-
|
|
74
|
+
height: 0,
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
|
|
@@ -83,5 +83,5 @@ module.exports = {
|
|
|
83
83
|
touchmove: touchMove,
|
|
84
84
|
touchstart: touchStart,
|
|
85
85
|
touchend: touchEnd,
|
|
86
|
-
propObserver: propObserver
|
|
87
|
-
}
|
|
86
|
+
propObserver: propObserver,
|
|
87
|
+
};
|