Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
JamyKing committed Mar 12, 2021
2 parents f90fab5 + 63da45f commit c7e1842
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 26 deletions.
11 changes: 11 additions & 0 deletions .hbuilderx/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
"version": "0.0",
"configurations": [{
"type": "uniCloud",
"default": {
"launchtype": "remote"
}
}
]
}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ export default {
| isRefresh | Boolean | true | 是否开启手势下拉刷新功能(true: 开启; false: 关闭) |
| refreshType | String | hollowDots | 刷新动画,可选类型参数(hollowDots, halfCircle, swappingSquares) |
| color | String | #F3F5F5 | 自定义动画颜色 |
| heightReduce | String | 0 | 裁剪高度(在整个屏幕高度中除该组件外,其余部分占据的高度,单位:rpx) |
| fixedHeight | String | 0 | 固定高度(优先级:fixedHeight > heightReduce;适用于确定组件容器高度的情况下;单位:rpx) |
| heightReduce | String | 0 | 裁剪高度(在整个屏幕高度中除该组件外,其余部分占据的高度;适用于不确定组件容器高度,欲撑满屏幕;单位:rpx) |
| backgroundCover | String | white | 数据列表块背景色 |
| pageNo | Number | 0 | 当前页码 |
| totalPageNo | Number | 0 | 总页数 |
Expand Down
51 changes: 29 additions & 22 deletions components/load-refresh/load-refresh.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
type: String,
default: 'hollowDots'
},
fixedHeight: {
type: String,
default: '0'
},
heightReduce: {
type: String,
default: '0'
Expand Down Expand Up @@ -92,8 +96,12 @@
// 计算组件所占屏幕高度
getHeight() {
// rpx = px / uni.getSystemInfoSync().windowWidth * 750
let height = uni.getSystemInfoSync().windowHeight - uni.upx2px(0 + this.heightReduce)
return `height: ${height}px;`
if (Number(this.fixedHeight)) {
return `height: ${this.fixedHeight}rpx;`
} else {
let height = uni.getSystemInfoSync().windowHeight - uni.upx2px(0 + this.heightReduce)
return `height: ${height}px;`
}
},
// 判断loadText,可以根据需求自定义
loadText() {
Expand Down Expand Up @@ -176,6 +184,25 @@
<style lang="scss" scoped>
$color: var(--color);
.load-refresh{
margin: 0;
padding: 0;
width: 100%;
.cover-container{
width: 100%;
margin-top: -100rpx;
.list{
width: 100%;
.load-more{
font-size: 20rpx;
text-align: center;
color: #AAAAAA;
padding: 16rpx;
}
}
}
}
/* 动画 */
.animation {
width: 100%;
Expand Down Expand Up @@ -306,24 +333,4 @@
}
}
}
/* 列表 */
.load-refresh{
margin: 0;
padding: 0;
width: 100%;
.cover-container{
width: 100%;
margin-top: -100rpx;
.list{
width: 100%;
.load-more{
font-size: 20rpx;
text-align: center;
color: #AAAAAA;
padding: 16rpx;
}
}
}
}
</style>
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name" : "uni-load-refresh",
"appid" : "__UNI__B809977",
"description" : "",
"versionName" : "1.2.0",
"versionCode" : "100",
"versionName" : "2.1.1",
"versionCode" : "211",
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
Expand Down
1 change: 0 additions & 1 deletion pages/index/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
:isRefresh="true"
refreshType="hollowDots"
color="#04C4C4"
heightReduce="0"
backgroundCover="#F3F5F5"
:pageNo="currPage"
:totalPageNo="totalPage"
Expand Down

0 comments on commit c7e1842

Please sign in to comment.