Browse Source

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

release
zzz 4 years ago
parent
commit
848f8c3f49
  1. 2
      pages/toRegister/toRegister.js
  2. 18
      project.config.json
  3. 36
      subpages/heart/pages/leaderboardNew/leaderboardNew.js
  4. 13
      subpages/heart/pages/leaderboardNew/leaderboardNew.wxml
  5. 47
      subpages/heart/pages/leaderboardNew/leaderboardNew.wxss
  6. 40
      subpages/heart/pages/volunteer/volunteer.js
  7. 13
      subpages/heart/pages/volunteer/volunteer.wxml
  8. 13
      utils/api.js
  9. 2
      utils/config.js

2
pages/toRegister/toRegister.js

@ -21,7 +21,7 @@ Page({
// }
// })
let that = this
const versionNum = "1.7.3"
const versionNum = "1.7.4"
api.getScanSwitch(versionNum).then(function (res) {
console.log(res.data)
let state = res.data.scanFlag

18
project.config.json

@ -6,33 +6,37 @@
"setting": {
"urlCheck": false,
"es6": true,
"enhance": true,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": true,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"useMultiFrameRuntime": false,
"lazyloadPlaceholderEnable": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": false,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"bundle": false,
"useIsolateContext": true,
"useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false,
"enableEngineNative": false,
"useIsolateContext": false,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"userConfirmedBundleSwitch": false,
"minifyWXSS": true
"minifyWXSS": true,
"showES6CompileOption": false
},
"compileType": "miniprogram",
"libVersion": "2.9.2",

36
subpages/heart/pages/leaderboardNew/leaderboardNew.js

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

13
subpages/heart/pages/leaderboardNew/leaderboardNew.wxml

@ -22,6 +22,11 @@
</preload-loveranking-item>
</block>
<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="num {{index === 0 ? 'color1' : index === 1 ? 'color2' : index === 2 ? 'color3' : ''}}">
{{index + 1}}</view>
@ -29,10 +34,18 @@
<view class="info">
<view class="name"><view>{{item.nickname}}</view><image src="../../images/ic_dangbiaoqian.png" wx:if="{{item.partyFlag == '1'}}"/></view>
<view class="info-detail">
<block wx:if="{{rankId == '0'}}">
<image class="heart-time" src="../../images/aixin.png"></image>
<view> 爱心时长 {{item.kindnessTime}}小时</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>

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

@ -100,12 +100,12 @@ button::after {
.bottom {
width: 100%;
box-sizing: border-box;
background: #fff;
margin-top: 4rpx;
background: #f7f7f7;
/* margin-top: 4rpx; */
/* padding: 0 30rpx; */
}
.padding{
padding: 0 30rpx;
/* padding: 0 30rpx; */
}
@ -124,6 +124,9 @@ button::after {
height: 140rpx;
display: flex;
align-items: center;
background-color: #fff;
box-sizing: border-box;
padding: 0 30rpx;
}
.bottom .list-item+.list-item {
@ -199,7 +202,7 @@ button::after {
height: 24rpx;
object-fit: cover;
margin-right: 6rpx;
margin-left: 20rpx;
/* margin-left: 20rpx; */
}
.project-nodata {
@ -267,3 +270,39 @@ button::after {
justify-content: 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: ''
}],
tagIndex: 0,
volunteerDept: {}, //志愿者部门id
deptList: [{
deptName: '请选择',
id: ''
}],
deptIndex: 0,
},
onLoad: function () {
this.setData({
@ -55,6 +61,7 @@ Page({
this.getPrepareComplete().then(() => {
this.getGridList()
this.getVolunteerTags()
this.getVolunteerDepts()
})
this.checkWxUnionId()
this.getWxCode()
@ -139,6 +146,26 @@ Page({
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:咨询热线
let that = this
@ -207,7 +234,8 @@ Page({
volunteerNickname:res.data.volunteerNickname,
volunteerSignature:res.data.volunteerSignature,
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
})
resolve(true)
@ -323,6 +351,7 @@ Page({
volunteerNickname:this.data.volunteerNickname.trim(''),
volunteerSignature:this.data.volunteerSignature,
volunteerTagId: this.data.volunteerTag.id,
volunteerDeptId: this.data.volunteerDept.id,
wxCode: this.data.unionIdStatus === "1" ? "" : this.data.wxCode,
encryptedData: this.data.unionIdStatus === "1" ? "" : this.data.encryptedData,
iv: this.data.unionIdStatus === "1" ? "" : this.data.iv
@ -570,4 +599,13 @@ Page({
'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>
</picker>
</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-name-last">格言</view>
</view>
@ -119,11 +128,11 @@
<view class="clear"></view>
</view>
<view class="info-box">
<!-- <view class="info-box">
<view class="address name">
{{gridName}}
</view>
</view>
</view> -->
<view class="info-box">
<view class="address name">

13
utils/api.js

@ -71,7 +71,8 @@ module.exports = {
signIn: signIn,
suggestDict: suggestDict,
suggestDictList: suggestDictList,
suggestDetail: suggestDetail
suggestDetail: suggestDetail,
getVolunteerDepts: getVolunteerDepts
}
function getToken (wxCode) {
@ -333,10 +334,11 @@ function userPointsRankinglist ({
/**
* 排行榜
*/
function leaderboard ({pageIndex, pageSize}) {
function leaderboard ({pageIndex, pageSize, type}) {
return fly.get("heart/volunteer/leaderboard", {
pageIndex,
pageSize
pageSize,
type
})
}
/**
@ -626,3 +628,8 @@ function suggestDictList(para) {
function suggestDetail (id) {
return fly.get(`custom/advice/detail/${id}`)
}
//志愿者注册-志愿者部门列表
function getVolunteerDepts () {
return fly.get(`app-user/volunteer/depts`)
}

2
utils/config.js

@ -8,7 +8,7 @@ module.exports = {
function BASEURL() {
// return 'https://epdc-jinan-test.elinkservice.cn/js/epdc-api/api/' // 锦水测试环境
return 'https://epdc-jinshui.elinkservice.cn/epdc-api/api/' // 锦水正式环境接口地址
// return 'http://192.168.43.49:9094/epdc-api/api/'
// return 'http://10.10.10.192:9094/epdc-api/api/'
// return 'https://nei.netease.com/api/apimock-v2/068b11343b2a993a9292d11f4b3fa8a8/api/'
}

Loading…
Cancel
Save