242 lines
5.2 KiB
Vue
242 lines
5.2 KiB
Vue
<template>
|
|
<view class="page">
|
|
<view class="title-box">
|
|
<text class="title">Hi,</text>
|
|
<text class="name">{{userName}}</text>
|
|
</view>
|
|
<view class="content">
|
|
<!-- Banner -->
|
|
<scroller @init="initScroller" @down="refreshData" @up="getData" :up="optUp"
|
|
@scroll="navFloatShow(scroller)" :fixed="false">
|
|
<view class="num-box">
|
|
<image src="../../static/images/ic_notify_icon.png" mode="aspectFill"></image>
|
|
<text>您一共有{{totalNum}}张国土绿化荣誉证书</text>
|
|
</view>
|
|
<!-- 列表 -->
|
|
<view class="content-box">
|
|
<view class="item" v-for="(item,index) in list" :key="index">
|
|
<image src="../../static/images/ic_circle_half.png" mode="aspectFill"></image>
|
|
<view class="item-content">
|
|
<view class="title">{{item.title}}</view>
|
|
<view class="time">{{item.startTime}}</view>
|
|
<view class="btn">查看</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</scroller>
|
|
</view>
|
|
<pageLoading v-if="showPageLoading"></pageLoading>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import scroller from '@/components/scroller/scroller.vue';
|
|
import pageLoading from '@/components/loading/pageLoading.vue';
|
|
export default {
|
|
components: {
|
|
pageLoading,
|
|
scroller
|
|
},
|
|
data() {
|
|
return {
|
|
userName: "昵称",
|
|
scroller: {},
|
|
optUp: {
|
|
auto: true,
|
|
onScroll: true,
|
|
page: {
|
|
num: 0, //当前页 默认0,回调之前会加1; 即callback(page)会从1开始
|
|
size: 10 //每页数据条数,默认10
|
|
},
|
|
empty: {
|
|
tip: '暂无数据~'
|
|
}
|
|
},
|
|
totalNum: 0,
|
|
showPageLoading: true,
|
|
list: [{
|
|
title: "测试测试测试测试测试测试测试测试测试测试测试测试",
|
|
startTime: "2022年9月10日",
|
|
endTime: "2022年9月30日"
|
|
}, {
|
|
title: "测试测试测试测试测试测试测试测试测试测试测试测试",
|
|
startTime: "2022年9月10日",
|
|
endTime: "2022年9月30日"
|
|
}, {
|
|
title: "测试测试测试测试测试测试测试测试测试测试测试测试",
|
|
startTime: "2022年9月10日",
|
|
endTime: "2022年9月30日"
|
|
}]
|
|
}
|
|
},
|
|
methods: {
|
|
/*初始化滚动*/
|
|
initScroller(scroller) {
|
|
this.scroller = scroller;
|
|
this.loadData();
|
|
},
|
|
|
|
/*刷新数据*/
|
|
refreshData() {
|
|
uni.showLoading({
|
|
title: '刷新中'
|
|
});
|
|
this.scroller.resetUpScroll();
|
|
},
|
|
|
|
/*加载数据*/
|
|
loadData() {
|
|
this.list = [];
|
|
this.scroller.resetUpScroll();
|
|
},
|
|
/*滚动时导航栏浮动*/
|
|
navFloatShow(scroller) {
|
|
|
|
},
|
|
//获取列表数据
|
|
getData() {
|
|
this.showPageLoading = false;
|
|
this.list = [{
|
|
title: "测试测试测试测试测试测试测试测试测试测试测试测试",
|
|
startTime: "2022年9月10日",
|
|
endTime: "2022年9月30日"
|
|
}, {
|
|
title: "测试测试测试测试测试测试测试测试测试测试测试测试",
|
|
startTime: "2022年9月10日",
|
|
endTime: "2022年9月30日"
|
|
}, {
|
|
title: "测试测",
|
|
startTime: "2022年9月10日",
|
|
endTime: "2022年9月30日"
|
|
}];
|
|
|
|
this.scroller.endBySize(0, 0);
|
|
this.scroller.endSuccess();
|
|
uni.hideLoading()
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
page {
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
.page {
|
|
display: flex;
|
|
flex: 1;
|
|
flex-direction: column;
|
|
overflow: hidden;
|
|
height: 100%;
|
|
}
|
|
|
|
.content {
|
|
flex: 1;
|
|
width: 100%;
|
|
height: 100rpx;
|
|
}
|
|
|
|
.title-box {
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: flex-start;
|
|
align-items: center;
|
|
padding: 20rpx;
|
|
|
|
.title {
|
|
font-size: 40rpx;
|
|
font-weight: 300;
|
|
color: black;
|
|
}
|
|
|
|
.name {
|
|
font-size: 30rpx;
|
|
font-weight: 200;
|
|
color: #139847;
|
|
}
|
|
}
|
|
|
|
.num-box {
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
background: #15A652;
|
|
justify-content: flex-start;
|
|
box-shadow: 0rpx 7rpx 33rpx 16rpx rgba(188, 226, 204, 0.15);
|
|
border-radius: 40rpx;
|
|
padding: 65rpx;
|
|
margin: 0rpx 20rpx;
|
|
|
|
image {
|
|
width: 40rpx;
|
|
height: 40rpx;
|
|
}
|
|
|
|
text {
|
|
color: #fff;
|
|
font-size: 30rpx;
|
|
text-align: center;
|
|
width: 85%;
|
|
}
|
|
}
|
|
|
|
.content-box {
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: flex-start;
|
|
align-items: flex-start;
|
|
padding: 20rpx;
|
|
|
|
.item {
|
|
display: flex;
|
|
flex-direction: row;
|
|
background: #fff;
|
|
border-radius: 10rpx;
|
|
margin: 20rpx 0rpx;
|
|
width: 100%;
|
|
box-shadow: 0rpx 7rpx 33rpx 16rpx rgba(188, 226, 204, 0.15);
|
|
|
|
|
|
image {
|
|
width: 39rpx;
|
|
height: 70rpx;
|
|
margin-top: 10rpx;
|
|
}
|
|
|
|
.item-content {
|
|
display: flex;
|
|
flex-direction: column;
|
|
width: 100%;
|
|
padding: 20rpx 15rpx;
|
|
|
|
.title {
|
|
font-size: 30rpx;
|
|
display: -webkit-box;
|
|
text-overflow: ellipsis;
|
|
-webkit-line-clamp: 1;
|
|
-webkit-box-orient: vertical;
|
|
overflow: hidden;
|
|
color: #000;
|
|
}
|
|
|
|
.time {
|
|
font-size: 20rpx;
|
|
color: #646464;
|
|
margin-top: 10rpx;
|
|
}
|
|
|
|
.btn {
|
|
font-size: 20rpx;
|
|
color: #747474;
|
|
margin-top: 10rpx;
|
|
margin-right: 15rpx;
|
|
align-self: flex-end;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
</style>
|