完善首页、新闻,直播列表
This commit is contained in:
parent
92417388f2
commit
3cb1681230
2
app.js
2
app.js
@ -9,7 +9,7 @@ App({
|
|||||||
venueUrl: 'http://192.168.0.109:8082/venuebooking',
|
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/',
|
volunteerUrl: 'http://192.168.0.111:8888/volunteer/',
|
||||||
|
liveUrl: 'http://192.168.0.113:8084/live',
|
||||||
restAjax: restAjax,
|
restAjax: restAjax,
|
||||||
dialog: dialog,
|
dialog: dialog,
|
||||||
onLaunch: function () {
|
onLaunch: function () {
|
||||||
|
2
app.json
2
app.json
@ -3,6 +3,7 @@
|
|||||||
"pages/index/index",
|
"pages/index/index",
|
||||||
"pages/activityDialog/activityDialog",
|
"pages/activityDialog/activityDialog",
|
||||||
"pages/teamDetail/teamDetail",
|
"pages/teamDetail/teamDetail",
|
||||||
|
"pages/broadcast/broadcast",
|
||||||
"pages/center/center",
|
"pages/center/center",
|
||||||
"pages/volunteerRegister/volunteerRegister",
|
"pages/volunteerRegister/volunteerRegister",
|
||||||
"pages/volunteer/volunteer",
|
"pages/volunteer/volunteer",
|
||||||
@ -11,7 +12,6 @@
|
|||||||
"pages/venueDetail/venueDetail",
|
"pages/venueDetail/venueDetail",
|
||||||
"pages/register/register",
|
"pages/register/register",
|
||||||
"pages/login/login",
|
"pages/login/login",
|
||||||
"pages/broadcast/broadcast",
|
|
||||||
"pages/newVolunteerActivity/newVolunteerActivity",
|
"pages/newVolunteerActivity/newVolunteerActivity",
|
||||||
"pages/newTeam/newTeam",
|
"pages/newTeam/newTeam",
|
||||||
"pages/volunteerTeam/volunteerTeam",
|
"pages/volunteerTeam/volunteerTeam",
|
||||||
|
@ -1,22 +1,57 @@
|
|||||||
// pages/broadcast/broadcast.js
|
// pages/broadcast/broadcast.js
|
||||||
|
var app = getApp();
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
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({
|
wx.navigateTo({
|
||||||
url: '../broadcastDetail/broadcastDetail',
|
url: '../broadcastDetail/broadcastDetail?livePlanId='+ event.currentTarget.dataset.livePlanId,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad: function (options) {
|
onLoad: function (options) {
|
||||||
|
var self = this;
|
||||||
|
self.doGetLiveList(1);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -51,14 +86,14 @@ Page({
|
|||||||
* 页面相关事件处理函数--监听用户下拉动作
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
*/
|
*/
|
||||||
onPullDownRefresh: function () {
|
onPullDownRefresh: function () {
|
||||||
|
this.doGetLiveList(1);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面上拉触底事件的处理函数
|
* 页面上拉触底事件的处理函数
|
||||||
*/
|
*/
|
||||||
onReachBottom: function () {
|
onReachBottom: function () {
|
||||||
|
this.doGetLiveList(this.data.currentPage + 1);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
{
|
{
|
||||||
"usingComponents": {}
|
"usingComponents": {},
|
||||||
|
"enablePullDownRefresh": true,
|
||||||
|
"backgroundTextStyle": "dark"
|
||||||
}
|
}
|
@ -1,20 +1,11 @@
|
|||||||
<view class="broadcast">
|
<view class="broadcast">
|
||||||
<view class="broadcast-box" bindtap="goDetail">
|
<view class="broadcast-box" bindtap="goDetail" data-live-plan-id="{{item.livePlanId}}" wx:for="{{live.liveList}}" wx:for-index="idx" wx:for-item="item" wx:key="liveList">
|
||||||
<view class="broadcast-img">
|
<view class="broadcast-img">
|
||||||
<image src="../../images/center-bg.png"></image>
|
<image src="{{live.liveUrl}}/route/file/downloadfile/true/{{item.livePlanPhoto}}"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="broadcast-info">
|
<view class="broadcast-info">
|
||||||
<view class="name">银保监会印发《关于加快推进意外险改直播标题</view>
|
<view class="name">{{item.livePlanName}}</view>
|
||||||
<view class="time">2020-02-02 14:00:00至2020-02-03 14:00:00</view>
|
<view class="time">{{item.livePlanStart}}至{{item.livePlanEnd}}</view>
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="broadcast-box" bindtap="goDetail">
|
|
||||||
<view class="broadcast-img">
|
|
||||||
<image src="../../images/center-bg.png"></image>
|
|
||||||
</view>
|
|
||||||
<view class="broadcast-info">
|
|
||||||
<view class="name">银保监会印发《关于加快推进意外险改直播标题</view>
|
|
||||||
<view class="time">2020-02-02 14:00:00至2020-02-03 14:00:00</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
@ -1,3 +1,4 @@
|
|||||||
|
var app = getApp();
|
||||||
function getRandomColor() {
|
function getRandomColor() {
|
||||||
const rgb = []
|
const rgb = []
|
||||||
for (let i = 0; i < 3; ++i) {
|
for (let i = 0; i < 3; ++i) {
|
||||||
@ -10,7 +11,9 @@ function getRandomColor() {
|
|||||||
|
|
||||||
Page({
|
Page({
|
||||||
data: {
|
data: {
|
||||||
src: '',
|
liveUrl: app.liveUrl,
|
||||||
|
liveDetail: {},
|
||||||
|
videoContext: null,
|
||||||
},
|
},
|
||||||
|
|
||||||
onShareAppMessage() {
|
onShareAppMessage() {
|
||||||
@ -21,7 +24,21 @@ Page({
|
|||||||
},
|
},
|
||||||
|
|
||||||
onReady() {
|
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() {
|
onHide() {
|
||||||
|
@ -1,35 +1,22 @@
|
|||||||
<view class="broadcast">
|
<view class="broadcast">
|
||||||
<view class="page-section tc">
|
<view class="page-section tc">
|
||||||
<video
|
<video id="myVideo" src="{{liveDetail.liveDeviceRtmpUrl}}" binderror="videoErrorCallback" danmu-list="{{danmuList}}" enable-danmu show-center-play-btn='{{false}}' show-play-btn="{{true}}" controls autoplay="{{true}}" picture-in-picture-mode="{{['push', 'pop']}}" bindenterpictureinpicture='bindVideoEnterPictureInPicture' bindleavepictureinpicture='bindVideoLeavePictureInPicture'></video>
|
||||||
id="myVideo"
|
</view>
|
||||||
src="http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400"
|
|
||||||
binderror="videoErrorCallback"
|
|
||||||
danmu-list="{{danmuList}}"
|
|
||||||
enable-danmu
|
|
||||||
show-center-play-btn='{{false}}'
|
|
||||||
show-play-btn="{{true}}"
|
|
||||||
controls
|
|
||||||
autoplay="{{true}}"
|
|
||||||
picture-in-picture-mode="{{['push', 'pop']}}"
|
|
||||||
bindenterpictureinpicture='bindVideoEnterPictureInPicture'
|
|
||||||
bindleavepictureinpicture='bindVideoLeavePictureInPicture'
|
|
||||||
></video>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="broadcast-title">银保监会印发《关于加快推进意外直播标题</view>
|
<view class="broadcast-title">{{liveDetail.livePlanName}}</view>
|
||||||
<view class="broadcast-time">
|
<view class="broadcast-time">
|
||||||
<view class="time">
|
<view class="time">
|
||||||
<image src="../../images/time.png"></image>
|
<image src="../../images/time.png"></image>
|
||||||
<text>开始时间:</text>
|
<text>开始时间:</text>
|
||||||
2020-02-03 14:00:00
|
{{liveDetail.livePlanStart}}
|
||||||
</view>
|
</view>
|
||||||
<view class="time">
|
<view class="time">
|
||||||
<image src="../../images/time.png"></image>
|
<image src="../../images/time.png"></image>
|
||||||
<text>结束时间:</text>
|
<text>结束时间:</text>
|
||||||
2020-02-03 14:00:00
|
{{liveDetail.livePlanEnd}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="broadcast-intro">
|
<view class="broadcast-intro">
|
||||||
<view class="broadcast-intro-title">直播介绍</view>
|
<view class="broadcast-intro-title">介绍</view>
|
||||||
<view class="intro-text">光拉便半运县写员二到院细天县见运命运感知争公着解全得律号深共权发市以家情军少先意单理样好族权达保很具你住红许气已第白知题候其然知王公众我头务族观经市指或七比生。适基历然题和低是局着先重信知议过说心龙素标安放大支入完二种设力果每角解收美约声里历美节办约管运但然新分活们心毛手过共点家或。革解快和特技县应精术被心走小器风育明油备己世国生往支因叫正心在备什新候流广这地。离克的却五北林越用变义按地界你值名证所局的况果被半去量片来参例形极别色部米老近和住例外七强可学变山意断群济。到报还省边速低起分力少族。</view>
|
<view class="intro-text">{{liveDetail.livePlanRecord}}</view>
|
||||||
</view>
|
</view>
|
@ -20,6 +20,10 @@ Page({
|
|||||||
},
|
},
|
||||||
activity: {
|
activity: {
|
||||||
activityUrl: app.activityUrl
|
activityUrl: app.activityUrl
|
||||||
|
},
|
||||||
|
live: {
|
||||||
|
liveUrl: app.liveUrl,
|
||||||
|
liveList: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
doLogin: function () {
|
doLogin: function () {
|
||||||
@ -85,6 +89,19 @@ Page({
|
|||||||
app.dialog.msg(data.msg);
|
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 () {
|
goNewsDetail: function () {
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: '../newsDetail/newsDetail',
|
url: '../newsDetail/newsDetail',
|
||||||
@ -133,6 +150,7 @@ Page({
|
|||||||
self.doLogin();
|
self.doLogin();
|
||||||
self.doGetLibrary();
|
self.doGetLibrary();
|
||||||
self.doGetNewsList();
|
self.doGetNewsList();
|
||||||
|
self.doGetLiveList();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -124,14 +124,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="broadcast-container">
|
<view class="broadcast-container">
|
||||||
<view class="broadcast-box" bindtap="goBroadcastDetail">
|
<view class="broadcast-box" bindtap="goBroadcastDetail" wx:for="{{live.liveList}}" wx:for-index="index" wx:for-item="item" wx:key="liveList">
|
||||||
<image src="../../images/center-bg.png"></image>
|
<image src="{{live.liveUrl}}/route/file/downloadfile/true/{{item.livePlanPhoto}}"></image>
|
||||||
</view>
|
|
||||||
<view class="broadcast-box" bindtap="goBroadcastDetail">
|
|
||||||
<image src="../../images/center-bg.png"></image>
|
|
||||||
</view>
|
|
||||||
<view class="broadcast-box" bindtap="goBroadcastDetail">
|
|
||||||
<image src="../../images/center-bg.png"></image>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
@ -1,7 +1,6 @@
|
|||||||
// pages/newsList/newsList.js
|
// pages/newsList/newsList.js
|
||||||
var app = getApp();
|
var app = getApp();
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"usingComponents": {},
|
"usingComponents": {},
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
|
"backgroundTextStyle": "dark",
|
||||||
"onReachBottomDistance": 50
|
"onReachBottomDistance": 50
|
||||||
}
|
}
|
@ -31,4 +31,19 @@
|
|||||||
width: 30%;
|
width: 30%;
|
||||||
height: 150rpx;
|
height: 150rpx;
|
||||||
margin-right: 20rpx;
|
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%;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user