You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
131 lines
5.7 KiB
131 lines
5.7 KiB
<template>
|
|
<view class='load-more'>
|
|
<block v-if="!loading&&noMore">
|
|
<view class="loadmore__line"></view>
|
|
<text class="loadmore__text">{{noMoreText}}</text>
|
|
<view class="loadmore__line"></view>
|
|
</block>
|
|
<block v-if="loading">
|
|
<view class="weui-loading"></view>
|
|
<text class="loadmore__text">{{loadText}}</text>
|
|
</block>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'load-more',
|
|
props: {
|
|
loadText: {
|
|
type: String,
|
|
default () {
|
|
return '努力加载中'
|
|
}
|
|
},
|
|
noMoreText: {
|
|
type: String,
|
|
default () {
|
|
return '没有更多了'
|
|
}
|
|
},
|
|
noMore: {
|
|
type: Boolean,
|
|
default () {
|
|
return false
|
|
}
|
|
},
|
|
loading: {
|
|
type: Boolean,
|
|
default () {
|
|
return true
|
|
}
|
|
}
|
|
},
|
|
created() {
|
|
|
|
},
|
|
data() {
|
|
return {
|
|
|
|
}
|
|
},
|
|
methods: {
|
|
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
.load-more {
|
|
display: flex;
|
|
width: 100%;
|
|
height: 90rpx;
|
|
justify-content: center;
|
|
align-items: center;
|
|
}
|
|
|
|
.loading-icon {
|
|
width: 30rpx;
|
|
height: 30rpx;
|
|
margin-right: 8rpx;
|
|
display: inline-block;
|
|
vertical-align: middle;
|
|
animation: weuiLoading 1s steps(12, end) infinite;
|
|
background: url('https://s10.mogucdn.com/mlcdn/c45406/171016_4a61e09hcadd157gadhdeje55e82c_32x32.png') no-repeat;
|
|
-webkit-background-size: 100%;
|
|
background-size: 100%;
|
|
}
|
|
|
|
.loadmore__text {
|
|
margin: 0 8rpx 0 8rpx;
|
|
color: #999;
|
|
font-size: 28rpx;
|
|
}
|
|
|
|
.loadmore__line {
|
|
width: 100rpx;
|
|
height: 1rpx;
|
|
border-top: 1rpx solid #d2d2d2;
|
|
}
|
|
|
|
/* 加载中动画 */
|
|
.weui-loading {
|
|
margin: 0 5px;
|
|
width: 20px;
|
|
height: 20px;
|
|
display: inline-block;
|
|
vertical-align: middle;
|
|
-webkit-animation: a 1s steps(12) infinite;
|
|
animation: a 1s steps(12) infinite;
|
|
background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUo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;
|
|
background-size: 100%
|
|
}
|
|
|
|
.weui-loading.weui-loading_transparent {
|
|
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect xmlns='http://www.w3.org/2000/svg' width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.56)' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.5)' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.43)' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.38)' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.32)' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.28)' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.25)' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.2)' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.17)' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.14)' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.1)' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.03)' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E")
|
|
}
|
|
|
|
@-webkit-keyframes a {
|
|
0% {
|
|
-webkit-transform: rotate(0deg);
|
|
transform: rotate(0deg)
|
|
}
|
|
|
|
to {
|
|
-webkit-transform: rotate(1turn);
|
|
transform: rotate(1turn)
|
|
}
|
|
}
|
|
|
|
@keyframes a {
|
|
0% {
|
|
-webkit-transform: rotate(0deg);
|
|
transform: rotate(0deg)
|
|
}
|
|
|
|
to {
|
|
-webkit-transform: rotate(1turn);
|
|
transform: rotate(1turn)
|
|
}
|
|
}
|
|
</style>
|
|
|