Browse Source

志愿者增加标签分类;

release
ZhaoTongYao 5 years ago
parent
commit
49f451d63b
  1. 62
      pages/heartNew/heartNew.js
  2. 21
      pages/heartNew/heartNew.wxml
  3. 58
      pages/heartNew/heartNew.wxss
  4. 2
      pages/toRegister/toRegister.js
  5. 42
      subpages/heart/pages/volunteer/volunteer.js
  6. 14
      subpages/heart/pages/volunteer/volunteer.wxml
  7. 5
      subpages/heart/pages/volunteer/volunteer.wxss
  8. 7
      utils/activity.js
  9. 7
      utils/api.js

62
pages/heartNew/heartNew.js

@ -41,6 +41,14 @@ Page({
infoCompleted: 0, //是否完善了用户信息 infoCompleted: 0, //是否完善了用户信息
completeInfoDialogVisible: false, completeInfoDialogVisible: false,
tabRightList: [], //拼团购和顺道捎 tabRightList: [], //拼团购和顺道捎
volunteerTagId: '',//志愿者标签id
tagList: [
{
tagName: '全部',
id: ''
}
],
isLoading: false, //防止标签切换加载数据时点击切换标签
}, },
/** /**
@ -48,6 +56,7 @@ Page({
*/ */
onLoad: function () { onLoad: function () {
this.bannerListV2() this.bannerListV2()
this.getVolunteerTags()
this.getImgUrl()//获取配置图片 this.getImgUrl()//获取配置图片
this.setData({ this.setData({
statusHeight: app.globalData.deviceInfo.statusHeight, statusHeight: app.globalData.deviceInfo.statusHeight,
@ -96,7 +105,8 @@ Page({
let parms = { let parms = {
pageIndex: this.data.indexPage, pageIndex: this.data.indexPage,
pageSize: this.data.pageSize, pageSize: this.data.pageSize,
nickname: this.data.searchName nickname: this.data.searchName,
volunteerTagId: this.data.volunteerTagId
} }
this.volunteerlist(parms) this.volunteerlist(parms)
} }
@ -157,7 +167,8 @@ Page({
let parms = { let parms = {
pageIndex: this.data.indexPage, pageIndex: this.data.indexPage,
pageSize: this.data.pageSize, pageSize: this.data.pageSize,
nickname: this.data.searchName nickname: this.data.searchName,
volunteerTagId: this.data.volunteerTagId
} }
this.volunteerlist(parms) this.volunteerlist(parms)
} else if (e.currentTarget.dataset.tab == "tab2") { } else if (e.currentTarget.dataset.tab == "tab2") {
@ -229,7 +240,8 @@ Page({
that.setData({ that.setData({
listLength:res.data.volunteerList.length, listLength:res.data.volunteerList.length,
volunteerlist:that.data.volunteerlist.concat(res.data.volunteerList), volunteerlist:that.data.volunteerlist.concat(res.data.volunteerList),
volunteerCount: res.data.volunteerCount volunteerCount: res.data.volunteerCount,
isLoading: false
}) })
}) })
}, },
@ -288,7 +300,8 @@ Page({
let parms = { let parms = {
pageIndex: this.data.indexPage, pageIndex: this.data.indexPage,
pageSize: this.data.pageSize, pageSize: this.data.pageSize,
nickname: this.data.searchName nickname: this.data.searchName,
volunteerTagId: this.data.volunteerTagId
} }
this.volunteerlist(parms) this.volunteerlist(parms)
}, },
@ -324,6 +337,20 @@ Page({
wx.stopPullDownRefresh(); wx.stopPullDownRefresh();
}) })
}, },
// 获取志愿者标签列表
getVolunteerTags () {
api.getVolunteerTags().then(res => {
if (res.code == 0 && res.msg == 'success') {
const tagList = this.data.tagList.concat(res.data)
console.log('志愿者标签列表: ', tagList)
this.setData({
tagList
})
}
}).catch(err => {
console.log(err)
})
},
// 获取配置图片 // 获取配置图片
getImgUrl:function (){//0:咨询热线 getImgUrl:function (){//0:咨询热线
let that = this let that = this
@ -372,7 +399,8 @@ Page({
let parms = { let parms = {
pageIndex: this.data.indexPage, pageIndex: this.data.indexPage,
pageSize: this.data.pageSize, pageSize: this.data.pageSize,
nickname: this.data.searchName nickname: this.data.searchName,
volunteerTagId: this.data.volunteerTagId
} }
this.volunteerlist(parms) this.volunteerlist(parms)
} else if (this.data.selectedTab == "tab2") { } else if (this.data.selectedTab == "tab2") {
@ -475,4 +503,28 @@ Page({
}) })
} }
}, },
//选择志愿者标签筛选
changeTag (e) {
if (this.data.isLoading) {
wx.showToast({
title: '正在加载...',
icon: 'loading',
})
return
}
const id = e.currentTarget.dataset.id
this.setData({
volunteerTagId: id,
volunteerlist: [],
indexPage: 1,
isLoading: true
})
let parms = {
pageIndex: this.data.indexPage,
pageSize: this.data.pageSize,
nickname: this.data.searchName,
volunteerTagId: this.data.volunteerTagId
}
this.volunteerlist(parms)
}
}) })

21
pages/heartNew/heartNew.wxml

@ -83,16 +83,23 @@
<!-- 志友朵朵 --> <!-- 志友朵朵 -->
<block wx:if="{{ selectedTab == 'tab1' }}"> <block wx:if="{{ selectedTab == 'tab1' }}">
<view class="details-top"> <view class="details-top">
<view class="search"> <view class="top-box">
<view class="item-all"> <view class="reg-count">志愿者注册数:{{volunteerCount}}</view>
<view class="item-left"> <view class="search">
<image src="../../images/search.png"></image> <view class="item-all">
<input placeholder-class="placeholder-style" placeholder="输入昵称关键字" bindinput="bindInputValue" value="{{searchName}}"></input> <view class="item-left">
<image src="../../images/search.png"></image>
<input placeholder-class="placeholder-style" placeholder="输入昵称关键字" bindinput="bindInputValue" value="{{searchName}}"></input>
</view>
<button class="item-right" bindtap="searchName" hover-class="none">搜索</button>
</view> </view>
<button class="item-right" bindtap="searchName" hover-class="none">搜索</button>
</view> </view>
<scroll-view scroll-x="{{true}}" class="scroll-tag">
<view class="volunteer-tag">
<view class="tag {{volunteerTagId == item.id ? 'sel' : ''}}" wx:for="{{tagList}}" wx:key="index" data-id="{{item.id}}" bindtap="changeTag">{{item.tagName}}</view>
</view>
</scroll-view>
</view> </view>
<view class="reg-count">志愿者注册数:{{volunteerCount}}</view>
<view class="volunteer-box"> <view class="volunteer-box">
<volunteer-list bind:clickImage="clickImage" wx:for="{{volunteerlist}}" volunteerItemObj="{{item}}" wx:for-index="index" wx:for-item="item" wx:key="index"></volunteer-list> <volunteer-list bind:clickImage="clickImage" wx:for="{{volunteerlist}}" volunteerItemObj="{{item}}" wx:for-index="index" wx:for-item="item" wx:key="index"></volunteer-list>
</view> </view>

58
pages/heartNew/heartNew.wxss

@ -393,13 +393,54 @@ button:last-child {
.details-top { .details-top {
margin-top: 385rpx; margin-top: 385rpx;
} }
.top-box {
width: 100%;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
background-color: #fff;
padding: 0 20rpx;
box-sizing: border-box;
}
.reg-count { .reg-count {
font-size: 22rpx; font-size: 28rpx;
color: #999; color: #666;
line-height: 22rpx; line-height: 28rpx;
padding-left: 40rpx; width: 270rpx;
margin-top: 26rpx;
}
.scroll-tag {
height: 100rpx;
display: flex;
align-items: center;
}
.volunteer-tag {
background: rgba(255, 255, 255, 1);
display: flex;
white-space: nowrap;
flex-direction: row;
align-items: center;
margin: 10rpx 0rpx;
height: 80rpx;
}
.volunteer-tag .tag {
border: 1px solid #999999;
border-radius: 32rpx;
padding: 10rpx;
margin: 0 10rpx;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
min-width: 140rpx;
text-align: center;
}
.volunteer-tag .sel {
border: 1px solid #da433d;
background-color: #da433d;
color: #fff;
} }
.volunteer-box { .volunteer-box {
display: flex; display: flex;
align-items: center; align-items: center;
@ -420,12 +461,13 @@ button:last-child {
.search { .search {
/* margin-top: 17rpx; */ /* margin-top: 17rpx; */
height: 66rpx; height: 66rpx;
background: rgba(255, 255, 255, 1); width: 410rpx;
background: #f7f7f7;
border-radius: 33rpx; border-radius: 33rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin: 10rpx 40rpx; margin-top: 26rpx;
} }
.search .item-all { .search .item-all {
@ -469,7 +511,7 @@ button:last-child {
font-size: 28rpx; font-size: 28rpx;
font-weight: 500; font-weight: 500;
color: rgba(51, 51, 51, 1); color: rgba(51, 51, 51, 1);
background-color: #fff; background-color: #f7f7f7;
} }
.search button { .search button {
width: 100rpx; width: 100rpx;

2
pages/toRegister/toRegister.js

@ -21,7 +21,7 @@ Page({
// } // }
// }) // })
let that = this let that = this
const versionNum = "1.6.19" const versionNum = "1.6.20"
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

42
subpages/heart/pages/volunteer/volunteer.js

@ -39,6 +39,12 @@ Page({
uploadImageList: [], uploadImageList: [],
disabled:false, disabled:false,
lock: false, //锁定提交状态,防止连击 lock: false, //锁定提交状态,防止连击
volunteerTag: {}, //志愿者标签id
tagList: [{
tagName: '请选择',
id: '0'
}],
tagIndex: 0,
}, },
onLoad: function () { onLoad: function () {
this.setData({ this.setData({
@ -48,6 +54,7 @@ Page({
this.getImgUrl() this.getImgUrl()
this.getPrepareComplete().then(() => { this.getPrepareComplete().then(() => {
this.getGridList() this.getGridList()
this.getVolunteerTags()
}) })
this.checkWxUnionId() this.checkWxUnionId()
this.getWxCode() this.getWxCode()
@ -112,6 +119,26 @@ Page({
volunteerSignature: e.detail.value volunteerSignature: e.detail.value
}) })
}, },
// 获取志愿者标签列表
getVolunteerTags () {
api.getVolunteerTags().then(res => {
if (res.code == 0 && res.msg == 'success') {
this.setData({
tagList: this.data.tagList.concat(res.data)
})
res.data.forEach((item, key) => {
if (item.id == this.data.volunteerTag.id) {
this.setData({
'volunteerTag.tag': item.tagName,
tagIndex: parseInt(key)+1
})
}
})
}
}).catch(err => {
console.log(err)
})
},
// 获取配置图片 // 获取配置图片
getImgUrl:function (){//0:咨询热线 getImgUrl:function (){//0:咨询热线
let that = this let that = this
@ -180,6 +207,7 @@ 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'
// introduce:res.data.introduce // introduce:res.data.introduce
}) })
resolve(true) resolve(true)
@ -256,6 +284,10 @@ Page({
this.showToast("请输入昵称") this.showToast("请输入昵称")
return false return false
} }
if (this.data.volunteerTag.id == '0') {
this.showToast("请选择小组")
return false
}
// if(!this.data.volunteerSignature){ // if(!this.data.volunteerSignature){
// this.showToast("请输入格言") // this.showToast("请输入格言")
// return false // return false
@ -290,6 +322,7 @@ Page({
volunteerFaceImg:this.data.volunteerFaceImg, volunteerFaceImg:this.data.volunteerFaceImg,
volunteerNickname:this.data.volunteerNickname, volunteerNickname:this.data.volunteerNickname,
volunteerSignature:this.data.volunteerSignature, volunteerSignature:this.data.volunteerSignature,
volunteerTagId: this.data.volunteerTag.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
@ -527,4 +560,13 @@ Page({
destructiveButtonClicked () {}, destructiveButtonClicked () {},
}) })
}, },
//
choosePicker (e) {
let index = e.detail.value
this.setData({
tagIndex: index,
'volunteerTag.id': this.data.tagList[index].id,
'volunteerTag.tag': this.data.tagList[index].tagName
})
},
}) })

14
subpages/heart/pages/volunteer/volunteer.wxml

@ -77,19 +77,27 @@
<!-- 头像 --> <!-- 头像 -->
<view class="my-info magin-top"> <view class="my-info magin-top">
<view class="head-portrait"> <view class="head-portrait">
<view class="head-portrait-name">头像</view> <view class="head-portrait-name"><text class="must">*</text>头像</view>
<view class="head-portrait-image" bindtap="chooseImage"> <view class="head-portrait-image" bindtap="chooseImage">
<image class="photo" src="{{volunteerFaceImg}}"></image> <image class="photo" src="{{volunteerFaceImg}}"></image>
<image class="photo-right" src="../../images/ic_jinruxiayiye@2x.png"></image> <image class="photo-right" src="../../images/ic_jinruxiayiye@2x.png"></image>
</view> </view>
</view> </view>
<view class="head-portrait"> <view class="head-portrait">
<view class="head-portrait-name">昵称</view> <view class="head-portrait-name"><text class="must">*</text>昵称</view>
<view class="nickname"> <view class="nickname">
<input class="nicknameinput" bindblur="nickname" bindinput="nickname" value="{{volunteerNickname}}" placeholder-class="placeholder-style" placeholder="请输入您的昵称" /> <input class="nicknameinput" bindblur="nickname" bindinput="nickname" value="{{volunteerNickname}}" placeholder-class="placeholder-style" placeholder="请输入您的昵称" />
</view> </view>
</view> </view>
<view class="head-portrait">
<view class="head-portrait-name"><text class="must">*</text>选择小组</view>
<!-- <view class="time">{{volunteerTag.tag}}</view> -->
<picker bindchange="choosePicker" value="{{tagIndex}}" range="{{tagList}}" range-key="tagName">
<view class="picker">
{{tagList[tagIndex].tagName}}
</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>

5
subpages/heart/pages/volunteer/volunteer.wxss

@ -380,6 +380,11 @@ button::after {
color: rgba(51, 51, 51, 1); color: rgba(51, 51, 51, 1);
} }
.head-portrait .head-portrait-name .must {
color: #F61616;
font-size: 30rpx;
}
.head-portrait .head-portrait-image { .head-portrait .head-portrait-image {
width: 95rpx; width: 95rpx;
height: 100%; height: 100%;

7
utils/activity.js

@ -6,7 +6,8 @@ module.exports = {
volunteerlist, volunteerlist,
volunteerV2list, volunteerV2list,
getImgUrl, getImgUrl,
getBannerDetail getBannerDetail,
getVolunteerTags
} }
function getActivityList (params) { function getActivityList (params) {
@ -36,4 +37,8 @@ function getImgUrl (imgType) {
//banner跳转详情 //banner跳转详情
function getBannerDetail (id) { function getBannerDetail (id) {
return fly.get(`heart/act/banner/detail/${id}`) return fly.get(`heart/act/banner/detail/${id}`)
}
//志愿者标签列表
function getVolunteerTags () {
return fly.get(`app-user/volunteer/tags`)
} }

7
utils/api.js

@ -64,7 +64,8 @@ module.exports = {
moduleCategory: moduleCategory, moduleCategory: moduleCategory,
reportIssue: reportIssue, reportIssue: reportIssue,
reportIssueList: reportIssueList, reportIssueList: reportIssueList,
reportIssueDetail: reportIssueDetail reportIssueDetail: reportIssueDetail,
getVolunteerTags: getVolunteerTags
} }
function getToken (wxCode) { function getToken (wxCode) {
@ -580,4 +581,8 @@ function reportIssueList(para) {
//一键服务-锦水清风-举报问题详情接口 //一键服务-锦水清风-举报问题详情接口
function reportIssueDetail (id) { function reportIssueDetail (id) {
return fly.get(`custom/reportissue/detail/${id}`) return fly.get(`custom/reportissue/detail/${id}`)
}
//志愿者标签列表
function getVolunteerTags () {
return fly.get(`app-user/volunteer/tags`)
} }
Loading…
Cancel
Save