Browse Source

增加网格队伍模块

feature/societyOrg
lihenian 4 years ago
parent
commit
465d2d5111
  1. 7
      epdc-resident-mp-yushan/app.json
  2. 53
      epdc-resident-mp-yushan/pages/index/index.js
  3. 1
      epdc-resident-mp-yushan/pages/index/index.json
  4. 6
      epdc-resident-mp-yushan/pages/index/index.wxml
  5. 11
      epdc-resident-mp-yushan/project.private.config.json
  6. BIN
      epdc-resident-mp-yushan/subpages/gridArmy/images/community.png
  7. BIN
      epdc-resident-mp-yushan/subpages/gridArmy/images/phone.png
  8. 90
      epdc-resident-mp-yushan/subpages/gridArmy/pages/index/index.js
  9. 9
      epdc-resident-mp-yushan/subpages/gridArmy/pages/index/index.json
  10. 32
      epdc-resident-mp-yushan/subpages/gridArmy/pages/index/index.wxml
  11. 129
      epdc-resident-mp-yushan/subpages/gridArmy/pages/index/index.wxss
  12. 14
      epdc-resident-mp-yushan/utils/api.js
  13. 4
      epdc-resident-mp-yushan/utils/config.js

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

@ -175,6 +175,13 @@
"pages": [
"pages/brightStatus/brightStatus"
]
},
{
"root": "subpages/gridArmy",
"name": "gridArmy",
"pages": [
"pages/index/index"
]
}
],
"preloadRule": {

53
epdc-resident-mp-yushan/pages/index/index.js

@ -33,11 +33,11 @@ Page({
communityNewsList: [],
currentIndex: 0,
moduleList: [
{ icon: 'https://epdc-yushan.elinkservice.cn/files-pro/20210914/b37b7368b6b64dd5993d096ef1ee33cc.png', tip: '积分排名' },
{ icon: 'https://epdc-yushan.elinkservice.cn/files-pro/20210914/59c1cf60c4214789a6ef3750588de98f.png', tip: '指尖榆山' },
{ icon: 'https://epdc-yushan.elinkservice.cn/files-pro/20210914/9d34f487426841cc8c32c42488c78969.png', tip: '网格队伍' },
{ icon: 'https://epdc-yushan.elinkservice.cn/files-pro/20210914/c6c7c00117ab41eba7d240fcfba5b148.png', tip: '志愿服务' },
{ icon: 'https://epdc-yushan.elinkservice.cn/files-pro/20210914/b884f294e3634f66b7ff36be682046a2.png', tip: '社会组织' }
{ icon: 'https://epdc-yushan.elinkservice.cn/files-pro/20210914/b37b7368b6b64dd5993d096ef1ee33cc.png', tip: '积分排名', module: 'pointRank' },
{ icon: 'https://epdc-yushan.elinkservice.cn/files-pro/20210914/59c1cf60c4214789a6ef3750588de98f.png', tip: '指尖榆山', module: 'fingerYushan' },
{ icon: 'https://epdc-yushan.elinkservice.cn/files-pro/20210914/9d34f487426841cc8c32c42488c78969.png', tip: '网格队伍', module: 'gridArmy' },
{ icon: 'https://epdc-yushan.elinkservice.cn/files-pro/20210914/c6c7c00117ab41eba7d240fcfba5b148.png', tip: '志愿服务', module: 'volunteerService' },
{ icon: 'https://epdc-yushan.elinkservice.cn/files-pro/20210914/b884f294e3634f66b7ff36be682046a2.png', tip: '社会组织', module: 'societyOrg' }
]
},
onLoad(options) {
@ -369,5 +369,48 @@ Page({
}).catch(err => {
console.error(err)
})
},
// 模块列表跳转
navigateToModule(e) {
const { module } = e.currentTarget.dataset
if (module === 'gridArmy') {
wx.navigateTo({
url: '/subpages/gridArmy/pages/index/index'
})
} else if (module === 'pointRank') {
wx.navigateTo({
url: '/subpages/integralCentre/pages/index/index'
})
} else if (module === 'volunteerService') {
wx.navigateTo({
url: '/pages/heart/heart'
})
} else if (module === 'societyOrg') {
wx.showToast({
title: '敬请期待~',
icon: 'none'
})
} else if (module === 'fingerYushan') {
}
},
// 我有事要说跳转
navigateToDiscussion() {
if (app.globalData.infoCompleted == 0) {
this.setData({
completeInfoDialogVisible: !this.data.completeInfoDialogVisible
})
return false
}
wx.navigateTo({
url: '/subpages/discussion/pages/addIssue/addIssue'
})
},
// 拨打便民服务电话
callPhone(e) {
const { phone } = e.currentTarget.dataset
wx.makePhoneCall({
phoneNumber: phone
})
}
})

1
epdc-resident-mp-yushan/pages/index/index.json

@ -1,6 +1,7 @@
{
"navigationStyle": "custom",
"navigationBarTextStyle": "white",
"backgroundColor": "#f7f7f7",
"usingComponents": {
"move-btn": "/components/moveButton/moveButton",
"community-news-list": "../index_bk/components/communityNewsList/communityNewsList"

6
epdc-resident-mp-yushan/pages/index/index.wxml

@ -53,12 +53,12 @@
<view class="num">
<image src="https://epdc-yushan.elinkservice.cn/files-pro/20210914/9930f010ddcd4b11a4261ffad212ac29.png" />
</view>
<view class="call">拨打</view>
<view class="call" bindtap="callPhone" data-phone="777-12345">拨打</view>
</view>
</view>
<!-- 我有事要说、要办、要提 -->
<view class="grid-list">
<view class="grid-item-left">
<view class="grid-item-left" bindtap="navigateToDiscussion">
<image src="https://epdc-yushan.elinkservice.cn/files-pro/20210914/3e2b3a7d912448c8bc0178aa7fdffb60.png" />
</view>
<view class="grid-item-right">
@ -72,7 +72,7 @@
</view>
<!-- 积分排名、指尖榆山、网格队伍、志愿服务、社会组织模块 -->
<view class="module-list">
<view class="module-item" wx:for="{{moduleList}}" wx:key="index" wx:for-item="item">
<view class="module-item" wx:for="{{moduleList}}" wx:key="index" wx:for-item="item" data-module="{{item.module}}" bindtap="navigateToModule">
<view class="icon">
<image src="{{item.icon}}" />
</view>

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

@ -11,12 +11,11 @@
"list": []
},
"miniprogram": {
"list": [
{
"list": [{
"id": 0,
"name": "带参数二维码",
"pathName": "pages/index/index",
"query": "scene=1169158362718629889&inviteUserId=12345",
"query": "scene=1288048536265261057&inviteUserId=12345",
"scene": 1011
},
{
@ -56,6 +55,12 @@
"pathName": "subpages/heart/pages/moreList/moreList",
"query": "",
"scene": null
},
{
"name": "网格队伍",
"pathName": "subpages/gridArmy/pages/index/index",
"query": "",
"scene": null
}
]
}

BIN
epdc-resident-mp-yushan/subpages/gridArmy/images/community.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
epdc-resident-mp-yushan/subpages/gridArmy/images/phone.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 B

90
epdc-resident-mp-yushan/subpages/gridArmy/pages/index/index.js

@ -0,0 +1,90 @@
const api = require('../../../../utils/api')
Page({
data: {
loadMoreType: 'none',
loadMoreVisible: false,
pageNo: 1,
pageSize: 10,
deptName: '',
deptIntro: '',
griderList: []
},
onLoad() {
this.getDeptInfo()
this.getMemberList()
},
onReachBottom() {
this.setData({
loadMoreVisible: true
})
if (this.data.loadMoreType === 'loading') {
this.data.pageNo += 1
this.loadMoreMemberList()
}
},
// 社区介绍
getDeptInfo() {
api.getDeptInfo().then(res => {
console.log(res)
const { deptInfo, deptName } = res.data
this.setData({
deptName: deptName,
deptIntro: deptInfo
})
}).catch(err => {
console.error(err)
})
},
// 初始化加载网格员队伍
getMemberList() {
const params = {
pageIndex: this.data.pageNo,
pageSize: this.data.pageSize
}
wx.showLoading({
title: '加载中...'
})
api.getMemberList(params).then(res => {
wx.hideLoading()
const arr = []
// res.data.forEach()
this.setData({
griderList: res.data,
loadMoreType: res.data.length === this.data.pageSize ? 'loading' : 'none'
})
}).catch(err => {
wx.hideLoading()
this.setData({
griderList: [],
loadMoreType: 'none'
})
})
},
// 下拉加载 网格员列表
loadMoreMemberList() {
const params = {
pageIndex: this.data.pageNo,
pageSize: this.data.pageSize
}
wx.showLoading({
title: '加载中...'
})
api.getMemberList(params).then(res => {
wx.hideLoading()
this.setData({
griderList: this.data.griderList.concat(res.data),
loadMoreType: res.data.length === this.data.pageSize ? 'loading' : 'none'
})
}).catch(err => {
wx.hideLoading()
console.error(err)
})
},
callGrider(e) {
const { phone } = e.currentTarget.dataset
wx.makePhoneCall({
phoneNumber: phone
})
}
})

9
epdc-resident-mp-yushan/subpages/gridArmy/pages/index/index.json

@ -0,0 +1,9 @@
{
"navigationBarBackgroundColor": "#d73e32",
"backgroundColor": "#f7f7f7",
"navigationBarTextStyle": "white",
"navigationBarTitleText": "网格队伍",
"usingComponents": {
"no-data": "/components/nodata/nodata"
}
}

32
epdc-resident-mp-yushan/subpages/gridArmy/pages/index/index.wxml

@ -0,0 +1,32 @@
<view class="grid-army">
<view class="community-intro">
<view class="community-name">
<view class="icon">
<image src="../../images/community.png" />
</view>
<view class="name">{{deptName}}</view>
</view>
<view class="community-detail">{{deptIntro}}</view>
</view>
<view class="grider-list" wx:if="{{griderList.length > 0}}">
<view class="grid-item" wx:for="{{griderList}}" wx:key="index">
<view class="avatar">
<image src="{{item.imgUrl}}" />
</view>
<view class="name">{{item.name}}</view>
<view class="item">格言:{{item.motto}}</view>
<view class="item">负责区域:{{item.territory}}</view>
<view class="item">电话:{{item.mobile}}</view>
<view class="call-phone">
<view class="phone">
<image src="../../images/phone.png" />
</view>
<view class="tip" bindtap="callGrider" data-phone="{{item.mobile}}">打电话</view>
</view>
</view>
</view>
<view wx:else class="no-data-container">
<no-data isShow="{{true}}"></no-data>
</view>
</view>
<load-more loadMoreType="{{loadMoreType}}" loadMoreVisible="{{loadMoreVisible}}"></load-more>

129
epdc-resident-mp-yushan/subpages/gridArmy/pages/index/index.wxss

@ -0,0 +1,129 @@
page {
background: #f7f7f7;
}
image {
width: 100%;
height: 100%;
float: left;
}
.grid-army {
width: 100%;
height: auto;
}
.community-intro {
width: 100%;
background: linear-gradient(to bottom, #d73e32, #cd1b1e);
box-sizing: border-box;
padding: 0 32rpx 80rpx;
}
.community-intro .community-name {
display: flex;
align-items: center;
height: 100rpx;
width: 100%;
}
.community-intro .community-name .icon {
width: 56rpx;
height: 56rpx;
}
.community-intro .community-name .name {
font-size: 52rpx;
color: #fff;
margin-left: 15rpx;
}
.community-intro .community-detail {
font-size: 30rpx;
color: #fff;
line-height: 50rpx;
text-indent: 60rpx;
}
.grider-list {
width: 100%;
box-sizing: border-box;
padding: 0 32rpx;
margin-top: -40rpx;
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-auto-flow: dense;
column-gap: 30rpx;
}
.grider-list .grid-item {
width: 100%;
background: #fff;
margin-bottom: 20rpx;
border-radius: 14rpx;
box-sizing: border-box;
padding: 40rpx 30rpx 30rpx;
display: flex;
flex-direction: column;
align-items: center;
}
.grider-list .grid-item .avatar {
width: 110rpx;
height: 110rpx;
border-radius: 50%;
background: yellow;
overflow: hidden;
}
.grider-list .grid-item .name {
font-size: 30rpx;
line-height: 50rpx;
color: #333;
margin-top: 20rpx;
}
.grider-list .grid-item .item {
width: 100%;
line-height: 36rpx;
font-size: 26rpx;
color: #c1c1c1;
}
.grider-list .grid-item .item + .item {
margin-top: 4rpx;
}
.grider-list .grid-item .call-phone {
margin-top: 20rpx;
width: 156rpx;
height: 56rpx;
background-image: linear-gradient(90deg,
#e3271c 0%,
#f95c2c 100%),
linear-gradient(
#8da5eb,
#8da5eb);
background-blend-mode: normal,
normal;
border-radius: 28rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
color: #ffffff;
}
.grider-list .grid-item .call-phone .phone {
width:23rpx;
height:27rpx;
margin-right: 6rpx;
}
.no-data-container {
width: 100%;
height: 50vh;
display: flex;
align-items: center;
justify-content: center;
}

14
epdc-resident-mp-yushan/utils/api.js

@ -61,7 +61,9 @@ module.exports = {
submitQuestion: submitQuestion,
getMyQuestion: getMyQuestion,
getConsultantDetail: getConsultantDetail,
gridmanList: gridmanList
gridmanList: gridmanList,
getDeptInfo: getDeptInfo,
getMemberList: getMemberList
}
function getToken(wxCode) {
@ -491,3 +493,13 @@ export function getConsultantDetail(id) {
export function getMyQuestion(param) {
return fly.get('property/psychology/listUserQuestion', param)
}
// 网格队伍-社区介绍
function getDeptInfo() {
return fly.get('sys/gridMember/getDeptInfo')
}
// 网格队伍-网格员列表
function getMemberList(params) {
return fly.get('sys/gridMember/getMemberList', params)
}

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

@ -7,8 +7,8 @@ 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-yushan.elinkservice.cn/epdc-api/api/' // 现代榆山正式环境
return "https://epdc-api-test.elinkservice.cn/epdc-api/api/" // 测试环境 ip接口地址
// return 'https://epdc-yushan.elinkservice.cn/epdc-api/api/' // 现代榆山正式环境
}
function WEBROOT() {

Loading…
Cancel
Save