From 9a0df17f176b33033e63badda9e0c1a94690fdd4 Mon Sep 17 00:00:00 2001 From: wenc000 <450292408@qq.com> Date: Sun, 28 Jun 2020 20:16:24 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=B4=E6=92=AD=E7=82=B9=E6=92=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 1 + app.json | 10 +- pages/activityDialog/activityDialog.js | 42 ++++- pages/broadcast/broadcast.wxml | 5 +- pages/broadcastDetail/broadcastDetail.js | 5 + pages/broadcastDetail/broadcastDetail.wxml | 9 +- pages/broadcastDetail/broadcastDetail.wxss | 29 +++- pages/broadcastList/broadcastList.js | 159 ++++++++++++++++++ pages/broadcastList/broadcastList.json | 5 + pages/broadcastList/broadcastList.wxml | 9 + pages/broadcastList/broadcastList.wxss | 49 ++++++ pages/index/index.js | 4 +- pages/index/index.wxml | 10 +- .../serviceActivityDetail.js | 10 ++ .../serviceActivityDetail.wxml | 5 +- .../serviceActivityDetail.wxss | 9 + pages/volunteerRegister/volunteerRegister.js | 67 ++++++-- 17 files changed, 391 insertions(+), 37 deletions(-) create mode 100644 pages/broadcastList/broadcastList.js create mode 100644 pages/broadcastList/broadcastList.json create mode 100644 pages/broadcastList/broadcastList.wxml create mode 100644 pages/broadcastList/broadcastList.wxss diff --git a/app.js b/app.js index bf675e7..8e6ad0e 100644 --- a/app.js +++ b/app.js @@ -10,6 +10,7 @@ App({ activityUrl: 'http://192.168.0.111:8080/culturalactivity', volunteerUrl: 'http://192.168.0.111:8888/volunteer', liveUrl: 'http://192.168.0.113:8084/live', + liveRecordUrl: 'http://192.168.0.113:8085', restAjax: restAjax, dialog: dialog, onLaunch: function () { diff --git a/app.json b/app.json index c96c74b..968b2d9 100644 --- a/app.json +++ b/app.json @@ -1,12 +1,12 @@ { "pages": [ -<<<<<<< HEAD -======= - "pages/center/center", - "pages/book/book", ->>>>>>> master "pages/index/index", "pages/broadcast/broadcast", + "pages/center/center", + "pages/book/book", + "pages/broadcastList/broadcastList", + "pages/orderDetail/orderDetail", + "pages/myVenueOrder/myVenueOrder", "pages/activityDialog/activityDialog", "pages/teamDetail/teamDetail", "pages/volunteerRegister/volunteerRegister", diff --git a/pages/activityDialog/activityDialog.js b/pages/activityDialog/activityDialog.js index 3c20d34..1146832 100644 --- a/pages/activityDialog/activityDialog.js +++ b/pages/activityDialog/activityDialog.js @@ -1,18 +1,56 @@ // pages/activityDialog/activityDialog.js +var app = getApp(); Page({ /** * 页面的初始数据 */ data: { - + token: '', + serviceId: '' }, + getToken: function() { + var self = this; + return new Promise(resolve =>{ + wx.getStorage({ + key: 'token', + success(res) { + self.setData({ + token: res.data + }) + return resolve(); + } + }) + }) + }, + getActivityHis: function() { + var self = this; + app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wxminiapp/teamactivityhis/listpageteamactivityhis?serviceId=' + self.data.serviceId, []), + {}, { + headers: { + token: self.data.token + } + }, function(code, data) { + if('200' == code) { + console.log(data) + } + }, function() { + }, function() { + + }) + }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { - + var self = this; + self.setData({ + serviceId: options.serviceId + }) + this.getToken().then(result => { + this.getActivityHis() + }) }, /** diff --git a/pages/broadcast/broadcast.wxml b/pages/broadcast/broadcast.wxml index d10391c..ff7c19d 100644 --- a/pages/broadcast/broadcast.wxml +++ b/pages/broadcast/broadcast.wxml @@ -2,7 +2,10 @@ - 直播中 + 已结束 + 未开始 + 直播中 + 错误 {{item.livePlanName}} diff --git a/pages/broadcastDetail/broadcastDetail.js b/pages/broadcastDetail/broadcastDetail.js index d5482bd..50e3166 100644 --- a/pages/broadcastDetail/broadcastDetail.js +++ b/pages/broadcastDetail/broadcastDetail.js @@ -39,6 +39,11 @@ Page({ app.dialog.msg(data.msg); }); }, + goLiveRecord(event) { + wx.navigateTo({ + url: '../broadcastList/broadcastList?livePlanId='+ event.currentTarget.dataset.livePlanId, + }) + }, onLoad(option) { this.getLivePlan(option.livePlanId); }, diff --git a/pages/broadcastDetail/broadcastDetail.wxml b/pages/broadcastDetail/broadcastDetail.wxml index 387c2a6..10af21f 100644 --- a/pages/broadcastDetail/broadcastDetail.wxml +++ b/pages/broadcastDetail/broadcastDetail.wxml @@ -1,8 +1,9 @@ - - + + + + + {{liveDetail.livePlanName}} diff --git a/pages/broadcastDetail/broadcastDetail.wxss b/pages/broadcastDetail/broadcastDetail.wxss index f58e660..c00897d 100644 --- a/pages/broadcastDetail/broadcastDetail.wxss +++ b/pages/broadcastDetail/broadcastDetail.wxss @@ -41,4 +41,31 @@ video{ color: #5F5F5F; line-height: 40rpx; margin-top: 15rpx; -} \ No newline at end of file +} +.play-button-box { + width: 200rpx; + height: 200rpx; + position: fixed; + z-index: 100; + top: 100rpx; + left: 50%; + margin-left: -100rpx; + background-color: rgba(0, 0, 0, 0.5); + border: 1rpx dotted rgba(255, 255, 255, 0.8); + border-radius: 100rpx; +} +.play-button-box .play-button { + border-top-width: 60rpx; + border-bottom-width: 60rpx; + border-left-width: 100rpx; + border-style: solid; + border-top-color: transparent; + border-left-color: red; + border-bottom-color: transparent; + border-right-color: transparent; + width: 0; + height: 0; + position: absolute; + top: 40rpx; + left: 60rpx; +} diff --git a/pages/broadcastList/broadcastList.js b/pages/broadcastList/broadcastList.js new file mode 100644 index 0000000..32d6ffa --- /dev/null +++ b/pages/broadcastList/broadcastList.js @@ -0,0 +1,159 @@ +// pages/broadcastList/broadcastList.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + liveUrl: app.liveUrl, + liveRecordUrl: app.liveRecordUrl, + liveRecordSrc: null, + livePlanId: '', + liveRecoreList: [], + videoContext: null, + currentPage: 1, + rows: 20, + isPlay: false + }, + getLivePlanRecordList: function(page) { + var self = this; + app.dialog.loading('正在加载'); + app.restAjax.get(app.restAjax.path('{liveUrl}/app/liverecord/listpageliverecordrelease/{planId}', [self.data.liveUrl, self.data.livePlanId]), { + page: page, + rows: self.data.rows + }, null, function(code, data) { + if(data.rows.length == 0) { + app.dialog.msg('暂无数据'); + return; + } + var liveRecoreArray; + if(page <= 1) { + liveRecoreArray = data.rows; + } else { + liveRecoreArray = self.data.liveRecoreList; + liveRecoreArray = liveRecoreArray.concat(data.rows); + } + self.setData({ + currentPage: page, + 'liveRecoreList': liveRecoreArray + }) + }, function(code, data) { + app.dialog.msg(data.msg); + }, function() { + wx.stopPullDownRefresh(); + wx.hideLoading(); + }) + }, + doChangeSrc: function(event) { + var self = this; + self.setData({ + liveRecordSrc: event.currentTarget.dataset.liveRecordSrc + }) + self.videoContext.play({ + success: function() { + self.setData({ + isPlay: true + }) + } + }); + }, + onPlayStateChange: function(event) { + console.log(event.detail.code) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.videoContext = wx.createLivePlayerContext('liveRecordVideo'); + this.setData({ + livePlanId: options.livePlanId + }) + this.getLivePlanRecordList(1); + }, + doPlay: function() { + var self = this; + if(!self.data.liveRecordSrc) { + if(self.data.liveRecoreList.length == 0) { + app.dialog.msg('无播放内容'); + return; + } + self.setData({ + liveRecordSrc : self.data.liveRecoreList[0].recordFilePath + }); + self.videoContext.play({ + success: function() { + self.setData({ + isPlay: true + }) + } + }); + } else { + self.videoContext.play({ + success: function() { + self.setData({ + isPlay: true + }) + } + }); + } + }, + doStop: function() { + var self = this; + self.videoContext.pause({ + success: function() { + self.setData({ + isPlay: false + }) + } + }); + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + this.getLivePlanRecordList(1); + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + this.getLivePlanRecordList(this.data.currentPage + 1); + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/broadcastList/broadcastList.json b/pages/broadcastList/broadcastList.json new file mode 100644 index 0000000..09e623a --- /dev/null +++ b/pages/broadcastList/broadcastList.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "enablePullDownRefresh": true, + "backgroundTextStyle": "dark" +} \ No newline at end of file diff --git a/pages/broadcastList/broadcastList.wxml b/pages/broadcastList/broadcastList.wxml new file mode 100644 index 0000000..f2a1427 --- /dev/null +++ b/pages/broadcastList/broadcastList.wxml @@ -0,0 +1,9 @@ + + + + + + + + {{index + 1}}.{{item.recordFileName}} + \ No newline at end of file diff --git a/pages/broadcastList/broadcastList.wxss b/pages/broadcastList/broadcastList.wxss new file mode 100644 index 0000000..faf0eb8 --- /dev/null +++ b/pages/broadcastList/broadcastList.wxss @@ -0,0 +1,49 @@ +.broadcast{ + width: 100%; + height: 400rpx; + background: #000000; + position: fixed; + top: 0; + left: 0; + right: 0; +} +video{ + width: 100%; + height: 400rpx; +} +.broadcast-title{ + padding: 30rpx; + font-size: 34rpx; + color: #242424; + border-bottom: 5px solid #FBFBFB; +} +.broadcast-list{ + margin-top: 400rpx; +} +.play-button-box { + width: 200rpx; + height: 200rpx; + position: fixed; + z-index: 100; + top: 100rpx; + left: 50%; + margin-left: -100rpx; + background-color: rgba(0, 0, 0, 0.5); + border: 1rpx dotted rgba(255, 255, 255, 0.8); + border-radius: 100rpx; +} +.play-button-box .play-button { + border-top-width: 60rpx; + border-bottom-width: 60rpx; + border-left-width: 100rpx; + border-style: solid; + border-top-color: transparent; + border-left-color: red; + border-bottom-color: transparent; + border-right-color: transparent; + width: 0; + height: 0; + position: absolute; + top: 40rpx; + left: 60rpx; +} \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index 1bc8e00..4057d26 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -143,9 +143,9 @@ Page({ url: '../venue/venue', }) }, - goBroadcastDetail: function () { + goBroadcastDetail: function (event) { wx.navigateTo({ - url: '../broadcastDetail/broadcastDetail', + url: '../broadcastDetail/broadcastDetail?livePlanId='+ event.currentTarget.dataset.livePlanId, }) }, goActivity: function () { diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 1945aba..9c937f3 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -115,10 +115,14 @@ - + - 文字 - 直播中 + {{item.livePlanName}} + 直播中 + 已结束 + 未开始 + 直播中 + 错误 \ No newline at end of file diff --git a/pages/serviceActivityDetail/serviceActivityDetail.js b/pages/serviceActivityDetail/serviceActivityDetail.js index 93857a4..31dd13d 100644 --- a/pages/serviceActivityDetail/serviceActivityDetail.js +++ b/pages/serviceActivityDetail/serviceActivityDetail.js @@ -224,11 +224,21 @@ Page({ }) }, + toActivityHis: function() { + var self = this; + wx.navigateTo({ + url: '../activityDialog/activityDialog?serviceId=' + self.data.serviceId, + }) + }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { var id = options.id; + var self = this; + self.setData({ + serviceId: id + }) this.getToken().then(result => { this.getDetail(id); this.getMyTeam(); diff --git a/pages/serviceActivityDetail/serviceActivityDetail.wxml b/pages/serviceActivityDetail/serviceActivityDetail.wxml index 9f8025f..9d86543 100644 --- a/pages/serviceActivityDetail/serviceActivityDetail.wxml +++ b/pages/serviceActivityDetail/serviceActivityDetail.wxml @@ -22,7 +22,10 @@ - 活动详情 + + 活动详情 + 评论列表 + diff --git a/pages/serviceActivityDetail/serviceActivityDetail.wxss b/pages/serviceActivityDetail/serviceActivityDetail.wxss index caed339..cb9f554 100644 --- a/pages/serviceActivityDetail/serviceActivityDetail.wxss +++ b/pages/serviceActivityDetail/serviceActivityDetail.wxss @@ -51,6 +51,15 @@ padding-left: 10rpx; font-size: 30rpx; margin-bottom: 10rpx; + display: flex; + justify-content: space-between; +} +.comment-btn{ + padding: 0 10rpx; + background: #9F1512; + color: #fff; + font-size: 28rpx; + border-radius: 10rpx; } .part-content{ font-size: 28rpx; diff --git a/pages/volunteerRegister/volunteerRegister.js b/pages/volunteerRegister/volunteerRegister.js index 7e5cc41..661383c 100644 --- a/pages/volunteerRegister/volunteerRegister.js +++ b/pages/volunteerRegister/volunteerRegister.js @@ -7,6 +7,7 @@ Page({ */ data: { token: '', + volunteerMsg: [], isAgree: false, // 是否同意志愿者注册协议 openExperience: 0, tempObj: {}, // 用于临时存储字典表返回的数据 @@ -180,7 +181,7 @@ Page({ icon: 'none', duration: 1500 }) - return false; + return false; } var volunteerVO = { serviceCity: self.data.teamCity[self.data.teamCityIndex] != '' @@ -203,7 +204,13 @@ Page({ agree: self.data.isAgree, openExperience : self.data.openExperience }; - app.restAjax.post(app.restAjax.path(app.volunteerUrl + '/wxminiapp/volunteer/savevolunteer', []), + var url; + if(!self.data.volunteerMsg) { + url = '/wxminiapp/volunteer/savevolunteer'; + }else { + url = '/wxminiapp/volunteer/updatevolunteer/' + self.data.volunteerMsg.volunteerId; + } + app.restAjax.post(app.restAjax.path(app.volunteerUrl + url, []), volunteerVO, { headers: { 'token': self.data.token @@ -263,31 +270,55 @@ Page({ }) }) }, + getVolunteerMsg() { + var self = this; + return new Promise(resolve => { + app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/wxminiapp/volunteer/getvolunteerbyuserid', []), + {}, { + headers: { + 'token': self.data.token + } + }, function(code, data) { + if('200' == code) { + self.setData({ + volunteerMsg: data + }) + } + return resolve(); + }, function() { + + }, function() { + + }) + }) + }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { var self = this; this.getToken().then(result => { - this.getDataFromDict('a223b308-014a-4e89-93fa-035a564e7fda', 1).then(result => { - self.setData({ - serviceType: self.data.tempObj, - tempObj: {} - }) - }).then(result => { - this.getDataFromDict('7b213c37-8575-4db3-bda1-86c4e38589f7', 1).then(result => { + this.getVolunteerMsg().then(result => { + this.getDataFromDict('a223b308-014a-4e89-93fa-035a564e7fda', 1).then(result => { self.setData({ - serviceIndustry: self.data.tempObj, + serviceType: self.data.tempObj, tempObj: {} }) - }) - }).then(result => { - this.getDataFromDict('4a03e904-81e2-48e9-9006-e15ea4a6bc69', 2).then(result => { - self.setData({ - teamCity: self.data.tempObj, - teamCityArray: self.data.tempArray, - tempObj: {}, - tempArray: [] + }).then(result => { + this.getDataFromDict('7b213c37-8575-4db3-bda1-86c4e38589f7', 1).then(result => { + self.setData({ + serviceIndustry: self.data.tempObj, + tempObj: {} + }) + }) + }).then(result => { + this.getDataFromDict('4a03e904-81e2-48e9-9006-e15ea4a6bc69', 2).then(result => { + self.setData({ + teamCity: self.data.tempObj, + teamCityArray: self.data.tempArray, + tempObj: {}, + tempArray: [] + }) }) }) })