From 35dc887c0d5bdbf72e5535d49da7747deb14518a Mon Sep 17 00:00:00 2001 From: Renpc-kilig <308442850@qq.com> Date: Fri, 26 Jun 2020 14:06:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=97=E6=84=BF=E8=80=85=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- images/share.png | Bin 1544 -> 1566 bytes images/team.png | Bin 337 -> 2301 bytes pages/center/center.js | 16 ++ pages/center/center.wxml | 12 ++ .../myVolunteerActivity.js | 166 +++++++++++++++ .../myVolunteerActivity.json | 3 + .../myVolunteerActivity.wxml | 30 +++ .../myVolunteerActivity.wxss | 94 +++++++++ pages/myVolunteerTeam/myVlounteerTeam.js | 166 +++++++++++++++ pages/myVolunteerTeam/myVlounteerTeam.json | 3 + pages/myVolunteerTeam/myVlounteerTeam.wxml | 30 +++ pages/myVolunteerTeam/myVlounteerTeam.wxss | 94 +++++++++ .../newVolunteerActivity.js | 19 +- .../newVolunteerActivity.wxml | 4 +- .../serviceActivityDetail.js | 196 +++++++++++++++++- .../serviceActivityDetail.wxml | 13 +- .../serviceActivityDetail.wxss | 2 +- pages/volunteerTeam/volunteerTeam.js | 65 +++++- pages/volunteerTeam/volunteerTeam.wxml | 10 +- 19 files changed, 897 insertions(+), 26 deletions(-) create mode 100644 pages/myVolunteerActivity/myVolunteerActivity.js create mode 100644 pages/myVolunteerActivity/myVolunteerActivity.json create mode 100644 pages/myVolunteerActivity/myVolunteerActivity.wxml create mode 100644 pages/myVolunteerActivity/myVolunteerActivity.wxss create mode 100644 pages/myVolunteerTeam/myVlounteerTeam.js create mode 100644 pages/myVolunteerTeam/myVlounteerTeam.json create mode 100644 pages/myVolunteerTeam/myVlounteerTeam.wxml create mode 100644 pages/myVolunteerTeam/myVlounteerTeam.wxss diff --git a/images/share.png b/images/share.png index bd36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Dx1rQv|mpBMX5$(2-I#5$1Awayo@;8&jh>W zQ_WnM7xSAC6L`0lYIGa~oN%;Gy?^(_ym`rtuO223YNuP3pM#mv)1sFUQLvJ+&jN3qb(4C- zmE%S$N&m(<#FoDPR0Rt|p|?x2cA%nhQQor^FsT>(ZpP?H^qy|6_=SBlc}&3k!5OH* zi{!X94ez%VFsZjj2kI*1xM=;5n%Q@g^B}rOv29W>c$aN2jex-Q6)>q6Tv?p0MM(M2 z|N6xnZF^}1+On%EU{VjLs=IlHXe^w2vh;rkQm=U!c~t9*ob4dfze9Z5wuc=7lbOP= zT2z_TZ`;F;AVY&(i0Sqx)ogJu_1pHaV?gk#3Yaz(uCndjq=4BJe_}1~AwgC70(IN= zZqksN&)@Hu%;prEe3^P}dp2dnHN`L4Z<6W``KW6Xb=vl-Ye?Xo7U>^D**d-92^`R92^`R92^`R92^`RrX&6b X6O;3mY2*^m00000NkvXXu0mjfOW}_* literal 337 zcmV-X0j~auP)=>w74GO zYwGp5{1kWz*s2LF($>|hs^9^z(Exm@Zq`xV1bhz+)W 我的收藏 + + + 我的志愿团队 + + + + 我的志愿活动 + + + + 我的分享 + 设置 diff --git a/pages/myVolunteerActivity/myVolunteerActivity.js b/pages/myVolunteerActivity/myVolunteerActivity.js new file mode 100644 index 0000000..8f4575b --- /dev/null +++ b/pages/myVolunteerActivity/myVolunteerActivity.js @@ -0,0 +1,166 @@ +// pages/volunteer/volunteer.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + baseUrl: 'http://192.168.0.111:8888/volunteer/', + token: '', + otherTeamMap: {}, + type: '1', + teamId: '', + + }, + getToken: function() { + var self = this; + return new Promise(resolve =>{ + wx.getStorage({ + key: 'token', + success(res) { + self.setData({ + token: res.data + }) + return resolve(); + } + }) + }) + }, + newTeam: function () { + wx.navigateTo({ + url: '../newTeam/newTeam', + }) + }, + changeTab: function(e) { + var self = this; + self.setData({ + type: e.currentTarget.dataset.type + }) + if(self.data.type === '1') { + self.otherTeam(self.data.baseUrl + 'wxminiapp/team/otherteamm?otherTeam=true'); + }else { + self.otherTeam(self.data.baseUrl + 'wxminiapp/team/myjointeam?myTeam=true'); + } + }, + otherTeam: function(url) { + var self = this; + wx.request({ + url: url, + header: { + token: self.data.token + }, + success(res) { + if('200' == res.statusCode) { + self.setData({ + otherTeamMap: res.data.rows + }) + } + console.log(res) + console.log(self.data.otherTeamMap) + } + }) + }, + /** + * 申请/退出加入团队 + */ + joinOrOutTeam: function(e) { + var self = this; + self.setData({ + teamId: e.currentTarget.dataset.teamid + }) + var teamMemberVO; + var url; + var methodType; + var title; + if('1' == self.data.type) { + url = self.data.baseUrl + 'wxminiapp/teammember/saveteammember' + teamMemberVO = { + teamId: e.currentTarget.dataset.teamid + } + methodType = 'POST' + title = '申请成功!' + }else { + url = self.data.baseUrl + 'wxminiapp/teammember/quitTeam/' + self.data.teamId + methodType = 'GET' + title = '退出成功!' + } + wx.request({ + url: url, + data: teamMemberVO, + method: methodType, + header: { + token: self.data.token + }, + success(res) { + if('200' == res.statusCode) { + wx.showToast({ + title: title, + icon: 'none', + duration: 2000 + }) + wx.navigateTo({ + url: '../volunteer/volunteer', + }) + } + } + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var self = this; + this.getToken().then(result => { + this.otherTeam(self.data.baseUrl + 'wxminiapp/team/otherteamm?otherTeam=true'); + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/myVolunteerActivity/myVolunteerActivity.json b/pages/myVolunteerActivity/myVolunteerActivity.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/myVolunteerActivity/myVolunteerActivity.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/myVolunteerActivity/myVolunteerActivity.wxml b/pages/myVolunteerActivity/myVolunteerActivity.wxml new file mode 100644 index 0000000..7fb08c9 --- /dev/null +++ b/pages/myVolunteerActivity/myVolunteerActivity.wxml @@ -0,0 +1,30 @@ + + + + 未参加 + + + + + 已参加 + + + + + + + {{item.teamName}} + 申请加入 + 退出 + 待审核 + 退出 + 审核驳回 + 已退出 + + 团队口号:{{item.teamWatchword}} + 所属区域:{{item.teamCityDictionaryName}} {{item.teamCountyDictionaryName}} {{item.teamAreaDictionaryName}} + + + + 创建新团队 + \ No newline at end of file diff --git a/pages/myVolunteerActivity/myVolunteerActivity.wxss b/pages/myVolunteerActivity/myVolunteerActivity.wxss new file mode 100644 index 0000000..97bc150 --- /dev/null +++ b/pages/myVolunteerActivity/myVolunteerActivity.wxss @@ -0,0 +1,94 @@ +.top-tab{ + position: fixed; + top: 0; + left: 0; + right: 0; + display: flex; + box-shadow:0 0 17rpx 0 rgba(0,0,0,0.1); + border-radius:0 0 31rpx 31rpx; + background: #fff; +} +.tab-box{ + display: flex; + justify-content: center; + align-items: center; + flex: 1; + position: relative; + height: 90rpx; + font-size: 30rpx; + color: #242424; +} +.tab-box.active{ + color: #9F1512; +} +.tab-box image{ + position: absolute; + width: 15rpx; + height: 40rpx; + top: 50%; + margin-top: -20rpx; + display: none; +} +.tab-box.active image{ + display: block; +} +.tab-box image.selected-l{ + left: 100rpx; +} +.tab-box image.selected-r{ + right: 100rpx; +} +.team{ + margin-top: 90rpx; + padding: 0 30rpx; + margin-bottom: 110rpx; +} +.team-box{ + padding: 20rpx 0; + border-bottom: 1px solid #EBEBEB; +} +.name-join{ + display: flex; + justify-content: space-between; + height: 40rpx; + line-height: 40rpx; + font-size: 32rpx; + color: #242424; +} +.name{ + width: 70%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.join{ + padding: 0 10rpx; + background: rgba(159,21,18,.1); + color: #9F1512; + font-size: 28rpx; + border-radius: 10rpx; +} +.slogan, .area{ + color: #949494; + font-size: 26rpx; + margin-top: 10rpx; +} +.new-team{ + position: fixed; + background: #fff; + bottom: 0; + left: 0; + right: 0; + padding: 15rpx 30rpx; + border-top: 1px solid #EBEBEB; +} +.new-team-btn{ + height: 80rpx; + display: flex; + justify-content: center; + align-items: center; + font-size: 30rpx; + color: #fff; + background: #9F1512; + border-radius: 10rpx; +} \ No newline at end of file diff --git a/pages/myVolunteerTeam/myVlounteerTeam.js b/pages/myVolunteerTeam/myVlounteerTeam.js new file mode 100644 index 0000000..8f4575b --- /dev/null +++ b/pages/myVolunteerTeam/myVlounteerTeam.js @@ -0,0 +1,166 @@ +// pages/volunteer/volunteer.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + baseUrl: 'http://192.168.0.111:8888/volunteer/', + token: '', + otherTeamMap: {}, + type: '1', + teamId: '', + + }, + getToken: function() { + var self = this; + return new Promise(resolve =>{ + wx.getStorage({ + key: 'token', + success(res) { + self.setData({ + token: res.data + }) + return resolve(); + } + }) + }) + }, + newTeam: function () { + wx.navigateTo({ + url: '../newTeam/newTeam', + }) + }, + changeTab: function(e) { + var self = this; + self.setData({ + type: e.currentTarget.dataset.type + }) + if(self.data.type === '1') { + self.otherTeam(self.data.baseUrl + 'wxminiapp/team/otherteamm?otherTeam=true'); + }else { + self.otherTeam(self.data.baseUrl + 'wxminiapp/team/myjointeam?myTeam=true'); + } + }, + otherTeam: function(url) { + var self = this; + wx.request({ + url: url, + header: { + token: self.data.token + }, + success(res) { + if('200' == res.statusCode) { + self.setData({ + otherTeamMap: res.data.rows + }) + } + console.log(res) + console.log(self.data.otherTeamMap) + } + }) + }, + /** + * 申请/退出加入团队 + */ + joinOrOutTeam: function(e) { + var self = this; + self.setData({ + teamId: e.currentTarget.dataset.teamid + }) + var teamMemberVO; + var url; + var methodType; + var title; + if('1' == self.data.type) { + url = self.data.baseUrl + 'wxminiapp/teammember/saveteammember' + teamMemberVO = { + teamId: e.currentTarget.dataset.teamid + } + methodType = 'POST' + title = '申请成功!' + }else { + url = self.data.baseUrl + 'wxminiapp/teammember/quitTeam/' + self.data.teamId + methodType = 'GET' + title = '退出成功!' + } + wx.request({ + url: url, + data: teamMemberVO, + method: methodType, + header: { + token: self.data.token + }, + success(res) { + if('200' == res.statusCode) { + wx.showToast({ + title: title, + icon: 'none', + duration: 2000 + }) + wx.navigateTo({ + url: '../volunteer/volunteer', + }) + } + } + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var self = this; + this.getToken().then(result => { + this.otherTeam(self.data.baseUrl + 'wxminiapp/team/otherteamm?otherTeam=true'); + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/myVolunteerTeam/myVlounteerTeam.json b/pages/myVolunteerTeam/myVlounteerTeam.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/myVolunteerTeam/myVlounteerTeam.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/myVolunteerTeam/myVlounteerTeam.wxml b/pages/myVolunteerTeam/myVlounteerTeam.wxml new file mode 100644 index 0000000..7fb08c9 --- /dev/null +++ b/pages/myVolunteerTeam/myVlounteerTeam.wxml @@ -0,0 +1,30 @@ + + + + 未参加 + + + + + 已参加 + + + + + + + {{item.teamName}} + 申请加入 + 退出 + 待审核 + 退出 + 审核驳回 + 已退出 + + 团队口号:{{item.teamWatchword}} + 所属区域:{{item.teamCityDictionaryName}} {{item.teamCountyDictionaryName}} {{item.teamAreaDictionaryName}} + + + + 创建新团队 + \ No newline at end of file diff --git a/pages/myVolunteerTeam/myVlounteerTeam.wxss b/pages/myVolunteerTeam/myVlounteerTeam.wxss new file mode 100644 index 0000000..97bc150 --- /dev/null +++ b/pages/myVolunteerTeam/myVlounteerTeam.wxss @@ -0,0 +1,94 @@ +.top-tab{ + position: fixed; + top: 0; + left: 0; + right: 0; + display: flex; + box-shadow:0 0 17rpx 0 rgba(0,0,0,0.1); + border-radius:0 0 31rpx 31rpx; + background: #fff; +} +.tab-box{ + display: flex; + justify-content: center; + align-items: center; + flex: 1; + position: relative; + height: 90rpx; + font-size: 30rpx; + color: #242424; +} +.tab-box.active{ + color: #9F1512; +} +.tab-box image{ + position: absolute; + width: 15rpx; + height: 40rpx; + top: 50%; + margin-top: -20rpx; + display: none; +} +.tab-box.active image{ + display: block; +} +.tab-box image.selected-l{ + left: 100rpx; +} +.tab-box image.selected-r{ + right: 100rpx; +} +.team{ + margin-top: 90rpx; + padding: 0 30rpx; + margin-bottom: 110rpx; +} +.team-box{ + padding: 20rpx 0; + border-bottom: 1px solid #EBEBEB; +} +.name-join{ + display: flex; + justify-content: space-between; + height: 40rpx; + line-height: 40rpx; + font-size: 32rpx; + color: #242424; +} +.name{ + width: 70%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.join{ + padding: 0 10rpx; + background: rgba(159,21,18,.1); + color: #9F1512; + font-size: 28rpx; + border-radius: 10rpx; +} +.slogan, .area{ + color: #949494; + font-size: 26rpx; + margin-top: 10rpx; +} +.new-team{ + position: fixed; + background: #fff; + bottom: 0; + left: 0; + right: 0; + padding: 15rpx 30rpx; + border-top: 1px solid #EBEBEB; +} +.new-team-btn{ + height: 80rpx; + display: flex; + justify-content: center; + align-items: center; + font-size: 30rpx; + color: #fff; + background: #9F1512; + border-radius: 10rpx; +} \ No newline at end of file diff --git a/pages/newVolunteerActivity/newVolunteerActivity.js b/pages/newVolunteerActivity/newVolunteerActivity.js index f4ae9b9..34d1463 100644 --- a/pages/newVolunteerActivity/newVolunteerActivity.js +++ b/pages/newVolunteerActivity/newVolunteerActivity.js @@ -37,10 +37,25 @@ Page({ }) }) }, - bindDateChange: function(e) { + startDateChange: function(e) { console.log('picker发送选择改变,携带值为', e.detail.value) this.setData({ - date: e.detail.value + startDate: e.detail.value + }) + }, + endDateChange: function(e) { + var self = this; + console.log('picker发送选择改变,携带值为', e.detail.value) + if(self.data.startDate > e.detail.value) { + wx.showToast({ + title: '结束时间不能早于开始时间', + icon: 'none', + duration: 1500 + }) + return false; + } + this.setData({ + endDate: e.detail.value }) }, dateDafault: function() { diff --git a/pages/newVolunteerActivity/newVolunteerActivity.wxml b/pages/newVolunteerActivity/newVolunteerActivity.wxml index 4dde695..1562072 100644 --- a/pages/newVolunteerActivity/newVolunteerActivity.wxml +++ b/pages/newVolunteerActivity/newVolunteerActivity.wxml @@ -67,7 +67,7 @@ 开始时间: - + {{startDate}} @@ -77,7 +77,7 @@ 结束时间: - + {{endDate}} diff --git a/pages/serviceActivityDetail/serviceActivityDetail.js b/pages/serviceActivityDetail/serviceActivityDetail.js index 0344101..cfa9a88 100644 --- a/pages/serviceActivityDetail/serviceActivityDetail.js +++ b/pages/serviceActivityDetail/serviceActivityDetail.js @@ -5,10 +5,17 @@ Page({ * 页面的初始数据 */ data: { - url: 'http://192.168.0.111:8888/volunteer/', + baseUrl: 'http://192.168.0.111:8888/volunteer/', imgUrl: 'http://192.168.0.111:8888/volunteer/route/file/downloadfile/true/', dataMap: {}, - token: '' + token: '', + serviceId: '', + type: '', + + teamIndex: 0, + teamResult: '请选择服务区域', + team: {}, // 服务区域-市 + teamArray: [], // 服务区域-市 }, getToken: function() { var self = this; @@ -24,15 +31,10 @@ Page({ }) }) }, - goSign: function () { - wx.navigateTo({ - url: '../activitySign/activitySign' - }) - }, getDetail: function(id) { var self = this; wx.request({ - url: self.data.url + 'wxminiapp/volunteerservice/getvolunteerservicebyid/' + id, + url: self.data.baseUrl + 'wxminiapp/volunteerservice/getvolunteerservicebyid/' + id, header: { 'token': self.data.token }, @@ -46,6 +48,183 @@ Page({ } }) }, + /** + * 志愿者团队报名 + */ + enroll: function(e) { + var self = this; + self.setData({ + serviceId: e.target.dataset.serviceid, + type: e.target.dataset.type + }) + }, + /** + * + * @param {志愿者报名} e + */ + volunteerEnroll: function(e) { + var self = this; + self.setData({ + serviceId: e.target.dataset.serviceid, + type: e.target.dataset.type + }) + + // 提交报名请求 + var serviceMemberVO = { + serviceId: self.data.serviceId, + voluntaryType: self.data.type + } + self.sendEnrollRequest(serviceMemberVO); + + }, + /** + * + * @param {团队报名} e + */ + teamChange: function(e) { + var self = this; + + self.setData({ + teamIndex: e.detail.value + }) + + // 提交报名请求 + var serviceMemberVO = { + serviceId: self.data.serviceId, + teamId: self.data.team[self.data.teamIndex].teamId, + voluntaryType: self.data.type + } + self.sendEnrollRequest(serviceMemberVO); + }, + /** + * + * @param {团队取消报名} e + */ + teamCancelChange: function(e) { + var self = this; + + self.setData({ + teamIndex: e.detail.value + }) + + self.sendCancelEnrollRequest(); + }, + /** + * + * @param {志愿者取消报名} e + */ + volunteerCancelEnroll: function(e) { + var self = this; + self.setData({ + serviceId: e.target.dataset.serviceid, + type: e.target.dataset.type, + teamArray: [] + }) + self.sendCancelEnrollRequest(); + }, + /** + * + * @param {发送报名请求} serviceMemberVO + */ + sendEnrollRequest: function(serviceMemberVO) { + var self = this; + wx.request({ + url: self.data.baseUrl + 'wxminiapp/servicemember/saveservicemember', + method: 'POST', + header: { + token: self.data.token + }, + data: serviceMemberVO, + success(res) { + if(res.statusCode == 200) { + wx.showToast({ + title: '报名成功!', + icon: 'none', + duration: 1500 + }) + wx.navigateTo({ + url: '../volunteer/volunteer', + }) + } + } + }) + }, + /** + * 发送取消报名请求 + */ + sendCancelEnrollRequest() { + var self = this; + var url; + if(self.data.teamArray.length > 0) { + url = self.data.baseUrl + 'wxminiapp/servicemember/cancelapply/'+ self.data.type +'/'+ self.data.serviceId +'/' + self.data.team[self.data.teamIndex].teamId; + }else { + url = self.data.baseUrl + 'wxminiapp/servicemember/cancelapply/'+ self.data.type +'/'+ self.data.serviceId +'/null'; + } + wx.request({ + url: url, + header: { + token: self.data.token + }, + success(res) { + if(res.statusCode == 200) { + wx.showToast({ + title: '取消报名成功!', + icon: 'none', + duration: 1500 + }) + wx.navigateTo({ + url: '../volunteer/volunteer', + }) + } + }, + fail(res) { + + } + }) + }, + /** + * 获取我的团队 + */ + getMyTeam: function() { + var self = this; + wx.request({ + url: self.data.baseUrl + 'wxminiapp/team/myteamm', + header: { + token: self.data.token + }, + success(res) { + if('200' == res.statusCode) { + var array = []; + for(var item of res.data.rows) { + delete item.teamArea; + delete item.teamAreaDictionaryName; + delete item.teamWatchword; + delete item.teamOwner; + delete item.memberId; + delete item.memberName; + delete item.gmtCreate; + delete item.photo; + delete item.count; + delete item.status; + delete item.content; + delete item.isTeamOwner; + delete item.checkStatus; + delete item.teamCounty; + delete item.teamCity; + delete item.teamCityDictionaryName; + delete item.teamCountyDictionaryName; + delete item.teamCity; + + array.push(item.teamName); + } + self.setData({ + teamArray: array, + team: res.data.rows + }) + } + } + }) + }, /** * 生命周期函数--监听页面加载 */ @@ -53,6 +232,7 @@ Page({ var id = options.id; this.getToken().then(result => { this.getDetail(id); + this.getMyTeam(); }) }, diff --git a/pages/serviceActivityDetail/serviceActivityDetail.wxml b/pages/serviceActivityDetail/serviceActivityDetail.wxml index dc7286b..9f8025f 100644 --- a/pages/serviceActivityDetail/serviceActivityDetail.wxml +++ b/pages/serviceActivityDetail/serviceActivityDetail.wxml @@ -27,6 +27,15 @@ - - 报名 + + + 报名 + + 报名 + + + 取消报名 + + 取消报名 + \ No newline at end of file diff --git a/pages/serviceActivityDetail/serviceActivityDetail.wxss b/pages/serviceActivityDetail/serviceActivityDetail.wxss index 40e403d..caed339 100644 --- a/pages/serviceActivityDetail/serviceActivityDetail.wxss +++ b/pages/serviceActivityDetail/serviceActivityDetail.wxss @@ -77,7 +77,7 @@ } .sign-btn{ width: 100%; - height: 100%; + height: 80rpx; background: #9F1512; border-radius: 10rpx; display: flex; diff --git a/pages/volunteerTeam/volunteerTeam.js b/pages/volunteerTeam/volunteerTeam.js index 288547b..8f4575b 100644 --- a/pages/volunteerTeam/volunteerTeam.js +++ b/pages/volunteerTeam/volunteerTeam.js @@ -8,7 +8,9 @@ Page({ baseUrl: 'http://192.168.0.111:8888/volunteer/', token: '', otherTeamMap: {}, - type: '1' + type: '1', + teamId: '', + }, getToken: function() { var self = this; @@ -35,11 +37,9 @@ Page({ type: e.currentTarget.dataset.type }) if(self.data.type === '1') { - console.log('otherteam') self.otherTeam(self.data.baseUrl + 'wxminiapp/team/otherteamm?otherTeam=true'); }else { - console.log('myteams') - self.otherTeam(self.data.baseUrl + 'wxminiapp/team/listpageteam'); + self.otherTeam(self.data.baseUrl + 'wxminiapp/team/myjointeam?myTeam=true'); } }, otherTeam: function(url) { @@ -50,11 +50,58 @@ Page({ token: self.data.token }, success(res) { - console.log(res.data); - self.setData({ - otherTeamMap: res.data.rows - }) - console.log(res.data.rows) + if('200' == res.statusCode) { + self.setData({ + otherTeamMap: res.data.rows + }) + } + console.log(res) + console.log(self.data.otherTeamMap) + } + }) + }, + /** + * 申请/退出加入团队 + */ + joinOrOutTeam: function(e) { + var self = this; + self.setData({ + teamId: e.currentTarget.dataset.teamid + }) + var teamMemberVO; + var url; + var methodType; + var title; + if('1' == self.data.type) { + url = self.data.baseUrl + 'wxminiapp/teammember/saveteammember' + teamMemberVO = { + teamId: e.currentTarget.dataset.teamid + } + methodType = 'POST' + title = '申请成功!' + }else { + url = self.data.baseUrl + 'wxminiapp/teammember/quitTeam/' + self.data.teamId + methodType = 'GET' + title = '退出成功!' + } + wx.request({ + url: url, + data: teamMemberVO, + method: methodType, + header: { + token: self.data.token + }, + success(res) { + if('200' == res.statusCode) { + wx.showToast({ + title: title, + icon: 'none', + duration: 2000 + }) + wx.navigateTo({ + url: '../volunteer/volunteer', + }) + } } }) }, diff --git a/pages/volunteerTeam/volunteerTeam.wxml b/pages/volunteerTeam/volunteerTeam.wxml index 95859b0..7fb08c9 100644 --- a/pages/volunteerTeam/volunteerTeam.wxml +++ b/pages/volunteerTeam/volunteerTeam.wxml @@ -1,12 +1,12 @@ - 团队 + 未参加 - 我的团队 + 已参加 @@ -14,6 +14,12 @@ {{item.teamName}} + 申请加入 + 退出 + 待审核 + 退出 + 审核驳回 + 已退出 团队口号:{{item.teamWatchword}} 所属区域:{{item.teamCityDictionaryName}} {{item.teamCountyDictionaryName}} {{item.teamAreaDictionaryName}}