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] =?UTF-8?q?=E5=AE=8C=E5=96=84=E9=A6=96=E9=A1=B5=E3=80=81?= =?UTF-8?q?=E6=96=B0=E9=97=BB=EF=BC=8C=E7=9B=B4=E6=92=AD=E5=88=97=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