This commit is contained in:
dong_bo0602 2020-09-29 17:05:43 +08:00
parent 805ad24d28
commit 1931c2cbf6
19 changed files with 605 additions and 152 deletions

View File

@ -1,6 +1,9 @@
{ {
"pages": [ "pages": [
"pages/index/index", "pages/index/index",
"pages/travel/travel",
"pages/template/template",
"pages/train/train",
"pages/cultureMap/cultureMap", "pages/cultureMap/cultureMap",
"pages/order/order", "pages/order/order",
"pages/venue/venue", "pages/venue/venue",

View File

@ -33,7 +33,11 @@ Page({
duration: 1500 duration: 1500
}) })
} }
console.log(self.data.liveRecordList) if (self.data.page == 1) {
self.setData({
videoPath: data.rows[0].recordFilePath
})
}
} }
) )
}, },

View File

@ -1,6 +1,7 @@
<view class="video"> <!-- <view class="video">
<video src="{{videoPath}}" autoplay="autoplay"></video> <video src="{{videoPath}}" autoplay="autoplay" controls="controls"></video>
</view> </view>
<view class="select-list"> <view class="select-list">
<view class="select-video {{item.recordFilePath == videoPath ? 'active': ''}}" wx:for="{{liveRecordList}}" data-url="{{item.recordFilePath}}" bindtap="playVideo">{{index+1}}.{{item.recordFileName}}</view> <view class="select-video {{item.recordFilePath == videoPath ? 'active': ''}}" wx:for="{{liveRecordList}}" data-url="{{item.recordFilePath}}" bindtap="playVideo">{{index+1}}.{{item.recordFileName}}</view>
</view> </view> -->
<web-view src="{{liveRecordContentUrl}}/flv/index.html?livePlanId={{livePlanId}}&liveUrl={{liveUrl}}&liveRecordUrl={{liveRecordUrl}}" wx:if="{{livePlanId}}"></web-view>

View File

@ -256,7 +256,6 @@ Page({
randomName: true randomName: true
}) })
} else { } else {
wx.hideTabBar()
self.setData({ self.setData({
randomName: false randomName: false
}) })

View File

@ -184,118 +184,6 @@ Page({
wx.navigateTo({ wx.navigateTo({
url: '../cultureDetail/cultureDetail?libraryId='+ event.currentTarget.dataset.libraryId, url: '../cultureDetail/cultureDetail?libraryId='+ event.currentTarget.dataset.libraryId,
}) })
},
// 获取输入的手机号
phoneNum: function (res) {
this.setData({
phone: res.detail.value
})
},
// 校验手机号
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;
self.setData({
gotCode: true
})
self.data.timer = setInterval(function () {
var cur = self.data.restTime - 1
if (cur == 0) {
clearInterval(self.data.timer)
self.setData({
restTime: 120,
gotCode: false
})
} else {
self.setData({
restTime: cur
})
}
}, 1000)
app.restAjax.get(app.restAjax.path('{usercenterUrl}/api/sms/getverificationcode/' + self.data.phone, [app.usercenterUrl]), {}, null,
function (code, data) {},
function (code, data) {
wx.showToast({
title: data.msg,
icon: 'none',
duration: 1500
})
})
},
// 提交绑定手机
submitPhone: function () {
var self = this;
self.setData({
isConfirm: true
})
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) {
wx.setStorageSync('token', data.data);
wx.setStorageSync('isRandomUsername', 0)
clearInterval(self.data.timer)
self.setData({
showPhone: false
})
wx.showTabBar();
self.getUserInfo()
}, function (code, data) {
app.dialog.msg(data.msg);
self.setData({
isConfirm: false
})
})
},
// 验证码
inputCode: function (e) {
this.setData({
code: e.detail.value
})
},
// 判断用户是否为随机名称
isRandomName: function () {
var self = this
wx.getStorage({
key: 'isRandomUsername',
success: function (res) {
if (res.data == 1) {
wx.hideTabBar()
self.setData({
randomName: true
})
} else {
wx.hideTabBar()
self.setData({
randomName: false
})
}
}
})
}, },
// 获取用户信息 // 获取用户信息
getUserInfo: function () { getUserInfo: function () {
@ -312,6 +200,16 @@ Page({
app.dialog.msg(data.msg); app.dialog.msg(data.msg);
}) })
}, },
goTrain: function () {
wx.navigateTo({
url: '../train/train',
})
},
goTravel: function () {
wx.navigateTo({
url: '../travel/travel',
})
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
@ -323,7 +221,6 @@ Page({
self.doGetLiveList(); self.doGetLiveList();
self.doGetVenueList(); self.doGetVenueList();
self.doGetActivityList(); self.doGetActivityList();
self.isRandomName();
}, },
/** /**

View File

@ -34,6 +34,14 @@
<image src="../../images/tab5.png"></image> <image src="../../images/tab5.png"></image>
<view class="tab-title">直播点播</view> <view class="tab-title">直播点播</view>
</view> </view>
<view class="tab-box" bindtap="goTrain">
<image src="../../images/tab5.png"></image>
<view class="tab-title">在线培训</view>
</view>
<view class="tab-box" bindtap="goTravel">
<image src="../../images/tab6.png"></image>
<view class="tab-title">文化旅游</view>
</view>
</view> </view>
<view class="recommend"> <view class="recommend">
<view class="public-title"> <view class="public-title">
@ -134,19 +142,3 @@
</view> </view>
</view> </view>
</view> </view>
<!-- <view class="set-phone" wx:if="{{randomName && showPhone}}">
<view class="set-phone-box">
<view class="tips">您还没有绑定手机号,请先绑定手机号</view>
<view class="phone-input">
<input placeholder="请输入手机号" bindinput="phoneNum" class="phone-input" type="number"></input>
</view>
<view class="code-input">
<input placeholder="请输入验证码" bindinput="inputCode" type="number"></input>
<view class="get-code" bindtap="testPhone" wx:if="{{!gotCode}}">获取验证码</view>
<view class="got-code" wx:else>{{restTime}}</view>
</view>
<view class="set-phone-btn-box">
<view class="set-phone-btn" bindtap="submitPhone" wx:if="{{!isConfirm}}">确认</view>
</view>
</view>
</view> -->

View File

@ -0,0 +1,70 @@
// pages/template/template.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
url: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
this.setData({
url: options.url
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1 @@
<web-view src="https://www.wgink.ink/{{url}}" wx:if="{{url}}"></web-view>

View File

@ -0,0 +1 @@
/* pages/template/template.wxss */

144
pages/train/train.js Normal file
View File

@ -0,0 +1,144 @@
// pages/train/train.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
newsUrl: app.newsUrl,
typeList: [],
currentNewsDictionariesId: '',
currentPage: 1,
rows: 10,
directoriesParentId: 'd9d8c7ea-32e0-43ed-ad17-7c99a3c389b9',
trainList: []
},
getType: function () {
var self = this
app.restAjax.get(app.restAjax.path('{newsUrl}/app/newsdirectories/listnewsdirectoriesrelease', [app.newsUrl]), {
directoriesParentId: self.data.directoriesParentId
}, null, function (code, data) {
self.setData({
typeList: data
})
self.getList(1)
})
},
changeType: function (e) {
this.setData({
currentNewsDictionariesId: e.currentTarget.dataset.newsDirectoriesId
})
this.getList(1)
},
doClearCurrentNewsDictionariesId: function() {
var self = this;
self.setData({
currentNewsDictionariesId: ''
});
this.getList(1)
},
getList: function (page) {
var self = this
app.dialog.loading('正在加载');
var info = {
newsDirectoriesParentId: self.data.directoriesParentId,
newsDirectoriesId: self.data.currentNewsDictionariesId ? self.data.currentNewsDictionariesId : '',
page: page,
rows: self.data.rows
}
app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease', [app.newsUrl]), info, null, function (code, data) {
var newsArray;
for (var i = 0; i < data.rows.length; i++) {
data.rows[i].newsContentCoverList = data.rows[i].newsContentCoverList[0].contentCoverId
}
if(page <= 1) {
newsArray = data.rows;
} else {
newsArray = self.data.news.newsList;
newsArray = newsArray.concat(data.rows);
}
self.setData({
currentPage: page,
trainList: newsArray
})
if(data.rows.length == 0) {
app.dialog.msg('暂无数据');
return;
}
}, function(code, data) {
app.dialog.msg(data.msg);
}, function() {
wx.stopPullDownRefresh();
wx.hideLoading();
})
},
goNewsDetail: function (e) {
var url = e.currentTarget.dataset.templateRecordUrl
var link = e.currentTarget.dataset.contentLink
if (link) {
wx.navigateTo({
url: '../template/template?url=' + link,
})
} else {
wx.navigateTo({
url: '../template/template?url=' + url,
})
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getType()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

3
pages/train/train.json Normal file
View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

25
pages/train/train.wxml Normal file
View File

@ -0,0 +1,25 @@
<view class="top-tab">
<view class="type">
<view class="tab-box {{!currentNewsDictionariesId ? 'active' : ''}}" bindtap="doClearCurrentNewsDictionariesId">
<image src="../../images/selected-l.png" class="selected-l"></image>
全部
<image src="../../images/selected-r.png" class="selected-r"></image>
</view>
<view class="tab-box {{item.newsDirectoriesId == currentNewsDictionariesId ? 'active' : ''}}" wx:for="{{typeList}}" wx:key="index" bindtap="changeType" data-news-directories-id="{{item.newsDirectoriesId}}">
<image src="../../images/selected-l.png" class="selected-l"></image>
{{item.directoriesName}}
<image src="../../images/selected-r.png" class="selected-r"></image>
</view>
</view>
</view>
<view class="news">
<view class="news-box" bindtap="goNewsDetail" data-template-record-url="{{item.templateRecordUrl}}" data-content-link="{{item.newsContentLink}}" wx:for="{{trainList}}" wx:key="index">
<view class="news-title">{{item.newsContentTitle}}</view>
<view class="news-small-pic">
<image src="{{newsUrl}}/route/file/downloadfile/true/{{item.newsContentCoverList}}"></image>
</view>
<view class="news-info">
<text>{{item.newsContentPublishTime}}</text>
</view>
</view>
</view>

141
pages/train/train.wxss Normal file
View File

@ -0,0 +1,141 @@
.top-tab{
position: fixed;
top: 0;
left: 0;
right: 0;
background: #fff;
overflow-x: auto;
}
.type{
display: flex;
}
.tab-box{
display: inline-flex;
justify-content: center;
align-items: center;
width: 30%;
position: relative;
height: 90rpx;
font-size: 30rpx;
color: #242424;
flex-shrink: 0;
padding: 0 10rpx;
}
.tab-box.active{
color: #9F1512;
}
.tab-box image{
position: absolute;
width: 15rpx;
height: 40rpx;
top: 50%;
margin-top: -20rpx;
display: none;
}
.tab-box.active image{
display: block;
}
.tab-box image.selected-l{
left: 10rpx;
}
.tab-box image.selected-r{
right: 10rpx;
}
.area{
overflow-x: auto;
white-space: nowrap;
position: fixed;
top: 90rpx;
left: 0;
right: 0;
border-bottom: 1px solid #DDD;
background: #fff;
}
.area-box{
display: inline-flex;
width: 30%;
height: 90rpx;
/* line-height: 90rpx;
text-align: center; */
align-items: center;
justify-content: center;
padding: 0 20px;
box-sizing: border-box;
position: relative;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 30rpx;
}
.area-box.active{
color: #9F1512;
}
.area-box image{
position: absolute;
width: 15rpx;
height: 40rpx;
top: 50%;
margin-top: -20rpx;
display: none;
}
.area-box.active image{
display: block;
}
.area-box image.selected-l{
left: 20rpx;
}
.area-box image.selected-r{
right: 20rpx;
}
.news{
padding: 0 30rpx;
border-bottom: 5px solid #FBFBFB;
margin-top: 90rpx;
}
.news-box{
padding: 30rpx 0;
border-bottom: 1px solid #EBEBEB;
display: flex;
flex-direction: column;
}
.news-box:first-child{
padding-top: 0;
}
.news-title{
color: #242424;
font-size: 30rpx;
font-weight: bold;
}
.news-info{
color: #949494;
margin-top: 15rpx;
font-size: 24rpx;
}
.news-info text{
margin-right: 20rpx;
}
.news-big-pic, .news-small-pic{
margin-top: 10rpx;
}
.news-big-pic image{
width: 100%;
}
.news-small-pic image{
width: 100%;
height: 400rpx;
}
.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%;
}

118
pages/travel/travel.js Normal file
View File

@ -0,0 +1,118 @@
// pages/travel/travel.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
newsUrl: app.newsUrl,
newsDirectoriesId: '51ae7beb-f277-47a4-937a-088e6d47656d',
currentPage: 1,
rows: 10,
travelList: []
},
getTravel: function (page) {
var self = this
app.dialog.loading('正在加载');
var info = {
page: page,
rows: self.data.rows,
newsDirectoriesId: self.data.newsDirectoriesId
}
app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease', [app.newsUrl]), info, null, function (code, data) {
var newsArray;
for (var i = 0; i < data.rows.length; i++) {
data.rows[i].newsContentCoverList = data.rows[i].newsContentCoverList[0].contentCoverId
}
if(page <= 1) {
newsArray = data.rows;
} else {
newsArray = self.data.travelList;
newsArray = newsArray.concat(data.rows);
}
console.log(newsArray)
self.setData({
currentPage: page,
travelList: newsArray
})
if(data.rows.length == 0) {
app.dialog.msg('暂无数据');
return;
}
}, function(code, data) {
app.dialog.msg(data.msg);
}, function() {
wx.stopPullDownRefresh();
wx.hideLoading();
})
},
goNewsDetail: function (e) {
var url = e.currentTarget.dataset.templateRecordUrl
var link = e.currentTarget.dataset.contentLink
if (link) {
wx.navigateTo({
url: '../template/template?url=' + link,
})
} else {
wx.navigateTo({
url: '../template/template?url=' + url,
})
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getTravel(1)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

3
pages/travel/travel.json Normal file
View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

8
pages/travel/travel.wxml Normal file
View File

@ -0,0 +1,8 @@
<view class="news">
<view class="news-box" bindtap="goNewsDetail" data-template-record-url="{{item.templateRecordUrl}}" data-content-link="{{item.newsContentLink}}" wx:for="{{travelList}}" wx:key="index">
<view class="news-title">{{item.newsContentTitle}}</view>
<view class="news-small-pic">
<image src="{{newsUrl}}/route/file/downloadfile/true/{{item.newsContentCoverList}}"></image>
</view>
</view>
</view>

52
pages/travel/travel.wxss Normal file
View File

@ -0,0 +1,52 @@
.news{
padding: 0 30rpx;
border-bottom: 5px solid #FBFBFB;
margin-top: 10rpx;
}
.news-box{
padding: 30rpx 0;
border-bottom: 1px solid #EBEBEB;
display: flex;
flex-direction: column;
}
.news-box:first-child{
padding-top: 0;
}
.news-title{
color: #242424;
font-size: 30rpx;
font-weight: bold;
}
.news-info{
color: #949494;
margin-top: 15rpx;
font-size: 24rpx;
}
.news-info text{
margin-right: 20rpx;
}
.news-big-pic, .news-small-pic{
margin-top: 10rpx;
}
.news-big-pic image{
width: 100%;
}
.news-small-pic image{
width: 100%;
height: 400rpx;
}
.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%;
}

View File

@ -11,7 +11,7 @@
<body> <body>
<div id="app"> <div id="app">
<div class="video"> <div class="video">
<video src="" id="video" controls></video> <video :src="videoPath" id="video" controls controlslist="nodownload"></video>
</div> </div>
<div class="video-list"> <div class="video-list">
<ul v-cloak> <ul v-cloak>
@ -22,7 +22,7 @@
<script src="js/jquery-2.1.4.min.js"></script> <script src="js/jquery-2.1.4.min.js"></script>
<script src="js/layer_mobile/layer.js"></script> <script src="js/layer_mobile/layer.js"></script>
<script src="js/vue.js"></script> <script src="js/vue.js"></script>
<script src="js/flv.min.js"></script> <!-- <script src="js/flv.min.js"></script> -->
<script> <script>
var vue = new Vue({ var vue = new Vue({
el: '#app', el: '#app',
@ -33,11 +33,12 @@
liveRecordSrc: null, liveRecordSrc: null,
liveRecordList: [], liveRecordList: [],
currentPage: 1, currentPage: 1,
rows: 20 rows: 20,
videoPath: ''
}, },
methods: { methods: {
playVideo: function(liveRecordSrc) { playVideo: function(liveRecordSrc) {
this.initFlvPlayer(this.liveRecordUrl + '/' + liveRecordSrc); this.videoPath = liveRecordSrc
}, },
getPathParams: function(url) { getPathParams: function(url) {
var params = url.split('?')[1]; var params = url.split('?')[1];
@ -112,19 +113,6 @@
}, 1000); }, 1000);
} }
}); });
},
initFlvPlayer: function(videoUrl) {
var self = this;
if (flvjs.isSupported()) {
var videoElement = document.getElementById('video');
var flvPlayer = flvjs.createPlayer({
type: 'flv',
url: videoUrl
});
flvPlayer.attachMediaElement(videoElement);
flvPlayer.load();
flvPlayer.play();
}
} }
}, },
mounted: function() { mounted: function() {