diff --git a/epdc-resident-mp-yushan/app.json b/epdc-resident-mp-yushan/app.json index 70adaef..440ba5a 100644 --- a/epdc-resident-mp-yushan/app.json +++ b/epdc-resident-mp-yushan/app.json @@ -18,8 +18,7 @@ "pages/gridLeaderRegister/gridLeaderRegister", "pages/property/property" ], - "subPackages": [ - { + "subPackages": [{ "root": "subpages/home", "name": "home", "pages": [ @@ -83,7 +82,13 @@ "pages/remarkOrReply/remarkOrReply", "pages/searchDiscussion/searchDiscussion", "pages/categoryList/categoryList" - ] + ], + "plugins": { + "esuaEpdcMpPlugin": { + "version": "0.1.1", + "provider": "wxdd8530c5f4926766" + } + } }, { "root": "subpages/mine", @@ -154,6 +159,21 @@ "pages": [ "pages/vaccines/vaccines" ] + }, + { + "root": "subpages/communityNews", + "name": "communityNews", + "pages": [ + "pages/index/index", + "pages/detail/detail" + ] + }, + { + "root": "subpages/status", + "name": "status", + "pages": [ + "pages/brightStatus/brightStatus" + ] } ], "preloadRule": { @@ -177,15 +197,14 @@ "network": "all", "packages": ["subpages/property"] } - + }, "tabBar": { "color": "#666666", "selectedColor": "#FF0000", "backgroundColor": "#FFFFFF", "borderStyle": "white", - "list": [ - { + "list": [{ "pagePath": "pages/index/index", "text": "首页", "iconPath": "images/home.png", @@ -224,7 +243,8 @@ "navigationBarTextStyle": "black" }, "usingComponents": { - "complete-info-dialog": "./components/completeInfoDialog/completeInfoDialog" + "complete-info-dialog": "./components/completeInfoDialog/completeInfoDialog", + "load-more": "/components/loadMore/loadMore" }, "networkTimeout": { "request": 60000 diff --git a/epdc-resident-mp-yushan/images/home/add-discussion.png b/epdc-resident-mp-yushan/images/home/add-discussion.png new file mode 100644 index 0000000..b8b5e46 Binary files /dev/null and b/epdc-resident-mp-yushan/images/home/add-discussion.png differ diff --git a/epdc-resident-mp-yushan/images/home/all-service.png b/epdc-resident-mp-yushan/images/home/all-service.png new file mode 100644 index 0000000..dcfccba Binary files /dev/null and b/epdc-resident-mp-yushan/images/home/all-service.png differ diff --git a/epdc-resident-mp-yushan/images/home/association.png b/epdc-resident-mp-yushan/images/home/association.png deleted file mode 100644 index a3c192f..0000000 Binary files a/epdc-resident-mp-yushan/images/home/association.png and /dev/null differ diff --git a/epdc-resident-mp-yushan/images/home/avatar.jpg b/epdc-resident-mp-yushan/images/home/avatar.jpg new file mode 100644 index 0000000..9e2cc22 Binary files /dev/null and b/epdc-resident-mp-yushan/images/home/avatar.jpg differ diff --git a/epdc-resident-mp-yushan/images/home/community-education.png b/epdc-resident-mp-yushan/images/home/community-education.png new file mode 100644 index 0000000..3cae842 Binary files /dev/null and b/epdc-resident-mp-yushan/images/home/community-education.png differ diff --git a/epdc-resident-mp-yushan/images/home/community-news.png b/epdc-resident-mp-yushan/images/home/community-news.png new file mode 100644 index 0000000..cfe1a5e Binary files /dev/null and b/epdc-resident-mp-yushan/images/home/community-news.png differ diff --git a/epdc-resident-mp-yushan/images/home/default-avatar.png b/epdc-resident-mp-yushan/images/home/default-avatar.png new file mode 100644 index 0000000..86e1d41 Binary files /dev/null and b/epdc-resident-mp-yushan/images/home/default-avatar.png differ diff --git a/epdc-resident-mp-yushan/images/home/discussion.png b/epdc-resident-mp-yushan/images/home/discussion.png deleted file mode 100644 index ec9c25d..0000000 Binary files a/epdc-resident-mp-yushan/images/home/discussion.png and /dev/null differ diff --git a/epdc-resident-mp-yushan/images/home/edu.png b/epdc-resident-mp-yushan/images/home/edu.png deleted file mode 100644 index a53c6e1..0000000 Binary files a/epdc-resident-mp-yushan/images/home/edu.png and /dev/null differ diff --git a/epdc-resident-mp-yushan/images/home/eye.png b/epdc-resident-mp-yushan/images/home/eye.png new file mode 100644 index 0000000..ee6cbf0 Binary files /dev/null and b/epdc-resident-mp-yushan/images/home/eye.png differ diff --git a/epdc-resident-mp-yushan/images/home/heart.png b/epdc-resident-mp-yushan/images/home/heart.png deleted file mode 100644 index 3825df2..0000000 Binary files a/epdc-resident-mp-yushan/images/home/heart.png and /dev/null differ diff --git a/epdc-resident-mp-yushan/images/home/integral.png b/epdc-resident-mp-yushan/images/home/integral.png deleted file mode 100644 index e4647ae..0000000 Binary files a/epdc-resident-mp-yushan/images/home/integral.png and /dev/null differ diff --git a/epdc-resident-mp-yushan/images/home/notice.png b/epdc-resident-mp-yushan/images/home/notice.png new file mode 100644 index 0000000..86f8b3a Binary files /dev/null and b/epdc-resident-mp-yushan/images/home/notice.png differ diff --git a/epdc-resident-mp-yushan/images/home/phone.png b/epdc-resident-mp-yushan/images/home/phone.png new file mode 100644 index 0000000..ea1fc33 Binary files /dev/null and b/epdc-resident-mp-yushan/images/home/phone.png differ diff --git a/epdc-resident-mp-yushan/images/home/point-ranking.png b/epdc-resident-mp-yushan/images/home/point-ranking.png new file mode 100644 index 0000000..d15063f Binary files /dev/null and b/epdc-resident-mp-yushan/images/home/point-ranking.png differ diff --git a/epdc-resident-mp-yushan/images/home/policy.png b/epdc-resident-mp-yushan/images/home/policy.png deleted file mode 100644 index b90debb..0000000 Binary files a/epdc-resident-mp-yushan/images/home/policy.png and /dev/null differ diff --git a/epdc-resident-mp-yushan/images/home/property.png b/epdc-resident-mp-yushan/images/home/property.png deleted file mode 100644 index 12d6e7e..0000000 Binary files a/epdc-resident-mp-yushan/images/home/property.png and /dev/null differ diff --git a/epdc-resident-mp-yushan/images/home/remark.png b/epdc-resident-mp-yushan/images/home/remark.png new file mode 100644 index 0000000..099167a Binary files /dev/null and b/epdc-resident-mp-yushan/images/home/remark.png differ diff --git a/epdc-resident-mp-yushan/images/home/right-sword-thin.png b/epdc-resident-mp-yushan/images/home/right-sword-thin.png new file mode 100644 index 0000000..251ac34 Binary files /dev/null and b/epdc-resident-mp-yushan/images/home/right-sword-thin.png differ diff --git a/epdc-resident-mp-yushan/images/home/safe-yushan.png b/epdc-resident-mp-yushan/images/home/safe-yushan.png new file mode 100644 index 0000000..e7717c4 Binary files /dev/null and b/epdc-resident-mp-yushan/images/home/safe-yushan.png differ diff --git a/epdc-resident-mp-yushan/images/home/safe.png b/epdc-resident-mp-yushan/images/home/safe.png deleted file mode 100644 index f4a4b48..0000000 Binary files a/epdc-resident-mp-yushan/images/home/safe.png and /dev/null differ diff --git a/epdc-resident-mp-yushan/images/home/service-company.png b/epdc-resident-mp-yushan/images/home/service-company.png new file mode 100644 index 0000000..cef8748 Binary files /dev/null and b/epdc-resident-mp-yushan/images/home/service-company.png differ diff --git a/epdc-resident-mp-yushan/images/home/synthetical-service.png b/epdc-resident-mp-yushan/images/home/synthetical-service.png deleted file mode 100644 index 2bc398e..0000000 Binary files a/epdc-resident-mp-yushan/images/home/synthetical-service.png and /dev/null differ diff --git a/epdc-resident-mp-yushan/images/mine/bianji.png b/epdc-resident-mp-yushan/images/mine/bianji.png new file mode 100644 index 0000000..85dafb5 Binary files /dev/null and b/epdc-resident-mp-yushan/images/mine/bianji.png differ diff --git a/epdc-resident-mp-yushan/images/mine/bright-status-bac.png b/epdc-resident-mp-yushan/images/mine/bright-status-bac.png new file mode 100644 index 0000000..12055c2 Binary files /dev/null and b/epdc-resident-mp-yushan/images/mine/bright-status-bac.png differ diff --git a/epdc-resident-mp-yushan/images/mine/dengji@2x.png b/epdc-resident-mp-yushan/images/mine/dengji@2x.png new file mode 100644 index 0000000..7bf0236 Binary files /dev/null and b/epdc-resident-mp-yushan/images/mine/dengji@2x.png differ diff --git a/epdc-resident-mp-yushan/images/mine/jifen@2x.png b/epdc-resident-mp-yushan/images/mine/jifen@2x.png new file mode 100644 index 0000000..2aef636 Binary files /dev/null and b/epdc-resident-mp-yushan/images/mine/jifen@2x.png differ diff --git a/epdc-resident-mp-yushan/images/mine/right.png b/epdc-resident-mp-yushan/images/mine/right.png new file mode 100644 index 0000000..9b2ec6e Binary files /dev/null and b/epdc-resident-mp-yushan/images/mine/right.png differ diff --git a/epdc-resident-mp-yushan/images/mine/yiliangshenfen.png b/epdc-resident-mp-yushan/images/mine/yiliangshenfen.png new file mode 100644 index 0000000..32a4250 Binary files /dev/null and b/epdc-resident-mp-yushan/images/mine/yiliangshenfen.png differ diff --git a/epdc-resident-mp-yushan/pages/complete/complete.js b/epdc-resident-mp-yushan/pages/complete/complete.js index abda09a..fed1585 100644 --- a/epdc-resident-mp-yushan/pages/complete/complete.js +++ b/epdc-resident-mp-yushan/pages/complete/complete.js @@ -8,67 +8,77 @@ Page({ moreThanOneGrid: false, gridInfo: { gridName: '', // 网格名称 - gridId: '' // 网格id + gridId: '', // 网格id }, - partyFlag: '0' + partyFlag: '0', + }, + onLoad(options) { + if (options.selectTab) { + this.setData({ + selectTab: options.selectTab, + }) + } }, // 我是居民/我是党员/我是企业 tab切换 - onTabChange (e) { + onTabChange(e) { if (e.currentTarget.dataset.tab === 'resident') { if (this.data.partyFlag === '1') { wx.showToast({ title: '您已是党员,不可认证居民', icon: 'none', - duration: 2000 + duration: 2000, }) return false } } this.setData({ - selectTab: e.currentTarget.dataset.tab + selectTab: e.currentTarget.dataset.tab, }) }, // 获取当前用户所有网格 getGridList(e) { - api.getGridList().then(res => { - console.log('获取所有网格', res) - const buttonList = [] - res.data.forEach(item => { - if (item.gridId !== e.detail.gridId) { - buttonList.push({ - id: item.gridId, - text: item.grid - }) - } - }) - this.setData({ - gridList: res.data, - changeGridList: buttonList, - moreThanOneGrid: buttonList.length > 0 + api + .getGridList() + .then((res) => { + console.log('获取所有网格', res) + const buttonList = [] + res.data.forEach((item) => { + if (item.gridId !== e.detail.gridId) { + buttonList.push({ + id: item.gridId, + text: item.grid, + }) + } + }) + this.setData({ + gridList: res.data, + changeGridList: buttonList, + moreThanOneGrid: buttonList.length > 0, + }) }) - }).catch(err => { - this.setData({ - gridList: [], - changeGridList: [] + .catch((err) => { + this.setData({ + gridList: [], + changeGridList: [], + }) + console.log(err) }) - console.log(err) - }) }, // 切换网格 changeGrid(e) { const buttonList = [] - this.data.gridList.forEach(item => { + this.data.gridList.forEach((item) => { buttonList.push({ id: item.gridId, - text: item.grid + text: item.grid, }) }) - const index = buttonList.findIndex(item => item.id === e.detail.gridId) + const index = buttonList.findIndex((item) => item.id === e.detail.gridId) if (index > -1) { buttonList.splice(index, 1) } this.setData({ - changeGridList: buttonList + changeGridList: buttonList, }) const that = this $wuxActionSheet().showSheet({ @@ -77,19 +87,19 @@ Page({ buttonClicked(index, item) { that.setData({ 'gridInfo.gridId': item.id, - 'gridInfo.gridName': item.text + 'gridInfo.gridName': item.text, }) return true }, cancelText: '取消', - cancel() { }, - destructiveButtonClicked() { }, + cancel() {}, + destructiveButtonClicked() {}, }) }, - selectTabChange (e) { + selectTabChange(e) { this.setData({ selectTab: e.detail.tab, - partyFlag: e.detail.partyFlag + partyFlag: e.detail.partyFlag, }) - } -}) \ No newline at end of file + }, +}) diff --git a/epdc-resident-mp-yushan/pages/discussion/components/projectItem/projectItem.wxml b/epdc-resident-mp-yushan/pages/discussion/components/projectItem/projectItem.wxml index cb25c7f..23977fb 100644 --- a/epdc-resident-mp-yushan/pages/discussion/components/projectItem/projectItem.wxml +++ b/epdc-resident-mp-yushan/pages/discussion/components/projectItem/projectItem.wxml @@ -1,33 +1,19 @@ - {{projectObj.nickname}} - {{projectObj.stateName}} + + {{projectObj.stateName}} + - {{projectObj.itemContent}} - - - + + - {{projectObj.categoryName}} - @@ -42,7 +28,6 @@ 【{{projectObj.latestProgress.progressName}}】{{projectObj.latestProgress.advice}} - 表达态度 {{projectObj.statementNum}} @@ -51,5 +36,4 @@ 不支持 {{projectObj.opposeNum}} - \ No newline at end of file diff --git a/epdc-resident-mp-yushan/pages/discussion/discussion.js b/epdc-resident-mp-yushan/pages/discussion/discussion.js index 0b1009c..f919c60 100644 --- a/epdc-resident-mp-yushan/pages/discussion/discussion.js +++ b/epdc-resident-mp-yushan/pages/discussion/discussion.js @@ -7,7 +7,7 @@ Page({ infoCompleted: 0, gridName: '' }, - onLoad () { + onLoad() { this.setData({ infoCompleted: app.globalData.infoCompleted }) @@ -16,14 +16,22 @@ Page({ gridName }) }, - onTabItemTap () { + onShow() { + if (wx.getStorageSync('discusstionType') && wx.getStorageSync('discusstionType') === 'project') { + this.setData({ + discussionType: 'project' + }) + wx.removeStorageSync('discusstionType') + } + }, + onTabItemTap() { if (this.data.discussionType === 'issue') { this.issuelist.getIssueList() } else if (this.data.discussionType === 'project') { this.projectlist.getProjectList() } }, - onPageScroll (e) { + onPageScroll(e) { if (this.data.discussionType === 'issue') { this.issuelist.onPageScroll(e) } else if (this.data.discussionType === 'project') { @@ -31,7 +39,7 @@ Page({ } }, // 议题、项目切换 - changeDiscussionType (e) { + changeDiscussionType(e) { if (e.currentTarget.dataset.type === 'issue') { this.setData({ discussionType: 'issue' @@ -43,7 +51,7 @@ Page({ } }, // 触底函数 - onReachBottom () { + onReachBottom() { if (this.data.discussionType === 'issue') { this.issuelist.onReachBottom() } else if (this.data.discussionType === 'project') { @@ -51,7 +59,7 @@ Page({ } }, // 跳转 我要报事 - addIssue () { + addIssue() { if (this.verifyCompleteInfo()) { return false } @@ -60,15 +68,15 @@ Page({ }) }, // 获取 项目组件实例 - getProjectComponent () { + getProjectComponent() { this.projectlist = this.selectComponent('#projectlist') }, // 获取 议题组件实例 - getIssueComponent () { + getIssueComponent() { this.issuelist = this.selectComponent('#issuelist') }, // 检查 是否完善信息 - verifyCompleteInfo () { + verifyCompleteInfo() { if (this.data.infoCompleted == 0) { this.setData({ completeInfoDialogVisible: !this.data.completeInfoDialogVisible diff --git a/epdc-resident-mp-yushan/pages/index/components/communityNewsList/communityNewsList.js b/epdc-resident-mp-yushan/pages/index/components/communityNewsList/communityNewsList.js new file mode 100644 index 0000000..9a714b3 --- /dev/null +++ b/epdc-resident-mp-yushan/pages/index/components/communityNewsList/communityNewsList.js @@ -0,0 +1,21 @@ +Component({ + properties: { + newsList: { + type: Array, + value: [] + } + }, + methods: { + navigateToCommunityNews() { + wx.navigateTo({ + url: '/subpages/communityNews/pages/index/index' + }) + }, + navigateToDetail(e) { + const { id } = e.currentTarget.dataset + wx.navigateTo({ + url: `/subpages/communityNews/pages/detail/detail?id=${id}` + }) + } + } +}) \ No newline at end of file diff --git a/epdc-resident-mp-yushan/pages/index/components/communityNewsList/communityNewsList.json b/epdc-resident-mp-yushan/pages/index/components/communityNewsList/communityNewsList.json new file mode 100644 index 0000000..32640e0 --- /dev/null +++ b/epdc-resident-mp-yushan/pages/index/components/communityNewsList/communityNewsList.json @@ -0,0 +1,3 @@ +{ + "component": true +} \ No newline at end of file diff --git a/epdc-resident-mp-yushan/pages/index/components/communityNewsList/communityNewsList.wxml b/epdc-resident-mp-yushan/pages/index/components/communityNewsList/communityNewsList.wxml new file mode 100644 index 0000000..f85d5a6 --- /dev/null +++ b/epdc-resident-mp-yushan/pages/index/components/communityNewsList/communityNewsList.wxml @@ -0,0 +1,30 @@ + + + 最新资讯 + + 更多 + + + + + + + + + + + + {{item.noticeTitle}} + + {{item.releaseTime}} + + + + + {{item.readingAmount}} + + + + + + \ No newline at end of file diff --git a/epdc-resident-mp-yushan/pages/index/components/communityNewsList/communityNewsList.wxss b/epdc-resident-mp-yushan/pages/index/components/communityNewsList/communityNewsList.wxss new file mode 100644 index 0000000..69c23a6 --- /dev/null +++ b/epdc-resident-mp-yushan/pages/index/components/communityNewsList/communityNewsList.wxss @@ -0,0 +1,124 @@ +image { + width: 100%; + height: 100%; + float: left; +} + +.community-news-list { + width: 100%; + margin-top: 12rpx; + background: #fff; +} + +.first { + width: 100%; + height: 85rpx; + display: flex; + align-items: center; + justify-content: space-between; + box-sizing: border-box; + padding: 0 30rpx; +} + +.first .title { + font-size: 34rpx; + color: #333333; +} + +.first .more { + display: flex; + align-items: center; + justify-content: flex-end; +} + +.first .more .tip { + font-size: 28rpx; + color: #c5c5c5; +} + +.first .more .right-sword { + width: 14rpx; + height: 22rpx; + margin-left: 4rpx; +} + +.news-list { + width: 100%; + background: #fff; + box-sizing: border-box; + padding: 0 30rpx; +} + +.news-list .list-item { + width: 100%; + box-sizing: border-box; + padding: 30rpx 0; + display: flex; + align-items: center; +} + +.news-list .list-item.first-item { + padding: 0 0 30rpx 0; +} + +.news-list .list-item + .list-item { + border-top: 1rpx solid #eaeaea; +} + +.news-list .list-item .news-img { + width: 210rpx; + height: 150rpx; + border-radius: 8rpx; + overflow: hidden; + margin-right: 20rpx; +} + +.news-list .list-item .detail { + width: calc(100% - 210rpx - 20rpx); + height: 150rpx; + display: flex; + flex-direction: column; + justify-content: space-between; +} + +.news-list .list-item .detail .title { + font-size: 34rpx; + color: #3f3f3f; + line-height: 44rpx; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; +} + +.news-list .list-item .bottom-detail { + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; +} + +.news-list .list-item .bottom-detail .time { + font-size: 22rpx; + letter-spacing: 1px; + color: #aaa; +} + +.news-list .list-item .bottom-detail .page-view { + display: flex; + align-items: center; + justify-content: flex-start; +} +.news-list .list-item .bottom-detail .page-view .page-view-img { + width: 30rpx; + height: 24rpx; + margin-right: 12rpx; +} + +.news-list .list-item .bottom-detail .page-view .num { + font-size: 24rpx; + letter-spacing: 1px; + color: #aaa; +} \ No newline at end of file diff --git a/epdc-resident-mp-yushan/pages/index/components/griderList/griderList.js b/epdc-resident-mp-yushan/pages/index/components/griderList/griderList.js new file mode 100644 index 0000000..79939d9 --- /dev/null +++ b/epdc-resident-mp-yushan/pages/index/components/griderList/griderList.js @@ -0,0 +1,16 @@ +Component({ + properties: { + griderList: { + type: Array, + value: [] + } + }, + methods: { + callGrider(e) { + const { phone } = e.currentTarget.dataset + wx.makePhoneCall({ + phoneNumber: phone + }) + } + } +}) \ No newline at end of file diff --git a/epdc-resident-mp-yushan/pages/index/components/griderList/griderList.json b/epdc-resident-mp-yushan/pages/index/components/griderList/griderList.json new file mode 100644 index 0000000..32640e0 --- /dev/null +++ b/epdc-resident-mp-yushan/pages/index/components/griderList/griderList.json @@ -0,0 +1,3 @@ +{ + "component": true +} \ No newline at end of file diff --git a/epdc-resident-mp-yushan/pages/index/components/griderList/griderList.wxml b/epdc-resident-mp-yushan/pages/index/components/griderList/griderList.wxml new file mode 100644 index 0000000..bcc6af3 --- /dev/null +++ b/epdc-resident-mp-yushan/pages/index/components/griderList/griderList.wxml @@ -0,0 +1,39 @@ + + 网格员在身边 + + + + + + + + + {{item.realName}} + {{item.proverbs}} + + + + + 有事找我 + + + + + + + + + {{item.realName}} + {{item.proverbs}} + + + + + 有事找我 + + + + + + + \ No newline at end of file diff --git a/epdc-resident-mp-yushan/pages/index/components/griderList/griderList.wxss b/epdc-resident-mp-yushan/pages/index/components/griderList/griderList.wxss new file mode 100644 index 0000000..3cc4deb --- /dev/null +++ b/epdc-resident-mp-yushan/pages/index/components/griderList/griderList.wxss @@ -0,0 +1,136 @@ +.grider-list { + width: 100%; + background: #fff; + margin-top: 12rpx; +} + +.grider-list .title { + width: 100%; + height: 80rpx; + line-height: 90rpx; + text-indent: 30rpx; + font-size: 34rpx; + color: #333; +} + +.grider-list scroll-view { + width: 100%; + height: calc(390rpx + 55rpx); +} + +.grider-list scroll-view .grider-item-contaner { + min-width: auto; + display: flex; + align-items: center; +} + +.grider-item { + width: 280rpx; + height: 390rpx; + flex-shrink: 0; + box-shadow: 0rpx 2rpx 24rpx 0rpx + rgba(227, 227, 227, 0.52); + border-radius: 10rpx; + margin: 10px 0px 0px 20rpx; + display: flex; + flex-direction: column; + align-items: center; + box-sizing: border-box; + padding: 0 5%; + overflow: hidden; +} + +.grider-item .avatar { + width: 120rpx; + height: 120rpx; + position: relative; + margin-top: 42rpx; + position: relative; +} + +.grider-item .avatar .grid-leader { + width: 80rpx; + height: 28rpx; + background-color: #f69635; + border-radius: 14rpx; + font-size: 20rpx; + color: #ffffff; + display: flex; + align-items: center; + justify-content: center; + position: absolute; + bottom: -14rpx; + left: calc(50% - 40rpx); +} + +.grider-item .avatar image { + border-radius: 50%; + overflow: hidden; +} + +.grider-item .name { + font-size: 30rpx; + color: #333333; + height: 52rpx; + line-height: 52rpx; + margin-top: 7rpx; +} + +.grider-item .logen { + font-size: 26rpx; + line-height: 36rpx; + height: 72rpx; + color: #aeaeae; + width: 100%; + text-align: center; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; +} + +.call-phone { + margin-top: 20rpx; + width: 160rpx; + height: 52rpx; + background-image: linear-gradient(90deg, + #e3271c 0%, + #f95c2c 100%), + linear-gradient( + #8da5eb, + #8da5eb); + background-blend-mode: normal, + normal; + border-radius: 25rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 26rpx; + color: #ffffff; +} + +.call-phone .phone { + width:23rpx; + height:27rpx; + margin-right: 4rpx; +} + +.grider-item.first { + margin-left: 30rpx; +} + +.item-container { + flex-shrink: 0; + width: 310rpx; + height: 390rpx; + margin: 10px 0px 0px 20rpx; +} + +.item-container .grider-item { + margin: 0; +} + +.item-container .grider-item.first { + margin: 0 0 0 10rpx; +} \ No newline at end of file diff --git a/epdc-resident-mp-yushan/pages/index/components/projectProgress/projectProgress.js b/epdc-resident-mp-yushan/pages/index/components/projectProgress/projectProgress.js new file mode 100644 index 0000000..61ae998 --- /dev/null +++ b/epdc-resident-mp-yushan/pages/index/components/projectProgress/projectProgress.js @@ -0,0 +1,22 @@ +Component({ + properties: { + projectList: { + type: Array, + value: [] + } + }, + methods: { + navigateToProjectDetail(e) { + const { id } = e.currentTarget.dataset + wx.navigateTo({ + url: `/subpages/discussion/pages/discussionDetail/discussionDetail?type=project&detailId=${id}&showClassify=show` + }) + }, + navigateToDiscussion() { + wx.setStorageSync('discusstionType', 'project') + wx.switchTab({ + url: '/pages/discussion/discussion' + }) + } + } +}) \ No newline at end of file diff --git a/epdc-resident-mp-yushan/pages/index/components/projectProgress/projectProgress.json b/epdc-resident-mp-yushan/pages/index/components/projectProgress/projectProgress.json new file mode 100644 index 0000000..32640e0 --- /dev/null +++ b/epdc-resident-mp-yushan/pages/index/components/projectProgress/projectProgress.json @@ -0,0 +1,3 @@ +{ + "component": true +} \ No newline at end of file diff --git a/epdc-resident-mp-yushan/pages/index/components/projectProgress/projectProgress.wxml b/epdc-resident-mp-yushan/pages/index/components/projectProgress/projectProgress.wxml new file mode 100644 index 0000000..8350b81 --- /dev/null +++ b/epdc-resident-mp-yushan/pages/index/components/projectProgress/projectProgress.wxml @@ -0,0 +1,81 @@ + + + 项目进度 + + 更多 + + + + + + + + + + + + + {{item.stateName}} + + {{item.itemContent}} + + + + + + {{item.nickname}} + + + 表达态度 {{item.statementNum}}次 + + + + + + + + + + {{item.stateName}} + + {{item.itemContent}} + + + + + + {{item.nickname}} + + + 表达态度 {{item.statementNum}}次 + + + + + + + + + \ No newline at end of file diff --git a/epdc-resident-mp-yushan/pages/index/components/projectProgress/projectProgress.wxss b/epdc-resident-mp-yushan/pages/index/components/projectProgress/projectProgress.wxss new file mode 100644 index 0000000..e6a83f9 --- /dev/null +++ b/epdc-resident-mp-yushan/pages/index/components/projectProgress/projectProgress.wxss @@ -0,0 +1,170 @@ +image { + width: 100%; + height: 100%; + float: left; +} + +.project-progress { + width: 100%; + margin-top: 12rpx; + background: #fff; +} + +.first { + width: 100%; + height: 85rpx; + display: flex; + align-items: center; + justify-content: space-between; + box-sizing: border-box; + padding: 0 30rpx; +} + +.first .title { + font-size: 34rpx; + color: #333333; +} + +.first .more { + display: flex; + align-items: center; + justify-content: flex-end; +} + +.first .more .tip { + font-size: 28rpx; + color: #c5c5c5; +} + +.first .more .right-sword { + width: 14rpx; + height: 22rpx; + margin-left: 4rpx; +} + +scroll-view { + width: 100%; + height: 364rpx; +} + +scroll-view .project-list { + width: 100%; + display: flex; + align-items: center; + padding-bottom: 30rpx; +} + +scroll-view .project-list .project-item { + flex-shrink: 0; + width: 472rpx; + margin-left: 30rpx; +} + +scroll-view .project-list .item-container { + flex-shrink: 0; + width: 532rpx; + box-sizing: border-box; + padding-right: 30rpx; +} + +scroll-view .project-list .project-item .project-img { + width: 100%; + height: 226rpx; + border-radius: 10rpx 10rpx 0 0; + overflow: hidden; + position: relative; +} + +scroll-view .project-list .project-item .project-img .project-state { + width: 86rpx; + height: 38rpx; + background-image: linear-gradient(90deg, + #ffac00 0%, + #ffbf00 100%), + linear-gradient( + #f7f7f7, + #f7f7f7); + background-blend-mode: normal, + normal; + border-radius: 10rpx 0 10rpx 0; + font-size: 22rpx; + line-height: 38rpx; + text-align: center; + position: absolute; + left: 0; + top: 0; + letter-spacing: 0px; + color: #ffffff; +} + +scroll-view .project-list .project-item .content { + font-size: 32rpx; + color: #333; + height: 76rpx; + line-height: 76rpx; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +scroll-view .project-list .project-item .detail { + width: 100%; + height: 32rpx; + display: flex; + align-items: center; + justify-content: space-between; +} + +scroll-view .project-list .project-item .detail .left { + display: flex; + align-items: center; +} + +scroll-view .project-list .project-item .detail .left .avatar { + width: 30rpx; + height: 30rpx; + border-radius: 50%; + overflow: hidden; + margin-right: 6rpx; +} + +scroll-view .project-list .project-item .detail .left .name { + font-size: 20rpx; + color: #444; +} + +scroll-view .project-list .project-item .detail .right { + display: flex; + align-items: center; + justify-content: flex-end; + font-size: 20rpx; + color: #999999; +} + +scroll-view .project-list .project-item .detail .right .item { + display: flex; + align-items: center; + justify-content: flex-end; +} + +scroll-view .project-list .project-item .detail .right .item + .item { + margin-left: 22rpx; +} + +scroll-view .project-list .project-item .detail .right .item .icon { + width: 23rpx; + height: 22rpx; +} + +scroll-view .project-list .project-item .detail .right .item .icon.eye { + width: 27rpx; + height: 21rpx; +} + +scroll-view .project-list .project-item .detail .right .item .tip { + font-size: 20rpx; + color: #999999; + margin-left: 8rpx; +} + diff --git a/epdc-resident-mp-yushan/pages/index/components/sudoku/sudoku.js b/epdc-resident-mp-yushan/pages/index/components/sudoku/sudoku.js index d878a30..be16641 100644 --- a/epdc-resident-mp-yushan/pages/index/components/sudoku/sudoku.js +++ b/epdc-resident-mp-yushan/pages/index/components/sudoku/sudoku.js @@ -10,42 +10,52 @@ Component({ }, methods: { // 跳转到左邻右舍 - navigateToAssociation () { - this.triggerEvent('navigateToAssociation') + navigateToCommunityNews() { + wx.navigateTo({ + url: '/subpages/communityNews/pages/index/index' + }) }, // 跳转到有么说么 navigateToDiscussion() { - this.triggerEvent('navigateToDiscussion') + wx.navigateTo({ + url: '/subpages/discussion/pages/addIssue/addIssue' + }) }, // 跳转到物业服务 - navigateToProperty () { + navigateToProperty() { this.triggerEvent('navigateToProperty') }, // 跳转到互帮互助 - navigateToHeart () { + navigateToHeart() { this.triggerEvent('navigateToHeart') }, // 跳转到社区教育 - navigateToEducation () { + navigateToEducation() { this.triggerEvent('navigateToEducation') // this.triggerEvent('navigateToEducation') }, // 跳转到平安榆山 - navigateToSafe () { + navigateToSafe() { this.triggerEvent('navigateToSafe') }, // 跳转到积分排行 - navigateToIntegral () { + navigateToIntegral() { this.triggerEvent('navigateToIntegral') }, // 跳转到综合服务 - navigateToSyntheticalService () { + navigateToSyntheticalService() { this.triggerEvent('navigateToSynthetical') }, + // 通知公告 + navigateToInfoList() { + wx.navigateTo({ + url: '/subpages/home/pages/notice/notice' + }) + }, // 暂未开放 - showNotAvailable () { + showNotAvailable() { wx.showToast({ - icon:'none', + icon: 'none', title: '暂未开放', }) }, diff --git a/epdc-resident-mp-yushan/pages/index/components/sudoku/sudoku.wxml b/epdc-resident-mp-yushan/pages/index/components/sudoku/sudoku.wxml index d370a09..0924af3 100644 --- a/epdc-resident-mp-yushan/pages/index/components/sudoku/sudoku.wxml +++ b/epdc-resident-mp-yushan/pages/index/components/sudoku/sudoku.wxml @@ -1,36 +1,36 @@ - - - 左邻右舍 + + + 社区资讯 - - - 有么说么 + + + 我要报事 - - - 我的物业 + + + 平安榆山 - - - 互帮互助 + + + 我的物业 - + 积分排行 - - - 平安榆山 - - - + + 社区教育 - - + + 综合服务 + + + 通知公告 + \ No newline at end of file diff --git a/epdc-resident-mp-yushan/pages/index/components/sudoku/sudoku.wxss b/epdc-resident-mp-yushan/pages/index/components/sudoku/sudoku.wxss index 7fce09f..e34811d 100644 --- a/epdc-resident-mp-yushan/pages/index/components/sudoku/sudoku.wxss +++ b/epdc-resident-mp-yushan/pages/index/components/sudoku/sudoku.wxss @@ -18,8 +18,12 @@ margin-top: 20rpx; } .item image { - width:110rpx; - height:110rpx; + width: 134rpx; + height: 134rpx; +} +.item.first image { + width: 124rpx; + height: 124rpx; } .item .name { font-size: 26rpx; diff --git a/epdc-resident-mp-yushan/pages/index/index.js b/epdc-resident-mp-yushan/pages/index/index.js index f92b0d0..12d69fb 100644 --- a/epdc-resident-mp-yushan/pages/index/index.js +++ b/epdc-resident-mp-yushan/pages/index/index.js @@ -4,6 +4,7 @@ const homeApi = require('../../utils/home') const global = require('../../utils/config') import { getTimestamp } from '../../utils/common' import checkoutVersion from '../../utils/checkVersion' +import home from '../../utils/home' Page({ data: { statusHeight: 0, // 自定义头部状态栏高度 @@ -26,10 +27,11 @@ Page({ completeInfoDialogVisible: false, // 完善信息弹框显隐 gridId: '', // 网格id departmentName: '', // 所在网格 - isCarryLoad: false, + isCarryLoad: false, vaccinationSwitch: false, // 疫苗入口开关 + griderList: [] }, - onLoad (options) { + onLoad(options) { if (options.scene) { if (options.scene.indexOf('RP') > -1) { this.setData({ @@ -55,15 +57,15 @@ Page({ this.data.isCarryLoad = true this.getResidentConfig() }, - onTabItemTap () { + onTabItemTap() { this.getUserState() }, - onShow () { + onShow() { this.getUnreadNum() // 实时获取有无未读消息 // 检查版本更新 checkoutVersion() }, - onReachBottom () { + onReachBottom() { this.setData({ loadMoreVisible: true }) @@ -73,7 +75,7 @@ Page({ } }, // 根据微信code查询用户当前状态 - getUserState () { + getUserState() { let that = this wx.login({ success(res) { @@ -88,13 +90,13 @@ Page({ departmentName: res.data.grid }) // 扫码进入 - if(that.data.gridId !== '') { + if (that.data.gridId !== '') { // 扫的是网格长码 if (that.data.gridId == 'gridLeader') { wx.redirectTo({ url: '/pages/gridLeaderRegister/gridLeaderRegister' }) - // 扫的是网格码 + // 扫的是网格码 } else { wx.redirectTo({ url: '/pages/formid/formid?gid=' + that.data.gridId @@ -114,7 +116,7 @@ Page({ } else { that.initLoad() } - + } } }) @@ -125,7 +127,7 @@ Page({ }) }, // 获取banner列表 - getBannerList () { + getBannerList() { api.bannerList('0').then(res => { console.log('首页banner列表', res) this.setData({ @@ -139,17 +141,17 @@ Page({ }) }, // 获取新闻列表 - getNewsList () { + getNewsList() { let para = { pageIndex: this.data.pageNo, pageSize: this.data.pageSize, timestamp: this.data.timestamp, - categoryCode:"" + categoryCode: "" } api.newsList(para).then((res) => { console.log('首页新闻列表', res) this.setData({ - loadMoreType: res.data.length === this.data.pageSize ? 'loading': 'none', + loadMoreType: res.data.length === this.data.pageSize ? 'loading' : 'none', newsList: this.data.newsList.concat(res.data) }) }).catch(() => { @@ -161,7 +163,7 @@ Page({ }) }, // 获取项目列表 - getProjectList () { + getProjectList() { const para = { pageIndex: 1, pageSize: 10, @@ -182,7 +184,7 @@ Page({ }) }, // 获取最新一条消息-主要获取消息未读数 - getUnreadNum () { + getUnreadNum() { api.getFirstInfo().then(res => { console.log('获取消息未读数', res) this.setData({ @@ -209,7 +211,7 @@ Page({ }) }, // 获取通知公告列表 - getNoticeList () { + getNoticeList() { let para = { pageIndex: 1, pageSize: 10, @@ -223,7 +225,7 @@ Page({ console.log(err) }) }, - // 九宫格检查状态 + // 九宫格检查状态 // getIndexSudokuState () { // api.getIndexSudokuState().then(res => { // console.log('九宫格状态', res) @@ -254,8 +256,8 @@ Page({ // }) // }) // }, - // 跳转到互帮互助 - navigateToHeart () { + // 跳转到互帮互助 + navigateToHeart() { if (app.globalData.infoCompleted == 0) { this.setData({ completeInfoDialogVisible: !this.data.completeInfoDialogVisible @@ -278,14 +280,29 @@ Page({ url: '/pages/association/association', }) }, + // 获取 网格员 + gridmanList() { + const params = { + pageIndex: 1, + pageSize: 10 + } + api.gridmanList(params).then(res => { + console.log('网格员列表', res) + this.setData({ + griderList: res.data + }) + }).catch(err => { + console.error('网格员列表', err) + }) + }, // 跳转到有么说么 - navigateToDiscussion () { + navigateToDiscussion() { wx.switchTab({ url: '/pages/discussion/discussion' }) }, // 跳转到物业服务 - navigateToProperty () { + navigateToProperty() { // if (app.globalData.infoCompleted == 0) { // this.setData({ // completeInfoDialogVisible: !this.data.completeInfoDialogVisible @@ -296,13 +313,13 @@ Page({ url: '/pages/property/property' }) }, - navigateToSafe(){ + navigateToSafe() { wx.navigateTo({ url: '/subpages/safety/pages/index/index', }) }, // 初始化加载 - initLoad () { + initLoad() { this.setData({ pageNo: 1, pageSize: 10, @@ -318,33 +335,35 @@ Page({ this.getNoticeList() this.getUnreadNum() this.getNewsList() + this.gridmanList() + this.contentList() }, // 切换网格,跳转到网格列表 changeGrid() { wx.navigateTo({ url: '/subpages/changegrid/pages/changeGrid/changeGrid' }) }, // 跳转到新闻详情 - navigatetoNewsDetail (e) { + navigatetoNewsDetail(e) { wx.navigateTo({ url: `/subpages/home/pages/newsDetail/newsDetail?id=${e.detail.newsId}` }) }, // 跳转到 项目详情 - navigatetoItemDetail (e) { + navigatetoItemDetail(e) { wx.navigateTo({ url: `/subpages/discussion/pages/discussionDetail/discussionDetail?type=project&detailId=${e.detail.itemId}&showClassify=show` }) }, // 跳转到通知公告列表 - navigateToInfoList () { + navigateToInfoList() { wx.navigateTo({ url: '/subpages/home/pages/notice/notice' }) }, // 跳转到消息页面 - navigateToNotice(){ + navigateToNotice() { wx.navigateTo({ url: '/subpages/home/pages/info/info' }) }, // 消息没有数据 - noMore () { + noMore() { wx.showToast({ title: "暂无更多消息~", icon: "none", @@ -352,20 +371,20 @@ Page({ }) }, // 跳转到banner详情 - navigatetoBannerDetail (e) { + navigatetoBannerDetail(e) { const { id, url, newsFlag } = e.detail if (newsFlag == '0') { wx.navigateTo({ - url: `/subpages/home/pages/webview/webview?url=${url}` + url: `/subpages/home/pages/webview/webview?url=${url}` }) } else if (newsFlag == '1') { wx.navigateTo({ url: `/subpages/home/pages/newsDetail/newsDetail?id=${id}` }) - } + } }, //积分排行 - navigateToIntegral(){ + navigateToIntegral() { api.getUserInfo().then(res => { // console.log('用户信息', res) wx.navigateTo({ @@ -375,25 +394,25 @@ Page({ console.log(err) }) }, - //社区教育 - navigateToEducation(){ + //社区教育 + navigateToEducation() { wx.navigateTo({ url: '/subpages/education/pages/index/index' }) }, - navigateToSynthetical(){ + navigateToSynthetical() { wx.navigateTo({ url: '/subpages/education/pages/healthyLife/healthyLife?page=zhfw' }) }, // 获取疫苗配置 - getResidentConfig () { + getResidentConfig() { homeApi.getResidentConfig().then(res => { if (res.code === 0 && res.msg === "success") { res.data.forEach(item => { if (item.residentType === "vaccination_config" && item.residentCode === "vaccination_switch") { this.setData({ - vaccinationSwitch:item.residentValue === 'on' + vaccinationSwitch: item.residentValue === 'on' }) } }) @@ -403,9 +422,25 @@ Page({ }) }, //疫苗接种 - toVaccines () { + toVaccines() { wx.navigateTo({ url: '/subpages/extend/pages/vaccines/vaccines' }) + }, + // 获取最新社区资讯 + contentList() { + const params = { + pageIndex: 1, + pageSize: 5, + typeId: '' + } + homeApi.contentList(params).then(res => { + console.log('社区最新资讯', res) + this.setData({ + newsList: res.data + }) + }).catch(err => { + console.error(err) + }) } }) \ No newline at end of file diff --git a/epdc-resident-mp-yushan/pages/index/index.json b/epdc-resident-mp-yushan/pages/index/index.json index 137f088..4d5bfe0 100644 --- a/epdc-resident-mp-yushan/pages/index/index.json +++ b/epdc-resident-mp-yushan/pages/index/index.json @@ -7,9 +7,12 @@ "sudoku": "./components/sudoku/sudoku", "notice": "./components/notice/notice", "project": "./components/project/project", - "news-list":"./components/newsList/newsList", + "news-list": "./components/newsList/newsList", "load-more": "../../components/loadMore/loadMore", "complete-info-dialog": "../../components/completeInfoDialog/completeInfoDialog", - "move-btn": "/components/moveButton/moveButton" + "move-btn": "/components/moveButton/moveButton", + "grider-list": "./components/griderList/griderList", + "project-progress": "./components/projectProgress/projectProgress", + "community-news-list": "./components/communityNewsList/communityNewsList" } } \ No newline at end of file diff --git a/epdc-resident-mp-yushan/pages/index/index.wxml b/epdc-resident-mp-yushan/pages/index/index.wxml index 7ab19f1..6ca98fd 100644 --- a/epdc-resident-mp-yushan/pages/index/index.wxml +++ b/epdc-resident-mp-yushan/pages/index/index.wxml @@ -1,11 +1,11 @@ - 现代榆山 + + 现代榆山 + - - - + @@ -20,57 +20,27 @@ - - - - - - + + - - - - - - - - - - - - + --> + + + + + + + + + + + - - + - - \ No newline at end of file + \ No newline at end of file diff --git a/epdc-resident-mp-yushan/pages/mine/mine.js b/epdc-resident-mp-yushan/pages/mine/mine.js index 459a521..a8c7ec9 100644 --- a/epdc-resident-mp-yushan/pages/mine/mine.js +++ b/epdc-resident-mp-yushan/pages/mine/mine.js @@ -17,33 +17,34 @@ Page({ userInfo: { faceImg: '', nickname: '', - partyFlag: '', + partyFlag: '', // 0不是党员 1是党员 points: 0, - grade: 0 + grade: 0, + showIdentityFlag: 0, // 是否亮过身份 0 否 1 是 }, completeInfoDialogVisible: false, - infoCompleted: 0 + infoCompleted: 0, }, - onLoad () { + onLoad() { this.getUserInfo() this.setData({ - infoCompleted: app.globalData.infoCompleted + infoCompleted: app.globalData.infoCompleted, }) }, - onShow () { + onShow() { if (!app.globalData.previewImage) { this.data.pageNo = 1 this.data.pageSize = 10 this.setData({ nomoreVisible: false, nomoreStatus: 'loading', - preloadVisible: true + preloadVisible: true, }) if (this.data.selectedTabBar === 'issue') { this.getIssueList() } else if (this.data.selectedTabBar === 'project') { this.getProjectList() - } else if (this.data.selectedTabBar === 'topic') { + } else if (this.data.selectedTabBar === 'topic') { this.getTopicList() } } @@ -53,7 +54,7 @@ Page({ // 触底 上拉加载 onReachBottom() { this.setData({ - nomoreVisible: true + nomoreVisible: true, }) if (this.data.selectedTabBar === 'topic') { if (this.data.nomoreStatus === 'loading') { @@ -61,7 +62,7 @@ Page({ this.loadMoreTopicList() } else { this.setData({ - nomoreVisible: true + nomoreVisible: true, }) } } else if (this.data.selectedTabBar === 'project') { @@ -70,17 +71,17 @@ Page({ this.loadMoreProjectList() } else { this.setData({ - nomoreVisible: true + nomoreVisible: true, }) } } }, // tab 切换 - chooseTabBar (e) { + chooseTabBar(e) { this.setData({ nomoreVisible: false, nomoreStatus: 'loading', - preloadVisible: true + preloadVisible: true, }) this.data.pageNo = 1 this.data.pageSize = 10 @@ -92,216 +93,265 @@ Page({ this.getProjectList() } else if (e.currentTarget.dataset.type === 'topic') { this.getTopicList() - } + } this.setData({ - selectedTabBar: e.currentTarget.dataset.type + selectedTabBar: e.currentTarget.dataset.type, }) }, // 获取 我的话题列表 - getTopicList () { + getTopicList() { this.setData({ - topicList: [] + topicList: [], }) const para = { pageIndex: this.data.pageNo, - pageSize: this.data.pageSize + pageSize: this.data.pageSize, } - api.getMyTopicList(para).then(res => { - console.log('我的话题列表', res) - this.setData({ - topicList: [...res.data], - nomoreStatus: res.data.length === 10 ? 'loading' : 'none', - preloadVisible: false + api + .getMyTopicList(para) + .then((res) => { + console.log('我的话题列表', res) + this.setData({ + topicList: [...res.data], + nomoreStatus: res.data.length === 10 ? 'loading' : 'none', + preloadVisible: false, + }) }) - }).catch(err => { - this.setData({ - topicList: [], - nomoreStatus: 'none', - preloadVisible: false + .catch((err) => { + this.setData({ + topicList: [], + nomoreStatus: 'none', + preloadVisible: false, + }) + console.log(err) }) - console.log(err) - }) }, // 获取 我的话题列表 上拉加载 - loadMoreTopicList () { + loadMoreTopicList() { const para = { pageIndex: this.data.pageNo, - pageSize: this.data.pageSize + pageSize: this.data.pageSize, } - api.getMyTopicList(para).then(res => { - console.log('我的话题列表', res) - const topicList = [...this.data.topicList, ...res.data] - this.setData({ - nomoreStatus: res.data.length === 10 ? 'loading' : 'none', - preloadVisible: false, - topicList, + api + .getMyTopicList(para) + .then((res) => { + console.log('我的话题列表', res) + const topicList = [...this.data.topicList, ...res.data] + this.setData({ + nomoreStatus: res.data.length === 10 ? 'loading' : 'none', + preloadVisible: false, + topicList, + }) }) - }).catch(err => { - this.setData({ - topicList: [], - nomoreStatus: 'none', - preloadVisible: false + .catch((err) => { + this.setData({ + topicList: [], + nomoreStatus: 'none', + preloadVisible: false, + }) + console.log(err) }) - console.log(err) - }) }, // 获取 我的议题列表 - getIssueList () { + getIssueList() { this.setData({ - issueList: [] + issueList: [], }) - api.getMyIssueList().then(res => { - console.log('我的议题列表', res) - this.setData({ - issueList: [...res.data], - nomoreStatus: 'none', - preloadVisible: false + api + .getMyIssueList() + .then((res) => { + console.log('我的议题列表', res) + this.setData({ + issueList: [...res.data], + nomoreStatus: 'none', + preloadVisible: false, + }) }) - }).catch(err => { - this.setData({ - issueList: [], - nomoreStatus: 'none', - preloadVisible: false + .catch((err) => { + this.setData({ + issueList: [], + nomoreStatus: 'none', + preloadVisible: false, + }) + console.log(err) }) - console.log(err) - }) }, // 获取 我的项目列表 - getProjectList () { + getProjectList() { this.setData({ - projectList: [] + projectList: [], }) this.data.timestamp = getTimestamp() const para = { pageIndex: this.data.pageNo, pageSize: this.data.pageSize, - timestamp: this.data.timestamp + timestamp: this.data.timestamp, } - api.getMyProjectList(para).then(res => { - console.log('我的项目列表', res) - this.setData({ - projectList: [...res.data], - nomoreStatus: res.data.length === 10 ? 'loading' : 'none', - preloadVisible: false + api + .getMyProjectList(para) + .then((res) => { + console.log('我的项目列表', res) + this.setData({ + projectList: [...res.data], + nomoreStatus: res.data.length === 10 ? 'loading' : 'none', + preloadVisible: false, + }) }) - }).catch(err => { - this.setData({ - projectList: [], - nomoreStatus: 'none', - preloadVisible: false + .catch((err) => { + this.setData({ + projectList: [], + nomoreStatus: 'none', + preloadVisible: false, + }) + console.log(err) }) - console.log(err) - }) }, // 获取 我的项目列表 上拉加载 - loadMoreProjectList () { + loadMoreProjectList() { const para = { pageIndex: this.data.pageNo, pageSize: this.data.pageSize, - timestamp: this.data.timestamp + timestamp: this.data.timestamp, } - api.getMyProjectList(para).then(res => { - console.log('我的项目列表', res) - const projectList = [...this.data.projectList,...res.data] - this.setData({ - nomoreStatus: res.data.length === 10 ? 'loading' : 'none', - preloadVisible: false, - projectList, + api + .getMyProjectList(para) + .then((res) => { + console.log('我的项目列表', res) + const projectList = [...this.data.projectList, ...res.data] + this.setData({ + nomoreStatus: res.data.length === 10 ? 'loading' : 'none', + preloadVisible: false, + projectList, + }) }) - }).catch(err => { - this.setData({ - projectList: [], - nomoreStatus: 'none', - preloadVisible: false + .catch((err) => { + this.setData({ + projectList: [], + nomoreStatus: 'none', + preloadVisible: false, + }) + console.log(err) }) - console.log(err) - }) }, // 获取用户信息 - getUserInfo () { - api.getUserInfo().then(res => { - console.log('用户信息', res) - const userInfo = {} - for(const key in this.data.userInfo) { - userInfo[key] = res.data[key] - } - this.setData({ - userInfo - }) - }).catch(err => { - this.setData({ - userInfo: { - faceImg: '', - nickname: '', - points: 0, - grade: 0 + getUserInfo() { + api + .getUserInfo() + .then((res) => { + console.log('用户信息', res) + const userInfo = {} + for (const key in this.data.userInfo) { + userInfo[key] = res.data[key] } + this.setData({ + userInfo, + }) + }) + .catch((err) => { + this.setData({ + userInfo: { + faceImg: '', + nickname: '', + points: 0, + grade: 0, + }, + }) + console.log(err) }) - console.log(err) - }) }, // 完善信息 - navigateToComplete () { + navigateToComplete() { wx.navigateTo({ - url: '/pages/complete/complete' + url: '/pages/complete/complete', }) }, // 议题列表 跳转详情 - toIssueDetail (e) { + toIssueDetail(e) { const { issueId, state } = e.detail if (state !== '待审核' && state !== '未通过') { wx.navigateTo({ - url: `/subpages/discussion/pages/discussionDetail/discussionDetail?type=issue&detailId=${issueId}` + url: `/subpages/discussion/pages/discussionDetail/discussionDetail?type=issue&detailId=${issueId}`, }) } else if (state === '待审核' || state === '未通过') { wx.navigateTo({ - url: `/subpages/mine/pages/eventDetail/eventDetail?eventId=${issueId}&eventType=${state}` + url: `/subpages/mine/pages/eventDetail/eventDetail?eventId=${issueId}&eventType=${state}`, }) } }, // 项目列表 跳转详情 - toProjectDetail (e) { + toProjectDetail(e) { const { itemId } = e.detail wx.navigateTo({ - url: `/subpages/discussion/pages/discussionDetail/discussionDetail?type=project&detailId=${itemId}` + url: `/subpages/discussion/pages/discussionDetail/discussionDetail?type=project&detailId=${itemId}`, }) }, // 话题列表 跳转详情 - toTopicDetail (e) { + toTopicDetail(e) { const { topicId } = e.detail wx.navigateTo({ - url: `/subpages/association/pages/topicDetail/topicDetail?detailId=${topicId}` + url: `/subpages/association/pages/topicDetail/topicDetail?detailId=${topicId}`, }) }, // 我要报事 - addIssue () { + addIssue() { if (this.data.infoCompleted == 0) { this.setData({ - completeInfoDialogVisible: !this.data.completeInfoDialogVisible + completeInfoDialogVisible: !this.data.completeInfoDialogVisible, }) return false } wx.navigateTo({ - url: '/subpages/discussion/pages/addIssue/addIssue' + url: '/subpages/discussion/pages/addIssue/addIssue', }) }, // 跳转到 邀请记录 - navigateToInviteRecord () { + navigateToInviteRecord() { wx.navigateTo({ - url: '/subpages/mine/pages/inviteRecord/inviteRecord' + url: '/subpages/mine/pages/inviteRecord/inviteRecord', }) }, // 跳转到 网格管理 - navigateToGridManage () { + navigateToGridManage() { wx.navigateTo({ - url: '/subpages/mine/pages/gridManage/gridManage' + url: '/subpages/mine/pages/gridManage/gridManage', }) }, //跳转到积分中心 - navigateToIntegralCentre () { - this.getUserInfo();//防止积分变化 + navigateToIntegralCentre() { + this.getUserInfo() //防止积分变化 wx.navigateTo({ - url: "/subpages/integralCentre/pages/index/index?points=" + this.data.userInfo.points + url: + '/subpages/integralCentre/pages/index/index?points=' + + this.data.userInfo.points, }) - } -}) \ No newline at end of file + }, + // 点亮徽章 + navigateToStatus() { + if (this.data.infoCompleted == 0) { + this.setData({ + completeInfoDialogVisible: !this.data.completeInfoDialogVisible, + }) + return false + } + if (this.data.userInfo.partyFlag === '0') { + wx.showModal({ + title: '提示', + content: '只有党员才可点亮徽章,是否要去认证为党员', + cancelText: '是', + confirmText: '否', + success(res) { + if (res.confirm) { + } else if (res.cancel) { + wx.navigateTo({ + url: `/pages/complete/complete?selectTab=partyMember`, + }) + } + }, + }) + } else { + wx.navigateTo({ + url: `/subpages/status/pages/brightStatus/brightStatus?showIdentityFlag=${this.data.userInfo.showIdentityFlag}`, + }) + } + }, +}) diff --git a/epdc-resident-mp-yushan/pages/mine/mine.json b/epdc-resident-mp-yushan/pages/mine/mine.json index a660765..557dd86 100644 --- a/epdc-resident-mp-yushan/pages/mine/mine.json +++ b/epdc-resident-mp-yushan/pages/mine/mine.json @@ -9,5 +9,7 @@ "preload-topic-item": "./components/preloadTopicItem/preloadTopicItem", "load-more": "../../components/loadMore/loadMore", "completeInfo-dialog": "../../components/completeInfoDialog/completeInfoDialog" - } + }, + "navigationBarBackgroundColor": "#e40000", + "navigationBarTextStyle": "white" } \ No newline at end of file diff --git a/epdc-resident-mp-yushan/pages/mine/mine.wxml b/epdc-resident-mp-yushan/pages/mine/mine.wxml index 1356c98..0865e85 100644 --- a/epdc-resident-mp-yushan/pages/mine/mine.wxml +++ b/epdc-resident-mp-yushan/pages/mine/mine.wxml @@ -1,8 +1,6 @@ - - @@ -26,11 +24,14 @@ - 等级:{{userInfo.grade}} - - 积分:{{userInfo.points}} - - + + + 等级:{{userInfo.grade}} + + + + 积分:{{userInfo.points}} +