# Conflicts:
#	project.config.json
This commit is contained in:
wans 2020-06-27 13:39:26 +08:00
commit f85d1434b8
50 changed files with 1649 additions and 451 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/project.config.json

4
app.js
View File

@ -7,9 +7,9 @@ App({
newsUrl: 'http://192.168.0.113:8082/news',
libraryUrl: 'http://192.168.0.113:8081/library',
venueUrl: 'http://192.168.0.109:8082/venuebooking',
activityUrl: 'http://192.168.0.111:8080/culturalactivity/',
activityUrl: 'http://192.168.0.111:8080/culturalactivity',
volunteerUrl: 'http://192.168.0.111:8888/volunteer/',
liveUrl: 'http://192.168.0.113:8084/live',
restAjax: restAjax,
dialog: dialog,
onLaunch: function () {

View File

@ -1,7 +1,11 @@
{
"pages": [
"pages/center/center",
"pages/book/book",
"pages/index/index",
"pages/broadcast/broadcast",
"pages/activityDialog/activityDialog",
"pages/teamDetail/teamDetail",
"pages/center/center",
"pages/volunteerRegister/volunteerRegister",
"pages/volunteer/volunteer",
"pages/heritage/heritage",
@ -9,7 +13,6 @@
"pages/venueDetail/venueDetail",
"pages/register/register",
"pages/login/login",
"pages/broadcast/broadcast",
"pages/newVolunteerActivity/newVolunteerActivity",
"pages/newTeam/newTeam",
"pages/volunteerTeam/volunteerTeam",

BIN
images/delete.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

View File

@ -1,12 +1,11 @@
// pages/activity/activity.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
url: 'http://192.168.0.111:8080/culturalactivity/',
imgUrl: 'http://192.168.0.111:8080/culturalactivity/route/file/downloadfile/true/',
dataList: []
},
goDetail: function (e) {
@ -20,20 +19,22 @@ Page({
*/
onLoad: function (options) {
var self = this;
wx.request({
url: self.data.url + 'wxminiapp/activitylibrary/listpageactivitylibraryfornetrelease',
success: function(res) {
if('200' == res.statusCode) {
for(var item of res.data.rows) {
app.restAjax.get(app.restAjax.path(app.activityUrl + 'wxminiapp/activitylibrary/listpageactivitylibraryfornetrelease', []),
{}, null, function(code, data) {
if('200' == code) {
for(var item of data.rows) {
if('' != item.activityImage) {
item.activityImage = self.data.imgUrl + item.activityImage;
item.activityImage = app.activityUrl + 'route/file/downloadfile/true/' + item.activityImage;
}
}
self.setData({
dataList: res.data.rows,
dataList: data.rows,
})
}
}
}, function() {
}, function() {
})
},

View File

@ -1,12 +1,11 @@
// pages/activityDetail/activityDetail.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
url: 'http://192.168.0.111:8080/culturalactivity/',
imgUrl: 'http://192.168.0.111:8080/culturalactivity/route/file/downloadfile/true/',
dataMap: {}
},
goSign: function () {
@ -20,16 +19,18 @@ Page({
onLoad: function (options) {
var self = this;
var id = options.id;
wx.request({
url: self.data.url + 'wxminiapp/activitylibrary/getactivitylibrarybyidrelease/' + id,
success: function(res) {
if('200' == res.statusCode) {
res.data.activityImage = self.data.imgUrl + res.data.activityImage;
app.restAjax.get(app.restAjax.path(app.activityUrl + 'wxminiapp/activitylibrary/getactivitylibrarybyidrelease/' + id, []),
{}, null, function(code, data) {
if('200' == code) {
data.activityImage = app.activityUrl + 'route/file/downloadfile/true/' + data.activityImage;
self.setData({
dataMap: res.data
dataMap: data
})
}
}
}, function() {
}, function() {
})
},

View File

@ -0,0 +1,66 @@
// pages/activityDialog/activityDialog.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@ -0,0 +1,32 @@
<view class="dialog">
<view class="dialog-box">
<view class="avatar">
<image src="../../images/avatar.png"></image>
</view>
<view class="user-info">
<view class="name">姓名</view>
<view class="content">哈哈哈哈哈</view>
<view class="public-time">
<view class="time">2020-02-02 00:00:00</view>
<view class="delete">
<image src="../../images/delete.png"></image>
</view>
</view>
</view>
</view>
<view class="dialog-box">
<view class="avatar">
<image src="../../images/avatar.png"></image>
</view>
<view class="user-info">
<view class="name">姓名</view>
<view class="content">哈哈哈哈哈</view>
<view class="public-time">
<view class="time">2020-02-02 00:00:00</view>
<view class="delete">
<image src="../../images/delete.png"></image>
</view>
</view>
</view>
</view>
</view>

View File

@ -0,0 +1,42 @@
.dialog{
padding: 30rpx;
}
.dialog-box{
margin-bottom: 15rpx;
display: flex;
justify-content: space-between;
}
.avatar{
width: 15%;
}
.avatar image{
width: 100%;
height: 90rpx;
}
.user-info{
width: 83%;
border-bottom: 1px solid #DEDEDE;
padding-bottom: 10rpx;
}
.name{
font-size: 34rpx;
color: #949494;
margin: 15rpx 0;
}
.content{
font-size: 30rpx;
color: #000;
margin-bottom: 15rpx;
}
.public-time{
display: flex;
justify-content: space-between;
}
.time{
font-size: 28rpx;
color: #949494;
}
.delete, .delete image{
width: 40rpx;
height: 40rpx;
}

75
pages/book/book.js Normal file
View File

@ -0,0 +1,75 @@
// pages/book/book.js
Page({
/**
* 页面的初始数据
*/
data: {
checkOrder: false
},
doCheckOrder: function () {
this.setData({
checkOrder: true
})
},
closeCheckOrder: function () {
this.setData({
checkOrder: false
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

3
pages/book/book.json Normal file
View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

135
pages/book/book.wxml Normal file
View File

@ -0,0 +1,135 @@
<view class="top-select">
<view class="select-box active">
<image src="../../images/selected-l.png" class="select-l"></image>
篮球
<image src="../../images/selected-r.png" class="select-r"></image>
</view>
<view class="select-box">
<image src="../../images/selected-l.png" class="select-l"></image>
篮球
<image src="../../images/selected-r.png" class="select-r"></image>
</view>
<view class="select-box">
<image src="../../images/selected-l.png" class="select-l"></image>
篮球
<image src="../../images/selected-r.png" class="select-r"></image>
</view>
</view>
<view class="venue-info">
<view class="title">营业时间:</view>
<view class="content">暂无信息</view>
<view class="title">项目描述:</view>
<view class="content">暂无信息</view>
<view class="title">场地设置:</view>
<view class="content">暂无信息</view>
</view>
<view class="date">
<view class="date-container">
<view class="date-box active">2020-01-01</view>
<view class="date-box">2020-01-01</view>
<view class="date-box">2020-01-01</view>
</view>
</view>
<view class="ground">
<view class="ground-container">
<view class="ground-box active">
<image src="../../images/selected-l.png" class="left"></image>
场地1
<image src="../../images/selected-r.png" class="right"></image>
</view>
<view class="ground-box">
<image src="../../images/selected-l.png" class="left"></image>
场地1
<image src="../../images/selected-r.png" class="right"></image>
</view>
<view class="ground-box">
<image src="../../images/selected-l.png" class="left"></image>
场地1
<image src="../../images/selected-r.png" class="right"></image>
</view>
</view>
</view>
<view class="time">
<view class="time-box selected">
<view>2020-01-01</view>
<view>12:00-13:00</view>
<view>15元</view>
</view>
<view class="time-box">
<view>2020-01-01</view>
<view>12:00-13:00</view>
<view>15元</view>
</view>
<view class="time-box">
<view>2020-01-01</view>
<view>12:00-13:00</view>
<view>15元</view>
</view>
<view class="time-box">
<view>2020-01-01</view>
<view>12:00-13:00</view>
<view>15元</view>
</view>
</view>
<view class="bottom">
<view class="phone-code">
<view class="row">
<view class="row-title">手机号:</view>
<view class="row-input">
<input placeholder="请输入手机号"></input>
</view>
</view>
<view class="row">
<view class="row-title">验证码:</view>
<view class="row-input">
<input placeholder="请输入验证码" class="code-input"></input>
<view class="get-code">获取验证码</view>
</view>
</view>
</view>
<view class="pay-book">
<view class="pay" bindtap="doCheckOrder">
订单金额10元
</view>
<view class="book">
预定
</view>
</view>
</view>
<view class="order-info" bindtap="closeCheckOrder" wx:if="{{checkOrder}}">
<view class="order-container">
<view class="order-title">订单信息</view>
<view class="order">
<view class="order-box">
<view class="top">
<view>2020-01-01</view>
<view>12:00-13:00</view>
</view>
<view class="bottom-info">
<view>场地1</view>
<view>15元</view>
</view>
</view>
<view class="order-box">
<view class="top">
<view>2020-01-01</view>
<view>12:00-13:00</view>
</view>
<view class="bottom-info">
<view>场地1</view>
<view>15元</view>
</view>
</view>
<view class="order-box">
<view class="top">
<view>2020-01-01</view>
<view>12:00-13:00</view>
</view>
<view class="bottom-info">
<view>场地1</view>
<view>15元</view>
</view>
</view>
</view>
</view>
</view>

221
pages/book/book.wxss Normal file
View File

@ -0,0 +1,221 @@
.top-select{
height:90rpx;
background:rgba(255,255,255,1);
box-shadow:0px 0px 16rpx 0px rgba(0,0,0,0.1);
border-radius:0px 0px 31rpx 31rpx;
padding: 0 30rpx;
display: flex;
margin-bottom: 10rpx;
}
.select-box{
padding: 0 30rpx;
position: relative;
font-size: 32rpx;
display: flex;
align-items: center;
justify-content: center;
}
.select-box image{
position: absolute;
top: 50%;
width: 20rpx;
height: 30rpx;
display: none;
transform: translate(0, -50%);
}
.select-box.active image{
display: block;
}
.select-l{
left: 0;
}
.select-r{
right: 0;
}
.venue-info{
padding: 0 30rpx;
}
.title{
font-size: 30rpx;
color: #000;
margin-bottom: 10rpx;
}
.content{
font-size: 28rpx;
color: #949494;
margin-bottom: 10rpx;
}
.date{
border-top: 3px solid #DEDEDE;
border-bottom: 3px solid #DEDEDE;
padding: 0 30rpx;
}
.date-container, .ground-container{
display: flex;
flex-wrap: nowrap;
overflow-x: auto;
}
.date-box, .ground-box{
flex-shrink: 0;
padding: 15rpx 0;
margin-right: 15rpx;
font-size: 30rpx;
color: #949494;
}
.date-box.active{
color: #9F1512;
}
.ground{
margin: 20rpx 0;
padding: 0 30rpx 20rpx;
border-bottom: 3px solid #DEDEDE;
}
.ground-box{
margin: 0;
padding: 0 25rpx;
position: relative;
}
.ground-box image{
width: 20rpx;
height: 30rpx;
position: absolute;
top: 50%;
transform: translate(0, -50%);
display: none;
}
.left{
left: 0
}
.right{
right: 0
}
.ground-box.active{
color: #9F1512;
}
.ground-box.active image{
display: block;
}
.time{
padding: 0 30rpx;
}
.time-box{
display: inline-block;
width: 32%;
margin-right: 2%;
background: rgba(159,21,18,.5);
color: #fff;
font-size: 28rpx;
border-radius: 15rpx;
margin-bottom: 15rpx;
text-align: center;
padding: 15rpx;
box-sizing: border-box;
}
.time-box:nth-child(3n){
margin-right: 0
}
.time-box.selected{
background: #9F1512;
}
.bottom{
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: 15rpx 30rpx;
}
.phone-code{
margin-bottom: 20rpx;
}
.row{
display: flex;
justify-content: space-between;
}
.row-title{
width: 20%;
font-size: 28rpx;
color: #000;
line-height: 55rpx;
padding: 10rpx 0;
}
.row-input{
width: 78%;
border-bottom: 1px solid #DEDEDE;
display: flex;
justify-content: space-between;
padding: 10rpx 0;
}
.row-input input{
width: 100%;
height: 55rpx;
}
.row-input input.code-input{
width: 70%;
}
.get-code{
width: 28%;
font-size: 28rpx;
background: #9F1512;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
}
.pay-book{
display: flex;
justify-content: space-between;
}
.pay, .book{
width: 70%;
height: 60rpx;
background: #9F1512;
color: #fff;
font-size: 28rpx;
display: flex;
justify-content: center;
align-items: center;
}
.book{
width: 29%;
}
.order-info{
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1000;
background: rgba(0,0,0,0.6);
}
.order-container{
position: absolute;
bottom: 90rpx;
left: 30rpx;
right: 30rpx;
background: #fff;
border-radius: 10rpx;
padding: 20rpx;
}
.order-title{
font-size: 30rpx;
text-align: center;
color: #9F1512;
}
.order{
margin-top: 20rpx;
overflow-x: auto;
white-space: nowrap;
}
.order-box{
border: 1px solid #9F1512;
border-radius: 10rpx;
text-align: center;
display: inline-block;
margin-right: 20rpx;
font-size: 28rpx;
width: 32%;
}
.top{
background: #9F1512;
color: #fff;
}

View File

@ -1,22 +1,57 @@
// pages/broadcast/broadcast.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
live: {
liveUrl: app.liveUrl,
liveList: []
},
currentPage: 1,
rows: 10
},
goDetail: function () {
doGetLiveList: function(page) {
var self = this;
app.dialog.loading('正在加载');
app.restAjax.get(app.restAjax.path('{liveUrl}/app/liveplan/listpageliveplanrelease', [self.data.live.liveUrl]), {
page: page,
rows: self.data.rows
}, null, function(code, data) {
if(data.rows.length == 0) {
app.dialog.msg('暂无数据');
return;
}
var liveArray;
if(page <= 1) {
liveArray = data.rows;
} else {
liveArray = self.data.live.liveList;
liveArray = liveArray.concat(data.rows);
}
self.setData({
currentPage: page,
'live.liveList': liveArray
})
}, function(code, data) {
app.dialog.msg(data.msg);
}, function() {
wx.stopPullDownRefresh();
wx.hideLoading();
});
},
goDetail: function (event) {
wx.navigateTo({
url: '../broadcastDetail/broadcastDetail',
url: '../broadcastDetail/broadcastDetail?livePlanId='+ event.currentTarget.dataset.livePlanId,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var self = this;
self.doGetLiveList(1);
},
/**
@ -51,14 +86,14 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
this.doGetLiveList(1);
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
this.doGetLiveList(this.data.currentPage + 1);
},
/**

View File

@ -1,3 +1,5 @@
{
"usingComponents": {}
"usingComponents": {},
"enablePullDownRefresh": true,
"backgroundTextStyle": "dark"
}

View File

@ -1,20 +1,12 @@
<view class="broadcast">
<view class="broadcast-box" bindtap="goDetail">
<view class="broadcast-box" bindtap="goDetail" data-live-plan-id="{{item.livePlanId}}" wx:for="{{live.liveList}}" wx:for-index="idx" wx:for-item="item" wx:key="liveList">
<view class="broadcast-img">
<image src="../../images/center-bg.png"></image>
<image src="{{live.liveUrl}}/route/file/downloadfile/true/{{item.livePlanPhoto}}"></image>
<view class="broadcast-status">直播中</view>
</view>
<view class="broadcast-info">
<view class="name">银保监会印发《关于加快推进意外险改直播标题</view>
<view class="time">2020-02-02 14:00:00至2020-02-03 14:00:00</view>
</view>
</view>
<view class="broadcast-box" bindtap="goDetail">
<view class="broadcast-img">
<image src="../../images/center-bg.png"></image>
</view>
<view class="broadcast-info">
<view class="name">银保监会印发《关于加快推进意外险改直播标题</view>
<view class="time">2020-02-02 14:00:00至2020-02-03 14:00:00</view>
<view class="name">{{item.livePlanName}}</view>
<view class="time">{{item.livePlanStart}}至{{item.livePlanEnd}}</view>
</view>
</view>
</view>

View File

@ -11,6 +11,9 @@
width: 100%;
height: 310rpx;
}
.broadcast-img{
position: relative;
}
.broadcast-info{
padding: 20rpx;
}
@ -25,4 +28,14 @@
color: #242424;
font-size: 26rpx;
margin-top: 10rpx;
}
.broadcast-status{
position: absolute;
top: 15rpx;
right: 15rpx;
padding: 5rpx 10rpx;
background: #9F1512;
color: #fff;
font-size: 28rpx;
border-radius: 10rpx;
}

View File

@ -1,3 +1,4 @@
var app = getApp();
function getRandomColor() {
const rgb = []
for (let i = 0; i < 3; ++i) {
@ -10,7 +11,9 @@ function getRandomColor() {
Page({
data: {
src: '',
liveUrl: app.liveUrl,
liveDetail: {},
videoContext: null,
},
onShareAppMessage() {
@ -21,7 +24,23 @@ Page({
},
onReady() {
this.videoContext = wx.createVideoContext('myVideo')
// this.videoContext = wx.createVideoContext('myVideo')
},
getLivePlan(livePlanId) {
var self = this;
app.restAjax.get(app.restAjax.path('{liveUrl}/app/liveplan/getliveplanbyidrelease/{livePlanId}', [self.data.liveUrl, livePlanId]), {}, null, function(code, data) {
self.setData({
liveDetail: data
});
self.videoContext = wx.createLivePlayerContext('liveVideo');
self.videoContext.play();
}, function(code, data) {
app.dialog.msg(data.msg);
});
},
onLoad(option) {
this.getLivePlan(option.livePlanId);
},
onHide() {

View File

@ -1,35 +1,23 @@
<view class="broadcast">
<view class="page-section tc">
<video
id="myVideo"
src="http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400"
binderror="videoErrorCallback"
danmu-list="{{danmuList}}"
enable-danmu
show-center-play-btn='{{false}}'
show-play-btn="{{true}}"
controls
autoplay="{{true}}"
picture-in-picture-mode="{{['push', 'pop']}}"
bindenterpictureinpicture='bindVideoEnterPictureInPicture'
bindleavepictureinpicture='bindVideoLeavePictureInPicture'
></video>
</view>
<!-- <view class="page-section tc">
<video id="myVideo" src="{{liveDetail.liveDeviceRtmpUrl}}" binderror="videoErrorCallback" danmu-list="{{danmuList}}" enable-danmu show-center-play-btn='{{false}}' show-play-btn="{{true}}" controls autoplay="{{true}}" picture-in-picture-mode="{{['push', 'pop']}}" bindenterpictureinpicture='bindVideoEnterPictureInPicture' bindleavepictureinpicture='bindVideoLeavePictureInPicture'></video>
</view> -->
<live-player id="liveVideo" src="{{liveDetail.liveDeviceRtmpUrl}}" mode="live" object-fit="contain" style="width: 100%; height: 400rpx;"/>
</view>
<view class="broadcast-title">银保监会印发《关于加快推进意外直播标题</view>
<view class="broadcast-title">{{liveDetail.livePlanName}}</view>
<view class="broadcast-time">
<view class="time">
<image src="../../images/time.png"></image>
<text>开始时间:</text>
2020-02-03 14:00:00
</view>
<view class="time">
<image src="../../images/time.png"></image>
<text>结束时间:</text>
2020-02-03 14:00:00
</view>
<view class="time">
<image src="../../images/time.png"></image>
<text>开始时间:</text>
{{liveDetail.livePlanStart}}
</view>
<view class="time">
<image src="../../images/time.png"></image>
<text>结束时间:</text>
{{liveDetail.livePlanEnd}}
</view>
</view>
<view class="broadcast-intro">
<view class="broadcast-intro-title">直播介绍</view>
<view class="intro-text">光拉便半运县写员二到院细天县见运命运感知争公着解全得律号深共权发市以家情军少先意单理样好族权达保很具你住红许气已第白知题候其然知王公众我头务族观经市指或七比生。适基历然题和低是局着先重信知议过说心龙素标安放大支入完二种设力果每角解收美约声里历美节办约管运但然新分活们心毛手过共点家或。革解快和特技县应精术被心走小器风育明油备己世国生往支因叫正心在备什新候流广这地。离克的却五北林越用变义按地界你值名证所局的况果被半去量片来参例形极别色部米老近和住例外七强可学变山意断群济。到报还省边速低起分力少族。</view>
<view class="broadcast-intro-title">介绍</view>
<view class="intro-text">{{liveDetail.livePlanRecord}}</view>
</view>

View File

@ -7,8 +7,19 @@ Page({
*/
data: {
userAvatar: '',
token: ''
token: '',
userInfo: {},
usercenterUrl: app.usercenterUrl,
sourcePath: '/route/file/downloadfile/true/',
randomName: '',
showPhone: true,
phone: '',
code: '',
gotCode: false,
restTime: 120,
timer: ''
},
// 选择头像来源
changeAvatar: function () {
var self = this
wx.showActionSheet({
@ -24,6 +35,7 @@ Page({
}
})
},
// 选择图片
chooseAvatar: function (type) {
var self = this
wx.chooseImage({
@ -32,14 +44,13 @@ Page({
sourceType: [type],
success: function (res) {
var avatar = res.tempFilePaths[0];
console.log(avatar)
app.restAjax.file(app.restAjax.path('{usercenterUrl}/app/file/uploadimage', [app.usercenterUrl]), avatar, 'image', {
headers: {
token: self.data.token
}
}, function (code, data) {
console.log(data);
var id = JSON.parse(data).data
self.uploadAvatar(id)
}, function (code, data) {
console.log(data)
})
@ -49,6 +60,38 @@ Page({
}
})
},
// 上传
uploadAvatar: function (avatarId) {
var self = this
app.restAjax.put(app.restAjax.path('{usercenterUrl}/app/user/updateuseravatar', [app.usercenterUrl]), {
avatar: avatarId
}, {
headers: {
token: self.data.token
}
}, function (code, data) {
wx.setStorageSync('token', data.data);
self.getUserInfo()
}, function (code, data) {
console.log(data)
})
},
// 获取用户信息
getUserInfo: function () {
var self = this
app.restAjax.get(app.restAjax.path('{usercenterUrl}/app/user/getappuser', [app.usercenterUrl]), {}, {
headers: {
token: self.data.token
}
}, function (code, data) {
self.setData({
userInfo: data
})
}, function (code, data) {
console.log(data)
})
},
// 获取token
getToken: function () {
var self = this
wx.getStorage({
@ -57,6 +100,7 @@ Page({
self.setData({
token: res.data
})
self.getUserInfo()
},
})
},
@ -65,7 +109,7 @@ Page({
*/
toMyTeam: function() {
wx.navigateTo({
url: '../myVlounteerTeam/myVlounteerTeam',
url: '../myVolunteerTeam/myVolunteerTeam',
})
},
/**
@ -76,11 +120,126 @@ Page({
url: '../myVolunteerActivity/myVolunteerActivity',
})
},
// 判断用户是否为随机名称
isRandomName: function () {
var self = this
wx.getStorage({
key: 'isRandomUsername',
success: function (res) {
if (res.data == 1) {
wx.hideTabBar()
self.setData({
randomName: true
})
}
}
})
},
// 取消绑定手机
cancelPhone: function () {
this.setData({
showPhone: false
})
wx.showTabBar()
},
// 获取输入的手机号
phoneNum: function (res) {
this.setData({
phone: res.detail.value
})
console.log(this.data.phone)
},
// 校验手机号
testPhone: function () {
var self = this
if (self.data.phone) {
if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(self.data.phone)) {
wx.showToast({
title: '请输入正确的手机号',
icon: 'none',
duration: 1500
})
} else {
self.getCode()
}
} else {
wx.showToast({
title: '手机号不能为空',
icon: 'none',
duration: 1500
})
}
},
// 获取验证码
getCode: function () {
var self = this
app.restAjax.get(app.restAjax.path('{usercenterUrl}/api/sms/getverificationcode/' + self.data.phone, [app.usercenterUrl]), {}, null,
function (code, data) {
if (code == 200) {
console.log(data)
self.setData({
gotCode: true
})
self.data.timer = setInterval(function () {
var cur = self.data.restTime - 1
console.log(cur)
if (cur == 0) {
clearInterval(self.data.timer)
self.setData({
restTime: 120,
gotCode: false
})
}
self.setData({
restTime: cur
})
}, 1000)
}
},
function (code, data) {
console.log(data)
wx.showToast({
title: data.msg,
icon: 'none',
duration: 1500
})
} )
},
// 提交绑定手机
submitPhone: function () {
var self = this
app.restAjax.put(app.restAjax.path('{usercenterUrl}/app/user/updateminiappdefaultusername', [app.usercenterUrl]), {
phone: self.data.phone,
verificationCode: self.data.code
}, {
headers: {
token: self.data.token
}
}, function (code, data) {
console.log(data)
wx.setStorageSync('token', data.data);
wx.setStorageSync('isRandomUsername', 0)
clearInterval(self.data.timer)
self.setData({
showPhone: false,
restTime: 120
})
self.getUserInfo()
}, function (code, data) {
console.log(data)
})
},
// 验证码
inputCode: function (e) {
this.setData({
code: e.detail.value
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.isRandomName()
this.getToken()
},

View File

@ -3,10 +3,10 @@
</view>
<view class="page-container">
<view class="person">
<view class="user-avatar" bindtap="changeAvatar">
<image src="{{userAvatar}}"></image>
<view class="user-avatar" bindtap="changeAvatar" wx:if="{{userInfo.avatar}}">
<image src="{{usercenterUrl}}{{sourcePath}}{{userInfo.avatar}}"></image>
</view>
<view class="user-name">杜若无心</view>
<view class="user-name">{{userInfo.name}}</view>
</view>
<view class="main">
<view class="main-title">常用功能</view>
@ -23,13 +23,13 @@
<image src="../../images/my-collect.png"></image>
<view class="title">我的收藏</view>
</view>
<view class="main-box">
<view class="main-box" bindtap="toMyTeam">
<image src="../../images/share.png"></image>
<view class="title" bindtap="toMyTeam">我的志愿团队</view>
<view class="title">我的志愿团队</view>
</view>
<view class="main-box">
<view class="main-box" bindtap="toMyVolunteerActivity">
<image src="../../images/team.png"></image>
<view class="title" bindtap="toMyVolunteerActivity">我的志愿活动</view>
<view class="title">我的志愿活动</view>
</view>
<view class="main-box">
<image src="../../images/share.png"></image>
@ -41,4 +41,21 @@
</view>
</view>
</view>
</view>
<view class="set-phone" wx:if="{{randomName && showPhone}}">
<view class="set-phone-box">
<view class="tips">您还没有绑定手机号,请先绑定手机号</view>
<view class="phone-input">
<input placeholder="请输入手机号" bindinput="phoneNum" class="phone-input"></input>
</view>
<view class="code-input">
<input placeholder="请输入验证码" bindinput="inputCode"></input>
<view class="get-code" bindtap="testPhone" wx:if="{{!gotCode}}">获取验证码</view>
<view class="got-code" wx:else>{{restTime}}</view>
</view>
<view class="set-phone-btn-box">
<view class="set-phone-btn" bindtap="submitPhone">确认</view>
<view class="set-phone-btn" bindtap="cancelPhone">取消</view>
</view>
</view>
</view>

View File

@ -63,4 +63,83 @@
.title{
font-size: 28rpx;
color: #242424;
}
.set-phone{
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, .6);
z-index: 100;
}
.set-phone-box{
width: 96%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: #fff;
border-radius: 10rpx;
padding: 30rpx;
box-sizing: border-box;
}
.tips{
font-size: 28rpx;
color: #000;
}
.phone-input{
margin: 25rpx 0;
}
.code-input{
display: flex;
justify-content: space-between;
margin-bottom: 25rpx;
}
.code-input input{
width: 70%;
height: 55rpx;
border: 1px solid #dedede;
border-radius: 10rpx;
padding: 0 10rpx;
box-sizing: border-box;
font-size: 28rpx;
}
.phone-input input{
width: 100%;
height: 55rpx;
border: 1px solid #dedede;
border-radius: 10rpx;
padding: 0 10rpx;
box-sizing: border-box;
font-size: 28rpx;
}
.get-code, .got-code{
font-size: 28rpx;
background: rgba(159,21,18,.1);
color: #9F1512;
width: 28%;
line-height: 55rpx;
text-align: center;
border-radius: 10rpx;
}
.got-code{
background: #fff;
color: #4a4d52;
border: 1px solid #eaeaea;
}
.set-phone-btn-box{
display: flex;
justify-content: space-between;
}
.set-phone-btn{
width: 49%;
height: 65rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 28rpx;
color: #fff;
background: #9F1512;
border-radius: 10rpx;
}

View File

@ -16,10 +16,16 @@ Page({
newsList: []
},
venue: {
venueUrl: app.venueUrl
venueUrl: app.venueUrl,
venueList: []
},
activity: {
activityUrl: app.activityUrl
activityUrl: app.activityUrl,
activityList: []
},
live: {
liveUrl: app.liveUrl,
liveList: []
}
},
doLogin: function () {
@ -60,17 +66,31 @@ Page({
app.dialog.msg(data.msg);
});
},
doGetVenue: function() {
app.restAjax.get(app.restAjax.path('', []), {
doGetVenueList: function() {
var self = this;
app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesinfo/listpagevenuesinforelease', [self.data.venue.venueUrl]), {
page: 1,
rows: 3
}, null, function(code, data) {
self.setData({
'venue.venueList': data.rows
});
}, function(code, data) {
app.dialog.msg(data.msg);
});
},
doGetActivity: function() {
doGetActivityList: function() {
var self = this;
app.restAjax.get(app.restAjax.path('{activityUrl}/app/activitylibrary/listpageactivitylibraryrelease', [self.data.activity.activityUrl]), {
page: 1,
rows: 3
}, null, function(code, data) {
self.setData({
'activity.activityList': data.rows
});
}, function(code, data) {
app.dialog.msg(data.msg);
});
},
doGetNewsList: function() {
var self = this;
@ -85,6 +105,19 @@ Page({
app.dialog.msg(data.msg);
});
},
doGetLiveList: function() {
var self = this;
app.restAjax.get(app.restAjax.path('{liveUrl}/app/liveplan/listpageliveplanrelease', [self.data.live.liveUrl]), {
page: 1,
rows: 4
}, null, function(code, data) {
self.setData({
'live.liveList': data.rows
})
}, function(code, data) {
app.dialog.msg(data.msg);
});
},
goNewsDetail: function () {
wx.navigateTo({
url: '../newsDetail/newsDetail',
@ -133,6 +166,9 @@ Page({
self.doLogin();
self.doGetLibrary();
self.doGetNewsList();
self.doGetLiveList();
self.doGetVenueList();
self.doGetActivityList();
},
/**

View File

@ -36,20 +36,11 @@
</view>
</view>
<view class="recommend-container">
<view class="recommend-box">
<image src="../../images/center-bg.png"></image>
<view class="recommend-box" wx:for="{{venue.venueList}}" wx:for-index="index" wx:for-item="item" wx:key="venueList">
<image src="{{venue.venueUrl}}/route/file/downloadfile/true/{{item.venuePanorama}}"></image>
</view>
<view class="recommend-box">
<image src="../../images/center-bg.png"></image>
</view>
<view class="recommend-box">
<image src="../../images/center-bg.png"></image>
</view>
<view class="recommend-box">
<image src="../../images/center-bg.png"></image>
</view>
<view class="recommend-box">
<image src="../../images/center-bg.png"></image>
<view class="recommend-box" wx:for="{{activity.activityList}}" wx:for-index="index" wx:for-item="item" wx:key="activityList">
<image src="{{activity.activityUrl}}/route/file/downloadfile/true/{{item.activityImage}}"></image>
</view>
</view>
</view>
@ -124,14 +115,9 @@
</view>
</view>
<view class="broadcast-container">
<view class="broadcast-box" bindtap="goBroadcastDetail">
<image src="../../images/center-bg.png"></image>
</view>
<view class="broadcast-box" bindtap="goBroadcastDetail">
<image src="../../images/center-bg.png"></image>
</view>
<view class="broadcast-box" bindtap="goBroadcastDetail">
<image src="../../images/center-bg.png"></image>
<view class="broadcast-box" bindtap="goBroadcastDetail" wx:for="{{live.liveList}}" wx:for-index="index" wx:for-item="item" wx:key="liveList">
<image src="{{live.liveUrl}}/route/file/downloadfile/true/{{item.livePlanPhoto}}"></image>
<view class="broadcast-text">文字</view>
</view>
</view>
</view>

View File

@ -128,8 +128,22 @@
overflow: hidden;
height: 185rpx;
margin-bottom: 15rpx;
position: relative;
}
.broadcast-box image{
width: 100%;
height: 100%;
}
.broadcast-text{
position: absolute;
left: 0;
right: 0;
bottom: 0;
padding: 5rpx 10rpx;
font-size: 26rpx;
background: rgba(0,0,0,0.6);
color: #fff;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

View File

@ -1,13 +1,13 @@
// pages/volunteer/volunteer.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
baseUrl: 'http://192.168.0.111:8888/volunteer/',
token: '',
otherTeamMap: {},
dataMap: {},
type: '1',
teamId: '',
@ -31,33 +31,53 @@ Page({
url: '../newTeam/newTeam',
})
},
goDetail: function (e) {
var id = e.currentTarget.dataset.id;
wx.navigateTo({
url: '../serviceActivityDetail/serviceActivityDetail?id=' + id
})
},
newActivity: function () {
wx.navigateTo({
url: '../newVolunteerActivity/newVolunteerActivity',
})
},
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');
// 我发起的活动
self.myActivity(app.volunteerUrl + 'wxminiapp/volunteerservice/listpagevolunteerservice');
}else {
self.otherTeam(self.data.baseUrl + 'wxminiapp/team/myjointeam?myTeam=true');
// 我参加的活动
self.myActivity(app.volunteerUrl + 'wxminiapp/volunteerservice/listpagemyjoinservice');
}
},
otherTeam: function(url) {
myActivity: function(url) {
var self = this;
wx.request({
url: url,
header: {
token: self.data.token
},
success(res) {
if('200' == res.statusCode) {
app.restAjax.get(app.restAjax.path(url, []),
{}, {
headers: {
token: self.data.token
}
}, function(code, data) {
if('200' == code) {
for(var item of data.rows) {
if('' != item.photo) {
var photoArr = item.photo.split(",");
item.photo = app.volunteerUrl + 'route/file/downloadfile/true/' + photoArr[0];
}
}
self.setData({
otherTeamMap: res.data.rows
dataMap: data.rows
})
}
console.log(res)
console.log(self.data.otherTeamMap)
}
}, function(code, data) {
app.dialog.msg(data.msg);
}, function() {
})
},
/**
@ -73,45 +93,42 @@ Page({
var methodType;
var title;
if('1' == self.data.type) {
url = self.data.baseUrl + 'wxminiapp/teammember/saveteammember'
url = app.volunteerUrl + 'wxminiapp/teammember/saveteammember'
teamMemberVO = {
teamId: e.currentTarget.dataset.teamid
}
methodType = 'POST'
methodType = app.restAjax.post
title = '申请成功!'
}else {
url = self.data.baseUrl + 'wxminiapp/teammember/quitTeam/' + self.data.teamId
methodType = 'GET'
url = app.volunteerUrl + 'wxminiapp/teammember/quitTeam/' + self.data.teamId
methodType = app.restAjax.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
})
methodType(app.restAjax.path(url, []),
teamMemberVO, {
headers: {
token: self.data.token
}
}, function(code, data) {
if('200' == code) {
app.dialog.msg(title);
wx.navigateTo({
url: '../volunteer/volunteer',
})
}
}
}, function(code, data) {
app.dialog.msg(data.msg);
}, function() {
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var self = this;
this.getToken().then(result => {
this.otherTeam(self.data.baseUrl + 'wxminiapp/team/otherteamm?otherTeam=true');
this.myActivity(app.volunteerUrl + 'wxminiapp/volunteerservice/listpagevolunteerservice');
})
},

View File

@ -1,30 +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 class="volunteer-activity">
<view class="activity">
<view class="activity-box" bindtap="goDetail" data-id="{{item.volunteerServiceId}}" wx:for="{{dataMap}}">
<view class="activity-img">
<image src="{{item.photo}}"></image>
</view>
<view class="activity-info">
<view class="title">
<view class="activity-title">{{item.serviceName}}</view>
</view>
<view class="date">{{item.startTime}}至{{item.endTime}}</view>
</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 class="new-team-btn" bindtap="newActivity">发起新活动</view>
</view>

View File

@ -91,4 +91,47 @@
color: #fff;
background: #9F1512;
border-radius: 10rpx;
}
.volunteer-activity{
margin-top: 90rpx;
padding: 0 30rpx;
margin-bottom: 105rpx;
}
.activity{
padding: 20rpx 30rpx 0;
}
.activity-box{
margin-bottom: 20rpx;
box-shadow:0px 0px 17rpx 0px rgba(0,0,0,0.1);
border-radius: 10rpx;
overflow: hidden;
}
.activity-img{
height: 320rpx;
position: relative;
}
.activity-img image{
width: 100%;
height: 100%;
}
.activity-info{
padding: 15rpx 20rpx;
}
.title{
display: flex;
justify-content: space-between;
}
.activity-title{
width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 30rpx;
color: #242424;
line-height: 40rpx;
}
.date{
margin-top: 10rpx;
font-size: 22rpx;
color: #242424;
}

View File

@ -1,11 +1,11 @@
// pages/volunteer/volunteer.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
baseUrl: 'http://192.168.0.111:8888/volunteer/',
token: '',
otherTeamMap: {},
type: '1',
@ -31,33 +31,23 @@ Page({
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) {
app.restAjax.get(app.restAjax.path(url, []),
{}, {
headers: {
token: self.data.token
}
}, function(code, data) {
if('200' == code) {
self.setData({
otherTeamMap: res.data.rows
otherTeamMap: data.rows
})
}
console.log(res)
console.log(self.data.otherTeamMap)
}
}, function(code, data) {
app.dialog.msg(data.msg);
}, function() {
})
},
/**
@ -73,45 +63,42 @@ Page({
var methodType;
var title;
if('1' == self.data.type) {
url = self.data.baseUrl + 'wxminiapp/teammember/saveteammember'
url = app.volunteerUrl + 'wxminiapp/teammember/saveteammember'
teamMemberVO = {
teamId: e.currentTarget.dataset.teamid
}
methodType = 'POST'
methodType = app.restAjax.post
title = '申请成功!'
}else {
url = self.data.baseUrl + 'wxminiapp/teammember/quitTeam/' + self.data.teamId
methodType = 'GET'
url = app.volunteerUrl + 'wxminiapp/teammember/quitTeam/' + self.data.teamId
methodType = app.restAjax.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
})
methodType(app.restAjax.path(url, []),
teamMemberVO, {
headers: {
token: self.data.token
}
}, function(code, data) {
if('200' == code) {
app.dialog.msg(title);
wx.navigateTo({
url: '../volunteer/volunteer',
})
}
}
}, function(code, data) {
app.dialog.msg(data.msg);
}, function() {
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var self = this;
this.getToken().then(result => {
this.otherTeam(self.data.baseUrl + 'wxminiapp/team/otherteamm?otherTeam=true');
this.otherTeam(app.volunteerUrl + 'wxminiapp/team/myteamm');
})
},

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -1,15 +1,3 @@
<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">
@ -24,7 +12,4 @@
<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>

View File

@ -39,9 +39,7 @@
right: 100rpx;
}
.team{
margin-top: 90rpx;
padding: 0 30rpx;
margin-bottom: 110rpx;
}
.team-box{
padding: 20rpx 0;

View File

@ -1,11 +1,11 @@
// pages/newTeam/newTeam.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
baseUrl: 'http://192.168.0.111:8888/volunteer/',
isAgree: false, // 是否同意志愿者注册协议
index: 0,
array: ['区域1','区域2','区域3','区域4'],
@ -63,26 +63,24 @@ Page({
wx.chooseImage({
success (res) {
const tempFilePaths = res.tempFilePaths
wx.uploadFile({
url: self.data.baseUrl + 'app/file/uploadimage',
filePath: tempFilePaths[0],
name: 'image',
header: {
'token': self.data.token
},
formData: {
'image': tempFilePaths[0]
},
success (res){
var data = res.data.substr(9, res.data.length);
data = data.substr(0, data.length - 2);
self.setData({
photo: data
})
},
fail: function(res) {
console.log(res)
}
console.log(tempFilePaths)
app.restAjax.file(app.restAjax.path(app.volunteerUrl + 'app/file/uploadimage', []), tempFilePaths[0],
'image', {
headers: {
token: self.data.token
}
}, function(code, data) {
if('200' == code) {
var data = data.substr(9, data.length);
data = data.substr(0, data.length - 2);
self.setData({
photo: data
})
}
}, function(code, data) {
app.dialog.msg(data.msg)
}, function() {
})
}
})
@ -186,27 +184,22 @@ Page({
self.data.teamArea[self.data.teamAreaIndex].dictionaryId :
'',
};
wx.request({
url: self.data.baseUrl + 'wxminiapp/team/saveteam',
method: 'POST',
header: {
'token': self.data.token
},
data: teamVO,
success(res) {
if(res.statusCode == 200) {
wx.showToast({
title: '注册成功!',
icon: 'none',
duration: 1500
})
app.restAjax.post(app.restAjax.path(app.volunteerUrl + 'wxminiapp/team/saveteam', []),
teamVO, {
headers: {
'token': self.data.token
}
}, function(code, data) {
if('200' == code) {
app.dialog.msg('注册成功')
wx.navigateTo({
url: '../volunteer/volunteer',
})
}else {
console.log('登陆失败!' + res.errMsg);
}
}
}, function(code, data) {
app.dialog.msg(data.msg)
}, function() {
})
},
/**
@ -215,16 +208,15 @@ Page({
getDataFromDict: function(dictId, type) {
var self = this;
return new Promise(resolve => {
wx.request({
url: self.data.baseUrl + 'app/datadictionary/listdictionarybyparentid/' + dictId,
header: {
'token': self.data.token
},
success: function(res) {
if('200' == res.statusCode) {
if(res.data || type === 2) {
var array = [];
for(var item of res.data) {
app.restAjax.get(app.restAjax.path(app.volunteerUrl + 'app/datadictionary/listdictionarybyparentid/' + dictId, []),
{}, {
headers: {
token: self.data.token
}
}, function(code, data) {
if('200' == code) {
var array = [];
for(var item of data) {
delete item.dictionaryParentId;
delete item.dictionaryParentName;
delete item.dictionarySummary;
@ -240,11 +232,13 @@ Page({
})
}
self.setData({
tempObj: res.data
tempObj: data
})
}
return resolve();
}
return resolve();
}, function() {
}, function() {
})
})
},

View File

@ -1,4 +1,5 @@
// pages/newVolunteerActivity/newVolunteerActivity.js
var app = getApp();
var util = require('../../utils/util.js');
Page({
@ -6,7 +7,6 @@ Page({
* 页面的初始数据
*/
data: {
baseUrl: 'http://192.168.0.111:8888/volunteer/',
token: '',
startDate: '',
endDate: '',
@ -89,26 +89,23 @@ Page({
wx.chooseImage({
success (res) {
const tempFilePaths = res.tempFilePaths
wx.uploadFile({
url: self.data.baseUrl + 'app/file/uploadimage',
filePath: tempFilePaths[0],
name: 'image',
header: {
'token': self.data.token
},
formData: {
'image': tempFilePaths[0]
},
success (res){
var data = res.data.substr(9, res.data.length);
data = data.substr(0, data.length - 2);
self.setData({
photo: data
})
},
fail: function(res) {
console.log(res)
}
app.restAjax.file(app.restAjax.path(app.volunteerUrl + 'app/file/uploadimage', []), tempFilePaths[0],
'image', {
headers: {
token: self.data.token
}
}, function(code, data) {
if('200' == code) {
var data = data.substr(9, data.length);
data = data.substr(0, data.length - 2);
self.setData({
photo: data
})
}
}, function(code, data) {
app.dialog.msg(data.msg)
}, function() {
})
}
})
@ -163,7 +160,6 @@ Page({
})
return false;
}
console.log(self.data.startDate)
var volunteerServiceVO = {
serviceName: self.data.serviceName,
serviceContent: self.data.serviceContent,
@ -179,27 +175,22 @@ Page({
photo: self.data.photo,
serviceRequirement: self.data.serviceRequirement
};
wx.request({
url: self.data.baseUrl + 'wxminiapp/volunteerservice/savevolunteerservice',
method: 'POST',
header: {
'token': self.data.token
},
data: volunteerServiceVO,
success(res) {
if(res.statusCode == 200) {
wx.showToast({
title: '活动发布成功!',
icon: 'none',
duration: 1500
})
app.restAjax.post(app.restAjax.path(app.volunteerUrl + 'wxminiapp/volunteerservice/savevolunteerservice', []),
volunteerServiceVO, {
headers: {
'token': self.data.token
}
}, function(code, data) {
if('200' == code) {
app.dialog.msg('活动发布成功!');
wx.navigateTo({
url: '../volunteer/volunteer',
})
}else {
console.log('登陆失败!' + res.errMsg);
}
}
}, function(code, data) {
app.dialog.msg(data.msg);
}, function() {
})
},
/**

View File

@ -1,7 +1,6 @@
// pages/newsList/newsList.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/

View File

@ -1,5 +1,6 @@
{
"usingComponents": {},
"enablePullDownRefresh": true,
"backgroundTextStyle": "dark",
"onReachBottomDistance": 50
}

View File

@ -31,4 +31,19 @@
width: 30%;
height: 150rpx;
margin-right: 20rpx;
}
.transverse-news{
flex-direction: row;
justify-content: space-between;
}
.news-row-img{
width: 30%;
height: 150rpx;
}
.news-row-img image{
width: 100%;
height: 100%;
}
.news-row-info{
width: 68%;
}

View File

@ -1,12 +1,11 @@
// pages/activityDetail/activityDetail.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
baseUrl: 'http://192.168.0.111:8888/volunteer/',
imgUrl: 'http://192.168.0.111:8888/volunteer/route/file/downloadfile/true/',
dataMap: {},
token: '',
serviceId: '',
@ -33,19 +32,22 @@ Page({
},
getDetail: function(id) {
var self = this;
wx.request({
url: self.data.baseUrl + 'wxminiapp/volunteerservice/getvolunteerservicebyid/' + id,
header: {
app.restAjax.get(app.restAjax.path(app.volunteerUrl + 'wxminiapp/volunteerservice/getvolunteerservicebyid/' + id, []),
{}, {
headers: {
'token': self.data.token
},
success: function(res) {
if('200' == res.statusCode) {
res.data.photo = self.data.imgUrl + res.data.photo;
}
}, function(code, data) {
if('200' == code) {
data.photo = app.volunteerUrl + 'route/file/downloadfile/true/' + data.photo;
self.setData({
dataMap: res.data
dataMap: data
})
}
}
}, function() {
}, function() {
})
},
/**
@ -128,25 +130,22 @@ Page({
*/
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
})
app.restAjax.post(app.restAjax.path(app.volunteerUrl + 'wxminiapp/servicemember/saveservicemember', []),
serviceMemberVO, {
headers: {
token: self.data.token
}
}, function(code, data) {
if('200' == code) {
app.dialog.msg('注册成功!');
wx.navigateTo({
url: '../volunteer/volunteer',
})
}
}
}, function() {
}, function() {
})
},
/**
@ -156,30 +155,26 @@ Page({
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;
url = app.volunteerUrl + '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';
url = app.volunteerUrl + 'wxminiapp/servicemember/cancelapply/'+ self.data.type +'/'+ self.data.serviceId +'/null';
}
wx.request({
url: url,
header: {
app.restAjax.get(app.restAjax.path(url, []), {}, {
headers: {
token: self.data.token
},
success(res) {
if(res.statusCode == 200) {
wx.showToast({
title: '取消报名成功!',
icon: 'none',
duration: 1500
})
}
}, function(code, data) {
if('200' == code) {
app.dialog.msg('取消报名成功!');
wx.navigateTo({
url: '../volunteer/volunteer',
})
}
},
fail(res) {
}
}, function() {
}, function() {
})
},
/**
@ -187,15 +182,16 @@ Page({
*/
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) {
console.log(self.data.token)
app.restAjax.get(app.restAjax.path(app.volunteerUrl + 'wxminiapp/team/myteamm', []),
{}, {
headers: {
token: self.data.token
}
}, function(code, data) {
if('200' == code) {
var array = [];
for(var item of res.data.rows) {
for(var item of data.rows) {
delete item.teamArea;
delete item.teamAreaDictionaryName;
delete item.teamWatchword;
@ -219,10 +215,13 @@ Page({
}
self.setData({
teamArray: array,
team: res.data.rows
team: data.rows
})
}
}
}, function(code, data) {
app.dialog.msg(data.msg);
}, function() {
})
},
/**

View File

@ -0,0 +1,66 @@
// pages/teamDetail/teamDetail.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,68 @@
<view class="team">
<view class="team-info">
<view class="row">
<view class="title">团队名称:</view>
<view class="content">团队名称</view>
</view>
<view class="row">
<view class="title">团队人数:</view>
<view class="content">1</view>
</view>
<view class="row">
<view class="title">所属区域:</view>
<view class="content">所属区域</view>
</view>
<view class="row">
<view class="title">团队介绍:</view>
<view class="content intro">团队介绍</view>
</view>
</view>
<view class="team-member">
<view class="member-title">团队成员</view>
<view class="member-box">
<view class="member-avatar">
<image src="../../images/avatar.png"></image>
</view>
<view class="member-info">
<view class="name">名字<text class="post">队长</text></view>
<view class="join-time">加入时间2020-02-02</view>
</view>
</view>
<view class="member-box">
<view class="member-avatar">
<image src="../../images/avatar.png"></image>
</view>
<view class="member-info">
<view class="name">名字<text class="post">队长</text></view>
<view class="join-time">加入时间2020-02-02</view>
</view>
</view>
<view class="member-box">
<view class="member-avatar">
<image src="../../images/avatar.png"></image>
</view>
<view class="member-info">
<view class="name">名字<text class="post">队长</text></view>
<view class="join-time">加入时间2020-02-02</view>
</view>
</view>
</view>
<view class="team-member">
<view class="member-title">申请人员</view>
<view class="member-box">
<view class="member-avatar">
<image src="../../images/avatar.png"></image>
</view>
<view class="member-info">
<view class="name apply-member">
<view class="name-box">名字</view>
<view class="btn">
<view class="agree">通过</view>
<view class="refuse">拒绝</view>
</view>
</view>
<view class="join-time">加入时间2020-02-02</view>
</view>
</view>
</view>
</view>

View File

@ -0,0 +1,83 @@
.team{
padding: 30rpx;
}
.team-info{
margin-bottom: 20rpx;
}
.row{
display: flex;
justify-content: space-between;
}
.title{
width: 23%;
font-size: 28rpx;
line-height: 65rpx;
}
.content{
width: 75%;
line-height: 65rpx;
font-size: 28rpx;
border-bottom: 1px solid #DEDEDE;
}
.intro{
min-height: 200rpx;
}
.team-member{
margin-top: 20rpx;
}
.member-title{
font-size: 30rpx;
color: #000;
padding-left: 25rpx;
border-left: 10rpx solid #9F1512;
margin-bottom: 20rpx;
}
.member-box{
display: flex;
justify-content: space-between;
padding: 10rpx 0;
border-bottom: 1px solid #DEDEDE;
}
.member-avatar{
width: 15%;
}
.member-avatar image{
width: 100%;
height: 90rpx;
}
.member-info{
width: 83%;
}
.name{
font-size: 30rpx;
margin: 20rpx 0;
}
.post{
display: inline-block;
background: rgba(159,21,18,.1);
color: #9F1512;
padding: 0 10rpx;
margin-left: 15rpx;
}
.join-time{
font-size: 28rpx;
color: #949494;
}
.apply-member, .btn{
display: flex;
justify-content: space-between;
}
.agree, .refuse{
padding: 0 10rpx;
background: rgba(159,21,18,.1);
color: #9F1512;
}
.refuse{
margin-left: 15rpx;
}
.name-box{
width: 60%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

View File

@ -4,6 +4,7 @@
left: 0;
right: 0;
padding: 0 30rpx;
background: #fff;
}
.fixed-tab{
padding: 30rpx 0;

View File

@ -50,4 +50,7 @@
<view class="intro-title">场馆简介:</view>
<!-- <view class="intro-content"></view> -->
<rich-text nodes="{{venuesDetail.venueDescription}}"></rich-text>
</view>
<view class="book-btn">
<view class="btn">预定</view>
</view>

View File

@ -86,6 +86,7 @@
}
.venue-intro{
padding: 0 20rpx 20rpx;
margin-bottom: 110rpx;
}
.intro-title{
font-size: 30rpx;
@ -95,4 +96,22 @@
.intro-content{
font-size: 28rpx;
color: #000;
}
.book-btn{
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: 15rpx 30rpx;
background: #fff;
}
.btn{
height: 80rpx;
background: #9F1512;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: 30rpx;
border-radius: 10rpx;
}

View File

@ -1,4 +1,5 @@
// pages/volunteer/volunteer.js
var app = getApp();
Page({
/**
@ -7,8 +8,6 @@ Page({
data: {
indicatorDots: true,
autoplay: true,
baseUrl: 'http://192.168.0.111:8888/volunteer/',
imgUrl: 'http://192.168.0.111:8888/volunteer/route/file/downloadfile/true/',
serviceMap: []
},
goDetail: function (e) {
@ -37,22 +36,24 @@ Page({
*/
activityList: function() {
var self = this;
wx.request({
url: self.data.baseUrl + 'wxminiapp/volunteerservice/listpagevolunteerservicerelease',
success: function(res) {
if('200' == res.statusCode) {
app.restAjax.get(app.restAjax.path(app.volunteerUrl + 'wxminiapp/volunteerservice/listpagevolunteerservicerelease', []),
{}, null, function(code, data) {
if('200' == code) {
// 将活动照片,拼接为可访问地址
for(var item of res.data.rows) {
for(var item of data.rows) {
if('' != item.photo) {
var photoArr = item.photo.split(",");
item.photo = self.data.imgUrl + photoArr[0];
item.photo = app.volunteerUrl + 'route/file/downloadfile/true/' + photoArr[0];
}
}
self.setData({
serviceMap: res.data.rows
serviceMap: data.rows
})
}
}
}, function() {
}, function() {
})
},
/**

View File

@ -1,11 +1,11 @@
// pages/volunteerRegister/volunteerRegister.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
baseUrl: 'http://192.168.0.111:8888/volunteer/',
token: '',
isAgree: false, // 是否同意志愿者注册协议
openExperience: 0,
@ -103,6 +103,12 @@ Page({
}
})
},
areaChange: function(e) {
var self = this;
self.setData({
teamAreaIndex: e.detail.value
})
},
changeOpen: function(e) {
if(e.detail.value == ''){
this.setData({
@ -197,27 +203,22 @@ Page({
agree: self.data.isAgree,
openExperience : self.data.openExperience
};
wx.request({
url: self.data.baseUrl + 'wxminiapp/volunteer/savevolunteer',
method: 'POST',
header: {
'token': self.data.token
},
data: volunteerVO,
success(res) {
if(res.statusCode == 200) {
wx.showToast({
title: '注册成功!',
icon: 'none',
duration: 1500
})
app.restAjax.post(app.restAjax.path(app.volunteerUrl + 'wxminiapp/volunteer/savevolunteer', []),
volunteerVO, {
headers: {
'token': self.data.token
}
}, function(code, data) {
if('200' == code) {
app.dialog.msg('注册成功!');
wx.navigateTo({
url: '../volunteer/volunteer',
})
}else {
console.log('登陆失败!' + res.errMsg);
}
}
}, function(code, data) {
app.dialog.msg(data.msg);
}, function() {
})
},
/**
@ -226,16 +227,16 @@ Page({
getDataFromDict: function(dictId, type) {
var self = this;
return new Promise(resolve => {
wx.request({
url: self.data.baseUrl + 'app/datadictionary/listdictionarybyparentid/' + dictId,
header: {
'token': self.data.token
},
success: function(res) {
if('200' == res.statusCode) {
if(res.data || type === 2) {
app.restAjax.get(app.restAjax.path(app.volunteerUrl + 'app/datadictionary/listdictionarybyparentid/' + dictId, []),
{}, {
headers: {
'token': self.data.token
}
}, function(code, data) {
if('200' == code) {
if(data || type === 2) {
var array = [];
for(var item of res.data) {
for(var item of data) {
delete item.dictionaryParentId;
delete item.dictionaryParentName;
delete item.dictionarySummary;
@ -251,11 +252,14 @@ Page({
})
}
self.setData({
tempObj: res.data
tempObj: data
})
}
return resolve();
}
return resolve();
}, function() {
}, function() {
})
})
},

View File

@ -40,7 +40,7 @@
<view class="info-name">乡镇村:</view>
<view class="info-text">
<view class="section">
<picker bindchange="countyChange" value="{{teamAreaIndex}}" range="{{teamAreaArray}}">
<picker bindchange="areaChange" value="{{teamAreaIndex}}" range="{{teamAreaArray}}">
<view class="picker">
{{teamAreaArray[teamAreaIndex]}}
</view>

View File

@ -1,11 +1,11 @@
// pages/volunteer/volunteer.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
baseUrl: 'http://192.168.0.111:8888/volunteer/',
token: '',
otherTeamMap: {},
type: '1',
@ -37,27 +37,28 @@ Page({
type: e.currentTarget.dataset.type
})
if(self.data.type === '1') {
self.otherTeam(self.data.baseUrl + 'wxminiapp/team/otherteamm?otherTeam=true');
self.otherTeam(app.volunteerUrl + 'wxminiapp/team/otherteamm?otherTeam=true');
}else {
self.otherTeam(self.data.baseUrl + 'wxminiapp/team/myjointeam?myTeam=true');
self.otherTeam(app.volunteerUrl + '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) {
app.restAjax.get(app.restAjax.path(url, []),
{}, {
headers: {
token: self.data.token
}
}, function(code, data) {
if('200' == code) {
self.setData({
otherTeamMap: res.data.rows
otherTeamMap: data.rows
})
}
console.log(res)
console.log(self.data.otherTeamMap)
}
}, function(code, data) {
app.dialog.msg(data.msg);
}, function() {
})
},
/**
@ -73,45 +74,42 @@ Page({
var methodType;
var title;
if('1' == self.data.type) {
url = self.data.baseUrl + 'wxminiapp/teammember/saveteammember'
url = app.volunteerUrl + 'wxminiapp/teammember/saveteammember'
teamMemberVO = {
teamId: e.currentTarget.dataset.teamid
}
methodType = 'POST'
methodType = app.restAjax.post
title = '申请成功!'
}else {
url = self.data.baseUrl + 'wxminiapp/teammember/quitTeam/' + self.data.teamId
methodType = 'GET'
url = app.volunteerUrl + 'wxminiapp/teammember/quitTeam/' + self.data.teamId
methodType = app.restAjax.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
})
methodType(app.restAjax.path(url, []),
teamMemberVO, {
headers: {
token: self.data.token
}
}, function(code, data) {
if('200' == code) {
app.dialog.msg(title);
wx.navigateTo({
url: '../volunteer/volunteer',
})
}
}
}, function(code, data) {
app.dialog.msg(data.msg);
}, function() {
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var self = this;
this.getToken().then(result => {
this.otherTeam(self.data.baseUrl + 'wxminiapp/team/otherteamm?otherTeam=true');
this.otherTeam(app.volunteerUrl + 'wxminiapp/team/otherteamm?otherTeam=true');
})
},