diff --git a/pages/activityDialog/activityDialog.js b/pages/activityDialog/activityDialog.js index 3c20d34..1146832 100644 --- a/pages/activityDialog/activityDialog.js +++ b/pages/activityDialog/activityDialog.js @@ -1,18 +1,56 @@ // pages/activityDialog/activityDialog.js +var app = getApp(); Page({ /** * 页面的初始数据 */ data: { - + token: '', + serviceId: '' }, + getToken: function() { + var self = this; + return new Promise(resolve =>{ + wx.getStorage({ + key: 'token', + success(res) { + self.setData({ + token: res.data + }) + return resolve(); + } + }) + }) + }, + getActivityHis: function() { + var self = this; + app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wxminiapp/teamactivityhis/listpageteamactivityhis?serviceId=' + self.data.serviceId, []), + {}, { + headers: { + token: self.data.token + } + }, function(code, data) { + if('200' == code) { + console.log(data) + } + }, function() { + }, function() { + + }) + }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { - + var self = this; + self.setData({ + serviceId: options.serviceId + }) + this.getToken().then(result => { + this.getActivityHis() + }) }, /** diff --git a/pages/serviceActivityDetail/serviceActivityDetail.js b/pages/serviceActivityDetail/serviceActivityDetail.js index 93857a4..31dd13d 100644 --- a/pages/serviceActivityDetail/serviceActivityDetail.js +++ b/pages/serviceActivityDetail/serviceActivityDetail.js @@ -224,11 +224,21 @@ Page({ }) }, + toActivityHis: function() { + var self = this; + wx.navigateTo({ + url: '../activityDialog/activityDialog?serviceId=' + self.data.serviceId, + }) + }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { var id = options.id; + var self = this; + self.setData({ + serviceId: id + }) this.getToken().then(result => { this.getDetail(id); this.getMyTeam(); diff --git a/pages/serviceActivityDetail/serviceActivityDetail.wxml b/pages/serviceActivityDetail/serviceActivityDetail.wxml index 9f8025f..9d86543 100644 --- a/pages/serviceActivityDetail/serviceActivityDetail.wxml +++ b/pages/serviceActivityDetail/serviceActivityDetail.wxml @@ -22,7 +22,10 @@ - 活动详情 + + 活动详情 + 评论列表 + diff --git a/pages/serviceActivityDetail/serviceActivityDetail.wxss b/pages/serviceActivityDetail/serviceActivityDetail.wxss index caed339..cb9f554 100644 --- a/pages/serviceActivityDetail/serviceActivityDetail.wxss +++ b/pages/serviceActivityDetail/serviceActivityDetail.wxss @@ -51,6 +51,15 @@ padding-left: 10rpx; font-size: 30rpx; margin-bottom: 10rpx; + display: flex; + justify-content: space-between; +} +.comment-btn{ + padding: 0 10rpx; + background: #9F1512; + color: #fff; + font-size: 28rpx; + border-radius: 10rpx; } .part-content{ font-size: 28rpx; diff --git a/pages/volunteerRegister/volunteerRegister.js b/pages/volunteerRegister/volunteerRegister.js index 7e5cc41..661383c 100644 --- a/pages/volunteerRegister/volunteerRegister.js +++ b/pages/volunteerRegister/volunteerRegister.js @@ -7,6 +7,7 @@ Page({ */ data: { token: '', + volunteerMsg: [], isAgree: false, // 是否同意志愿者注册协议 openExperience: 0, tempObj: {}, // 用于临时存储字典表返回的数据 @@ -180,7 +181,7 @@ Page({ icon: 'none', duration: 1500 }) - return false; + return false; } var volunteerVO = { serviceCity: self.data.teamCity[self.data.teamCityIndex] != '' @@ -203,7 +204,13 @@ Page({ agree: self.data.isAgree, openExperience : self.data.openExperience }; - app.restAjax.post(app.restAjax.path(app.volunteerUrl + '/wxminiapp/volunteer/savevolunteer', []), + var url; + if(!self.data.volunteerMsg) { + url = '/wxminiapp/volunteer/savevolunteer'; + }else { + url = '/wxminiapp/volunteer/updatevolunteer/' + self.data.volunteerMsg.volunteerId; + } + app.restAjax.post(app.restAjax.path(app.volunteerUrl + url, []), volunteerVO, { headers: { 'token': self.data.token @@ -263,31 +270,55 @@ Page({ }) }) }, + getVolunteerMsg() { + var self = this; + return new Promise(resolve => { + app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wxminiapp/volunteer/getvolunteerbyuserid', []), + {}, { + headers: { + 'token': self.data.token + } + }, function(code, data) { + if('200' == code) { + self.setData({ + volunteerMsg: data + }) + } + return resolve(); + }, function() { + + }, function() { + + }) + }) + }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { var self = this; this.getToken().then(result => { - this.getDataFromDict('a223b308-014a-4e89-93fa-035a564e7fda', 1).then(result => { - self.setData({ - serviceType: self.data.tempObj, - tempObj: {} - }) - }).then(result => { - this.getDataFromDict('7b213c37-8575-4db3-bda1-86c4e38589f7', 1).then(result => { + this.getVolunteerMsg().then(result => { + this.getDataFromDict('a223b308-014a-4e89-93fa-035a564e7fda', 1).then(result => { self.setData({ - serviceIndustry: self.data.tempObj, + serviceType: self.data.tempObj, tempObj: {} }) - }) - }).then(result => { - this.getDataFromDict('4a03e904-81e2-48e9-9006-e15ea4a6bc69', 2).then(result => { - self.setData({ - teamCity: self.data.tempObj, - teamCityArray: self.data.tempArray, - tempObj: {}, - tempArray: [] + }).then(result => { + this.getDataFromDict('7b213c37-8575-4db3-bda1-86c4e38589f7', 1).then(result => { + self.setData({ + serviceIndustry: self.data.tempObj, + tempObj: {} + }) + }) + }).then(result => { + this.getDataFromDict('4a03e904-81e2-48e9-9006-e15ea4a6bc69', 2).then(result => { + self.setData({ + teamCity: self.data.tempObj, + teamCityArray: self.data.tempArray, + tempObj: {}, + tempArray: [] + }) }) }) })