init
This commit is contained in:
+83
@@ -0,0 +1,83 @@
|
||||
/*下拉刷新--内容区,定位于区域底部*/
|
||||
.mescroll-downwarp .downwarp-content{
|
||||
height: 150rpx;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
/*下拉刷新--标语*/
|
||||
.mescroll-downwarp .downwarp-slogan{
|
||||
padding: 32rpx 0 0 36rpx;
|
||||
font-size: 26rpx;
|
||||
color: gray;
|
||||
}
|
||||
/*下拉刷新--进度提示*/
|
||||
.mescroll-downwarp .downwarp-text{
|
||||
margin-top: 4rpx;
|
||||
font-size: 22rpx;
|
||||
color: darkgray;
|
||||
}
|
||||
/*下拉刷新--向下进度动画*/
|
||||
.mescroll-downwarp .downwarp-progress{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
width: auto;
|
||||
height: auto;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
margin-right: 0;
|
||||
margin-left: -180rpx;
|
||||
display: flex;
|
||||
align-items: middle;
|
||||
}
|
||||
/*下拉刷新--人*/
|
||||
.mescroll-downwarp .downwarp-man{
|
||||
width: 105rpx;
|
||||
height: 146rpx;
|
||||
transform-origin: left 60%;
|
||||
}
|
||||
/*下拉刷新--盒子*/
|
||||
.mescroll-downwarp .downwarp-box{
|
||||
width: 36rpx;
|
||||
height: 30rpx;
|
||||
margin-top: 60rpx;
|
||||
margin-left: -40rpx;
|
||||
transform-origin: right -100%;
|
||||
}
|
||||
/*下拉刷新--进度条*/
|
||||
.mescroll-downwarp .downwarp-loading{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
margin-left: -176rpx;
|
||||
width: 100rpx;
|
||||
height: 140rpx;
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
animation: animManRun .3s steps(1,start) infinite;
|
||||
}
|
||||
|
||||
@keyframes animManRun {
|
||||
0% {background-image: url(https://www.mescroll.com/img/jingdong/mescroll-progress2.png)}
|
||||
40% {background-image: url(https://www.mescroll.com/img/jingdong/mescroll-progress3.png)}
|
||||
70% {background-image: url(https://www.mescroll.com/img/jingdong/mescroll-progress4.png)}
|
||||
100% {background-image: url(https://www.mescroll.com/img/jingdong/mescroll-progress2.png)}
|
||||
}
|
||||
|
||||
.mescroll-downwarp .downwarp-loading:before{
|
||||
position: absolute;
|
||||
top: 30rpx;
|
||||
left: 50%;
|
||||
margin-left: -120rpx;
|
||||
content: '';
|
||||
width: 80rpx;
|
||||
height: 140rpx;
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
background-image: url(https://www.mescroll.com/img/jingdong/mescroll-progress5.png);
|
||||
}
|
||||
|
||||
/*下拉刷新--资源预加载,避免下拉的时候闪白屏*/
|
||||
.mescroll-downwarp .downwarp-load-preload {
|
||||
animation: animManRun 1s steps(1, end) 1s;
|
||||
pointer-events: none;
|
||||
}
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
<!-- 下拉刷新区域 -->
|
||||
<template>
|
||||
<view v-if="mOption.use" class="mescroll-downwarp" :style="{'background':mOption.bgColor,'color':mOption.textColor}">
|
||||
<view class="downwarp-content">
|
||||
<view class="downwarp-slogan">让购物更便捷</view>
|
||||
<view class="downwarp-text">{{downText}}</view>
|
||||
<view v-if="isDownLoading" class="downwarp-loading"></view>
|
||||
<view v-else class="downwarp-progress">
|
||||
<image class="downwarp-man" :style="{'transform':downRotate, 'transition': transition}" src="https://www.mescroll.com/img/jingdong/mescroll-progress1.png" mode="widthFix"/>
|
||||
<image class="downwarp-box" :style="{'transform':downRotate, 'transition': transition}" src="https://www.mescroll.com/img/jingdong/mescroll-progress0.png" mode="widthFix"/>
|
||||
</view>
|
||||
<!-- 预加载,避免首次显示动画时,图片没及时加载完毕导致短暂的白屏 -->
|
||||
<view class="downwarp-preload"></view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
option: Object, // down的配置项
|
||||
type: Number, // 下拉状态(inOffset:1, outOffset:2, showLoading:3, endDownScroll:4)
|
||||
rate: Number // 下拉比率 (inOffset: rate<1; outOffset: rate>=1)
|
||||
},
|
||||
computed: {
|
||||
// 支付宝小程序需写成计算属性,prop定义default仍报错
|
||||
mOption() {
|
||||
return this.option || {};
|
||||
},
|
||||
// 是否在加载中
|
||||
isDownLoading() {
|
||||
return this.type === 3;
|
||||
},
|
||||
// 缩放比例
|
||||
downRotate() {
|
||||
return this.type === 1 ? 'scale('+this.rate+','+this.rate+')' : this.type === 4 ? 'scale(0,0)' : '';
|
||||
},
|
||||
// 过渡
|
||||
transition() {
|
||||
return this.type===4 ? 'transform 300ms' : ''
|
||||
},
|
||||
// 文本提示
|
||||
downText() {
|
||||
switch (this.type) {
|
||||
case 1:
|
||||
return this.mOption.textInOffset;
|
||||
case 2:
|
||||
return this.mOption.textOutOffset;
|
||||
case 3:
|
||||
return this.mOption.textLoading;
|
||||
case 4:
|
||||
return this.mOption.textLoading;
|
||||
default:
|
||||
return this.mOption.textInOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@import '../../../mescroll-uni/components/mescroll-down.css';
|
||||
@import './mescroll-down.css';
|
||||
</style>
|
||||
@@ -0,0 +1,16 @@
|
||||
/*上拉加载--进度条*/
|
||||
.mescroll-upwarp .upwarp-progress{
|
||||
display: inline-block;
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
border: none;
|
||||
background-image: url(https://www.mescroll.com/img/jingdong/mescroll-loading2.png);
|
||||
background-size: contain;
|
||||
}
|
||||
.mescroll-upwarp .upwarp-loading{
|
||||
display: inline-block;
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
background-image: url(https://www.mescroll.com/img/jingdong/mescroll-loading1.png);
|
||||
background-size: contain;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<!-- 上拉加载区域 -->
|
||||
<template>
|
||||
<view class="mescroll-upwarp" :style="{'background':mOption.bgColor,'color':mOption.textColor}">
|
||||
<!-- 加载中 (此处不能用v-if,否则android小程序快速上拉可能会不断触发上拉回调) -->
|
||||
<view v-show="isUpLoading">
|
||||
<view class="upwarp-progress">
|
||||
<view class="upwarp-loading mescroll-rotate"></view>
|
||||
</view>
|
||||
<view class="upwarp-tip">{{ mOption.textLoading }}</view>
|
||||
</view>
|
||||
<!-- 无数据 -->
|
||||
<view v-if="isUpNoMore" class="upwarp-nodata">{{ mOption.textNoMore }}</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
option: Object, // up的配置项
|
||||
type: Number // 上拉加载的状态:0(loading前),1(loading中),2(没有更多了,显示END文本提示),3(没有更多了,不显示END文本提示)
|
||||
},
|
||||
computed: {
|
||||
// 支付宝小程序需写成计算属性,prop定义default仍报错
|
||||
mOption() {
|
||||
return this.option || {};
|
||||
},
|
||||
// 加载中
|
||||
isUpLoading() {
|
||||
return this.type === 1;
|
||||
},
|
||||
// 没有更多了
|
||||
isUpNoMore() {
|
||||
return this.type === 2;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@import '../../../mescroll-uni/components/mescroll-up.css';
|
||||
@import './mescroll-up.css';
|
||||
</style>
|
||||
Reference in New Issue
Block a user