Browse Source

活动列表页面

feature/societyOrg
FightingN 4 years ago
parent
commit
96cff44baa
  1. 3
      epdc-resident-mp-yushan/app.json
  2. 9
      epdc-resident-mp-yushan/project.config.json
  3. 10
      epdc-resident-mp-yushan/project.private.config.json
  4. 109
      epdc-resident-mp-yushan/subpages/heart/pages/moreList/moreList.js
  5. 7
      epdc-resident-mp-yushan/subpages/heart/pages/moreList/moreList.json
  6. 34
      epdc-resident-mp-yushan/subpages/heart/pages/moreList/moreList.wxml
  7. 78
      epdc-resident-mp-yushan/subpages/heart/pages/moreList/moreList.wxss
  8. 23
      epdc-resident-mp-yushan/subpages/heart/utils/heartApi.js
  9. 2
      epdc-resident-mp-yushan/utils/config.js

3
epdc-resident-mp-yushan/app.json

@ -69,7 +69,8 @@
"pages/cancelDetail/cancelDetail", "pages/cancelDetail/cancelDetail",
"pages/joinVolunteerOrg/joinVolunteerOrg", "pages/joinVolunteerOrg/joinVolunteerOrg",
"pages/volunteerOrgList/volunteerOrgList", "pages/volunteerOrgList/volunteerOrgList",
"pages/activeApply/activeApply" "pages/activeApply/activeApply",
"pages/moreList/moreList"
] ]
}, },
{ {

9
epdc-resident-mp-yushan/project.config.json

@ -17,8 +17,8 @@
"checkInvalidKey": true, "checkInvalidKey": true,
"checkSiteMap": true, "checkSiteMap": true,
"uploadWithSourceMap": true, "uploadWithSourceMap": true,
"useMultiFrameRuntime": true, "useMultiFrameRuntime": false,
"useApiHook": true, "useApiHook": false,
"useApiHostProcess": false, "useApiHostProcess": false,
"babelSetting": { "babelSetting": {
"ignore": [], "ignore": [],
@ -26,12 +26,11 @@
"outputPath": "" "outputPath": ""
}, },
"useIsolateContext": false, "useIsolateContext": false,
"useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false,
"userConfirmedBundleSwitch": false, "userConfirmedBundleSwitch": false,
"packNpmManually": false, "packNpmManually": false,
"packNpmRelationList": [], "packNpmRelationList": [],
"minifyWXSS": true "minifyWXSS": true,
"showES6CompileOption": false
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.10.4", "libVersion": "2.10.4",

10
epdc-resident-mp-yushan/project.private.config.json

@ -40,20 +40,22 @@
"scene": null "scene": null
}, },
{ {
"name": "pages/mine/mine",
"pathName": "pages/mine/mine",
"name": "pages/index/index", "name": "pages/index/index",
"pathName": "pages/index/index", "pathName": "pages/index/index",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"name": "亮身份",
"pathName": "subpages/status/pages/brightStatus/brightStatus",
"name": "subpages/communityNews/pages/index/index", "name": "subpages/communityNews/pages/index/index",
"pathName": "subpages/communityNews/pages/index/index", "pathName": "subpages/communityNews/pages/index/index",
"query": "", "query": "",
"scene": null "scene": null
},
{
"name": "活动列表",
"pathName": "subpages/heart/pages/moreList/moreList",
"query": "",
"scene": null
} }
] ]
} }

109
epdc-resident-mp-yushan/subpages/heart/pages/moreList/moreList.js

@ -0,0 +1,109 @@
// import { getStudyNewsList } from '../../../../api/studyPlace'
const api = require('../../utils/heartApi')
Page({
data: {
newsLsit: [
{
id: '1',
title: '小区环境美化正在进行中,各社区居民积极参与',
state: 0, //审核状态:0-审核中,5-未通过,10-待发布,15已发布
stateName: '审核中', //状态名
createdTime: '2020.10.09',
},
{
id: '2',
title: '小区环境美化正在进行中,各社区居民积极参与',
state: 5, //审核状态:0-审核中,5-未通过,10-待发布,15已发布
stateName: '未通过', //状态名
createdTime: '2020.10.09',
},
{
id: '3',
title: '小区环境美化正在进行中,各社区居民积极参与',
state: 10, //审核状态:0-审核中,5-未通过,10-待发布,15已发布
stateName: '待发布', //状态名
createdTime: '2020.10.09',
},
{
id: '4',
title: '小区环境美化正在进行中,各社区居民积极参与',
state: 15, //审核状态:0-审核中,5-未通过,10-待发布,15已发布
stateName: '已发布', //状态名
createdTime: '2020.10.09',
},
{
id: '6',
title: '小区环境美化正在进行中,各社区居民积极参与',
state: 0, //审核状态:0-审核中,5-未通过,10-待发布,15已发布
stateName: '审核中', //状态名
createdTime: '2020.10.09',
},
],
pageIndex: 1,
pageSize: 10,
loadMoreVisible: true,
loadMoreType: 'loading',
isShow: false,
},
onLoad: function () {
// this.getStudyNewsList()
},
// 列表点击事件
toDetail(e) {
wx.navigateTo({
// url: `/pages/listDetail/listDetail?newsId=${e.detail.id}&pageType=studyTypeList`,
})
},
getStudyNewsList() {
let params = {
pageIndex: this.data.pageIndex,
pageSize: this.data.pageSize,
}
if (this.data.pageIndex == 1) {
this.setData({
newsLsit: [],
})
}
api.getActivityList(params)
.then((res) => {
let newsLsit = []
res.data.forEach((item) => {
newsLsit.push({
newsImageUrl: item.newsImageUrl,
newsTitle: item.newsTitle,
newsContent: item.richTextContent,
id: item.id,
})
})
this.setData({
newsLsit: this.data.newsLsit.concat(newsLsit),
loadMoreType:
res.data.length < this.data.pageSize ? 'none' : 'loading',
})
if (this.data.newsLsit == 0) {
this.setData({
isShow: true,
loadMoreVisible: false,
})
}
})
.catch((err) => {
this.setData({
loadMoreVisible: false,
isShow: true,
})
})
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
if (this.data.loadMoreType == 'none') {
return
}
this.setData({
pageIndex: ++this.data.pageIndex,
})
this.getStudyNewsList()
},
})

7
epdc-resident-mp-yushan/subpages/heart/pages/moreList/moreList.json

@ -0,0 +1,7 @@
{
"navigationBarTitleText": "活动申请",
"usingComponents": {
"load-more": "../../../../components/loadMore/loadMore",
"no-data": "../../../../components/nodata/nodata"
}
}

34
epdc-resident-mp-yushan/subpages/heart/pages/moreList/moreList.wxml

@ -0,0 +1,34 @@
<view class="more-list">
<!-- <view class="item-box">
<view class="item-title" hover-class="none" hover-stop-propagation="false">
服务为民,一次办好
</view>
<view class="item-bottom">
<view class="item-bottom-left">
<view class="state">审核中</view>
<view class="time">2020.10.01</view>
</view>
<view class="item-bottom-right">
<view class="edit">编辑</view>
<view class="look">查看</view>
</view>
</view>
</view> -->
<view class="item-box" wx:for="{{newsLsit}}">
<view class="item-title" hover-class="none" hover-stop-propagation="false">{{item.title}}</view>
<view class="item-bottom">
<view class="item-bottom-left">
<view class="state {{item.state==0? 'state':item.state==5?'state-nopass':item.state==10?'state':item.state==15?'state-published':''}}">
{{item.stateName}}
</view>
<view class="time">{{item.createdTime}}</view>
</view>
<view class="item-bottom-right">
<view class="edit" wx:if="{{item.state ==0 || item.state ==5}}">编辑</view>
<view class="look" bind:tap='toDetail'>查看</view>
</view>
</view>
</view>
</view>
<load-more loadMoreVisible="{{loadMoreVisible}}" loadMoreType="{{loadMoreType}}" bg-f="bg-f"></load-more>
<no-data isShow='{{isShow}}'></no-data>

78
epdc-resident-mp-yushan/subpages/heart/pages/moreList/moreList.wxss

@ -0,0 +1,78 @@
page {
background: #f7f7f7;
}
.more-list {
box-sizing: border-box;
width: 100%;
}
.item-box {
box-sizing: border-box;
width: 100%;
height: 188rpx;
background: #fff;
margin-bottom: 7rpx;
padding: 30rpx 37rpx 0 31rpx;
}
.item-title {
height: 80rpx;
font-size: 32rpx;
color: #000000;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.item-bottom {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
}
.item-bottom-left {
display: flex;
align-items: center;
}
.state {
font-size: 26rpx;
color: #ffaf03;
margin-right: 37rpx;
}
.state-nopass {
color: #e10000;
}
.state-stay {
color: #ffaf03;
}
.state-published {
color: #00a069;
}
.time {
font-size: 22rpx;
color: #aaaaaa;
}
.item-bottom-right {
display: flex;
align-items: center;
}
.edit {
font-size: 26rpx;
color: #bb0300;
margin-right: 53rpx;
}
.look {
font-size: 26rpx;
color: #666666;
}

23
epdc-resident-mp-yushan/subpages/heart/utils/heartApi.js

@ -2,7 +2,8 @@ var fly = require('../../../utils/request')
module.exports = { module.exports = {
getVolunteerDetail, getVolunteerDetail,
getOrgList, getOrgList,
applyVolunteer applyVolunteer,
getActivityList,
} }
// 互帮互助-志愿组织认证详情 // 互帮互助-志愿组织认证详情
function getVolunteerDetail() { function getVolunteerDetail() {
@ -15,8 +16,24 @@ function getOrgList() {
} }
// 互帮互助-志愿组织认证 // 互帮互助-志愿组织认证
function applyVolunteer({ id, realName, idCard, mobile, volunteerOrgIds, introduceInfo }) { function applyVolunteer({
id,
realName,
idCard,
mobile,
volunteerOrgIds,
introduceInfo,
}) {
return fly.post('heart/volunteer/applyVolunteer', { return fly.post('heart/volunteer/applyVolunteer', {
id, realName, idCard, mobile, volunteerOrgIds, introduceInfo id,
realName,
idCard,
mobile,
volunteerOrgIds,
introduceInfo,
}) })
} }
function getActivityList(params) {
return fly.get('heart/volunteer/getActivityList', params)
}

2
epdc-resident-mp-yushan/utils/config.js

@ -7,7 +7,7 @@ module.exports = {
function BASEURL() { function BASEURL() {
// return 'http://192.168.51.31:9094/epdc-api/api/' // 测试环境 接口地址 // return 'http://192.168.51.31:9094/epdc-api/api/' // 测试环境 接口地址
return "https://epdc-api-test.elinkservice.cn/epdc-api/api/" // 测试环境 ip接口地址 // return "https://epdc-api-test.elinkservice.cn/epdc-api/api/" // 测试环境 ip接口地址
return 'https://epdc-yushan.elinkservice.cn/epdc-api/api/' // 现代榆山正式环境 return 'https://epdc-yushan.elinkservice.cn/epdc-api/api/' // 现代榆山正式环境
} }

Loading…
Cancel
Save