diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a60a8c6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/project.config.json diff --git a/app.js b/app.js index 458b692..ce64a40 100644 --- a/app.js +++ b/app.js @@ -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 () { diff --git a/app.json b/app.json index 6062cc6..397f712 100644 --- a/app.json +++ b/app.json @@ -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", diff --git a/images/delete.png b/images/delete.png new file mode 100644 index 0000000..63f7d52 Binary files /dev/null and b/images/delete.png differ diff --git a/pages/activity/activity.js b/pages/activity/activity.js index 201b727..75d3736 100644 --- a/pages/activity/activity.js +++ b/pages/activity/activity.js @@ -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() { + }) }, diff --git a/pages/activityDetail/activityDetail.js b/pages/activityDetail/activityDetail.js index f7e8732..115d24b 100644 --- a/pages/activityDetail/activityDetail.js +++ b/pages/activityDetail/activityDetail.js @@ -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() { + }) }, diff --git a/pages/activityDialog/activityDialog.js b/pages/activityDialog/activityDialog.js new file mode 100644 index 0000000..3c20d34 --- /dev/null +++ b/pages/activityDialog/activityDialog.js @@ -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 () { + + } +}) \ No newline at end of file diff --git a/pages/myVolunteerTeam/myVlounteerTeam.json b/pages/activityDialog/activityDialog.json similarity index 100% rename from pages/myVolunteerTeam/myVlounteerTeam.json rename to pages/activityDialog/activityDialog.json diff --git a/pages/activityDialog/activityDialog.wxml b/pages/activityDialog/activityDialog.wxml new file mode 100644 index 0000000..57a02dd --- /dev/null +++ b/pages/activityDialog/activityDialog.wxml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/activityDialog/activityDialog.wxss b/pages/activityDialog/activityDialog.wxss new file mode 100644 index 0000000..b01a43d --- /dev/null +++ b/pages/activityDialog/activityDialog.wxss @@ -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; +} \ No newline at end of file diff --git a/pages/book/book.js b/pages/book/book.js new file mode 100644 index 0000000..c6b9688 --- /dev/null +++ b/pages/book/book.js @@ -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 () { + + } +}) \ No newline at end of file diff --git a/pages/book/book.json b/pages/book/book.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/book/book.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/book/book.wxml b/pages/book/book.wxml new file mode 100644 index 0000000..0cbad2e --- /dev/null +++ b/pages/book/book.wxml @@ -0,0 +1,135 @@ + + + + 篮球 + + + + + 篮球 + + + + + 篮球 + + + + + 营业时间: + 暂无信息 + 项目描述: + 暂无信息 + 场地设置: + 暂无信息 + + + + 2020-01-01 + 2020-01-01 + 2020-01-01 + + + + + + + 场地1 + + + + + 场地1 + + + + + 场地1 + + + + + + + 2020-01-01 + 12:00-13:00 + 15元 + + + 2020-01-01 + 12:00-13:00 + 15元 + + + 2020-01-01 + 12:00-13:00 + 15元 + + + 2020-01-01 + 12:00-13:00 + 15元 + + + + + + 手机号: + + + + + + 验证码: + + + 获取验证码 + + + + + + 订单金额:10元 + + + 预定 + + + + + + 订单信息 + + + + 2020-01-01 + 12:00-13:00 + + + 场地1 + 15元 + + + + + 2020-01-01 + 12:00-13:00 + + + 场地1 + 15元 + + + + + 2020-01-01 + 12:00-13:00 + + + 场地1 + 15元 + + + + + \ No newline at end of file diff --git a/pages/book/book.wxss b/pages/book/book.wxss new file mode 100644 index 0000000..2332f35 --- /dev/null +++ b/pages/book/book.wxss @@ -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; +} \ No newline at end of file diff --git a/pages/broadcast/broadcast.js b/pages/broadcast/broadcast.js index 8c585dc..903814a 100644 --- a/pages/broadcast/broadcast.js +++ b/pages/broadcast/broadcast.js @@ -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); }, /** diff --git a/pages/broadcast/broadcast.json b/pages/broadcast/broadcast.json index 8835af0..09e623a 100644 --- a/pages/broadcast/broadcast.json +++ b/pages/broadcast/broadcast.json @@ -1,3 +1,5 @@ { - "usingComponents": {} + "usingComponents": {}, + "enablePullDownRefresh": true, + "backgroundTextStyle": "dark" } \ No newline at end of file diff --git a/pages/broadcast/broadcast.wxml b/pages/broadcast/broadcast.wxml index 01c2d47..d10391c 100644 --- a/pages/broadcast/broadcast.wxml +++ b/pages/broadcast/broadcast.wxml @@ -1,20 +1,12 @@ - + - + + 直播中 - 银保监会印发《关于加快推进意外险改直播标题 - 2020-02-02 14:00:00至2020-02-03 14:00:00 - - - - - - - - 银保监会印发《关于加快推进意外险改直播标题 - 2020-02-02 14:00:00至2020-02-03 14:00:00 + {{item.livePlanName}} + {{item.livePlanStart}}至{{item.livePlanEnd}} \ No newline at end of file diff --git a/pages/broadcast/broadcast.wxss b/pages/broadcast/broadcast.wxss index 73a739e..98d1160 100644 --- a/pages/broadcast/broadcast.wxss +++ b/pages/broadcast/broadcast.wxss @@ -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; } \ No newline at end of file diff --git a/pages/broadcastDetail/broadcastDetail.js b/pages/broadcastDetail/broadcastDetail.js index 0b51a9e..d5482bd 100644 --- a/pages/broadcastDetail/broadcastDetail.js +++ b/pages/broadcastDetail/broadcastDetail.js @@ -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() { diff --git a/pages/broadcastDetail/broadcastDetail.wxml b/pages/broadcastDetail/broadcastDetail.wxml index 8cb725c..387c2a6 100644 --- a/pages/broadcastDetail/broadcastDetail.wxml +++ b/pages/broadcastDetail/broadcastDetail.wxml @@ -1,35 +1,23 @@ - - - + + -银保监会印发《关于加快推进意外直播标题 +{{liveDetail.livePlanName}} - - - 开始时间: - 2020-02-03 14:00:00 - - - - 结束时间: - 2020-02-03 14:00:00 - + + + 开始时间: + {{liveDetail.livePlanStart}} + + + + 结束时间: + {{liveDetail.livePlanEnd}} + - 直播介绍 - 光拉便半运县写员二到院细天县见运命运感知争公着解全得律号深共权发市以家情军少先意单理样好族权达保很具你住红许气已第白知题候其然知王公众我头务族观经市指或七比生。适基历然题和低是局着先重信知议过说心龙素标安放大支入完二种设力果每角解收美约声里历美节办约管运但然新分活们心毛手过共点家或。革解快和特技县应精术被心走小器风育明油备己世国生往支因叫正心在备什新候流广这地。离克的却五北林越用变义按地界你值名证所局的况果被半去量片来参例形极别色部米老近和住例外七强可学变山意断群济。到报还省边速低起分力少族。 + 介绍 + {{liveDetail.livePlanRecord}} \ No newline at end of file diff --git a/pages/center/center.js b/pages/center/center.js index 343da48..de7bca9 100644 --- a/pages/center/center.js +++ b/pages/center/center.js @@ -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() }, diff --git a/pages/center/center.wxml b/pages/center/center.wxml index 82ae944..6f06c29 100644 --- a/pages/center/center.wxml +++ b/pages/center/center.wxml @@ -3,10 +3,10 @@ - - + + - 杜若无心 + {{userInfo.name}} 常用功能 @@ -23,13 +23,13 @@ 我的收藏 - + - 我的志愿团队 + 我的志愿团队 - + - 我的志愿活动 + 我的志愿活动 @@ -41,4 +41,21 @@ + + + + 您还没有绑定手机号,请先绑定手机号 + + + + + + 获取验证码 + {{restTime}} + + + 确认 + 取消 + + \ No newline at end of file diff --git a/pages/center/center.wxss b/pages/center/center.wxss index 6307e32..c4d5a4a 100644 --- a/pages/center/center.wxss +++ b/pages/center/center.wxss @@ -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; } \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index f72822e..1bc8e00 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -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(); }, /** diff --git a/pages/index/index.wxml b/pages/index/index.wxml index f589d84..21fceed 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -36,20 +36,11 @@ - - + + - - - - - - - - - - - + + @@ -124,14 +115,9 @@ - - - - - - - - + + + 文字 \ No newline at end of file diff --git a/pages/index/index.wxss b/pages/index/index.wxss index 0260508..e60de93 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -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; } \ No newline at end of file diff --git a/pages/myVolunteerActivity/myVolunteerActivity.js b/pages/myVolunteerActivity/myVolunteerActivity.js index 8f4575b..216845f 100644 --- a/pages/myVolunteerActivity/myVolunteerActivity.js +++ b/pages/myVolunteerActivity/myVolunteerActivity.js @@ -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'); }) }, diff --git a/pages/myVolunteerActivity/myVolunteerActivity.wxml b/pages/myVolunteerActivity/myVolunteerActivity.wxml index 7fb08c9..b018090 100644 --- a/pages/myVolunteerActivity/myVolunteerActivity.wxml +++ b/pages/myVolunteerActivity/myVolunteerActivity.wxml @@ -1,30 +1,30 @@ - 未参加 + 我发起 - 已参加 + 我参加 - - - - {{item.teamName}} - 申请加入 - 退出 - 待审核 - 退出 - 审核驳回 - 已退出 + + + + + + + + + {{item.serviceName}} + + {{item.startTime}}至{{item.endTime}} + - 团队口号:{{item.teamWatchword}} - 所属区域:{{item.teamCityDictionaryName}} {{item.teamCountyDictionaryName}} {{item.teamAreaDictionaryName}} - 创建新团队 + 发起新活动 \ No newline at end of file diff --git a/pages/myVolunteerActivity/myVolunteerActivity.wxss b/pages/myVolunteerActivity/myVolunteerActivity.wxss index 97bc150..b777244 100644 --- a/pages/myVolunteerActivity/myVolunteerActivity.wxss +++ b/pages/myVolunteerActivity/myVolunteerActivity.wxss @@ -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; } \ No newline at end of file diff --git a/pages/myVolunteerTeam/myVlounteerTeam.js b/pages/myVolunteerTeam/myVolunteerTeam.js similarity index 60% rename from pages/myVolunteerTeam/myVlounteerTeam.js rename to pages/myVolunteerTeam/myVolunteerTeam.js index 8f4575b..840cbc1 100644 --- a/pages/myVolunteerTeam/myVlounteerTeam.js +++ b/pages/myVolunteerTeam/myVolunteerTeam.js @@ -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'); }) }, diff --git a/pages/myVolunteerTeam/myVolunteerTeam.json b/pages/myVolunteerTeam/myVolunteerTeam.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/myVolunteerTeam/myVolunteerTeam.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/myVolunteerTeam/myVlounteerTeam.wxml b/pages/myVolunteerTeam/myVolunteerTeam.wxml similarity index 63% rename from pages/myVolunteerTeam/myVlounteerTeam.wxml rename to pages/myVolunteerTeam/myVolunteerTeam.wxml index 7fb08c9..38740fc 100644 --- a/pages/myVolunteerTeam/myVlounteerTeam.wxml +++ b/pages/myVolunteerTeam/myVolunteerTeam.wxml @@ -1,15 +1,3 @@ - - - - 未参加 - - - - - 已参加 - - - @@ -24,7 +12,4 @@ 团队口号:{{item.teamWatchword}} 所属区域:{{item.teamCityDictionaryName}} {{item.teamCountyDictionaryName}} {{item.teamAreaDictionaryName}} - - - 创建新团队 \ No newline at end of file diff --git a/pages/myVolunteerTeam/myVlounteerTeam.wxss b/pages/myVolunteerTeam/myVolunteerTeam.wxss similarity index 96% rename from pages/myVolunteerTeam/myVlounteerTeam.wxss rename to pages/myVolunteerTeam/myVolunteerTeam.wxss index 97bc150..29df066 100644 --- a/pages/myVolunteerTeam/myVlounteerTeam.wxss +++ b/pages/myVolunteerTeam/myVolunteerTeam.wxss @@ -39,9 +39,7 @@ right: 100rpx; } .team{ - margin-top: 90rpx; padding: 0 30rpx; - margin-bottom: 110rpx; } .team-box{ padding: 20rpx 0; diff --git a/pages/newTeam/newTeam.js b/pages/newTeam/newTeam.js index fb48765..8cea636 100644 --- a/pages/newTeam/newTeam.js +++ b/pages/newTeam/newTeam.js @@ -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() { + }) }) }, diff --git a/pages/newVolunteerActivity/newVolunteerActivity.js b/pages/newVolunteerActivity/newVolunteerActivity.js index 34d1463..03915af 100644 --- a/pages/newVolunteerActivity/newVolunteerActivity.js +++ b/pages/newVolunteerActivity/newVolunteerActivity.js @@ -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() { + }) }, /** diff --git a/pages/newsList/newsList.js b/pages/newsList/newsList.js index 1e10070..76803bd 100644 --- a/pages/newsList/newsList.js +++ b/pages/newsList/newsList.js @@ -1,7 +1,6 @@ // pages/newsList/newsList.js var app = getApp(); Page({ - /** * 页面的初始数据 */ diff --git a/pages/newsList/newsList.json b/pages/newsList/newsList.json index 2a7b263..8275159 100644 --- a/pages/newsList/newsList.json +++ b/pages/newsList/newsList.json @@ -1,5 +1,6 @@ { "usingComponents": {}, "enablePullDownRefresh": true, + "backgroundTextStyle": "dark", "onReachBottomDistance": 50 } \ No newline at end of file diff --git a/pages/newsList/newsList.wxss b/pages/newsList/newsList.wxss index 7e0ade1..c081a6d 100644 --- a/pages/newsList/newsList.wxss +++ b/pages/newsList/newsList.wxss @@ -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%; } \ No newline at end of file diff --git a/pages/serviceActivityDetail/serviceActivityDetail.js b/pages/serviceActivityDetail/serviceActivityDetail.js index cfa9a88..15f8aa8 100644 --- a/pages/serviceActivityDetail/serviceActivityDetail.js +++ b/pages/serviceActivityDetail/serviceActivityDetail.js @@ -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() { + }) }, /** diff --git a/pages/teamDetail/teamDetail.js b/pages/teamDetail/teamDetail.js new file mode 100644 index 0000000..aaf2ecc --- /dev/null +++ b/pages/teamDetail/teamDetail.js @@ -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 () { + + } +}) \ No newline at end of file diff --git a/pages/teamDetail/teamDetail.json b/pages/teamDetail/teamDetail.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/teamDetail/teamDetail.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/teamDetail/teamDetail.wxml b/pages/teamDetail/teamDetail.wxml new file mode 100644 index 0000000..7f28701 --- /dev/null +++ b/pages/teamDetail/teamDetail.wxml @@ -0,0 +1,68 @@ + + + + 团队名称: + 团队名称 + + + 团队人数: + 1 + + + 所属区域: + 所属区域 + + + 团队介绍: + 团队介绍 + + + + 团队成员 + + + + + + 名字队长 + 加入时间:2020-02-02 + + + + + + + + 名字队长 + 加入时间:2020-02-02 + + + + + + + + 名字队长 + 加入时间:2020-02-02 + + + + + 申请人员 + + + + + + + 名字 + + 通过 + 拒绝 + + + 加入时间:2020-02-02 + + + + \ No newline at end of file diff --git a/pages/teamDetail/teamDetail.wxss b/pages/teamDetail/teamDetail.wxss new file mode 100644 index 0000000..0443cd1 --- /dev/null +++ b/pages/teamDetail/teamDetail.wxss @@ -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; +} \ No newline at end of file diff --git a/pages/venue/venue.wxss b/pages/venue/venue.wxss index d692850..aa6ecd2 100644 --- a/pages/venue/venue.wxss +++ b/pages/venue/venue.wxss @@ -4,6 +4,7 @@ left: 0; right: 0; padding: 0 30rpx; + background: #fff; } .fixed-tab{ padding: 30rpx 0; diff --git a/pages/venueDetail/venueDetail.wxml b/pages/venueDetail/venueDetail.wxml index 9972306..537a765 100644 --- a/pages/venueDetail/venueDetail.wxml +++ b/pages/venueDetail/venueDetail.wxml @@ -50,4 +50,7 @@ 场馆简介: + + + 预定 \ No newline at end of file diff --git a/pages/venueDetail/venueDetail.wxss b/pages/venueDetail/venueDetail.wxss index ca0d6f6..5e7dcba 100644 --- a/pages/venueDetail/venueDetail.wxss +++ b/pages/venueDetail/venueDetail.wxss @@ -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; } \ No newline at end of file diff --git a/pages/volunteer/volunteer.js b/pages/volunteer/volunteer.js index e0f9843..5821d54 100644 --- a/pages/volunteer/volunteer.js +++ b/pages/volunteer/volunteer.js @@ -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() { + }) }, /** diff --git a/pages/volunteerRegister/volunteerRegister.js b/pages/volunteerRegister/volunteerRegister.js index d2d7878..beab318 100644 --- a/pages/volunteerRegister/volunteerRegister.js +++ b/pages/volunteerRegister/volunteerRegister.js @@ -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() { + }) }) }, diff --git a/pages/volunteerRegister/volunteerRegister.wxml b/pages/volunteerRegister/volunteerRegister.wxml index 7871737..7597413 100644 --- a/pages/volunteerRegister/volunteerRegister.wxml +++ b/pages/volunteerRegister/volunteerRegister.wxml @@ -40,7 +40,7 @@ 乡镇村: - + {{teamAreaArray[teamAreaIndex]}} diff --git a/pages/volunteerTeam/volunteerTeam.js b/pages/volunteerTeam/volunteerTeam.js index 8f4575b..032dbc8 100644 --- a/pages/volunteerTeam/volunteerTeam.js +++ b/pages/volunteerTeam/volunteerTeam.js @@ -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'); }) },