加入文化详情页面

This commit is contained in:
wuxw 2020-02-23 23:16:23 +08:00
parent 531024fcb1
commit 9e24407b22
4 changed files with 196 additions and 4 deletions

View File

@ -31,6 +31,18 @@
}
}
,{
"path" : "pages/activityes/activityes",
"style" : {
"navigationBarTitleText": "小区文化"
}
}
,{
"path" : "pages/activityDetail/activityDetail",
"style" : {
"navigationBarTitleText": "文化详情"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "white",

View File

@ -0,0 +1,65 @@
<template>
<view>
<view class="detailContainer">
<image class="headImg" :src="src"></image>
<view class="ad_titile">
<text class="company">{{title}}</text>
</view>
<view>
<view span="8" offset="4"><text class="ad_au_text">{{userName}}</text></view>
<view span="8" offset="2"><text class="ad_au_text">{{startTime}}</text></view>
</view>
<view class="ad_context">
<van-divider />
<rich-text :nodes="context"/>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
activity:{
}
}
},
onLoad(options) {
this.activity = JSON.parse(options.item);
console.log('文化详情',JSON.parse(options.item));
},
methods: {
}
}
</script>
<style>
.detailContainer{
background-color: #fff;
}
.detailContainer .headImg{
width: 100%;
height: 400rpx;
}
.detailContainer .ad_titile{
text-align: center;
margin-top: 30rpx;
margin-bottom: 30rpx;
font-size: 44rpx;
}
.detailContainer .ad_au_text{
font-size: 32rpx;
color: #8e8e8e
}
.detailContainer .ad_context{
padding: 0rpx 40rpx 40rpx 40rpx;
}
</style>

View File

@ -0,0 +1,105 @@
<template>
<view>
<view class="cu-card case no-card margin-top" v-for="(item,index) in activities" :key = "index">
<view class="cu-item shadow " >
<view class="image">
<image :src="item.src"
class="act-cu-img" ></image>
<view class="cu-bar bg-shadeBottom"> <text class="text-cut">{{item.title}}</text></view>
</view>
<view class="cu-list menu-avatar">
<view class="cu-item">
<view class="cu-avatar round lg" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg);"></view>
<view class="content flex-sub">
<view class="text-grey">{{item.userName}}</view>
<view class="text-gray text-sm flex justify-between">
{{item.startTime}}
<view class="text-gray text-sm">
<text class="cuIcon-attentionfill margin-lr-xs"></text> {{item.readCount}}
<text class="cuIcon-appreciatefill margin-lr-xs"></text> {{item.likeCount}}
<text class="cuIcon-messagefill margin-lr-xs"></text> {{item.collectCount}}
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
activities:[],
currentCommunityId:''
}
},
onLoad(options) {
this.currentCommunityId = options.currentCommunityId;
this._loadActivites();
},
methods: {
/**
* 加载活动
* 第一次加载是可能没有小区 则直接下载固定小区
*
*/
_loadActivites: function () {
let _that = this;
let _objData = {
page: 1,
row: 15,
communityId: this.currentCommunityId
};
_that.java110Context.request({
url: _that.java110Constant.url.listActivitiess,
header: _that.java110Context.getHeaders(),
method: "GET",
data: _objData, //
success: function (res) {
console.log("请求返回信息:", res);
if (res.statusCode == 200) {
let _activites = res.data.activitiess;
let _acts = [];
_activites.forEach(function (_item) {
_item.src = _that.java110Constant.url.filePath + "?fileId=" + _item.headerImg + "&communityId=" + _that.currentCommunityId + "&time=" + new Date();
let _startTime = _item.startTime.replace(/\-/g, "/")
let _tmpStartTime = new Date(_startTime);
_item.startTime = _that.java110Util.date.formatDate(_tmpStartTime);
_acts.push(_item);
});
_that.activities= _acts;
return;
}
wx.showToast({
title: "服务器异常了",
icon: 'none',
duration: 2000
})
},
fail: function (e) {
wx.showToast({
title: "服务器异常了",
icon: 'none',
duration: 2000
})
}
});
},
}
}
</script>
<style>
.act-cu-img{
height: 400upx;
}
</style>

View File

@ -26,14 +26,14 @@
<view class="action">
小区文化
</view>
<view class="action">
<view class="action" @tap="_moreActivity()">
<text class="lg text-gray cuIcon-more"></text>
</view>
</view>
<view class="noticesList">
<block v-for="(item,index) in activitys" :key="index" wx:key="index" >
<view class="noticesList-list" >
<view class="noticesList-list" @tap="_toDetail(item)">
<view class="notices-info">
<view class="notices-info-name">{{item.title}}</view>
@ -231,6 +231,16 @@
})
}
});
},
_moreActivity:function(){
uni.navigateTo({
url:'/pages/activityes/activityes?currentCommunityId='+this.currentCommunityId
});
},
_toDetail:function(_item){
uni.navigateTo({
url:'/pages/activityDetail/activityDetail?item='+JSON.stringify(_item)
});
}
}