From 49f451d63be1f54fbbc902251629f40dca3a8e6c Mon Sep 17 00:00:00 2001 From: ZhaoTongYao <531131322@qq.com> Date: Wed, 27 Jan 2021 17:39:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=97=E6=84=BF=E8=80=85=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=88=86=E7=B1=BB=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/heartNew/heartNew.js | 62 +++++++++++++++++-- pages/heartNew/heartNew.wxml | 21 ++++--- pages/heartNew/heartNew.wxss | 58 ++++++++++++++--- pages/toRegister/toRegister.js | 2 +- subpages/heart/pages/volunteer/volunteer.js | 42 +++++++++++++ subpages/heart/pages/volunteer/volunteer.wxml | 14 ++++- subpages/heart/pages/volunteer/volunteer.wxss | 5 ++ utils/activity.js | 7 ++- utils/api.js | 7 ++- 9 files changed, 192 insertions(+), 26 deletions(-) diff --git a/pages/heartNew/heartNew.js b/pages/heartNew/heartNew.js index bf7c624..a39ea48 100644 --- a/pages/heartNew/heartNew.js +++ b/pages/heartNew/heartNew.js @@ -41,6 +41,14 @@ Page({ infoCompleted: 0, //是否完善了用户信息 completeInfoDialogVisible: false, tabRightList: [], //拼团购和顺道捎 + volunteerTagId: '',//志愿者标签id + tagList: [ + { + tagName: '全部', + id: '' + } + ], + isLoading: false, //防止标签切换加载数据时点击切换标签 }, /** @@ -48,6 +56,7 @@ Page({ */ onLoad: function () { this.bannerListV2() + this.getVolunteerTags() this.getImgUrl()//获取配置图片 this.setData({ statusHeight: app.globalData.deviceInfo.statusHeight, @@ -96,7 +105,8 @@ Page({ let parms = { pageIndex: this.data.indexPage, pageSize: this.data.pageSize, - nickname: this.data.searchName + nickname: this.data.searchName, + volunteerTagId: this.data.volunteerTagId } this.volunteerlist(parms) } @@ -157,7 +167,8 @@ Page({ let parms = { pageIndex: this.data.indexPage, pageSize: this.data.pageSize, - nickname: this.data.searchName + nickname: this.data.searchName, + volunteerTagId: this.data.volunteerTagId } this.volunteerlist(parms) } else if (e.currentTarget.dataset.tab == "tab2") { @@ -229,7 +240,8 @@ Page({ that.setData({ listLength:res.data.volunteerList.length, 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 = { pageIndex: this.data.indexPage, pageSize: this.data.pageSize, - nickname: this.data.searchName + nickname: this.data.searchName, + volunteerTagId: this.data.volunteerTagId } this.volunteerlist(parms) }, @@ -324,6 +337,20 @@ Page({ 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:咨询热线 let that = this @@ -372,7 +399,8 @@ Page({ let parms = { pageIndex: this.data.indexPage, pageSize: this.data.pageSize, - nickname: this.data.searchName + nickname: this.data.searchName, + volunteerTagId: this.data.volunteerTagId } this.volunteerlist(parms) } 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) + } }) \ No newline at end of file diff --git a/pages/heartNew/heartNew.wxml b/pages/heartNew/heartNew.wxml index 2df8e54..db03e2c 100644 --- a/pages/heartNew/heartNew.wxml +++ b/pages/heartNew/heartNew.wxml @@ -83,16 +83,23 @@ - - - - - + + 志愿者注册数:{{volunteerCount}} + + + + + + + - + + + {{item.tagName}} + + - 志愿者注册数:{{volunteerCount}} diff --git a/pages/heartNew/heartNew.wxss b/pages/heartNew/heartNew.wxss index 9ce2f6d..5e10d46 100644 --- a/pages/heartNew/heartNew.wxss +++ b/pages/heartNew/heartNew.wxss @@ -393,13 +393,54 @@ button:last-child { .details-top { 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 { - font-size: 22rpx; - color: #999; - line-height: 22rpx; - padding-left: 40rpx; + font-size: 28rpx; + color: #666; + line-height: 28rpx; + 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 { display: flex; align-items: center; @@ -420,12 +461,13 @@ button:last-child { .search { /* margin-top: 17rpx; */ height: 66rpx; - background: rgba(255, 255, 255, 1); + width: 410rpx; + background: #f7f7f7; border-radius: 33rpx; display: flex; align-items: center; justify-content: center; - margin: 10rpx 40rpx; + margin-top: 26rpx; } .search .item-all { @@ -469,7 +511,7 @@ button:last-child { font-size: 28rpx; font-weight: 500; color: rgba(51, 51, 51, 1); - background-color: #fff; + background-color: #f7f7f7; } .search button { width: 100rpx; diff --git a/pages/toRegister/toRegister.js b/pages/toRegister/toRegister.js index 7bd790e..ad2cad2 100644 --- a/pages/toRegister/toRegister.js +++ b/pages/toRegister/toRegister.js @@ -21,7 +21,7 @@ Page({ // } // }) let that = this - const versionNum = "1.6.19" + const versionNum = "1.6.20" api.getScanSwitch(versionNum).then(function (res) { console.log(res.data) let state = res.data.scanFlag diff --git a/subpages/heart/pages/volunteer/volunteer.js b/subpages/heart/pages/volunteer/volunteer.js index e0cb081..02910da 100644 --- a/subpages/heart/pages/volunteer/volunteer.js +++ b/subpages/heart/pages/volunteer/volunteer.js @@ -39,6 +39,12 @@ Page({ uploadImageList: [], disabled:false, lock: false, //锁定提交状态,防止连击 + volunteerTag: {}, //志愿者标签id + tagList: [{ + tagName: '请选择', + id: '0' + }], + tagIndex: 0, }, onLoad: function () { this.setData({ @@ -48,6 +54,7 @@ Page({ this.getImgUrl() this.getPrepareComplete().then(() => { this.getGridList() + this.getVolunteerTags() }) this.checkWxUnionId() this.getWxCode() @@ -112,6 +119,26 @@ Page({ 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:咨询热线 let that = this @@ -180,6 +207,7 @@ Page({ volunteerNickname:res.data.volunteerNickname, volunteerSignature:res.data.volunteerSignature, volunteerFaceImg:res.data.volunteerFaceImg, + 'volunteerTag.id': res.data.volunteerTagId || '0' // introduce:res.data.introduce }) resolve(true) @@ -256,6 +284,10 @@ Page({ this.showToast("请输入昵称") return false } + if (this.data.volunteerTag.id == '0') { + this.showToast("请选择小组") + return false + } // if(!this.data.volunteerSignature){ // this.showToast("请输入格言") // return false @@ -290,6 +322,7 @@ Page({ volunteerFaceImg:this.data.volunteerFaceImg, volunteerNickname:this.data.volunteerNickname, volunteerSignature:this.data.volunteerSignature, + volunteerTagId: this.data.volunteerTag.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 @@ -527,4 +560,13 @@ Page({ 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 + }) + }, }) \ No newline at end of file diff --git a/subpages/heart/pages/volunteer/volunteer.wxml b/subpages/heart/pages/volunteer/volunteer.wxml index d806705..258dfe0 100644 --- a/subpages/heart/pages/volunteer/volunteer.wxml +++ b/subpages/heart/pages/volunteer/volunteer.wxml @@ -77,19 +77,27 @@ - 头像 + *头像 - 昵称 + *昵称 - + + *选择小组 + + + + {{tagList[tagIndex].tagName}} + + + 格言 diff --git a/subpages/heart/pages/volunteer/volunteer.wxss b/subpages/heart/pages/volunteer/volunteer.wxss index 070bece..4bff1dd 100644 --- a/subpages/heart/pages/volunteer/volunteer.wxss +++ b/subpages/heart/pages/volunteer/volunteer.wxss @@ -380,6 +380,11 @@ button::after { color: rgba(51, 51, 51, 1); } +.head-portrait .head-portrait-name .must { + color: #F61616; + font-size: 30rpx; +} + .head-portrait .head-portrait-image { width: 95rpx; height: 100%; diff --git a/utils/activity.js b/utils/activity.js index b3cef3f..57030d8 100644 --- a/utils/activity.js +++ b/utils/activity.js @@ -6,7 +6,8 @@ module.exports = { volunteerlist, volunteerV2list, getImgUrl, - getBannerDetail + getBannerDetail, + getVolunteerTags } function getActivityList (params) { @@ -36,4 +37,8 @@ function getImgUrl (imgType) { //banner跳转详情 function getBannerDetail (id) { return fly.get(`heart/act/banner/detail/${id}`) +} +//志愿者标签列表 +function getVolunteerTags () { + return fly.get(`app-user/volunteer/tags`) } \ No newline at end of file diff --git a/utils/api.js b/utils/api.js index ca81b5d..975f322 100644 --- a/utils/api.js +++ b/utils/api.js @@ -64,7 +64,8 @@ module.exports = { moduleCategory: moduleCategory, reportIssue: reportIssue, reportIssueList: reportIssueList, - reportIssueDetail: reportIssueDetail + reportIssueDetail: reportIssueDetail, + getVolunteerTags: getVolunteerTags } function getToken (wxCode) { @@ -580,4 +581,8 @@ function reportIssueList(para) { //一键服务-锦水清风-举报问题详情接口 function reportIssueDetail (id) { return fly.get(`custom/reportissue/detail/${id}`) +} +//志愿者标签列表 +function getVolunteerTags () { + return fly.get(`app-user/volunteer/tags`) } \ No newline at end of file