修改bug
This commit is contained in:
parent
3a1c600550
commit
0bac46e527
3
app.json
3
app.json
@ -26,7 +26,8 @@
|
||||
"pages/activityDetail/activityDetail",
|
||||
"pages/activity/activity",
|
||||
"pages/newsDetail/newsDetail",
|
||||
"pages/newsList/newsList"
|
||||
"pages/newsList/newsList",
|
||||
"pages/userAgree/userAgree"
|
||||
],
|
||||
"window": {
|
||||
"backgroundTextStyle": "light",
|
||||
|
@ -9,7 +9,8 @@ Page({
|
||||
isAgree: false, // 是否同意志愿者注册协议
|
||||
index: 0,
|
||||
array: ['区域1','区域2','区域3','区域4'],
|
||||
photo: '',
|
||||
photo: '', // 用于页面显示的photo链接
|
||||
uploadPhoto: '', // 用于传到后台的photoId
|
||||
teamName: '',
|
||||
count:'',
|
||||
teamWatchword: '',
|
||||
@ -74,7 +75,8 @@ Page({
|
||||
var data = data.substr(9, data.length);
|
||||
data = data.substr(0, data.length - 2);
|
||||
self.setData({
|
||||
photo: app.volunteerUrl + '/route/file/downloadfile/true/' + data
|
||||
photo: app.volunteerUrl + '/route/file/downloadfile/true/' + data,
|
||||
uploadPhoto: data
|
||||
})
|
||||
}
|
||||
}, function(code, data) {
|
||||
@ -140,6 +142,18 @@ Page({
|
||||
}
|
||||
})
|
||||
},
|
||||
areaChange: function(e) {
|
||||
var self = this;
|
||||
self.setData({
|
||||
teamAreaIndex: e.detail.value
|
||||
})
|
||||
},
|
||||
userAgree: function(e) {
|
||||
var type = e.currentTarget.dataset.type;
|
||||
wx.navigateTo({
|
||||
url: '../userAgree/userAgree?type=' + type,
|
||||
})
|
||||
},
|
||||
changeAgree: function (e) {
|
||||
if(e.detail.value == ''){
|
||||
this.setData({
|
||||
@ -162,7 +176,7 @@ Page({
|
||||
return false;
|
||||
}
|
||||
var teamVO = {
|
||||
photo: self.data.photo,
|
||||
photo: self.data.uploadPhoto,
|
||||
teamName: self.data.teamName,
|
||||
count:self.data.count,
|
||||
teamWatchword: self.data.teamWatchword,
|
||||
|
@ -49,7 +49,7 @@
|
||||
<view class="row" hidden="{{areaShowStatus}}">
|
||||
<view class="row-title">乡镇村:</view>
|
||||
<view class="row-text">
|
||||
<picker bindchange="countyChange" value="{{teamAreaIndex}}" range="{{teamAreaArray}}">
|
||||
<picker bindchange="areaChange" value="{{teamAreaIndex}}" range="{{teamAreaArray}}">
|
||||
<view class="picker">
|
||||
{{teamAreaArray[teamAreaIndex]}}
|
||||
</view>
|
||||
@ -67,7 +67,7 @@
|
||||
<view class="agree">
|
||||
<checkbox-group bindchange="changeAgree">
|
||||
<label>
|
||||
<checkbox value="{{isAgree}}" checked="{{isAgree}}" color="#9F1512" class="agree-checkbox"/>我已阅读并同意<text class="agreement">《团队注册服务协议》</text>
|
||||
<checkbox value="{{isAgree}}" checked="{{isAgree}}" color="#9F1512" class="agree-checkbox"/>我已阅读并同意<text class="agreement" style="color: red;" data-type="team" bindtap="userAgree">《团队注册服务协议》</text>
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
|
@ -20,7 +20,8 @@ Page({
|
||||
introduce: '', // 活动介绍
|
||||
voluntaryType: 1, // 类型
|
||||
tempFilePaths: '', // 宣传图片
|
||||
photo: '', // 宣传图片
|
||||
photo: '', // 用于页面显示的宣传图片链接
|
||||
uploadPhoto: '', // 用于传到后台的宣传图片Id
|
||||
serviceRequirement: '', // 服务要求
|
||||
},
|
||||
getToken: function() {
|
||||
@ -99,7 +100,8 @@ Page({
|
||||
var data = data.substr(9, data.length);
|
||||
data = data.substr(0, data.length - 2);
|
||||
self.setData({
|
||||
photo: app.volunteerUrl + '/route/file/downloadfile/true/' + data
|
||||
photo: app.volunteerUrl + '/route/file/downloadfile/true/' + data,
|
||||
uploadPhoto: data
|
||||
})
|
||||
}
|
||||
}, function(code, data) {
|
||||
@ -172,7 +174,7 @@ Page({
|
||||
introduce: self.data.introduce,
|
||||
startTime: self.data.startDate,
|
||||
endTime: self.data.endDate,
|
||||
photo: self.data.photo,
|
||||
photo: self.data.uploadPhoto,
|
||||
serviceRequirement: self.data.serviceRequirement
|
||||
};
|
||||
app.restAjax.post(app.restAjax.path(app.volunteerUrl + '/wxminiapp/volunteerservice/savevolunteerservice', []),
|
||||
|
@ -138,7 +138,7 @@ Page({
|
||||
}, function(code, data) {
|
||||
if('200' == code) {
|
||||
app.dialog.msg('注册成功!');
|
||||
wx.navigateTo({
|
||||
wx.redirectTo({
|
||||
url: '../volunteer/volunteer',
|
||||
})
|
||||
}
|
||||
@ -167,7 +167,7 @@ Page({
|
||||
}, function(code, data) {
|
||||
if('200' == code) {
|
||||
app.dialog.msg('取消报名成功!');
|
||||
wx.navigateTo({
|
||||
wx.redirectTo({
|
||||
url: '../volunteer/volunteer',
|
||||
})
|
||||
}
|
||||
|
104
pages/userAgree/userAgree.js
Normal file
104
pages/userAgree/userAgree.js
Normal file
@ -0,0 +1,104 @@
|
||||
// pages/userAgree/userAgree.js
|
||||
var app = getApp();
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
agreeContent: '',
|
||||
token: ''
|
||||
},
|
||||
getToken: function() {
|
||||
var self = this;
|
||||
return new Promise(resolve =>{
|
||||
wx.getStorage({
|
||||
key: 'token',
|
||||
success(res) {
|
||||
self.setData({
|
||||
token: res.data
|
||||
})
|
||||
return resolve();
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
getUserAgree: function(type) {
|
||||
var self = this;
|
||||
app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wxminiapp/agreecontent/getagreecontentbyid/' + type, []),
|
||||
{}, {
|
||||
headers: {
|
||||
token: self.data.token
|
||||
}
|
||||
}, function(code, data) {
|
||||
if('200' == code) {
|
||||
self.setData({
|
||||
agreeContent: data.content
|
||||
})
|
||||
}
|
||||
}, function(code, data) {
|
||||
app.dialog.msg(data.msg)
|
||||
}, function() {
|
||||
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
var type = options.type;
|
||||
var self = this;
|
||||
this.getToken().then(result => {
|
||||
this.getUserAgree(type);
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
3
pages/userAgree/userAgree.json
Normal file
3
pages/userAgree/userAgree.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
4
pages/userAgree/userAgree.wxml
Normal file
4
pages/userAgree/userAgree.wxml
Normal file
@ -0,0 +1,4 @@
|
||||
<!--pages/userAgree/userAgree.wxml-->
|
||||
<view>
|
||||
<rich-text nodes="{{agreeContent}}"></rich-text>
|
||||
</view>
|
1
pages/userAgree/userAgree.wxss
Normal file
1
pages/userAgree/userAgree.wxss
Normal file
@ -0,0 +1 @@
|
||||
/* pages/userAgree/userAgree.wxss */
|
@ -122,6 +122,7 @@ Page({
|
||||
}
|
||||
},
|
||||
changeAgree: function (e) {
|
||||
console.log(e)
|
||||
if(e.detail.value == ''){
|
||||
this.setData({
|
||||
isAgree: false
|
||||
@ -132,6 +133,12 @@ Page({
|
||||
})
|
||||
}
|
||||
},
|
||||
userAgree: function(e) {
|
||||
var type = e.currentTarget.dataset.type;
|
||||
wx.navigateTo({
|
||||
url: '../userAgree/userAgree?type=' + type,
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 服务类别选择
|
||||
* @param {}} e
|
||||
@ -205,12 +212,15 @@ Page({
|
||||
openExperience : self.data.openExperience
|
||||
};
|
||||
var url;
|
||||
var requ;
|
||||
if(!self.data.volunteerMsg) {
|
||||
url = '/wxminiapp/volunteer/savevolunteer';
|
||||
requ = app.restAjax.post;
|
||||
}else {
|
||||
url = '/wxminiapp/volunteer/updatevolunteer/' + self.data.volunteerMsg.volunteerId;
|
||||
requ = app.restAjax.put;
|
||||
}
|
||||
app.restAjax.post(app.restAjax.path(app.volunteerUrl + url, []),
|
||||
requ(app.restAjax.path(app.volunteerUrl + url, []),
|
||||
volunteerVO, {
|
||||
headers: {
|
||||
'token': self.data.token
|
||||
@ -280,6 +290,7 @@ Page({
|
||||
}
|
||||
}, function(code, data) {
|
||||
if('200' == code) {
|
||||
console.log(data)
|
||||
self.setData({
|
||||
volunteerMsg: data
|
||||
})
|
||||
|
@ -1,4 +1,5 @@
|
||||
<view class="register">
|
||||
<view class="row" wx:if="{{volunteerMsg}}" style="color:red;margin-bottom:15rpx;">您已经是志愿者,可修改以下信息!</view>
|
||||
<view class="row" style="height: auto">
|
||||
<view class="info-name">公开经历:</view>
|
||||
<view class="info-text" style="height: auto">
|
||||
@ -77,9 +78,10 @@
|
||||
<view class="is-agree">
|
||||
<checkbox-group bindchange="changeAgree">
|
||||
<label class="checkbox">
|
||||
<checkbox value="{{isAgree}}" checked="{{isAgree}}" />我已阅读并同意<text class="bargain">《志愿者注册服务协议》</text>
|
||||
<checkbox value="{{isAgree}}" checked="{{isAgree}}" />我已阅读并同意<text class="bargain" data-type="volunteer" bindtap="userAgree">《志愿者注册服务协议》</text>
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
<view class="submit" bindtap="submitRegister">立即注册</view>
|
||||
<view class="submit" bindtap="submitRegister" wx:if="{{!volunteerMsg}}">立即注册</view>
|
||||
<view class="submit" bindtap="submitRegister" wx:else>立即修改</view>
|
||||
</view>
|
Loading…
Reference in New Issue
Block a user