diff --git a/app.json b/app.json index 5de6a9f..b877083 100644 --- a/app.json +++ b/app.json @@ -207,5 +207,8 @@ "desc": "e锦水将获取您的位置信息" } }, - "sitemapLocation": "sitemap.json" + "sitemapLocation": "sitemap.json", + "requiredPrivateInfos":[ + "getLocation" + ] } \ No newline at end of file diff --git a/pages/heartNew/heartNew.js b/pages/heartNew/heartNew.js index 878a3cf..0b64858 100644 --- a/pages/heartNew/heartNew.js +++ b/pages/heartNew/heartNew.js @@ -42,12 +42,15 @@ Page({ infoCompleted: 0, //是否完善了用户信息 completeInfoDialogVisible: false, volunteerTagId: '',//志愿者标签id - tagList: [ - { - tagName: '全部', - id: '' - } - ], + // tagList: [ + // { + // tagName: '全部', + // id: '' + // } + // ], + tagList: [], + tagGroupList:[], + tagTeamList:[], isLoading: false, //防止标签切换加载数据时点击切换标签 btnTop: 0, btnLeft: 0, @@ -56,6 +59,7 @@ Page({ applyBtn: {}, // 申请发单按钮改为可配置, searchActive: '', // searchJingcai: '', + volunteerlistType:'expend', }, /** @@ -118,7 +122,8 @@ Page({ dingdan: true, jingcai: true, volunteerlist:[],//列表置空 - listLength:0 + listLength:0, + volunteerTagId:this.data.tagGroupList[0].id }) let parms = { pageIndex: this.data.indexPage, @@ -184,7 +189,8 @@ Page({ jingcai: true, volunteerlist:[],//列表置空 listLength:0, - searchName: '' + searchName: '', + volunteerTagId:this.data.tagGroupList[0].id }) let parms = { pageIndex: this.data.indexPage, @@ -252,6 +258,43 @@ Page({ actId: "" }) }, + // 志愿者tab切换 + handleType(event) { + const volunteerlistType = event.currentTarget.dataset.type; + this.setData({ + volunteerlistType: volunteerlistType, + }); + let params; + this.setData({ + volunteerlist: [], + }); + if(volunteerlistType === 'expend'){ + params={ + indexPage: 1, + pageIndex: 1, + pageSize: 10, + isLoading: true, + nickname: this.data.searchName, + volunteerTagId: this.data.tagGroupList[0].id + } + this.setData({ + volunteerTagId: this.data.tagGroupList[0].id, + }); + }else{ + params={ + indexPage: 1, + pageIndex: 1, + pageSize: 10, + isLoading: true, + nickname: this.data.searchName, + volunteerTagId: this.data.tagTeamList[0].id + } + this.setData({ + volunteerTagId: this.data.tagTeamList[0].id, + }); + } + this.volunteerlist(params) + }, // 志愿者列表 volunteerlist (params){ let that = this @@ -391,10 +434,14 @@ Page({ getVolunteerTags () { api.getVolunteerTags().then(res => { if (res.code == 0 && res.msg == 'success') { - const tagList = this.data.tagList.concat(res.data) + const tagList = res.data + const tagGroupList = res.data[0].lists + const tagTeamList = res.data[1].lists console.log('志愿者标签列表: ', tagList) this.setData({ - tagList + tagList, + tagGroupList, + tagTeamList, }) } }).catch(err => { diff --git a/pages/heartNew/heartNew.wxml b/pages/heartNew/heartNew.wxml index 5f2822e..95745b7 100644 --- a/pages/heartNew/heartNew.wxml +++ b/pages/heartNew/heartNew.wxml @@ -55,13 +55,13 @@ - + - + @@ -96,7 +96,7 @@ - + @@ -114,13 +114,40 @@ - + + + + + 服务团 + 服务队 + - - - {{item.tagName}} - - + + + + + {{item.tagName}} + + + + + + + + + {{item.tagName}} + + + + @@ -146,27 +173,8 @@ - - - + +