提交
This commit is contained in:
commit
14aa5fa88e
6
app.js
6
app.js
@ -3,11 +3,13 @@ var restAjax = require('utils/restAjax.js');
|
||||
var dialog = require('utils/dialog.js');
|
||||
App({
|
||||
loginUrl: 'http://192.168.0.113:7001/usercenter',
|
||||
usercenterUrl: 'http://192.168.0.113:7001/usesrcenter',
|
||||
usercenterUrl: 'http://192.168.0.113:7001/usercenter',
|
||||
newsUrl: 'http://192.168.0.113:8082/news',
|
||||
libraryUrl: 'http://192.168.0.113:8081/library',
|
||||
activityUrl: '',
|
||||
venueUrl: 'http://192.168.0.109:8082/venuebooking',
|
||||
activityUrl: 'http://192.168.0.111:8080/culturalactivity/',
|
||||
volunteerUrl: 'http://192.168.0.111:8888/volunteer/',
|
||||
|
||||
restAjax: restAjax,
|
||||
dialog: dialog,
|
||||
onLaunch: function () {
|
||||
|
2
app.json
2
app.json
@ -1,5 +1,6 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/center/center",
|
||||
"pages/index/index",
|
||||
"pages/volunteerRegister/volunteerRegister",
|
||||
"pages/volunteer/volunteer",
|
||||
@ -13,7 +14,6 @@
|
||||
"pages/newTeam/newTeam",
|
||||
"pages/volunteerTeam/volunteerTeam",
|
||||
"pages/venue/venue",
|
||||
"pages/center/center",
|
||||
"pages/cultureDetail/cultureDetail",
|
||||
"pages/activitySign/activitySign",
|
||||
"pages/activityDetail/activityDetail",
|
||||
|
BIN
images/share.png
BIN
images/share.png
Binary file not shown.
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
BIN
images/team.png
BIN
images/team.png
Binary file not shown.
Before Width: | Height: | Size: 337 B After Width: | Height: | Size: 2.2 KiB |
@ -1,18 +1,87 @@
|
||||
// pages/center/center.js
|
||||
var app = getApp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
userAvatar: '',
|
||||
token: ''
|
||||
},
|
||||
changeAvatar: function () {
|
||||
var self = this
|
||||
wx.showActionSheet({
|
||||
itemList: ['从相册中选择','拍照'],
|
||||
success: function (res) {
|
||||
if (!res.cancel) {
|
||||
if (res.tapIndex == 0) {
|
||||
self.chooseAvatar('album')
|
||||
} else {
|
||||
self.chooseAvatar('camera')
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
chooseAvatar: function (type) {
|
||||
var self = this
|
||||
wx.chooseImage({
|
||||
count: 1,
|
||||
sizeType: ['original', 'compressed'],
|
||||
sourceType: [type],
|
||||
success: function (res) {
|
||||
var avatar = res.tempFilePaths[0];
|
||||
console.log(avatar)
|
||||
app.restAjax.post(app.restAjax.path('{usercenterUrl}/app/file/uploadimage', [app.usercenterUrl]), avatar, 'image', {
|
||||
headers: {
|
||||
token: self.data.token
|
||||
}
|
||||
}, function (code, data) {
|
||||
console.log(data);
|
||||
|
||||
}, function (code, data) {
|
||||
console.log(data)
|
||||
})
|
||||
self.setData({
|
||||
userAvatar: avatar
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getToken: function () {
|
||||
var self = this
|
||||
wx.getStorage({
|
||||
key: 'token',
|
||||
success: function(res) {
|
||||
self.setData({
|
||||
token: res.data
|
||||
})
|
||||
},
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 跳转到我的志愿团队页面
|
||||
*/
|
||||
toMyTeam: function() {
|
||||
wx.navigateTo({
|
||||
url: '../myVlounteerTeam/myVlounteerTeam',
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 跳转到我的志愿活动页面
|
||||
*/
|
||||
toMyVolunteerActivity: function() {
|
||||
wx.navigateTo({
|
||||
url: '../myVolunteerActivity/myVolunteerActivity',
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
|
||||
this.getToken()
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -3,8 +3,8 @@
|
||||
</view>
|
||||
<view class="page-container">
|
||||
<view class="person">
|
||||
<view class="user-avatar">
|
||||
<image src="../../images/user-avatar.png"></image>
|
||||
<view class="user-avatar" bindtap="changeAvatar">
|
||||
<image src="{{userAvatar}}"></image>
|
||||
</view>
|
||||
<view class="user-name">杜若无心</view>
|
||||
</view>
|
||||
@ -23,6 +23,18 @@
|
||||
<image src="../../images/my-collect.png"></image>
|
||||
<view class="title">我的收藏</view>
|
||||
</view>
|
||||
<view class="main-box">
|
||||
<image src="../../images/share.png"></image>
|
||||
<view class="title" bindtap="toMyTeam">我的志愿团队</view>
|
||||
</view>
|
||||
<view class="main-box">
|
||||
<image src="../../images/team.png"></image>
|
||||
<view class="title" bindtap="toMyVolunteerActivity">我的志愿活动</view>
|
||||
</view>
|
||||
<view class="main-box">
|
||||
<image src="../../images/share.png"></image>
|
||||
<view class="title">我的分享</view>
|
||||
</view>
|
||||
<view class="main-box">
|
||||
<image src="../../images/setting.png"></image>
|
||||
<view class="title">设置</view>
|
||||
|
166
pages/myVolunteerActivity/myVolunteerActivity.js
Normal file
166
pages/myVolunteerActivity/myVolunteerActivity.js
Normal file
@ -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 () {
|
||||
|
||||
}
|
||||
})
|
3
pages/myVolunteerActivity/myVolunteerActivity.json
Normal file
3
pages/myVolunteerActivity/myVolunteerActivity.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
30
pages/myVolunteerActivity/myVolunteerActivity.wxml
Normal file
30
pages/myVolunteerActivity/myVolunteerActivity.wxml
Normal file
@ -0,0 +1,30 @@
|
||||
<view class="top-tab">
|
||||
<view class="tab-box {{type==1?'active':''}}" data-type="1" bindtap="changeTab">
|
||||
<image src="../../images/selected-l.png" class="selected-l"></image>
|
||||
未参加
|
||||
<image src="../../images/selected-r.png" class="selected-r"></image>
|
||||
</view>
|
||||
<view class="tab-box {{type==2?'active':''}}" data-type="2" bindtap="changeTab">
|
||||
<image src="../../images/selected-l.png" class="selected-l"></image>
|
||||
已参加
|
||||
<image src="../../images/selected-r.png" class="selected-r"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="team">
|
||||
<view class="team-box" wx:for="{{otherTeamMap}}" data-id="{{item.teamId}}">
|
||||
<view class="name-join">
|
||||
<view class="name">{{item.teamName}}</view>
|
||||
<view class="join" wx:if="{{item.checkStatus == '' && type == 1}}" data-teamid="{{item.teamId}}" bindtap="joinOrOutTeam">申请加入</view>
|
||||
<view class="join" wx:if="{{item.checkStatus == '' && type == 2}}" data-teamid="{{item.teamId}}" bindtap="joinOrOutTeam">退出</view>
|
||||
<view class="join" wx:if="{{item.checkStatus != '' && item.checkStatus == '0'}}">待审核</view>
|
||||
<view class="join" wx:if="{{item.checkStatus != '' && item.checkStatus == '1'}}" bindtap="joinOrOutTeam">退出</view>
|
||||
<view class="join" wx:if="{{item.checkStatus != '' && item.checkStatus == '2'}}">审核驳回</view>
|
||||
<view class="join" wx:if="{{item.checkStatus != '' && item.checkStatus == '3'}}">已退出 </view>
|
||||
</view>
|
||||
<view class="slogan">团队口号:{{item.teamWatchword}}</view>
|
||||
<view class="area">所属区域:{{item.teamCityDictionaryName}} {{item.teamCountyDictionaryName}} {{item.teamAreaDictionaryName}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="new-team">
|
||||
<view class="new-team-btn" bindtap="newTeam">创建新团队</view>
|
||||
</view>
|
94
pages/myVolunteerActivity/myVolunteerActivity.wxss
Normal file
94
pages/myVolunteerActivity/myVolunteerActivity.wxss
Normal file
@ -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;
|
||||
}
|
166
pages/myVolunteerTeam/myVlounteerTeam.js
Normal file
166
pages/myVolunteerTeam/myVlounteerTeam.js
Normal file
@ -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 () {
|
||||
|
||||
}
|
||||
})
|
3
pages/myVolunteerTeam/myVlounteerTeam.json
Normal file
3
pages/myVolunteerTeam/myVlounteerTeam.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
30
pages/myVolunteerTeam/myVlounteerTeam.wxml
Normal file
30
pages/myVolunteerTeam/myVlounteerTeam.wxml
Normal file
@ -0,0 +1,30 @@
|
||||
<view class="top-tab">
|
||||
<view class="tab-box {{type==1?'active':''}}" data-type="1" bindtap="changeTab">
|
||||
<image src="../../images/selected-l.png" class="selected-l"></image>
|
||||
未参加
|
||||
<image src="../../images/selected-r.png" class="selected-r"></image>
|
||||
</view>
|
||||
<view class="tab-box {{type==2?'active':''}}" data-type="2" bindtap="changeTab">
|
||||
<image src="../../images/selected-l.png" class="selected-l"></image>
|
||||
已参加
|
||||
<image src="../../images/selected-r.png" class="selected-r"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="team">
|
||||
<view class="team-box" wx:for="{{otherTeamMap}}" data-id="{{item.teamId}}">
|
||||
<view class="name-join">
|
||||
<view class="name">{{item.teamName}}</view>
|
||||
<view class="join" wx:if="{{item.checkStatus == '' && type == 1}}" data-teamid="{{item.teamId}}" bindtap="joinOrOutTeam">申请加入</view>
|
||||
<view class="join" wx:if="{{item.checkStatus == '' && type == 2}}" data-teamid="{{item.teamId}}" bindtap="joinOrOutTeam">退出</view>
|
||||
<view class="join" wx:if="{{item.checkStatus != '' && item.checkStatus == '0'}}">待审核</view>
|
||||
<view class="join" wx:if="{{item.checkStatus != '' && item.checkStatus == '1'}}" bindtap="joinOrOutTeam">退出</view>
|
||||
<view class="join" wx:if="{{item.checkStatus != '' && item.checkStatus == '2'}}">审核驳回</view>
|
||||
<view class="join" wx:if="{{item.checkStatus != '' && item.checkStatus == '3'}}">已退出 </view>
|
||||
</view>
|
||||
<view class="slogan">团队口号:{{item.teamWatchword}}</view>
|
||||
<view class="area">所属区域:{{item.teamCityDictionaryName}} {{item.teamCountyDictionaryName}} {{item.teamAreaDictionaryName}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="new-team">
|
||||
<view class="new-team-btn" bindtap="newTeam">创建新团队</view>
|
||||
</view>
|
94
pages/myVolunteerTeam/myVlounteerTeam.wxss
Normal file
94
pages/myVolunteerTeam/myVlounteerTeam.wxss
Normal file
@ -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;
|
||||
}
|
@ -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() {
|
||||
|
@ -67,7 +67,7 @@
|
||||
<view class="row">
|
||||
<view class="row-title">开始时间:</view>
|
||||
<view class="row-text">
|
||||
<picker mode="date" value="{{startDate}}" bindchange="bindDateChange">
|
||||
<picker mode="date" value="{{startDate}}" bindchange="startDateChange">
|
||||
<view class="picker">
|
||||
{{startDate}}
|
||||
</view>
|
||||
@ -77,7 +77,7 @@
|
||||
<view class="row">
|
||||
<view class="row-title">结束时间:</view>
|
||||
<view class="row-text">
|
||||
<picker mode="date" value="{{endDate}}" bindchange="bindDateChange">
|
||||
<picker mode="date" value="{{endDate}}" bindchange="endDateChange">
|
||||
<view class="picker">
|
||||
{{endDate}}
|
||||
</view>
|
||||
|
@ -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();
|
||||
})
|
||||
},
|
||||
|
||||
|
@ -27,6 +27,15 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="sign-box" bindtap="goSign" data-id="{{dataMap.activityLibraryId }}" wx-if="{{dataMap.activityState == 3 && dataMap.isEnroll == ''}}">
|
||||
<view class="sign-btn">报名</view>
|
||||
<view class="sign-box" wx-if="{{dataMap.status == 'enroll'}}">
|
||||
<picker bindchange="teamChange" value="{{teamIndex}}" range="{{teamArray}}" wx:if="{{dataMap.voluntaryType == '2'}}">
|
||||
<view class="sign-btn" data-serviceId="{{dataMap.volunteerServiceId }}" data-type="{{dataMap.voluntaryType }}" bindtap="enroll">报名</view>
|
||||
</picker>
|
||||
<view class="sign-btn" wx:if="{{dataMap.voluntaryType == '1'}}" data-serviceId="{{dataMap.volunteerServiceId }}" data-type="{{dataMap.voluntaryType }}" bindtap="volunteerEnroll">报名</view>
|
||||
</view>
|
||||
<view class="sign-box" wx-if="{{dataMap.status == 'isEnroll'}}">
|
||||
<picker bindchange="teamCancelChange" value="{{teamIndex}}" range="{{teamArray}}" wx:if="{{dataMap.voluntaryType == '2'}}">
|
||||
<view class="sign-btn" wx:if="{{dataMap.voluntaryType == '2'}}" data-serviceId="{{dataMap.volunteerServiceId }}" data-type="{{dataMap.voluntaryType }}" bindtap="enroll">取消报名</view>
|
||||
</picker>
|
||||
<view class="sign-btn" wx:if="{{dataMap.voluntaryType == '1'}}" data-serviceId="{{dataMap.volunteerServiceId }}" data-type="{{dataMap.voluntaryType }}" bindtap="volunteerCancelEnroll">取消报名</view>
|
||||
</view>
|
@ -77,7 +77,7 @@
|
||||
}
|
||||
.sign-btn{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
height: 80rpx;
|
||||
background: #9F1512;
|
||||
border-radius: 10rpx;
|
||||
display: flex;
|
||||
|
@ -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',
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -1,12 +1,12 @@
|
||||
<view class="top-tab">
|
||||
<view class="tab-box {{type==1?'active':''}}" data-type="1" bindtap="changeTab">
|
||||
<image src="../../images/selected-l.png" class="selected-l"></image>
|
||||
团队
|
||||
未参加
|
||||
<image src="../../images/selected-r.png" class="selected-r"></image>
|
||||
</view>
|
||||
<view class="tab-box {{type==2?'active':''}}" data-type="2" bindtap="changeTab">
|
||||
<image src="../../images/selected-l.png" class="selected-l"></image>
|
||||
我的团队
|
||||
已参加
|
||||
<image src="../../images/selected-r.png" class="selected-r"></image>
|
||||
</view>
|
||||
</view>
|
||||
@ -14,6 +14,12 @@
|
||||
<view class="team-box" wx:for="{{otherTeamMap}}" data-id="{{item.teamId}}">
|
||||
<view class="name-join">
|
||||
<view class="name">{{item.teamName}}</view>
|
||||
<view class="join" wx:if="{{item.checkStatus == '' && type == 1}}" data-teamid="{{item.teamId}}" bindtap="joinOrOutTeam">申请加入</view>
|
||||
<view class="join" wx:if="{{item.checkStatus == '' && type == 2}}" data-teamid="{{item.teamId}}" bindtap="joinOrOutTeam">退出</view>
|
||||
<view class="join" wx:if="{{item.checkStatus != '' && item.checkStatus == '0'}}">待审核</view>
|
||||
<view class="join" wx:if="{{item.checkStatus != '' && item.checkStatus == '1'}}" bindtap="joinOrOutTeam">退出</view>
|
||||
<view class="join" wx:if="{{item.checkStatus != '' && item.checkStatus == '2'}}">审核驳回</view>
|
||||
<view class="join" wx:if="{{item.checkStatus != '' && item.checkStatus == '3'}}">已退出 </view>
|
||||
</view>
|
||||
<view class="slogan">团队口号:{{item.teamWatchword}}</view>
|
||||
<view class="area">所属区域:{{item.teamCityDictionaryName}} {{item.teamCountyDictionaryName}} {{item.teamAreaDictionaryName}}</view>
|
||||
|
@ -6,16 +6,16 @@
|
||||
"setting": {
|
||||
"urlCheck": false,
|
||||
"es6": true,
|
||||
"enhance": false,
|
||||
"postcss": true,
|
||||
"preloadBackgroundData": false,
|
||||
"minified": true,
|
||||
"newFeature": true,
|
||||
"coverView": true,
|
||||
"nodeModules": false,
|
||||
"autoAudits": false,
|
||||
"coverView": true,
|
||||
"showShadowRootInWxmlPanel": true,
|
||||
"scopeDataCheck": false,
|
||||
"enhance": false,
|
||||
"nodeModules": false,
|
||||
"uglifyFileName": false,
|
||||
"checkInvalidKey": true,
|
||||
"checkSiteMap": true,
|
||||
|
@ -223,4 +223,5 @@ module.exports.put = putJson;
|
||||
module.exports.get = getForm;
|
||||
module.exports.params = getParamsArg;
|
||||
module.exports.path = buildPath;
|
||||
module.exports.escape = escape;
|
||||
module.exports.escape = escape;
|
||||
module.exports.file = postFile;
|
Loading…
Reference in New Issue
Block a user