Browse Source

志愿者注册增加部门字段;志愿者银行增加类型分类;

master
zzz 4 years ago
parent
commit
d2d4e09e82
  1. 14
      pages/heartNew/heartNew.js
  2. 44
      subpages/heart/pages/leaderboardNew/leaderboardNew.js
  3. 22
      subpages/heart/pages/leaderboardNew/leaderboardNew.wxml
  4. 47
      subpages/heart/pages/leaderboardNew/leaderboardNew.wxss
  5. 40
      subpages/heart/pages/volunteer/volunteer.js
  6. 13
      subpages/heart/pages/volunteer/volunteer.wxml
  7. 7
      utils/api.js
  8. 9
      utils/heartBehavior.js

14
pages/heartNew/heartNew.js

@ -71,15 +71,19 @@ Page({
this.indexNew(options) this.indexNew(options)
}, },
onLoadConfig () { onLoadConfig () {
this.loadBehavior()
this.getVolunteerVerify()
this.bannerListV2()
this.getVolunteerTags()
this.setData({ this.setData({
statusHeight: app.globalData.deviceInfo.statusHeight, statusHeight: app.globalData.deviceInfo.statusHeight,
navigationHeight: app.globalData.deviceInfo.navigationHeight, navigationHeight: app.globalData.deviceInfo.navigationHeight,
infoCompleted: app.globalData.infoCompleted infoCompleted: app.globalData.infoCompleted,
tagList: [{ tagName: '全部', id: '' }],
tabList: [],
tabLeftList: [],
tabRightList: []
}) })
this.loadBehavior()
this.getVolunteerVerify()
this.bannerListV2()
this.getVolunteerTags()
let parms = { let parms = {
pageIndex: this.data.indexPage, pageIndex: this.data.indexPage,

44
subpages/heart/pages/leaderboardNew/leaderboardNew.js

@ -43,7 +43,22 @@ Page({
timer: "", timer: "",
timestamp: getTimestamp(), timestamp: getTimestamp(),
jilu: true, jilu: true,
banner:[] banner:[],
rankId: '0',
rankTabList: [
{
id: '0',
label: '爱心时长'
},
{
id: '1',
label: '参与次数'
},
{
id: '2',
label: '公益积分'
}
]
}, },
// tab 切换 // tab 切换
onTabChange (e) { onTabChange (e) {
@ -55,6 +70,7 @@ Page({
if (e.currentTarget.dataset.tab == "tab2") { if (e.currentTarget.dataset.tab == "tab2") {
this.setData({ this.setData({
jilu: false, jilu: false,
signedList: []
}) })
this.getSignedList() this.getSignedList()
} else { } else {
@ -107,7 +123,8 @@ Page({
}) })
const para = { const para = {
pageIndex: this.data.pageNo, pageIndex: this.data.pageNo,
pageSize: this.data.pageSize pageSize: this.data.pageSize,
type: this.data.rankId
} }
api.leaderboard(para).then(res => { api.leaderboard(para).then(res => {
this.setData({ this.setData({
@ -197,11 +214,11 @@ Page({
this.setData({ this.setData({
pageNo: this.data.pageNo + 1 pageNo: this.data.pageNo + 1
}) })
} if(this.data.selectTab == "tab2"){
if(this.data.selectTab == "tab2"){ this.getSignedList()
this.getSignedList() } else {
} else { this.loadLoveRanking()
this.loadLoveRanking() }
} }
}, },
// 列表 下拉刷新, 初始化加载 // 列表 下拉刷新, 初始化加载
@ -288,5 +305,16 @@ Page({
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {
} },
//选择排序列
changeTag (e) {
const id = e.currentTarget.dataset.id
this.setData({
rankId: id,
loveRankingList: [],
pageNo: 1
})
this.loadLoveRanking()
},
}) })

22
subpages/heart/pages/leaderboardNew/leaderboardNew.wxml

@ -21,7 +21,13 @@
<preload-loveranking-item wx:for="{{[1,2,3,4]}}" wx:for-index="index" wx:key="index"> <preload-loveranking-item wx:for="{{[1,2,3,4]}}" wx:for-index="index" wx:key="index">
</preload-loveranking-item> </preload-loveranking-item>
</block> </block>
<block wx:elif="{{loveRankingList.length > 0}}"> <block wx:elif="{{loveRankingList.length > 0}}">
<scroll-view scroll-x="{{true}}" class="scroll-tag">
<view class="volunteer-tag">
<view class="tag {{rankId == item.id ? 'sel' : ''}}" wx:for="{{rankTabList}}" wx:key="index" data-id="{{item.id}}" bindtap="changeTag">{{item.label}}</view>
</view>
</scroll-view>
<view class="list-item" wx:for-item="item" wx:key="index" wx:for-index="index" wx:for="{{loveRankingList}}"> <view class="list-item" wx:for-item="item" wx:key="index" wx:for-index="index" wx:for="{{loveRankingList}}">
<view class="num {{index === 0 ? 'color1' : index === 1 ? 'color2' : index === 2 ? 'color3' : ''}}"> <view class="num {{index === 0 ? 'color1' : index === 1 ? 'color2' : index === 2 ? 'color3' : ''}}">
{{index + 1}}</view> {{index + 1}}</view>
@ -29,10 +35,18 @@
<view class="info"> <view class="info">
<view class="name"><view>{{item.nickname}}</view><image src="../../images/ic_dangbiaoqian.png" wx:if="{{item.partyFlag == '1'}}"/></view> <view class="name"><view>{{item.nickname}}</view><image src="../../images/ic_dangbiaoqian.png" wx:if="{{item.partyFlag == '1'}}"/></view>
<view class="info-detail"> <view class="info-detail">
<image class="heart-time" src="../../images/aixin.png"></image> <block wx:if="{{rankId == '0'}}">
<view> 爱心时长 {{item.kindnessTime}}小时</view> <image class="heart-time" src="../../images/aixin.png"></image>
<image class="enter-times" src="../../images/bofangcishu.png"></image> <view> 爱心时长 {{item.kindnessTime}}小时</view>
<view> 参加次数 {{item.participationNum}}次</view> </block>
<block wx:elif="{{rankId == '1'}}">
<image class="enter-times" src="../../images/bofangcishu.png"></image>
<view> 参加次数 {{item.participationNum}}次</view>
</block>
<block wx:elif="{{rankId == '2'}}">
<image class="enter-times" src="../../images/aixin.png"></image>
<view> 公益积分 {{item.volunteerPoints}}分</view>
</block>
</view> </view>
</view> </view>
</view> </view>

47
subpages/heart/pages/leaderboardNew/leaderboardNew.wxss

@ -100,12 +100,12 @@ button::after {
.bottom { .bottom {
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
background: #fff; background: #f7f7f7;
margin-top: 4rpx; /* margin-top: 4rpx; */
/* padding: 0 30rpx; */ /* padding: 0 30rpx; */
} }
.padding{ .padding{
padding: 0 30rpx; /* padding: 0 30rpx; */
} }
@ -124,6 +124,9 @@ button::after {
height: 140rpx; height: 140rpx;
display: flex; display: flex;
align-items: center; align-items: center;
background-color: #fff;
box-sizing: border-box;
padding: 0 30rpx;
} }
.bottom .list-item+.list-item { .bottom .list-item+.list-item {
@ -198,7 +201,7 @@ button::after {
height: 24rpx; height: 24rpx;
object-fit: cover; object-fit: cover;
margin-right: 6rpx; margin-right: 6rpx;
margin-left: 20rpx; /* margin-left: 20rpx; */
} }
.project-nodata { .project-nodata {
@ -265,4 +268,40 @@ button::after {
flex-direction: row; flex-direction: row;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
}
.scroll-tag {
height: 80rpx;
display: flex;
align-items: center;
margin-bottom: 10rpx;
}
.volunteer-tag {
background: rgba(255, 255, 255, 1);
display: flex;
white-space: nowrap;
flex-direction: row;
align-items: center;
justify-content: center;
height: 80rpx;
}
.volunteer-tag .tag {
border: 1px solid #999999;
border-radius: 32rpx;
padding: 0 10rpx;
margin: 0 10rpx;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
min-width: 140rpx;
text-align: center;
height: 52rpx;
line-height: 52rpx;
}
.volunteer-tag .sel {
border: 1px solid #da433d;
background-color: #da433d;
color: #fff;
font-weight: bold;
} }

40
subpages/heart/pages/volunteer/volunteer.js

@ -45,6 +45,12 @@ Page({
id: '' id: ''
}], }],
tagIndex: 0, tagIndex: 0,
volunteerDept: {}, //志愿者部门id
deptList: [{
deptName: '请选择',
id: ''
}],
deptIndex: 0,
}, },
onLoad: function () { onLoad: function () {
this.setData({ this.setData({
@ -55,6 +61,7 @@ Page({
this.getPrepareComplete().then(() => { this.getPrepareComplete().then(() => {
this.getGridList() this.getGridList()
this.getVolunteerTags() this.getVolunteerTags()
this.getVolunteerDepts()
}) })
this.checkWxUnionId() this.checkWxUnionId()
this.getWxCode() this.getWxCode()
@ -139,6 +146,26 @@ Page({
console.log(err) console.log(err)
}) })
}, },
// 获取志愿者部门列表
getVolunteerDepts () {
api.getVolunteerDepts().then(res => {
if (res.code == 0 && res.msg == 'success') {
this.setData({
deptList: this.data.deptList.concat(res.data)
})
res.data.forEach((item, key) => {
if (item.id == this.data.volunteerDept.id) {
this.setData({
'volunteerDept.dept': item.deptName,
deptIndex: parseInt(key)+1
})
}
})
}
}).catch(err => {
console.log(err)
})
},
// 获取配置图片 // 获取配置图片
getImgUrl:function (){//0:咨询热线 getImgUrl:function (){//0:咨询热线
let that = this let that = this
@ -207,7 +234,8 @@ Page({
volunteerNickname:res.data.volunteerNickname, volunteerNickname:res.data.volunteerNickname,
volunteerSignature:res.data.volunteerSignature, volunteerSignature:res.data.volunteerSignature,
volunteerFaceImg:res.data.volunteerFaceImg, volunteerFaceImg:res.data.volunteerFaceImg,
'volunteerTag.id': res.data.volunteerTagId || '0' 'volunteerTag.id': res.data.volunteerTagId || '0',
'volunteerDept.id': res.data.volunteerDeptId || '0'
// introduce:res.data.introduce // introduce:res.data.introduce
}) })
resolve(true) resolve(true)
@ -323,6 +351,7 @@ Page({
volunteerNickname:this.data.volunteerNickname.trim(''), volunteerNickname:this.data.volunteerNickname.trim(''),
volunteerSignature:this.data.volunteerSignature, volunteerSignature:this.data.volunteerSignature,
volunteerTagId: this.data.volunteerTag.id, volunteerTagId: this.data.volunteerTag.id,
volunteerDeptId: this.data.volunteerDept.id,
wxCode: this.data.unionIdStatus === "1" ? "" : this.data.wxCode, wxCode: this.data.unionIdStatus === "1" ? "" : this.data.wxCode,
encryptedData: this.data.unionIdStatus === "1" ? "" : this.data.encryptedData, encryptedData: this.data.unionIdStatus === "1" ? "" : this.data.encryptedData,
iv: this.data.unionIdStatus === "1" ? "" : this.data.iv iv: this.data.unionIdStatus === "1" ? "" : this.data.iv
@ -570,4 +599,13 @@ Page({
'volunteerTag.tag': this.data.tagList[index].tagName 'volunteerTag.tag': this.data.tagList[index].tagName
}) })
}, },
//
choosePicker2 (e) {
let index = e.detail.value
this.setData({
deptIndex: index,
'volunteerDept.id': this.data.deptList[index].id,
'volunteerDept.dept': this.data.deptList[index].deptName
})
},
}) })

13
subpages/heart/pages/volunteer/volunteer.wxml

@ -98,6 +98,15 @@
</view> </view>
</picker> </picker>
</view> </view>
<view class="head-portrait">
<view class="head-portrait-name">选择部门</view>
<!-- <view class="time">{{volunteerTag.tag}}</view> -->
<picker bindchange="choosePicker2" value="{{deptIndex}}" range="{{deptList}}" range-key="deptName">
<view class="picker">
{{deptList[deptIndex].deptName}}
</view>
</picker>
</view>
<view class="head-portrait-last"> <view class="head-portrait-last">
<view class="head-portrait-name-last">格言</view> <view class="head-portrait-name-last">格言</view>
</view> </view>
@ -119,11 +128,11 @@
<view class="clear"></view> <view class="clear"></view>
</view> </view>
<view class="info-box"> <!-- <view class="info-box">
<view class="address name"> <view class="address name">
{{gridName}} {{gridName}}
</view> </view>
</view> </view> -->
<view class="info-box"> <view class="info-box">
<view class="address name"> <view class="address name">

7
utils/api.js

@ -71,7 +71,8 @@ module.exports = {
signIn: signIn, signIn: signIn,
suggestDict: suggestDict, suggestDict: suggestDict,
suggestDictList: suggestDictList, suggestDictList: suggestDictList,
suggestDetail: suggestDetail suggestDetail: suggestDetail,
getVolunteerDepts: getVolunteerDepts
} }
function getToken (wxCode) { function getToken (wxCode) {
@ -627,4 +628,8 @@ function suggestDictList(para) {
//一键服务-建议直通-建议详情接口 //一键服务-建议直通-建议详情接口
function suggestDetail (id) { function suggestDetail (id) {
return fly.get(`custom/advice/detail/${id}`) return fly.get(`custom/advice/detail/${id}`)
}
//志愿者注册-志愿者部门列表
function getVolunteerDepts () {
return fly.get(`app-user/volunteer/depts`)
} }

9
utils/heartBehavior.js

@ -30,9 +30,10 @@ module.exports = Behavior ({
Promise.all([this.getModuleList(), this.getImgUrl()]).then( () => { Promise.all([this.getModuleList(), this.getImgUrl()]).then( () => {
let newArr = group(this.data.tabList.sort(compare('sort')), 2) let newArr = group(this.data.tabList.sort(compare('sort')), 2)
this.setData({ this.setData({
tabLeftList: newArr[0], tabLeftList: newArr[1],
tabRightList: newArr[1] tabRightList: newArr[0]
}) })
// 2021.07.09 左右菜单互换位置
}) })
}, },
// 获取模块信息 // 获取模块信息
@ -49,8 +50,8 @@ module.exports = Behavior ({
if (item.categoryCode == 'shouye') { if (item.categoryCode == 'shouye') {
this.data.tabList.push(item) this.data.tabList.push(item)
this.setData({ this.setData({
shouye: item, shouye: item,
tabList: this.data.tabList tabList: this.data.tabList
}) })
} }
}) })

Loading…
Cancel
Save