diff --git a/epdc-resident-mp-yushan/app.json b/epdc-resident-mp-yushan/app.json index 440ba5a..b3c9e57 100644 --- a/epdc-resident-mp-yushan/app.json +++ b/epdc-resident-mp-yushan/app.json @@ -69,7 +69,8 @@ "pages/cancelDetail/cancelDetail", "pages/joinVolunteerOrg/joinVolunteerOrg", "pages/volunteerOrgList/volunteerOrgList", - "pages/activeApply/activeApply" + "pages/activeApply/activeApply", + "pages/moreList/moreList" ] }, { diff --git a/epdc-resident-mp-yushan/project.config.json b/epdc-resident-mp-yushan/project.config.json index ee10086..4ff538e 100644 --- a/epdc-resident-mp-yushan/project.config.json +++ b/epdc-resident-mp-yushan/project.config.json @@ -17,8 +17,8 @@ "checkInvalidKey": true, "checkSiteMap": true, "uploadWithSourceMap": true, - "useMultiFrameRuntime": true, - "useApiHook": true, + "useMultiFrameRuntime": false, + "useApiHook": false, "useApiHostProcess": false, "babelSetting": { "ignore": [], @@ -26,12 +26,11 @@ "outputPath": "" }, "useIsolateContext": false, - "useCompilerModule": true, - "userConfirmedUseCompilerModuleSwitch": false, "userConfirmedBundleSwitch": false, "packNpmManually": false, "packNpmRelationList": [], - "minifyWXSS": true + "minifyWXSS": true, + "showES6CompileOption": false }, "compileType": "miniprogram", "libVersion": "2.10.4", diff --git a/epdc-resident-mp-yushan/project.private.config.json b/epdc-resident-mp-yushan/project.private.config.json index c66d4c0..37e536f 100644 --- a/epdc-resident-mp-yushan/project.private.config.json +++ b/epdc-resident-mp-yushan/project.private.config.json @@ -40,20 +40,22 @@ "scene": null }, { - "name": "pages/mine/mine", - "pathName": "pages/mine/mine", "name": "pages/index/index", "pathName": "pages/index/index", "query": "", "scene": null }, { - "name": "亮身份", - "pathName": "subpages/status/pages/brightStatus/brightStatus", "name": "subpages/communityNews/pages/index/index", "pathName": "subpages/communityNews/pages/index/index", "query": "", "scene": null + }, + { + "name": "活动列表", + "pathName": "subpages/heart/pages/moreList/moreList", + "query": "", + "scene": null } ] } diff --git a/epdc-resident-mp-yushan/subpages/heart/pages/moreList/moreList.js b/epdc-resident-mp-yushan/subpages/heart/pages/moreList/moreList.js new file mode 100644 index 0000000..edcc8b3 --- /dev/null +++ b/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() + }, +}) diff --git a/epdc-resident-mp-yushan/subpages/heart/pages/moreList/moreList.json b/epdc-resident-mp-yushan/subpages/heart/pages/moreList/moreList.json new file mode 100644 index 0000000..178e74c --- /dev/null +++ b/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" + } +} \ No newline at end of file diff --git a/epdc-resident-mp-yushan/subpages/heart/pages/moreList/moreList.wxml b/epdc-resident-mp-yushan/subpages/heart/pages/moreList/moreList.wxml new file mode 100644 index 0000000..aa32546 --- /dev/null +++ b/epdc-resident-mp-yushan/subpages/heart/pages/moreList/moreList.wxml @@ -0,0 +1,34 @@ + + + + {{item.title}} + + + + {{item.stateName}} + + {{item.createdTime}} + + + 编辑 + 查看 + + + + + + \ No newline at end of file diff --git a/epdc-resident-mp-yushan/subpages/heart/pages/moreList/moreList.wxss b/epdc-resident-mp-yushan/subpages/heart/pages/moreList/moreList.wxss new file mode 100644 index 0000000..64d1af5 --- /dev/null +++ b/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; +} \ No newline at end of file diff --git a/epdc-resident-mp-yushan/subpages/heart/utils/heartApi.js b/epdc-resident-mp-yushan/subpages/heart/utils/heartApi.js index 09157bf..6f5d60a 100644 --- a/epdc-resident-mp-yushan/subpages/heart/utils/heartApi.js +++ b/epdc-resident-mp-yushan/subpages/heart/utils/heartApi.js @@ -2,7 +2,8 @@ var fly = require('../../../utils/request') module.exports = { getVolunteerDetail, getOrgList, - applyVolunteer + applyVolunteer, + getActivityList, } // 互帮互助-志愿组织认证详情 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', { - id, realName, idCard, mobile, volunteerOrgIds, introduceInfo + id, + realName, + idCard, + mobile, + volunteerOrgIds, + introduceInfo, }) -} \ No newline at end of file +} + +function getActivityList(params) { + return fly.get('heart/volunteer/getActivityList', params) +} diff --git a/epdc-resident-mp-yushan/utils/config.js b/epdc-resident-mp-yushan/utils/config.js index 005e12e..0918b71 100644 --- a/epdc-resident-mp-yushan/utils/config.js +++ b/epdc-resident-mp-yushan/utils/config.js @@ -7,7 +7,7 @@ module.exports = { function BASEURL() { // 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/' // 现代榆山正式环境 }