Commit 921c555a by zhanxin liu

fix

parent dcc61f1c
{
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/Security-Check/index",
"path": "pages/Security-Check/security-task-list",
"style": {
}
},
......
<template>
<view class="page-news">
<uni-list class="listview" :enableBackToTop="true" :scroll-y="true" @scrolltolower="loadMore()">
<uni-refresh class="refresh" @refresh="onrefresh" @pullingdown="onpullingdown" :display="refreshing ? 'show' : 'hide'">
<div class="refresh-view">
<image class="refresh-icon" :src="refreshIcon" :style="{width: (refreshing || pulling) ? 0: '32px'}"
:class="{'refresh-icon-active': refreshFlag}"></image>
<uni-load-more v-if="refreshing" class="loading-icon" status="loading" :contentText="loadingMoreText"></uni-load-more>
<text class="loading-text">{{refreshText}}</text>
</div>
</uni-refresh>
<uni-cell v-for="(item, index) in dataList" :key="item.id">
<text>啦啦啦啦啦啦</text>
</uni-cell>
<uni-cell v-if="isLoading || dataList.length > 4">
<view class="loading-more">
<text class="loading-more-text">{{loadingText}}</text>
</view>
</uni-cell>
</uni-list>
<no-data class="no-data" v-if="isNoData" @retry="loadMore"></no-data>
<mescroll-body ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback" @up="upCallback">
<view class="news-li" v-for="news in dataList" :key="news.id">
<view>标题</view>
<view class="new-content">内容</view>
</view>
</mescroll-body>
</template>
<script>
import uniList from '@/components/list/uni-list/uni-list.vue';
import uniCell from '@/components/list/uni-list/uni-cell.vue';
import uniRefresh from '@/components/load-more/uni-refresh.vue';
import uniLoadMore from '@/components/load-more/uni-load-more.vue';
import noData from '@/components/load-more/nodata.nvue';
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
export default {
components: {
uniList,
uniCell,
uniRefresh,
uniLoadMore,
noData,
},
props: {
},
mixins: [MescrollMixin],
data() {
return {
dataList: ["1","2","1","2","1","2","1","2","1","2","1","2","1","2"],
navigateFlag: false,
pulling: false,
refreshing: false,
refreshFlag: false,
refreshText: "",
isLoading: false,
loadingText: '加载中...',
isNoData: false,
pulling: false,
angle: 0,
loadingMoreText: {
contentdown: '',
contentrefresh: '',
contentnomore: ''
},
refreshIcon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAB5QTFRFcHBw3Nzct7e39vb2ycnJioqK7e3tpqam29vb////D8oK7wAAAAp0Uk5T////////////ALLMLM8AAABxSURBVHja7JVBDoAgDASrjqj//7CJBi90iyYeOHTPMwmFZrHjYyyFYYUy1bwUZqtJIYVxhf1a6u0R7iUvWsCcrEtwJHp8MwMdvh2amHduiZD3rpWId9+BgPd7Cc2LIkPyqvlQvKxKBJ//Qwq/CacAAwDUv0a0YuKhzgAAAABJRU5ErkJggg=="
}
downOption: {
auto: false //是否在初始化后,自动执行downCallback; 默认true
},
created() {
this.pullTimer = null;
dataList: [1,2,3,4,5,6,6,7,8,8],
upOption: {
use: false, // 是否启用上拉加载; 默认true
},
methods: {
loadData(refresh) {
if (this.isLoading) {
return;
}
this.isLoading = true;
this.isNoData = false;
this.requestParams.time = new Date().getTime() + '';
var startTime = new Date();
},
loadMore(e) {
this.loadData();
},
clear() {
this.dataList.length = 0;
this.requestParams.minId = 0;
},
refreshData() {
if (this.isLoading) {
return;
}
this.pulling = true;
this.refreshing = true;
this.refreshText = "正在刷新...";
this.loadData(true);
},
onrefresh(e) {
this.refreshData();
},
onpullingdown(e) {
if (this.refreshing) {
return;
}
this.pulling = false;
if (Math.abs(e.pullingDistance) > Math.abs(e.viewHeight)) {
this.refreshFlag = true;
this.refreshText = "释放立即刷新";
} else {
this.refreshFlag = false;
this.refreshText = "下拉可以刷新";
}
methods: {
/*下拉刷新的回调 */
downCallback() {
this.mescroll.endSuccess();
},
newGuid() {
let s4 = function() {
return (65536 * (1 + Math.random()) | 0).toString(16).substring(1);
}
return (s4() + s4() + "-" + s4() + "-4" + s4().substr(0, 3) + "-" + s4() + "-" + s4() + s4() + s4()).toUpperCase();
}
}
}
</script>
<style scoped>
.no-data {
flex: 1;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
z-index: 10;
}
.page-news {
flex: 1;
flex-direction: column;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
}
/*上拉加载的回调 */
upCallback(page) {
.listview {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
/* #ifndef APP-NVUE */
display: flex;
flex-direction: column;
/* #endif */
/* #ifndef MP-ALIPAY */
flex-direction: column;
/* #endif */
}
.refresh {
justify-content: center;
}
.refresh-view {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
width: 750rpx;
height: 64px;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
}
.refresh-icon {
width: 32px;
height: 32px;
transition-duration: .5s;
transition-property: transform;
transform: rotate(0deg);
transform-origin: 15px 15px;
}
.refresh-icon-active {
transform: rotate(180deg);
}
.loading-icon {
width: 28px;
height: 28px;
margin-right: 5px;
color: gray;
}
.loading-text {
margin-left: 2px;
font-size: 16px;
color: #999999;
}
</script>
.loading-more {
align-items: center;
justify-content: center;
padding-top: 14px;
padding-bottom: 14px;
<style>
/*说明*/
.notice{
font-size: 30upx;
padding: 40upx 0;
border-bottom: 1upx solid #eee;
text-align: center;
}
.loading-more-text {
/*展示上拉加载的数据列表*/
.news-li{
font-size: 32upx;
padding: 32upx;
border-bottom: 1upx solid #eee;
}
.news-li .new-content{
font-size: 28upx;
color: #999;
margin-top: 10upx;
margin-left: 20upx;
color: #666;
}
</style>
<template>
<view>
<mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption"
\ No newline at end of file
var isReady=false;var onReadyCallbacks=[];
var __uniConfig = {"pages":["pages/Security-Check/index","pages/Switch-School/index","components/address-select/index"],"window":{"navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8"},"splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"cloudTrain","compilerVersion":"2.5.11","entryPagePath":"pages/Security-Check/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
var __uniRoutes = [{"path":"/pages/Security-Check/index","meta":{"isQuit":true},"window":{}},{"path":"/pages/Switch-School/index","meta":{},"window":{"navigationBarTitleText":""}},{"path":"/components/address-select/index","meta":{},"window":{"navigationBarTitleText":""}}];
var __uniConfig = {"pages":["pages/Security-Check/security-task-list","pages/Switch-School/index","components/address-select/index"],"window":{"navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8"},"splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"cloudTrain","compilerVersion":"2.5.11","entryPagePath":"pages/Security-Check/security-task-list","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
var __uniRoutes = [{"path":"/pages/Security-Check/security-task-list","meta":{"isQuit":true},"window":{}},{"path":"/pages/Switch-School/index","meta":{},"window":{"navigationBarTitleText":""}},{"path":"/components/address-select/index","meta":{},"window":{"navigationBarTitleText":""}}];
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes}}}});
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment