From 7269c492541605c099bb31f2d168b080d558bd1c Mon Sep 17 00:00:00 2001 From: dong_bo0602 <358256383@qq.com> Date: Fri, 26 Jun 2020 18:43:33 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E6=88=91=E7=9A=84=E3=80=81=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E6=97=A5=E5=BF=97=E3=80=81=E5=9B=A2=E9=98=9F=E8=AF=A6?= =?UTF-8?q?=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 4 +- images/delete.png | Bin 0 -> 497 bytes pages/activityDialog/activityDialog.js | 66 +++++++++ pages/activityDialog/activityDialog.json | 3 + pages/activityDialog/activityDialog.wxml | 32 +++++ pages/activityDialog/activityDialog.wxss | 42 ++++++ pages/center/center.js | 169 ++++++++++++++++++++++- pages/center/center.wxml | 23 ++- pages/center/center.wxss | 79 +++++++++++ pages/teamDetail/teamDetail.js | 66 +++++++++ pages/teamDetail/teamDetail.json | 3 + pages/teamDetail/teamDetail.wxml | 68 +++++++++ pages/teamDetail/teamDetail.wxss | 83 +++++++++++ pages/venue/venue.wxss | 1 + 14 files changed, 630 insertions(+), 9 deletions(-) create mode 100644 images/delete.png create mode 100644 pages/activityDialog/activityDialog.js create mode 100644 pages/activityDialog/activityDialog.json create mode 100644 pages/activityDialog/activityDialog.wxml create mode 100644 pages/activityDialog/activityDialog.wxss create mode 100644 pages/teamDetail/teamDetail.js create mode 100644 pages/teamDetail/teamDetail.json create mode 100644 pages/teamDetail/teamDetail.wxml create mode 100644 pages/teamDetail/teamDetail.wxss diff --git a/app.json b/app.json index 0b259bb..0a0e48a 100644 --- a/app.json +++ b/app.json @@ -1,7 +1,9 @@ { "pages": [ - "pages/center/center", "pages/index/index", + "pages/activityDialog/activityDialog", + "pages/teamDetail/teamDetail", + "pages/center/center", "pages/volunteerRegister/volunteerRegister", "pages/volunteer/volunteer", "pages/heritage/heritage", diff --git a/images/delete.png b/images/delete.png new file mode 100644 index 0000000000000000000000000000000000000000..63f7d52fb780a5dc4d6f6c67001def6fa56be7ed GIT binary patch literal 497 zcmV>Odp4-Gj!Vgpnvl^lR&BAV_6O+=RfZjCWd zagvJ#P%f9p(&_XafSEW>0lb7^IG@kwUw!tm0D>S`QPoo-IuFC}u$R+RDz&AmPAOxI z>1pfyd;^F`R#hjuIL{H$o~rHxsCu&U+BO=ETA@&=MFH*s%=skyqxBjyPelQa08F+8 za82hPU&cPBPJSMkdG`lE)QgCy`=+W3*4lv}+{qy#*Suinj{VlP2@`;*0`4d_o6V7W zy?#+F7T=w$BC?^XZ`Rs#_g*TMMl+errm8+O^VOf0Ktx$Q#8$cPrBQwu-^3io73WC6m*TLsl z=EiI9j2{V*C8Cwq+()!#j5+BG;B(+O2CzCv_HBD^n0c|A5ATnOh%6D&x~h)%2~tzl nGi&X2uYF#CK7;mcK6HQ&BAh}$?W7?700000NkvXXu0mjf)oa@2 literal 0 HcmV?d00001 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/activityDialog/activityDialog.json b/pages/activityDialog/activityDialog.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/activityDialog/activityDialog.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file 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/center/center.js b/pages/center/center.js index 343da48..3f7528a 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() }, }) }, @@ -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..22f06d1 100644 --- a/pages/center/center.wxml +++ b/pages/center/center.wxml @@ -3,10 +3,10 @@ - - + + - 杜若无心 + {{userInfo.name}} 常用功能 @@ -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/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; From 3cd7d19b77ed291afd7f7d5c87e38c8fc4a7f7fe Mon Sep 17 00:00:00 2001 From: Renpc-kilig <308442850@qq.com> Date: Fri, 26 Jun 2020 18:51:28 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/activity/activity.js | 21 ++-- pages/activityDetail/activityDetail.js | 19 ++-- pages/center/center.js | 2 +- pages/center/center.wxml | 8 +- .../myVolunteerActivity.js | 91 +++++++++------ .../myVolunteerActivity.wxml | 30 ++--- .../myVolunteerActivity.wxss | 43 +++++++ ...{myVlounteerTeam.js => myVolunteerTeam.js} | 75 ++++++------- ...lounteerTeam.json => myVolunteerTeam.json} | 0 ...lounteerTeam.wxml => myVolunteerTeam.wxml} | 15 --- ...lounteerTeam.wxss => myVolunteerTeam.wxss} | 2 - pages/newTeam/newTeam.js | 98 ++++++++-------- .../newVolunteerActivity.js | 69 +++++------- .../serviceActivityDetail.js | 105 +++++++++--------- pages/volunteer/volunteer.js | 21 ++-- pages/volunteerRegister/volunteerRegister.js | 64 ++++++----- .../volunteerRegister/volunteerRegister.wxml | 2 +- pages/volunteerTeam/volunteerTeam.js | 68 ++++++------ 18 files changed, 376 insertions(+), 357 deletions(-) rename pages/myVolunteerTeam/{myVlounteerTeam.js => myVolunteerTeam.js} (60%) rename pages/myVolunteerTeam/{myVlounteerTeam.json => myVolunteerTeam.json} (100%) rename pages/myVolunteerTeam/{myVlounteerTeam.wxml => myVolunteerTeam.wxml} (63%) rename pages/myVolunteerTeam/{myVlounteerTeam.wxss => myVolunteerTeam.wxss} (96%) 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/center/center.js b/pages/center/center.js index 9fca8ff..d49a43a 100644 --- a/pages/center/center.js +++ b/pages/center/center.js @@ -67,7 +67,7 @@ Page({ */ toMyTeam: function() { wx.navigateTo({ - url: '../myVlounteerTeam/myVlounteerTeam', + url: '../myVolunteerTeam/myVolunteerTeam', }) }, /** diff --git a/pages/center/center.wxml b/pages/center/center.wxml index 82ae944..e434ec7 100644 --- a/pages/center/center.wxml +++ b/pages/center/center.wxml @@ -23,13 +23,13 @@ 我的收藏 - + - 我的志愿团队 + 我的志愿团队 - + - 我的志愿活动 + 我的志愿活动 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/myVlounteerTeam.json b/pages/myVolunteerTeam/myVolunteerTeam.json similarity index 100% rename from pages/myVolunteerTeam/myVlounteerTeam.json rename to pages/myVolunteerTeam/myVolunteerTeam.json 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/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/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'); }) }, From 3cb1681230c934fc1dda7072f8e49125ec5d45f3 Mon Sep 17 00:00:00 2001 From: wenc000 <450292408@qq.com> Date: Fri, 26 Jun 2020 19:32:52 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E5=AE=8C=E5=96=84=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E3=80=81=E6=96=B0=E9=97=BB=EF=BC=8C=E7=9B=B4=E6=92=AD=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 2 +- app.json | 2 +- pages/broadcast/broadcast.js | 49 ++++++++++++++++++---- pages/broadcast/broadcast.json | 4 +- pages/broadcast/broadcast.wxml | 17 ++------ pages/broadcastDetail/broadcastDetail.js | 21 +++++++++- pages/broadcastDetail/broadcastDetail.wxml | 45 +++++++------------- pages/index/index.js | 18 ++++++++ pages/index/index.wxml | 10 +---- pages/newsList/newsList.js | 1 - pages/newsList/newsList.json | 1 + pages/newsList/newsList.wxss | 15 +++++++ 12 files changed, 122 insertions(+), 63 deletions(-) diff --git a/app.js b/app.js index 458b692..c1ab62f 100644 --- a/app.js +++ b/app.js @@ -9,7 +9,7 @@ App({ venueUrl: 'http://192.168.0.109:8082/venuebooking', 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 a3f277c..f5bb32b 100644 --- a/app.json +++ b/app.json @@ -3,6 +3,7 @@ "pages/index/index", "pages/activityDialog/activityDialog", "pages/teamDetail/teamDetail", + "pages/broadcast/broadcast", "pages/center/center", "pages/volunteerRegister/volunteerRegister", "pages/volunteer/volunteer", @@ -11,7 +12,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/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..4e0a051 100644 --- a/pages/broadcast/broadcast.wxml +++ b/pages/broadcast/broadcast.wxml @@ -1,20 +1,11 @@ - + - + - 银保监会印发《关于加快推进意外险改直播标题 - 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/broadcastDetail/broadcastDetail.js b/pages/broadcastDetail/broadcastDetail.js index 0b51a9e..df03ba5 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,21 @@ 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.data.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..96ab1a3 100644 --- a/pages/broadcastDetail/broadcastDetail.wxml +++ b/pages/broadcastDetail/broadcastDetail.wxml @@ -1,35 +1,22 @@ - - - + + + -银保监会印发《关于加快推进意外直播标题 +{{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/index/index.js b/pages/index/index.js index f72822e..c67720b 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -20,6 +20,10 @@ Page({ }, activity: { activityUrl: app.activityUrl + }, + live: { + liveUrl: app.liveUrl, + liveList: [] } }, doLogin: function () { @@ -85,6 +89,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 +150,7 @@ Page({ self.doLogin(); self.doGetLibrary(); self.doGetNewsList(); + self.doGetLiveList(); }, /** diff --git a/pages/index/index.wxml b/pages/index/index.wxml index f589d84..dbde2a7 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -124,14 +124,8 @@ - - - - - - - - + + \ No newline at end of file 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 From 96f941052c14deaa4b3ae41822aa4ffa883f014b Mon Sep 17 00:00:00 2001 From: wenc000 <450292408@qq.com> Date: Fri, 26 Jun 2020 19:32:52 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E5=AE=8C=E5=96=84=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 2 +- pages/index/index.js | 34 ++++++++++++++++++++++++++-------- pages/index/index.wxml | 17 ++++------------- 3 files changed, 31 insertions(+), 22 deletions(-) diff --git a/app.js b/app.js index c1ab62f..ce64a40 100644 --- a/app.js +++ b/app.js @@ -7,7 +7,7 @@ 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, diff --git a/pages/index/index.js b/pages/index/index.js index c67720b..1bc8e00 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -16,10 +16,12 @@ Page({ newsList: [] }, venue: { - venueUrl: app.venueUrl + venueUrl: app.venueUrl, + venueList: [] }, activity: { - activityUrl: app.activityUrl + activityUrl: app.activityUrl, + activityList: [] }, live: { liveUrl: app.liveUrl, @@ -64,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; @@ -151,6 +167,8 @@ Page({ self.doGetLibrary(); self.doGetNewsList(); self.doGetLiveList(); + self.doGetVenueList(); + self.doGetActivityList(); }, /** diff --git a/pages/index/index.wxml b/pages/index/index.wxml index dbde2a7..2163cd7 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -36,20 +36,11 @@ - - + + - - - - - - - - - - - + + From 6420cdb6ff5d17714e2bd39f2477a4eef5b66a2b Mon Sep 17 00:00:00 2001 From: wenc000 <450292408@qq.com> Date: Sat, 27 Jun 2020 12:04:54 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9appid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project.config.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/project.config.json b/project.config.json index c0536ba..b88d59a 100644 --- a/project.config.json +++ b/project.config.json @@ -6,16 +6,16 @@ "setting": { "urlCheck": false, "es6": true, + "enhance": false, "postcss": true, "preloadBackgroundData": false, "minified": true, "newFeature": true, - "autoAudits": false, "coverView": true, + "nodeModules": false, + "autoAudits": false, "showShadowRootInWxmlPanel": true, "scopeDataCheck": false, - "enhance": false, - "nodeModules": false, "uglifyFileName": false, "checkInvalidKey": true, "checkSiteMap": true, @@ -32,7 +32,7 @@ }, "compileType": "miniprogram", "libVersion": "2.11.1", - "appid": "wxb9c87f3dcf05852f", + "appid": "wxe17874894f7ff27b", "projectname": "xz_mini", "debugOptions": { "hidedInDevtools": [] From 275b8a575896a3f02fca45832719b043b6da5fa7 Mon Sep 17 00:00:00 2001 From: wenc000 <450292408@qq.com> Date: Sat, 27 Jun 2020 12:53:37 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E5=A4=84=E7=90=86=E7=9B=B4=E6=92=AD?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/broadcastDetail/broadcastDetail.js | 4 +++- pages/broadcastDetail/broadcastDetail.wxml | 5 +++-- project.config.json | 24 +++++++++++----------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/pages/broadcastDetail/broadcastDetail.js b/pages/broadcastDetail/broadcastDetail.js index df03ba5..d5482bd 100644 --- a/pages/broadcastDetail/broadcastDetail.js +++ b/pages/broadcastDetail/broadcastDetail.js @@ -30,7 +30,9 @@ Page({ 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.data.liveDetail = data; + self.setData({ + liveDetail: data + }); self.videoContext = wx.createLivePlayerContext('liveVideo'); self.videoContext.play(); }, function(code, data) { diff --git a/pages/broadcastDetail/broadcastDetail.wxml b/pages/broadcastDetail/broadcastDetail.wxml index 96ab1a3..387c2a6 100644 --- a/pages/broadcastDetail/broadcastDetail.wxml +++ b/pages/broadcastDetail/broadcastDetail.wxml @@ -1,7 +1,8 @@ - + + {{liveDetail.livePlanName}} diff --git a/project.config.json b/project.config.json index b88d59a..e0f70e6 100644 --- a/project.config.json +++ b/project.config.json @@ -5,30 +5,30 @@ }, "setting": { "urlCheck": false, + "scopeDataCheck": false, + "coverView": true, "es6": true, - "enhance": false, "postcss": true, + "compileHotReLoad": false, "preloadBackgroundData": false, "minified": true, - "newFeature": true, - "coverView": true, - "nodeModules": false, "autoAudits": false, - "showShadowRootInWxmlPanel": true, - "scopeDataCheck": false, + "newFeature": true, "uglifyFileName": false, + "uploadWithSourceMap": true, + "useIsolateContext": true, + "nodeModules": false, + "enhance": false, + "useCompilerModule": true, + "userConfirmedUseCompilerModuleSwitch": false, + "showShadowRootInWxmlPanel": true, "checkInvalidKey": true, "checkSiteMap": true, - "uploadWithSourceMap": true, - "compileHotReLoad": false, "babelSetting": { "ignore": [], "disablePlugins": [], "outputPath": "" - }, - "useIsolateContext": true, - "useCompilerModule": true, - "userConfirmedUseCompilerModuleSwitch": false + } }, "compileType": "miniprogram", "libVersion": "2.11.1", From 37dcacc937c78d327ff1cba1610935091fb4c214 Mon Sep 17 00:00:00 2001 From: dong_bo0602 <358256383@qq.com> Date: Sat, 27 Jun 2020 13:01:40 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 1 + pages/book/book.js | 66 ++++++++++ pages/book/book.json | 3 + pages/book/book.wxml | 115 +++++++++++++++++ pages/book/book.wxss | 197 +++++++++++++++++++++++++++++ pages/venueDetail/venueDetail.wxml | 3 + pages/venueDetail/venueDetail.wxss | 19 +++ project.config.json | 22 ++++ 8 files changed, 426 insertions(+) create mode 100644 pages/book/book.js create mode 100644 pages/book/book.json create mode 100644 pages/book/book.wxml create mode 100644 pages/book/book.wxss diff --git a/app.json b/app.json index f5bb32b..af7d876 100644 --- a/app.json +++ b/app.json @@ -1,5 +1,6 @@ { "pages": [ + "pages/book/book", "pages/index/index", "pages/activityDialog/activityDialog", "pages/teamDetail/teamDetail", diff --git a/pages/book/book.js b/pages/book/book.js new file mode 100644 index 0000000..764627f --- /dev/null +++ b/pages/book/book.js @@ -0,0 +1,66 @@ +// pages/book/book.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/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..463d606 --- /dev/null +++ b/pages/book/book.wxml @@ -0,0 +1,115 @@ + + + + 篮球 + + + + + 篮球 + + + + + 篮球 + + + + + 营业时间: + 暂无信息 + 项目描述: + 暂无信息 + 场地设置: + 暂无信息 + + + + 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元 + + + + + \ No newline at end of file diff --git a/pages/book/book.wxss b/pages/book/book.wxss new file mode 100644 index 0000000..c6f08ab --- /dev/null +++ b/pages/book/book.wxss @@ -0,0 +1,197 @@ +.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: 80rpx; + left: 30rpx; + right: 30rpx; + background: #fff; + border-radius: 10rpx; +} \ No newline at end of file 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/project.config.json b/project.config.json index e0f70e6..31b36ca 100644 --- a/project.config.json +++ b/project.config.json @@ -8,12 +8,22 @@ "scopeDataCheck": false, "coverView": true, "es6": true, + "enhance": false, "postcss": true, "compileHotReLoad": false, "preloadBackgroundData": false, "minified": true, +<<<<<<< Updated upstream "autoAudits": false, "newFeature": true, +======= + "newFeature": true, + "coverView": true, + "nodeModules": false, + "autoAudits": false, + "showShadowRootInWxmlPanel": true, + "scopeDataCheck": false, +>>>>>>> Stashed changes "uglifyFileName": false, "uploadWithSourceMap": true, "useIsolateContext": true, @@ -24,11 +34,23 @@ "showShadowRootInWxmlPanel": true, "checkInvalidKey": true, "checkSiteMap": true, +<<<<<<< Updated upstream +======= + "uploadWithSourceMap": true, +>>>>>>> Stashed changes "babelSetting": { "ignore": [], "disablePlugins": [], "outputPath": "" +<<<<<<< Updated upstream } +======= + }, + "useCompilerModule": true, + "userConfirmedUseCompilerModuleSwitch": false, + "compileHotReLoad": false, + "useIsolateContext": true +>>>>>>> Stashed changes }, "compileType": "miniprogram", "libVersion": "2.11.1", From b72dfd34b36140786b27c65df6daf053be61c871 Mon Sep 17 00:00:00 2001 From: dong_bo0602 <358256383@qq.com> Date: Sat, 27 Jun 2020 13:02:13 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project.config.json | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/project.config.json b/project.config.json index 31b36ca..61ce167 100644 --- a/project.config.json +++ b/project.config.json @@ -5,52 +5,30 @@ }, "setting": { "urlCheck": false, - "scopeDataCheck": false, - "coverView": true, "es6": true, "enhance": false, "postcss": true, - "compileHotReLoad": false, "preloadBackgroundData": false, "minified": true, -<<<<<<< Updated upstream - "autoAudits": false, - "newFeature": true, -======= "newFeature": true, "coverView": true, "nodeModules": false, "autoAudits": false, "showShadowRootInWxmlPanel": true, "scopeDataCheck": false, ->>>>>>> Stashed changes "uglifyFileName": false, - "uploadWithSourceMap": true, - "useIsolateContext": true, - "nodeModules": false, - "enhance": false, - "useCompilerModule": true, - "userConfirmedUseCompilerModuleSwitch": false, - "showShadowRootInWxmlPanel": true, "checkInvalidKey": true, "checkSiteMap": true, -<<<<<<< Updated upstream -======= "uploadWithSourceMap": true, ->>>>>>> Stashed changes "babelSetting": { "ignore": [], "disablePlugins": [], "outputPath": "" -<<<<<<< Updated upstream - } -======= }, "useCompilerModule": true, "userConfirmedUseCompilerModuleSwitch": false, "compileHotReLoad": false, "useIsolateContext": true ->>>>>>> Stashed changes }, "compileType": "miniprogram", "libVersion": "2.11.1", From e71537a41e7fcd85c8d871ba1c8231587f8249a4 Mon Sep 17 00:00:00 2001 From: dong_bo0602 <358256383@qq.com> Date: Sat, 27 Jun 2020 13:19:24 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E7=9B=B4=E6=92=AD=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/broadcast/broadcast.wxml | 1 + pages/broadcast/broadcast.wxss | 13 +++++++++++++ pages/index/index.wxml | 1 + pages/index/index.wxss | 14 ++++++++++++++ 4 files changed, 29 insertions(+) diff --git a/pages/broadcast/broadcast.wxml b/pages/broadcast/broadcast.wxml index 4e0a051..d10391c 100644 --- a/pages/broadcast/broadcast.wxml +++ b/pages/broadcast/broadcast.wxml @@ -2,6 +2,7 @@ + 直播中 {{item.livePlanName}} 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/index/index.wxml b/pages/index/index.wxml index 2163cd7..21fceed 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -117,6 +117,7 @@ + 文字 \ 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 From 51c90735c1cb1b94b3258579219bb8f046d815ac Mon Sep 17 00:00:00 2001 From: dong_bo0602 <358256383@qq.com> Date: Sat, 27 Jun 2020 13:25:40 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E7=9B=B4=E6=92=AD=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 2 +- pages/book/book.js | 13 +++++++++++-- pages/book/book.wxml | 26 +++++++++++++++++++++++--- pages/book/book.wxss | 26 +++++++++++++++++++++++++- 4 files changed, 60 insertions(+), 7 deletions(-) diff --git a/app.json b/app.json index af7d876..397f712 100644 --- a/app.json +++ b/app.json @@ -2,9 +2,9 @@ "pages": [ "pages/book/book", "pages/index/index", + "pages/broadcast/broadcast", "pages/activityDialog/activityDialog", "pages/teamDetail/teamDetail", - "pages/broadcast/broadcast", "pages/center/center", "pages/volunteerRegister/volunteerRegister", "pages/volunteer/volunteer", diff --git a/pages/book/book.js b/pages/book/book.js index 764627f..c6b9688 100644 --- a/pages/book/book.js +++ b/pages/book/book.js @@ -5,9 +5,18 @@ Page({ * 页面的初始数据 */ data: { - + checkOrder: false + }, + doCheckOrder: function () { + this.setData({ + checkOrder: true + }) + }, + closeCheckOrder: function () { + this.setData({ + checkOrder: false + }) }, - /** * 生命周期函数--监听页面加载 */ diff --git a/pages/book/book.wxml b/pages/book/book.wxml index 463d606..0cbad2e 100644 --- a/pages/book/book.wxml +++ b/pages/book/book.wxml @@ -88,7 +88,7 @@ - + 订单金额:10元 @@ -96,7 +96,7 @@ - + 订单信息 @@ -105,7 +105,27 @@ 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元 diff --git a/pages/book/book.wxss b/pages/book/book.wxss index c6f08ab..2332f35 100644 --- a/pages/book/book.wxss +++ b/pages/book/book.wxss @@ -189,9 +189,33 @@ } .order-container{ position: absolute; - bottom: 80rpx; + 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