deming/pageD/activity/activity.vue

120 lines
2.7 KiB
Vue
Raw Normal View History

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