@kengic/uni 0.3.2-beta.10
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/README.md +1 -0
- package/dist/index.css +1 -0
- package/dist/kengic-uni.js +5 -0
- package/dist/src/consts/i18n/en.d.ts +45 -0
- package/dist/src/consts/i18n/index.d.ts +90 -0
- package/dist/src/consts/i18n/zh_CN.d.ts +45 -0
- package/dist/src/consts/index.d.ts +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/kg.util.d.ts +5 -0
- package/dist/uni-ui/index.ts +11 -0
- package/dist/uni-ui/uni-badge/uni-badge.vue +253 -0
- package/dist/uni-ui/uni-breadcrumb/uni-breadcrumb.vue +41 -0
- package/dist/uni-ui/uni-breadcrumb-item/uni-breadcrumb-item.vue +121 -0
- package/dist/uni-ui/uni-calendar/calendar.js +546 -0
- package/dist/uni-ui/uni-calendar/i18n/en.json +12 -0
- package/dist/uni-ui/uni-calendar/i18n/index.js +8 -0
- package/dist/uni-ui/uni-calendar/i18n/zh-Hans.json +12 -0
- package/dist/uni-ui/uni-calendar/i18n/zh-Hant.json +12 -0
- package/dist/uni-ui/uni-calendar/uni-calendar-item.vue +187 -0
- package/dist/uni-ui/uni-calendar/uni-calendar.vue +566 -0
- package/dist/uni-ui/uni-calendar/util.js +360 -0
- package/dist/uni-ui/uni-card/uni-card.vue +281 -0
- package/dist/uni-ui/uni-col/uni-col.vue +317 -0
- package/dist/uni-ui/uni-collapse/uni-collapse.vue +147 -0
- package/dist/uni-ui/uni-collapse-item/uni-collapse-item.vue +402 -0
- package/dist/uni-ui/uni-combox/uni-combox.vue +294 -0
- package/dist/uni-ui/uni-countdown/i18n/en.json +6 -0
- package/dist/uni-ui/uni-countdown/i18n/index.js +8 -0
- package/dist/uni-ui/uni-countdown/i18n/zh-Hans.json +6 -0
- package/dist/uni-ui/uni-countdown/i18n/zh-Hant.json +6 -0
- package/dist/uni-ui/uni-countdown/uni-countdown.vue +267 -0
- package/dist/uni-ui/uni-data-checkbox/uni-data-checkbox.vue +821 -0
- package/dist/uni-ui/uni-data-picker/keypress.js +45 -0
- package/dist/uni-ui/uni-data-picker/uni-data-picker.vue +551 -0
- package/dist/uni-ui/uni-data-pickerview/uni-data-picker.js +622 -0
- package/dist/uni-ui/uni-data-pickerview/uni-data-pickerview.vue +323 -0
- package/dist/uni-ui/uni-data-select/uni-data-select.vue +517 -0
- package/dist/uni-ui/uni-dateformat/date-format.js +200 -0
- package/dist/uni-ui/uni-dateformat/uni-dateformat.vue +88 -0
- package/dist/uni-ui/uni-datetime-picker/calendar-item.vue +177 -0
- package/dist/uni-ui/uni-datetime-picker/calendar.vue +928 -0
- package/dist/uni-ui/uni-datetime-picker/i18n/en.json +22 -0
- package/dist/uni-ui/uni-datetime-picker/i18n/index.js +8 -0
- package/dist/uni-ui/uni-datetime-picker/i18n/zh-Hans.json +22 -0
- package/dist/uni-ui/uni-datetime-picker/i18n/zh-Hant.json +22 -0
- package/dist/uni-ui/uni-datetime-picker/time-picker.vue +934 -0
- package/dist/uni-ui/uni-datetime-picker/uni-datetime-picker.vue +1026 -0
- package/dist/uni-ui/uni-datetime-picker/util.js +403 -0
- package/dist/uni-ui/uni-drawer/keypress.js +45 -0
- package/dist/uni-ui/uni-drawer/uni-drawer.vue +181 -0
- package/dist/uni-ui/uni-easyinput/common.js +56 -0
- package/dist/uni-ui/uni-easyinput/uni-easyinput.vue +660 -0
- package/dist/uni-ui/uni-fab/uni-fab.vue +491 -0
- package/dist/uni-ui/uni-fav/i18n/en.json +4 -0
- package/dist/uni-ui/uni-fav/i18n/index.js +8 -0
- package/dist/uni-ui/uni-fav/i18n/zh-Hans.json +4 -0
- package/dist/uni-ui/uni-fav/i18n/zh-Hant.json +4 -0
- package/dist/uni-ui/uni-fav/uni-fav.vue +161 -0
- package/dist/uni-ui/uni-file-picker/choose-and-upload-file.js +224 -0
- package/dist/uni-ui/uni-file-picker/uni-file-picker.vue +667 -0
- package/dist/uni-ui/uni-file-picker/upload-file.vue +325 -0
- package/dist/uni-ui/uni-file-picker/upload-image.vue +292 -0
- package/dist/uni-ui/uni-file-picker/utils.js +109 -0
- package/dist/uni-ui/uni-forms/uni-forms.vue +398 -0
- package/dist/uni-ui/uni-forms/utils.js +293 -0
- package/dist/uni-ui/uni-forms/validate.js +486 -0
- package/dist/uni-ui/uni-forms-item/uni-forms-item.vue +601 -0
- package/dist/uni-ui/uni-goods-nav/i18n/en.json +6 -0
- package/dist/uni-ui/uni-goods-nav/i18n/index.js +8 -0
- package/dist/uni-ui/uni-goods-nav/i18n/zh-Hans.json +6 -0
- package/dist/uni-ui/uni-goods-nav/i18n/zh-Hant.json +6 -0
- package/dist/uni-ui/uni-goods-nav/uni-goods-nav.vue +229 -0
- package/dist/uni-ui/uni-grid/uni-grid.vue +143 -0
- package/dist/uni-ui/uni-grid-item/uni-grid-item.vue +129 -0
- package/dist/uni-ui/uni-group/uni-group.vue +134 -0
- package/dist/uni-ui/uni-icons/icons.js +1169 -0
- package/dist/uni-ui/uni-icons/uni-icons.vue +96 -0
- package/dist/uni-ui/uni-icons/uniicons.css +663 -0
- package/dist/uni-ui/uni-icons/uniicons.ttf +0 -0
- package/dist/uni-ui/uni-indexed-list/uni-indexed-list-item.vue +144 -0
- package/dist/uni-ui/uni-indexed-list/uni-indexed-list.vue +367 -0
- package/dist/uni-ui/uni-link/uni-link.vue +128 -0
- package/dist/uni-ui/uni-list/uni-list.vue +123 -0
- package/dist/uni-ui/uni-list/uni-refresh.vue +65 -0
- package/dist/uni-ui/uni-list/uni-refresh.wxs +87 -0
- package/dist/uni-ui/uni-list-ad/uni-list-ad.vue +107 -0
- package/dist/uni-ui/uni-list-chat/uni-list-chat.scss +58 -0
- package/dist/uni-ui/uni-list-chat/uni-list-chat.vue +593 -0
- package/dist/uni-ui/uni-list-item/uni-list-item.vue +534 -0
- package/dist/uni-ui/uni-load-more/i18n/en.json +5 -0
- package/dist/uni-ui/uni-load-more/i18n/index.js +8 -0
- package/dist/uni-ui/uni-load-more/i18n/zh-Hans.json +5 -0
- package/dist/uni-ui/uni-load-more/i18n/zh-Hant.json +5 -0
- package/dist/uni-ui/uni-load-more/uni-load-more.vue +399 -0
- package/dist/uni-ui/uni-nav-bar/uni-nav-bar.vue +357 -0
- package/dist/uni-ui/uni-nav-bar/uni-status-bar.vue +24 -0
- package/dist/uni-ui/uni-notice-bar/uni-notice-bar.vue +426 -0
- package/dist/uni-ui/uni-number-box/uni-number-box.vue +221 -0
- package/dist/uni-ui/uni-pagination/i18n/en.json +5 -0
- package/dist/uni-ui/uni-pagination/i18n/es.json +5 -0
- package/dist/uni-ui/uni-pagination/i18n/fr.json +5 -0
- package/dist/uni-ui/uni-pagination/i18n/index.js +12 -0
- package/dist/uni-ui/uni-pagination/i18n/zh-Hans.json +5 -0
- package/dist/uni-ui/uni-pagination/i18n/zh-Hant.json +5 -0
- package/dist/uni-ui/uni-pagination/uni-pagination.vue +465 -0
- package/dist/uni-ui/uni-popup/i18n/en.json +7 -0
- package/dist/uni-ui/uni-popup/i18n/index.js +9 -0
- package/dist/uni-ui/uni-popup/i18n/zh-Hans.json +7 -0
- package/dist/uni-ui/uni-popup/i18n/zh-Hant.json +7 -0
- package/dist/uni-ui/uni-popup/keypress.js +45 -0
- package/dist/uni-ui/uni-popup/popup.js +23 -0
- package/dist/uni-ui/uni-popup/uni-popup.vue +464 -0
- package/dist/uni-ui/uni-popup-dialog/keypress.js +45 -0
- package/dist/uni-ui/uni-popup-dialog/uni-popup-dialog.vue +275 -0
- package/dist/uni-ui/uni-popup-message/uni-popup-message.vue +143 -0
- package/dist/uni-ui/uni-popup-share/uni-popup-share.vue +187 -0
- package/dist/uni-ui/uni-rate/uni-rate.vue +365 -0
- package/dist/uni-ui/uni-row/uni-row.vue +190 -0
- package/dist/uni-ui/uni-scss/changelog.md +8 -0
- package/dist/uni-ui/uni-scss/index.scss +1 -0
- package/dist/uni-ui/uni-scss/package.json +82 -0
- package/dist/uni-ui/uni-scss/readme.md +4 -0
- package/dist/uni-ui/uni-scss/styles/index.scss +7 -0
- package/dist/uni-ui/uni-scss/styles/setting/_border.scss +3 -0
- package/dist/uni-ui/uni-scss/styles/setting/_color.scss +66 -0
- package/dist/uni-ui/uni-scss/styles/setting/_radius.scss +55 -0
- package/dist/uni-ui/uni-scss/styles/setting/_space.scss +56 -0
- package/dist/uni-ui/uni-scss/styles/setting/_styles.scss +167 -0
- package/dist/uni-ui/uni-scss/styles/setting/_text.scss +24 -0
- package/dist/uni-ui/uni-scss/styles/setting/_variables.scss +146 -0
- package/dist/uni-ui/uni-scss/styles/tools/functions.scss +19 -0
- package/dist/uni-ui/uni-scss/theme.scss +31 -0
- package/dist/uni-ui/uni-scss/variables.scss +62 -0
- package/dist/uni-ui/uni-search-bar/i18n/en.json +4 -0
- package/dist/uni-ui/uni-search-bar/i18n/index.js +8 -0
- package/dist/uni-ui/uni-search-bar/i18n/zh-Hans.json +4 -0
- package/dist/uni-ui/uni-search-bar/i18n/zh-Hant.json +4 -0
- package/dist/uni-ui/uni-search-bar/uni-search-bar.vue +298 -0
- package/dist/uni-ui/uni-section/uni-section.vue +167 -0
- package/dist/uni-ui/uni-segmented-control/uni-segmented-control.vue +145 -0
- package/dist/uni-ui/uni-steps/uni-steps.vue +269 -0
- package/dist/uni-ui/uni-swipe-action/uni-swipe-action.vue +60 -0
- package/dist/uni-ui/uni-swipe-action-item/bindingx.js +302 -0
- package/dist/uni-ui/uni-swipe-action-item/isPC.js +12 -0
- package/dist/uni-ui/uni-swipe-action-item/mpalipay.js +195 -0
- package/dist/uni-ui/uni-swipe-action-item/mpother.js +260 -0
- package/dist/uni-ui/uni-swipe-action-item/mpwxs.js +84 -0
- package/dist/uni-ui/uni-swipe-action-item/render.js +270 -0
- package/dist/uni-ui/uni-swipe-action-item/uni-swipe-action-item.vue +347 -0
- package/dist/uni-ui/uni-swipe-action-item/wx.wxs +341 -0
- package/dist/uni-ui/uni-swiper-dot/uni-swiper-dot.vue +218 -0
- package/dist/uni-ui/uni-table/uni-table.vue +455 -0
- package/dist/uni-ui/uni-tag/uni-tag.vue +252 -0
- package/dist/uni-ui/uni-tbody/uni-tbody.vue +29 -0
- package/dist/uni-ui/uni-td/uni-td.vue +90 -0
- package/dist/uni-ui/uni-th/filter-dropdown.vue +511 -0
- package/dist/uni-ui/uni-th/uni-th.vue +285 -0
- package/dist/uni-ui/uni-thead/uni-thead.vue +129 -0
- package/dist/uni-ui/uni-title/uni-title.vue +171 -0
- package/dist/uni-ui/uni-tooltip/uni-tooltip.vue +68 -0
- package/dist/uni-ui/uni-tr/table-checkbox.vue +179 -0
- package/dist/uni-ui/uni-tr/uni-tr.vue +171 -0
- package/dist/uni-ui/uni-transition/createAnimation.js +131 -0
- package/dist/uni-ui/uni-transition/uni-transition.vue +281 -0
- package/package.json +90 -0
|
@@ -0,0 +1,123 @@
|
|
|
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>
|
|
@@ -0,0 +1,65 @@
|
|
|
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>
|
|
61
|
+
.uni-refresh {
|
|
62
|
+
height: 0;
|
|
63
|
+
overflow: hidden;
|
|
64
|
+
}
|
|
65
|
+
</style>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
var pullDown = {
|
|
2
|
+
threshold: 95,
|
|
3
|
+
maxHeight: 200,
|
|
4
|
+
callRefresh: 'onrefresh',
|
|
5
|
+
callPullingDown: 'onpullingdown',
|
|
6
|
+
refreshSelector: '.uni-refresh'
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
function ready(newValue, oldValue, ownerInstance, instance) {
|
|
10
|
+
var state = instance.getState()
|
|
11
|
+
state.canPullDown = newValue;
|
|
12
|
+
// console.log(newValue);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function touchStart(e, instance) {
|
|
16
|
+
var state = instance.getState();
|
|
17
|
+
state.refreshInstance = instance.selectComponent(pullDown.refreshSelector);
|
|
18
|
+
state.canPullDown = (state.refreshInstance != null && state.refreshInstance != undefined);
|
|
19
|
+
if (!state.canPullDown) {
|
|
20
|
+
return
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// console.log("touchStart");
|
|
24
|
+
|
|
25
|
+
state.height = 0;
|
|
26
|
+
state.touchStartY = e.touches[0].pageY || e.changedTouches[0].pageY;
|
|
27
|
+
state.refreshInstance.setStyle({
|
|
28
|
+
'height': 0
|
|
29
|
+
});
|
|
30
|
+
state.refreshInstance.callMethod("onchange", true);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function touchMove(e, ownerInstance) {
|
|
34
|
+
var instance = e.instance;
|
|
35
|
+
var state = instance.getState();
|
|
36
|
+
if (!state.canPullDown) {
|
|
37
|
+
return
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
var oldHeight = state.height;
|
|
41
|
+
var endY = e.touches[0].pageY || e.changedTouches[0].pageY;
|
|
42
|
+
var height = endY - state.touchStartY;
|
|
43
|
+
if (height > pullDown.maxHeight) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
var refreshInstance = state.refreshInstance;
|
|
48
|
+
refreshInstance.setStyle({
|
|
49
|
+
'height': height + 'px'
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
height = height < pullDown.maxHeight ? height : pullDown.maxHeight;
|
|
53
|
+
state.height = height;
|
|
54
|
+
refreshInstance.callMethod(pullDown.callPullingDown, {
|
|
55
|
+
height: height
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function touchEnd(e, ownerInstance) {
|
|
60
|
+
var state = e.instance.getState();
|
|
61
|
+
if (!state.canPullDown) {
|
|
62
|
+
return
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
state.refreshInstance.callMethod("onchange", false);
|
|
66
|
+
|
|
67
|
+
var refreshInstance = state.refreshInstance;
|
|
68
|
+
if (state.height > pullDown.threshold) {
|
|
69
|
+
refreshInstance.callMethod(pullDown.callRefresh);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
refreshInstance.setStyle({
|
|
74
|
+
'height': 0
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function propObserver(newValue, oldValue, instance) {
|
|
79
|
+
pullDown = newValue;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
module.exports = {
|
|
83
|
+
touchmove: touchMove,
|
|
84
|
+
touchstart: touchStart,
|
|
85
|
+
touchend: touchEnd,
|
|
86
|
+
propObserver: propObserver
|
|
87
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- #ifdef APP-NVUE -->
|
|
3
|
+
<cell>
|
|
4
|
+
<!-- #endif -->
|
|
5
|
+
<view class="uni-list-ad">
|
|
6
|
+
<view v-if="borderShow" :class="{'uni-list--border':border,'uni-list-item--first':isFirstChild}"></view>
|
|
7
|
+
<ad style="width: 200px;height: 300px;border-width: 1px;border-color: red;border-style: solid;" adpid="1111111111"
|
|
8
|
+
unit-id="" appid="" apid="" type="feed" @error="aderror" @close="closeAd"></ad>
|
|
9
|
+
</view>
|
|
10
|
+
<!-- #ifdef APP-NVUE -->
|
|
11
|
+
</cell>
|
|
12
|
+
<!-- #endif -->
|
|
13
|
+
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
// #ifdef APP-NVUE
|
|
18
|
+
const dom = uni.requireNativePlugin('dom');
|
|
19
|
+
// #endif
|
|
20
|
+
export default {
|
|
21
|
+
name: 'UniListAd',
|
|
22
|
+
props: {
|
|
23
|
+
title: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: '',
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
// inject: ['list'],
|
|
30
|
+
data() {
|
|
31
|
+
return {
|
|
32
|
+
isFirstChild: false,
|
|
33
|
+
border: false,
|
|
34
|
+
borderShow: true,
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
mounted() {
|
|
39
|
+
this.list = this.getForm()
|
|
40
|
+
if (this.list) {
|
|
41
|
+
if (!this.list.firstChildAppend) {
|
|
42
|
+
this.list.firstChildAppend = true
|
|
43
|
+
this.isFirstChild = true
|
|
44
|
+
}
|
|
45
|
+
this.border = this.list.border
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
methods: {
|
|
49
|
+
/**
|
|
50
|
+
* 获取父元素实例
|
|
51
|
+
*/
|
|
52
|
+
getForm(name = 'uniList') {
|
|
53
|
+
let parent = this.$parent;
|
|
54
|
+
let parentName = parent.$options.name;
|
|
55
|
+
while (parentName !== name) {
|
|
56
|
+
parent = parent.$parent;
|
|
57
|
+
if (!parent) return false
|
|
58
|
+
parentName = parent.$options.name;
|
|
59
|
+
}
|
|
60
|
+
return parent;
|
|
61
|
+
},
|
|
62
|
+
aderror(e) {
|
|
63
|
+
console.log("aderror: " + JSON.stringify(e.detail));
|
|
64
|
+
},
|
|
65
|
+
closeAd(e) {
|
|
66
|
+
this.borderShow = false
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
</script>
|
|
71
|
+
|
|
72
|
+
<style lang="scss" >
|
|
73
|
+
.uni-list-ad {
|
|
74
|
+
position: relative;
|
|
75
|
+
border: 1px red solid;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.uni-list--border {
|
|
79
|
+
position: relative;
|
|
80
|
+
padding-bottom: 1px;
|
|
81
|
+
/* #ifdef APP-PLUS */
|
|
82
|
+
border-top-color: $uni-border-color;
|
|
83
|
+
border-top-style: solid;
|
|
84
|
+
border-top-width: 0.5px;
|
|
85
|
+
/* #endif */
|
|
86
|
+
margin-left: $uni-spacing-row-lg;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* #ifndef APP-NVUE */
|
|
90
|
+
.uni-list--border:after {
|
|
91
|
+
position: absolute;
|
|
92
|
+
top: 0;
|
|
93
|
+
right: 0;
|
|
94
|
+
left: 0;
|
|
95
|
+
height: 1px;
|
|
96
|
+
content: '';
|
|
97
|
+
-webkit-transform: scaleY(.5);
|
|
98
|
+
transform: scaleY(.5);
|
|
99
|
+
background-color: $uni-border-color;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.uni-list-item--first:after {
|
|
103
|
+
height: 0px;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* #endif */
|
|
107
|
+
</style>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 这里是 uni-list 组件内置的常用样式变量
|
|
3
|
+
* 如果需要覆盖样式,这里提供了基本的组件样式变量,您可以尝试修改这里的变量,去完成样式替换,而不用去修改源码
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// 背景色
|
|
8
|
+
$background-color : #fff;
|
|
9
|
+
// 分割线颜色
|
|
10
|
+
$divide-line-color : #e5e5e5;
|
|
11
|
+
|
|
12
|
+
// 默认头像大小,如需要修改此值,注意同步修改 js 中的值 const avatarWidth = xx ,目前只支持方形头像
|
|
13
|
+
// nvue 页面不支持修改头像大小
|
|
14
|
+
$avatar-width : 45px ;
|
|
15
|
+
|
|
16
|
+
// 头像边框
|
|
17
|
+
$avatar-border-radius: 5px;
|
|
18
|
+
$avatar-border-color: #eee;
|
|
19
|
+
$avatar-border-width: 1px;
|
|
20
|
+
|
|
21
|
+
// 标题文字样式
|
|
22
|
+
$title-size : 16px;
|
|
23
|
+
$title-color : #3b4144;
|
|
24
|
+
$title-weight : normal;
|
|
25
|
+
|
|
26
|
+
// 描述文字样式
|
|
27
|
+
$note-size : 12px;
|
|
28
|
+
$note-color : #999;
|
|
29
|
+
$note-weight : normal;
|
|
30
|
+
|
|
31
|
+
// 右侧额外内容默认样式
|
|
32
|
+
$right-text-size : 12px;
|
|
33
|
+
$right-text-color : #999;
|
|
34
|
+
$right-text-weight : normal;
|
|
35
|
+
|
|
36
|
+
// 角标样式
|
|
37
|
+
// nvue 页面不支持修改圆点位置以及大小
|
|
38
|
+
// 角标在左侧时,角标的位置,默认为 0 ,负数左/下移动,正数右/上移动
|
|
39
|
+
$badge-left: 0px;
|
|
40
|
+
$badge-top: 0px;
|
|
41
|
+
|
|
42
|
+
// 显示圆点时,圆点大小
|
|
43
|
+
$dot-width: 10px;
|
|
44
|
+
$dot-height: 10px;
|
|
45
|
+
|
|
46
|
+
// 显示角标时,角标大小和字体大小
|
|
47
|
+
$badge-size : 18px;
|
|
48
|
+
$badge-font : 12px;
|
|
49
|
+
// 显示角标时,角标前景色
|
|
50
|
+
$badge-color : #fff;
|
|
51
|
+
// 显示角标时,角标背景色
|
|
52
|
+
$badge-background-color : #ff5a5f;
|
|
53
|
+
// 显示角标时,角标左右间距
|
|
54
|
+
$badge-space : 6px;
|
|
55
|
+
|
|
56
|
+
// 状态样式
|
|
57
|
+
// 选中颜色
|
|
58
|
+
$hover : #f5f5f5;
|