deming/pageD/activity/activity.vue

120 lines
2.7 KiB
Vue

<template>
<view id="actives" :style="{height : height + 'px'}">
<!-- 活动消息推送 -->
<block v-for="(item, index) in actives" :key="index">
<view class="time">{{ item.addtime }}</view>
<view class="activity">
<view class="content">
<view class="title">{{item.title}}</view>
<view class="images_about">
<image :src="item.picture" mode="aspectFill"></image>
<view>
<text class="u-line-2">{{item.summary}}</text>
</view>
</view>
</view>
</view>
</block>
<u-loadmore :status="loadStatus" bg-color="#ECECEC" margin-top="20" v-if="loadStatus=='nomore'" />
</view>
</template>
<script>
export default {
data() {
return {
height:'600',
actives: [],
loadStatus: 'loadmore'
};
},
onLoad(){
var _that = this
_that.messageactivityList();
uni.getSystemInfo({
success: function (res) {
console.log(res.windowHeight);
_that.height = res.windowHeight
}
});
},
methods: {
titletext(){
},
// 活动消息列表
messageactivityList(){
this.$u.api.messageactivityList({}).then((res)=>{
if (res.errCode == 0) {
this.actives = res.data;
// 目前没有分页,只无数据提示用,他们建议这样做
if(!this.actives.length) this.loadStatus = 'nomore';
}
})
}
},
components:{
}
};
</script>
<style lang="scss">
page {
background-color: #ECECEC;
}
uni-page-body{
height: 100%;
}
#actives{
background: #ECECEC;
.time {
padding: 30rpx 0;
color: #666;
text-align: center;
font-size: 28rpx;
}
}
.activity{
.times{
width:100%;
font-size:28rpx;
font-weight:400;
color:rgba(102,102,102,1);
text-align: center;
padding: 39rpx 0 30rpx;
}
.content{
width:94%;
padding: 30rpx;
background:rgba(255,255,255,1);
border-radius:20rpx;
margin: 0 auto;
overflow: hidden;
image{
flex-shrink: 0;
width: 140rpx;
height: 140rpx;
}
.title{
font-size:30rpx;
color:rgba(51,51,51,1);
padding: 0rpx 0 19rpx;
}
.images_about{
display: flex;
& > view{
display: flex;
flex-direction: column;
justify-content: center;
width: 100%;
height: 140rpx;
line-height: 36rpx;
padding: 20rpx;
background: rgba(241,241,241,1);
& > text {
}
}
}
}
}
</style>