Browse Source

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

release
zzz 4 years ago
parent
commit
848f8c3f49
  1. 2
      pages/toRegister/toRegister.js
  2. 18
      project.config.json
  3. 44
      subpages/heart/pages/leaderboardNew/leaderboardNew.js
  4. 21
      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 let that = this
const versionNum = "1.7.3" const versionNum = "1.7.4"
api.getScanSwitch(versionNum).then(function (res) { api.getScanSwitch(versionNum).then(function (res) {
console.log(res.data) console.log(res.data)
let state = res.data.scanFlag let state = res.data.scanFlag

18
project.config.json

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

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()
},
}) })

21
subpages/heart/pages/leaderboardNew/leaderboardNew.wxml

@ -22,6 +22,11 @@
</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 +34,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 {
@ -199,7 +202,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 {
@ -267,3 +270,39 @@ button::after {
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">

13
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) {
@ -333,10 +334,11 @@ function userPointsRankinglist ({
/** /**
* 排行榜 * 排行榜
*/ */
function leaderboard ({pageIndex, pageSize}) { function leaderboard ({pageIndex, pageSize, type}) {
return fly.get("heart/volunteer/leaderboard", { return fly.get("heart/volunteer/leaderboard", {
pageIndex, pageIndex,
pageSize pageSize,
type
}) })
} }
/** /**
@ -626,3 +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`)
}

2
utils/config.js

@ -8,7 +8,7 @@ module.exports = {
function BASEURL() { function BASEURL() {
// return 'https://epdc-jinan-test.elinkservice.cn/js/epdc-api/api/' // 锦水测试环境 // return 'https://epdc-jinan-test.elinkservice.cn/js/epdc-api/api/' // 锦水测试环境
return 'https://epdc-jinshui.elinkservice.cn/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/' // return 'https://nei.netease.com/api/apimock-v2/068b11343b2a993a9292d11f4b3fa8a8/api/'
} }

Loading…
Cancel
Save