提交 66274909 authored 作者: 周文彬's avatar 周文彬

1126

上级 d6358db3
<script>
export default {
onLaunch: function() {
console.log('App Launch')
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
// onLaunch: function() {
// console.log('App Launch')
// },
// onShow: function() {
// console.log('App Show')
// },
// onHide: function() {
// console.log('App Hide')
// }
}
</script>
......
......@@ -74,11 +74,58 @@ export function getSpecialAPI (params) {
method: 'get'
})
}
//推荐位 GET /wap/
//推荐位
export function getRecommendAPI (params) {
return ajax({
url: `${requestPath.resource}/recommend/content/list`,
method: 'get',
data:params
})
}
// 专题列表
export function getSpecialListAPI (params) {
return ajax({
url: `${requestPath.resource}/project-library/page`,
method: 'get',
data:params
})
}
//专题关联资源分页
export function getSpecialRelationAPI (params) {
return ajax({
url: `${requestPath.resource}/project-library/page/resource`,
method: 'get',
data:params
})
}
// 专题详情
export function getSpecialDetailAPI (params) {
return ajax({
url: `${requestPath.resource}/project-library/get/${params}`,
method: 'get'
})
}
//音频
export function getMusicDetailAPI (params) {
return ajax({
url: `${requestPath.resource}/audio-library/getwap/${params}`,
method: 'get'
})
}
// 视频
export function getVideoDetailAPI (params) {
return ajax({
url: `${requestPath.resource}/video-library/getwap/${params}`,
method: 'get'
})
}
// GET /file/
export function getFileAPI (params) {
return ajax({
url: `${requestPath.file}/getFilePath`,
method: 'get',
data:params
})
}
\ No newline at end of file
......@@ -5,10 +5,10 @@
<image :src='startPic' class='icon' v-show='!status'></image>
<image :src='endPic' class='icon' v-show='status'></image>
</view>
<view class='flex-1'>
<!-- <view class='flex-1'>
<slider @change='changeAudio' :activeColor='activeColor' :min='0' :max='duration.toFixed(0)' :value='currentTime.toFixed(0)' :step='0.1'></slider>
</view>
<view class='ml-3'>{{getTime(Math.round(currentTime))}}</view>
</view> -->
<!-- <view class='ml-3'>{{getTime(Math.round(currentTime))}}</view> -->
</view>
</template>
......@@ -86,14 +86,16 @@
}
</script>
<style>
.audio {
background: #F4F4F4;
padding: 20rpx;
<style lang="less" scoped>
.mr-3{
width: 100%;
position: relative;
}
.icon {
width: 80rpx;
height: 80rpx;
width: 96rpx;
height: 97rpx;
position: absolute;
left: 50%;
transform: translateX(-50%);
}
</style>
{
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/newIndex/newIndex"
},
{
"path": "pages/microIndex/microIndex"
},
{
"path": "pages/index/index"
},
{
"path": "pages/microIndex/microIndex"
},
{
"path": "pages/video/video"
},
......
<template>
<view class="articalBox">
<view class="listCon">
<dl>
<dt>
<image src="../../static/topicImg.png" mode=""></image>
</dt>
<dd>
<ul>
<li class="topicTitle">裴李岗遗址最新测年距今8000年前后 发现旧石器晚期遗存</li>
<li class="uploadTimer">
<span>中国新闻网</span>
<span>2020-11-03</span>
</li>
</ul>
</dd>
</dl>
<dl>
<!-- <dt>
<image src="../../static/topicImg.png" mode=""></image>
</dt> -->
<dd>
<ul>
<li class="topicTitle">裴李岗遗址最新测年距今8000年前后 发现旧石器晚期遗存</li>
<li class="uploadTimer">
<span>中国新闻网</span>
<span>2020-11-03</span>
</li>
</ul>
</dd>
</dl>
<view class="listCon">
<block v-for="(item,index) in list" :key="item.id">
<dl @tap="goDetail(item.resId)">
<dt v-if="item.resImg">
<image :src="fileUrl(item.resImg)"></image>
</dt>
<dd>
<ul>
<li class="topicTitle">{{item.resName}}</li>
<li class="uploadTimer">
<span>{{item.source == null?'':item.source}}</span>
<span v-if="item.createTime">{{item.createTime.substring(0,10)}}</span>
</li>
</ul>
</dd>
</dl>
</block>
</view>
<view class="bottomLine" v-if="isLast && !isNull">—— 这是我的底线 ——</view>
<view class="nodata_view" v-if="isNull">
<image class="nodata_img" mode="aspectFit" src="../../static/nodata.png"></image>
<text class="nodata_text">抱歉,没有找到相关内容</text>
</view>
</view>
</template>
<script>
<script>
import { getRecommendAPI } from '../../api/index.js';
export default {
data() {
return {
listQuery:{
recomCode:'Selected_Articles',
pageNum:1,
pageSize:10
},
list:[],
isNull: null,
isLast: null,
}
},
onLoad() {
this.listQuery.pageNum = 1
this.getList()
},
onReachBottom() {
if (!this.isLast) {//判断是否有下一页
this.listQuery.pageNum += 1
this.getSpecialList()
}
},
methods: {
methods: {
goDetail(id){
uni.navigateTo({
url: '../details/article?id='+id
})
},
getList(){
getRecommendAPI(this.listQuery).then(res => {
if(res.data.code == 0){
try{
if(res.data.data.list.length>0){
this.list.push(...res.data.data.list)
this.isNull = res.data.data.total == 0 ? true : false
this.isLast = !res.data.data.hasNextPage
}else{
this.list = []
this.isNull = true
}
}catch(e){
this.list = []
this.isNull = true
}
}
})
}
}
}
</script>
<style lang="less" scoped>
<style lang="less" scoped>
image{
border-radius: 10rpx;
}
.articalBox {
width: 100%;
height: 100%;
......@@ -125,5 +162,27 @@
}
}
}
}
.bottomLine{
width: 100%;
padding-bottom: 40rpx;
text-align: center;
color: #D5D7E0;
font-size: 24rpx;
margin-top: 20rpx;
}
.nodata_view{
text-align: center;
}
.nodata_img{
width: 452rpx;
margin-top: 100rpx;
}
.nodata_view .nodata_text{
display: inline-block;
width: 100%;
margin-top: 54rpx;
font-size: 34rpx;
color: #999999;
}
</style>
<template>
<view class="audioDetailBox">
<view class="audioCon">
<free-audio startPic='../../static/icon_detail_bofang.png' endPic='../../static/delete.png' :url='path'></free-audio>
<view class="audioCon">
<image class="topImg" v-if="obj.cover" :src="fileUrl(obj.cover)"></image>
<image src="../../static/icon_back.png" class="back" @tap="goback"></image>
<free-audio v-if="path" class="audio_view" startPic='../../static/icon_detail_music.png' endPic='../../static/icon_zanting.png' :url='path'></free-audio>
<!-- <audio style="text-align: left" :src="current.src" :poster="current.poster" :name="current.name" :author="current.author" :action="audioAction" controls></audio> -->
</view>
<view class="aduioRelations">
<h2>习近平主席在第三届中国国际进口博览会开幕式上的主旨演讲传递信心与力量</h2>
<text class="source">来源:中国政协</text>
<h2>{{obj.name}}</h2>
<text class="source" v-if="obj.source">来源:{{obj.source}}</text>
<view class="TimerAndPlayerNum">
<text>发布时间:2020-08-26</text>
<text>播放次数:500</text>
<text>发布时间:{{obj.uploadTime.substring(0,10)}}</text>
<text>播放次数:{{obj.clickNum}}</text>
</view>
</view>
<view class="synopsis">
<h3>简介</h3>
<p>11月4日,习近平主席在第三届中国国际进口博览会开幕式上发表主旨演讲,再次向世界展示了中国推动高水平开放的坚定决心和战略定力,再次向世界表明了中国致力于与各国互利共赢的不变初心和不懈追求,让与会代表和参展商受鼓舞、有信心、添动力。
“习近平主席提出的共同开放,体现着中国致力于推动全球化朝着更加包容的方向发展。”南非总统拉马福萨在致辞中如是表示。
“习近平主席的主旨演讲传递了新时代中国深化改革开放、推动合作共赢的强烈信号,彰显了中国推动建设开放型世界经济、携手共创美好未来的智慧与担当。”强生全球资深副总裁、中国区主席宋为群表示。</p>
<view v-html="obj.synopsis"> </view>
</view>
</view>
</template>
<script>
import freeAudio from '../../components/free-audio/free-audio.vue'
import freeAudio from '../../components/free-audio/free-audio.vue'
import { getMusicDetailAPI,getFileAPI } from '../../api/index.js'
import { ApiUrl } from 'env.js'
export default {
components: {
freeAudio
},
data() {
return {
path: '../../static/xgd.mp3'
path: null,
id:'',
obj:{}
}
},
onLoad(options) {
this.id = options.id
this.getMusicDetail()
},
methods: {
getMusicDetail(){
getMusicDetailAPI(this.id).then(res => {
if(res.data.code == 0){
this.obj = res.data.data
let audio = res.data.data.audio
this.getFile(audio)
}
})
},
goback(){
uni.navigateBack({
delta: 1
});
},
getFile(audio){
getFileAPI({fileName:audio}).then(res => {
if(res.data.code == 0){
this.path = `${ApiUrl}/`+ res.data.data
console.log(this.path)
}
})
}
}
}
......@@ -45,7 +76,27 @@
width: 100%;
background: #f2f2f2;
.audioCon {
width: 100%;
width: 100%;
height: 420rpx;
position: relative;
}
.topImg{
width: 100%;
height: 420rpx;
}
.back{
width: 20rpx;
height: 34rpx;
position: absolute;
left: 24rpx;
top: 67rpx;
z-index: 999;
}
.audio_view{
position: absolute;
width: 100%;
top: 50%;
left: 0;
}
.aduioRelations {
width: 100%;
......
......@@ -38,7 +38,6 @@
});
},
getDetail(){
console.log(777)
getArticleAPI(this.id).then( res => {
if(res.data.code==0){
this.articleData=res.data.data;
......
......@@ -56,9 +56,13 @@
</view>
</view>
</view>
</view>
<view class="readBox" @click="readpdf(bookData.pdf,bookData.download)">
<view class="readbtn">
</view>
<view class="readBox">
<view class="readEpub">
立即阅读
</view>
<view class="readbtn" @click="readpdf(bookData.pdf,bookData.download)">
<image src="../../static/read.png" mode=""></image>
<text>阅读PDF</text>
</view>
......@@ -148,15 +152,18 @@
let topScroll = that.getScrollTop();
console.log(topScroll)
let bignav = document.getElementById("tabBars");
if(topScroll > 322){
bignav.style.position = 'fixed';
bignav.style.top = '0';
bignav.style.zIndex = '9999';
}
if(topScroll < 277){
bignav.style.position = 'static';
let bignav = document.getElementById("tabBars");
try{
if(topScroll > 322){
bignav.style.position = 'fixed';
bignav.style.top = '0';
bignav.style.zIndex = '9999';
}
if(topScroll < 277){
bignav.style.position = 'static';
}
}catch(e){
console.log(e)
}
})
}
......@@ -315,25 +322,40 @@
width: 100%;
position: fixed;
background: white;
bottom: 0;
box-shadow:0px 8px 11px 0px rgba(255, 49, 163, 0.35);
bottom: 0;
display: flex;
justify-content: space-around;
box-shadow:0px 8px 11px 0px rgba(255, 49, 163, 0.35);
.readEpub{
width:600upx;
height:76upx;
font-size: 14px;
background:rgb(41,155,255);
color: white;
text-align: center;
line-height: 76upx;
}
.readbtn{
bottom: 0;
margin: 16upx 64upx;
width:620upx;
width:220upx;
height:76upx;
font-size: 16px;
font-size: 14px;
background:rgba(255,163,49,1);
border-radius:38px;
color: white;
text-align: center;
line-height: 76upx;
line-height: 76upx;
position: relative;
text{
line-height: 76upx;
padding-left: 36upx;
}
image{
width: 40upx;
height: 34upx;
margin-right: 20upx;
vertical-align: middle;
width: 30upx;
height: 26upx;
margin-right: 10upx;
position: absolute;
top: 50%;
transform: translateY(-50%);
}
}
}
......
<template>
<view class="microIndexBox">
<view class="topBanner">
<image src="../../static/topBanner.png" mode=""></image>
<image v-if="topImg" :src="fileUrl(topImg)"></image>
</view>
<view class="listCon">
<dl>
<dt>
<image src="../../static/54ee75366dab20f8831607.png" mode=""></image>
</dt>
<dd>政协70周年</dd>
</dl>
<dl>
<dt>
<image src="../../static/54ee75366dab20f8831607.png" mode=""></image>
</dt>
<dd>政协70周年</dd>
</dl>
<dl>
<dt>
<image src="../../static/54ee75366dab20f8831607.png" mode=""></image>
</dt>
<dd>政协70周年</dd>
</dl>
<dl>
<dt>
<image src="../../static/54ee75366dab20f8831607.png" mode=""></image>
</dt>
<dd>政协70周年</dd>
</dl>
<view class="listCon">
<block v-for="(item,index) in list" :key="item.id">
<dl class="list_view" @tap="goTopicDetail(item.id)">
<dt>
<image v-if="item.cover1" :src="fileUrl(item.cover1)" mode=""></image>
<image src="../../static/no_picture.png" v-else></image>
</dt>
<dd class="list_name">{{item.name}}</dd>
</dl>
</block>
</view>
<view class="bottomLine" v-if="isLast && !isNull">—— 这是我的底线 ——</view>
<view class="nodata_view" v-if="isNull">
<image class="nodata_img" mode="aspectFit" src="../../static/nodata.png"></image>
<text class="nodata_text">抱歉,没有找到相关内容</text>
</view>
</view>
</template>
<script>
<script>
import { getSpecialListAPI,getIndexLbAPI } from '../../api/index.js'
export default {
data() {
return {
listQuery:{
type:1,
pageNum:1,
pageSize:20
},
topImg:null,
isNull: null,
isLast: null,
list:[]
};
},
onLoad() {
this.getTopImg()
this.listQuery.pageNum = 1
this.getSpecialList()
},
onReachBottom() {
if (!this.isLast) {//判断是否有下一页
this.listQuery.pageNum += 1
this.getSpecialList()
}
},
methods: {
getSpecialList(){
getSpecialListAPI(this.listQuery).then(res => {
this.isShowLoad=false
if(res.data.code == 0){
try{
if(res.data.data.list.length>0){
this.list.push(...res.data.data.list)
this.isNull = res.data.data.total == 0 ? true : false
this.isLast = !res.data.data.hasNextPage
}else{
this.list = []
this.isNull = true
}
}catch(e){
this.list = []
this.isNull = true
}
}
})
},
getTopImg(){
getIndexLbAPI({signValue:'z_project',num:1}).then(res => {
if(res.data.code == 0){
this.topImg = res.data.data[0].picture
}
})
},
goTopicDetail(id){
uni.navigateTo({
url: '../topicDetail/topicDetail?id='+id
})
},
}
}
</script>
<style lang="less" scoped>
<style lang="less" scoped>
image{
border-radius: 20rpx;
}
.microIndexBox {
width: 100%;
.topBanner {
......@@ -58,11 +107,25 @@
.listCon {
width: 100%;
box-sizing: border-box;
padding: 0 30upx;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
line-height: 1;
padding: 0 30upx;
overflow: hidden;
// display: flex;
// justify-content: space-between;
// flex-wrap: wrap;
line-height: 1;
.list_name{
width: 100%;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.list_view{
float: left;
margin-left: 75upx;
}
.list_view:nth-child(3n+1){
margin-left: 0;
}
dl {
width: 180upx;
margin-top: 70upx;
......@@ -75,11 +138,32 @@
}
}
dd {
width: 100%;
text-align: center;
margin-top: 29upx;
}
}
}
}
.bottomLine{
width: 100%;
padding-bottom: 40rpx;
text-align: center;
color: #D5D7E0;
font-size: 24rpx;
margin-top: 20rpx;
}
.nodata_view{
text-align: center;
}
.nodata_img{
width: 452rpx;
margin-top: 100rpx;
}
.nodata_view .nodata_text{
display: inline-block;
width: 100%;
margin-top: 54rpx;
font-size: 34rpx;
color: #999999;
}
</style>
......@@ -25,7 +25,7 @@
</view>
<view class="magazineList">
<block v-for="(item,index) in newMagazine" :key="item.id">
<dl>
<dl @tap="goDetails(item.id)">
<dt>
<image :src="fileUrl(item.bookCover)" mode=""></image>
</dt>
......@@ -37,14 +37,14 @@
</view>
<view class="topicBox">
<view class="top">
<view class="top topic_head">
<image src="../../static/topicPic.png" style="width: 79upx;"></image>
<span @tap="goTab(2)">更多</span>
</view>
<view class="topicList">
<block v-for="(item,index) in specialList" :key="item.id">
<dl>
<dl @tap="goTopicDetail(item.id)">
<dt>
<image :src="fileUrl(item.cover)"></image>
</dt>
......@@ -61,52 +61,27 @@
</view>
<view class="articalList">
<dl>
<dt>
<image src="../../static/topicImg.png" mode=""></image>
</dt>
<dd>
<ul>
<li class="topicTitle">裴李岗遗址最新测年距今8000年前后 发现旧石器晚期遗存</li>
<li class="uploadTimer">
<span>中国新闻网</span>
<span>2020-11-03</span>
</li>
</ul>
</dd>
</dl>
<dl>
<!-- <dt>
<image src="../../static/topicImg.png" mode=""></image>
</dt> -->
<dd>
<ul>
<li class="topicTitle">裴李岗遗址最新测年距今8000年前后 发现旧石器晚期遗存</li>
<li class="uploadTimer">
<span>中国新闻网</span>
<span>2020-11-03</span>
</li>
</ul>
</dd>
</dl>
<dl>
<!-- <dt>
<image src="../../static/topicImg.png" mode=""></image>
</dt> -->
<dd>
<ul>
<li class="topicTitle">裴李岗遗址最新测年距今8000年前后 发现旧石器晚期遗存</li>
<li class="videoPicCon">
<image src="../../static/swiperPic.png" mode=""></image>
<image src="../../static/icon_detail_bofang.png" mode=""></image>
</li>
<li class="uploadTimer">
<span>中国新闻网</span>
<span>2020-11-03</span>
</li>
</ul>
</dd>
</dl>
<block v-for="(item,index) in articList" :key="index">
<dl @tap="goArticalDetail(item.resId)">
<dt v-if="item.resImg != null">
<image :src="fileUrl(item.resImg)"></image>
</dt>
<dd>
<ul>
<li class="topicTitle">{{item.resName}}</li>
<!-- <li class="videoPicCon">
<image src="../../static/swiperPic.png" mode=""></image>
<image src="../../static/icon_detail_bofang.png" mode=""></image>
</li> -->
<li class="uploadTimer">
<span>{{item.source == null?'':item.source}}</span>
<span v-if="item.createTime">{{item.createTime.substring(0,10)}}</span>
</li>
</ul>
</dd>
</dl>
</block>
</view>
</view>
</block>
......@@ -126,14 +101,15 @@
listObj:{
recomCode:'Selected_Articles',
pageNum:1,
pageSize:10
pageSize:5
},
total:0,
indicatorDots: true,
autoplay: true,
interval: 5000,
duration: 500,
circular:true,
circular:true,
articList:[]
}
},
onLoad() {
......@@ -162,9 +138,25 @@
getRecommendAPI({...this.listObj}).then(res => {
if(res.data.code == 0){
this.total = res.data.data.total
this.articList = res.data.data.list
}
})
},
goDetails(id){
uni.navigateTo({
url: '../details/index?id='+id
})
},
goTopicDetail(id){
uni.navigateTo({
url: '../topicDetail/topicDetail?id='+id
})
},
goArticalDetail(id){
uni.navigateTo({
url: '../details/article?id='+id
})
},
getEbookNew(){
getEbookNewAPI().then(res => {
if(res.data.code ==0){
......@@ -190,16 +182,18 @@
})
}else if(num == 3){
uni.switchTab({
url: 'pages/articalPage/articalPage'
url: '/pages/articalPage/articalPage'
})
}
}
//
}
}
}
</script>
<style lang="less" scoped>
<style lang="less" scoped>
image{
border-radius: 10rpx;
}
.indexBox {
width: 100%;
height: 100%;
......@@ -269,7 +263,8 @@
width: 100%;
padding: 0 30upx;
box-sizing: border-box;
display: flex;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 50upx;
image {
......@@ -281,11 +276,13 @@
font-size: 26upx;
background: url(../../static/arrow.png) no-repeat;
background-size: 12upx 20upx;
background-position: 58upx 14upx;
background-position: 58upx center;
width: 68upx;
}
}
.topic_head{
margin-bottom: 0;
}
.magazineList {
width: 100%;
box-sizing: border-box;
......@@ -328,7 +325,8 @@
flex-wrap: wrap;
box-sizing: border-box;
dl {
width: 330upx;
width: 330upx;
margin-top: 20rpx;
dt {
width: 100%;
height: 220upx;
......@@ -337,12 +335,23 @@
height: 100%;
}
}
dd {
dd {
color: #333333;
font-weight: 600;
width: 100%;
text-align: center;
text-align: center;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
line-height: 1;
margin-top: 30upx;
}
}
dl:nth-of-type(3){
margin-top: 45rpx;
}
dl:nth-of-type(4){
margin-top: 45rpx;
}
}
}
......@@ -351,7 +360,7 @@
width: 100%;
background: #FFFFFF;
margin-top: 20upx;
padding: 50upx 0 158upx 0;
padding: 50upx 0 58upx 0;
box-sizing: border-box;
.articalList {
width: 100%;
......
......@@ -162,7 +162,6 @@ export default {
if(data.data.code==0){
listData=data.data.data.list
}
//联网成功的回调
successCallback && successCallback(listData);
},
......
<template>
<view class="topicBox">
<view class="topBanner">
<image src="../../static/topBanner.png" mode=""></image>
<image :src="fileUrl(topImg)" mode=""></image>
</view>
<view class="toppicList">
<uni-load-more status="loading" v-if="isShowLoad"></uni-load-more>
<mescroll-uni v-else @down="downCallback" @up="upCallback" @init="mescrollInit">
<dl class="itemCon">
<dt>
<image src="../../static/topicImg.png" mode=""></image>
</dt>
<dd>全新风貌再现百年历史</dd>
</dl>
<dl class="itemCon">
<dt>
<image src="../../static/topicImg.png" mode=""></image>
</dt>
<dd>全新风貌再现百年历史</dd>
</dl>
<dl class="itemCon">
<dt>
<image src="../../static/topicImg.png" mode=""></image>
</dt>
<dd>全新风貌再现百年历史</dd>
</dl>
<view class="" v-if="showLoading"></view>
</mescroll-uni>
<view class="toppicList">
<block v-for="(item,index) in list">
<dl class="itemCon" @tap="goTopicDetail(item.id)">
<dt>
<image :src="fileUrl(item.cover)"></image>
</dt>
<dd class="list_name">{{item.name}}</dd>
</dl>
</block>
</view>
<view class="bottomLine" v-if="isLast && !isNull">—— 这是我的底线 ——</view>
<view class="nodata_view" v-if="isNull">
<image class="nodata_img" mode="aspectFit" src="../../static/nodata.png"></image>
<text class="nodata_text">抱歉,没有找到相关内容</text>
</view>
</view>
</template>
<script>
import MescrollUni from "../../components/mescroll-uni/mescroll-uni.vue";
import uniLoadMore from "../../components/uni-load-more/uni-load-more.vue";
<script>
import {getSpecialListAPI,getIndexLbAPI} from '../../api/index.js'
export default {
components: {
MescrollUni,
uniLoadMore
},
data() {
return {
isShowLoad: false,
showLoading:false,
mescroll: null,
return {
topImg:null,
listQuery:{
type:0,
pageNum:1,
pageSize:20
},
isNull: null,
isLast: null,
list:[]
}
},
onLoad() {
this.getTopImg()
this.listQuery.pageNum = 1
this.getSpecialList()
},
//注册滚动到底部的事件,用于上拉加载
onReachBottom() {
this.mescroll && this.mescroll.onReachBottom();
},
//注册列表滚动事件,用于下拉刷新
onPageScroll(e) {
this.mescroll && this.mescroll.onPageScroll(e);
if (!this.isLast) {//判断是否有下一页
this.listQuery.pageNum += 1
this.getSpecialList()
}
},
methods: {
mescrollInit(mescroll) {
this.mescroll = mescroll;
},
// 下拉刷新的回调
downCallback(mescroll){
mescroll.resetUpScroll()
methods: {
getSpecialList(){
getSpecialListAPI(this.listQuery).then(res => {
this.isShowLoad=false
if(res.data.code == 0){
try{
if(res.data.data.list.length>0){
this.list.push(...res.data.data.list)
this.isNull = res.data.data.total == 0 ? true : false
this.isLast = !res.data.data.hasNextPage
}else{
this.list = []
this.isNull = true
}
}catch(e){
this.list = []
this.isNull = true
}
}
})
},
getTopImg(){
getIndexLbAPI({signValue:'z_project',num:1}).then(res => {
if(res.data.code == 0){
this.topImg = res.data.data[0].picture
}
})
},
goTopicDetail(id){
uni.navigateTo({
url: '../topicDetail/topicDetail?id='+id
})
},
upCallback(mescroll) {
console.log(9)
//联网加载数据
//this.listQuery.pageNum=mescroll.num;
// this.getListDataFromNet(this.listQuery, (curPageData)=>{
// mescroll.endSuccess(curPageData.length);
// //设置列表数据
// if(mescroll.num == 1) this.list = [];
// this.list=this.list.concat(curPageData);
// }, () => {
// //联网失败的回调,隐藏下拉刷新的状态
// mescroll.endErr();
// })
},
}
}
</script>
<style lang="less" scoped>
<style lang="less" scoped>
image{
border-radius: 10rpx;
}
.topicBox {
width: 100%;
height: 100%;
......@@ -92,17 +104,29 @@
height: 100%;
}
}
}
.list_bottom{
color: #A8ACB4;
text-align: center;
font-size: 24rpx;
}
.toppicList {
width: 100%;
box-sizing: border-box;
padding: 0 30upx;
padding: 0 30upx;
overflow: hidden;
.itemCon {
width: 325upx;
float: left;
margin-top: 60upx;
&:nth-of-type(2n) {
margin-left: 40upx;
}
.list_name{
width: 100%;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
dt {
width: 100%;
......@@ -121,5 +145,27 @@
font-size: 28upx;
}
}
}
.bottomLine{
width: 100%;
padding-bottom: 40rpx;
text-align: center;
color: #D5D7E0;
font-size: 24rpx;
margin-top: 20rpx;
}
.nodata_view{
text-align: center;
}
.nodata_img{
width: 452rpx;
margin-top: 100rpx;
}
.nodata_view .nodata_text{
display: inline-block;
width: 100%;
margin-top: 54rpx;
font-size: 34rpx;
color: #999999;
}
</style>
<template>
<view class="topicDetailBox">
<view class="topBanner">
<image src="../../static/swiperPic.png" mode=""></image>
<view class="topicDetailBox">
<!-- <view class="backBox">
<image src="../../static/back.png" mode="" class="back" @click="goBack()"></image>
</view> -->
<view class="topBanner" v-if="topImg">
<image :src="fileUrl(topImg)"></image>
</view>
<view class="list">
<dl>
<dt>
<image src="../../static/topicImg.png" mode=""></image>
</dt>
<dd>
<ul>
<li class="topicTitle">裴李岗遗址最新测年距今8000年前后 发现旧石器晚期遗存</li>
<li class="uploadTimer">
<span>中国新闻网</span>
<span>2020-11-03</span>
</li>
</ul>
</dd>
</dl>
<dl>
<!-- <dt>
<image src="../../static/topicImg.png" mode=""></image>
</dt> -->
<dd>
<ul>
<li class="topicTitle">裴李岗遗址最新测年距今8000年前后 发现旧石器晚期遗存</li>
<li class="uploadTimer">
<span>中国新闻网</span>
<span>2020-11-03</span>
</li>
</ul>
</dd>
</dl>
<dl>
<!-- <dt>
<image src="../../static/topicImg.png" mode=""></image>
</dt> -->
<dd>
<ul>
<li class="topicTitle">裴李岗遗址最新测年距今8000年前后 发现旧石器晚期遗存</li>
<li class="videoPicCon">
<image src="../../static/swiperPic.png" mode=""></image>
<image src="../../static/icon_detail_bofang.png" mode=""></image>
</li>
<li class="uploadTimer">
<span>中国新闻网</span>
<span>2020-11-03</span>
</li>
</ul>
</dd>
</dl>
<view class="list">
<block v-for="(item,index) in list" :ket="item.id">
<dl @tap="goDetail(item.resourceType,item.id)">
<dt v-if="item.img && item.resourceType != 5">
<image :src="fileUrl(item.img)"></image>
<image src="../../static/icon_detail_music.png" v-if="item.resourceType == 6"></image>
</dt>
<dd>
<ul>
<li class="topicTitle">{{item.name}}</li>
<li class="videoPicCon" v-if="item.resourceType == 5 && item.img">
<image :src="fileUrl(item.img)" mode=""></image>
<image src="../../static/icon_detail_bofang.png" mode=""></image>
</li>
<li class="uploadTimer">
<span>{{item.source}}</span>
<span>{{item.uploadTime.substring(0,10)}}</span>
</li>
</ul>
</dd>
</dl>
</block>
</view>
<view class="bottomLine" v-if="isLast && !isNull">—— 这是我的底线 ——</view>
<view class="nodata_view" v-if="isNull">
<image class="nodata_img" mode="aspectFit" src="../../static/nodata.png"></image>
<text class="nodata_text">抱歉,没有找到相关内容</text>
</view>
</view>
</template>
<script>
<script>
import {getSpecialRelationAPI,getSpecialDetailAPI} from "../../api/index.js"
export default {
data() {
return {
return {
listQuery:{
id:'',
pageNum:1,
pageSize:20
},
topImg:null,
list:[],
isNull: null,
isLast: null,
}
},
onLoad(options) {
this.listQuery.id = options.id
this.getList()
this.getSpecialDetail()
},
onReachBottom() {
if (!this.isLast) {//判断是否有下一页
this.listQuery.pageNum += 1
this.getList()
}
},
methods: {
goBack() {
uni.navigateBack({
delta: 1
});
},
getSpecialDetail(){
getSpecialDetailAPI(this.listQuery.id).then(res => {
if(res.data.code == 0){
this.topImg = res.data.data.backcover
}
})
},
getList(){
getSpecialRelationAPI(this.listQuery).then(res => {
try{
if(res.data.data.list.length>0){
this.list.push(...res.data.data.list)
this.isNull = res.data.data.total == 0 ? true : false
this.isLast = !res.data.data.hasNextPage
}else{
this.list = []
this.isNull = true
}
}catch(e){
this.list = []
this.isNull = true
}
})
},
goDetail(type,id){
if(type == 2){
uni.navigateTo({
url: '../details/article?id='+id
})
}else if(type == 5){
uni.navigateTo({
url: '../video/video?id='+id
})
}else if(type == 6){
uni.navigateTo({
url: '../audio/audio?id='+id
})
}
}
}
}
</script>
......@@ -72,7 +119,21 @@
width: 100%;
height: 100%;
box-sizing: border-box;
padding-top: 30upx;
padding-top: 30upx;
.backBox {
height: 68upx;
padding: 16upx 30upx 10upx 24upx;
position: absolute;
top: 0;
left: 20upx;
}
.back {
height: 38upx;
width: 21upx;
vertical-align: middle;
margin-top: 6upx;
}
.topBanner {
width: 100%;
height: 300upx;
......@@ -104,10 +165,21 @@
dt {
width: 200upx;
height: 134upx;
border-radius: 10upx;
image {
width: 100%;
height: 100%;
border-radius: 10upx;
position: relative;
image:nth-of-type(1) {
width: 100%;
height: 100%;
}
image:nth-of-type(2) {
width: 50upx;
height: 50upx;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
}
}
dd {
......@@ -159,5 +231,27 @@
}
}
}
}
.bottomLine{
width: 100%;
padding-bottom: 40rpx;
text-align: center;
color: #D5D7E0;
font-size: 24rpx;
margin-top: 20rpx;
}
.nodata_view{
text-align: center;
}
.nodata_img{
width: 452rpx;
margin-top: 100rpx;
}
.nodata_view .nodata_text{
display: inline-block;
width: 100%;
margin-top: 54rpx;
font-size: 34rpx;
color: #999999;
}
</style>
<template>
<view class="audioDetailBox">
<view class="audioCon">
<video id="myVideo" :src=src controls></video>
<video id="myVideo" :src="src" controls @play="startPlay">
<cover-image v-if="obj.img && imgFlag" class="topImg" :src="fileUrl(obj.img)"></cover-image>
<cover-image @tap="goback" class="back" src="../../static/icon_back.png"></cover-image>
</video>
</view>
<view class="aduioRelations">
<h2>习近平主席在第三届中国国际进口博览会开幕式上的主旨演讲传递信心与力量</h2>
<text class="source">来源:中国政协</text>
<h2>{{obj.name}}</h2>
<text class="source" v-if="obj.adSlogan">来源:{{obj.adSlogan}}</text>
<view class="TimerAndPlayerNum">
<text>发布时间:2020-08-26</text>
<text>播放次数:500</text>
<text>发布时间:{{obj.uploadTime.substring(0,10)}}</text>
<text>播放次数:{{obj.clickNum}}</text>
</view>
</view>
<view class="synopsis">
<h3>简介</h3>
<p>11月4日,习近平主席在第三届中国国际进口博览会开幕式上发表主旨演讲,再次向世界展示了中国推动高水平开放的坚定决心和战略定力,再次向世界表明了中国致力于与各国互利共赢的不变初心和不懈追求,让与会代表和参展商受鼓舞、有信心、添动力。
“习近平主席提出的共同开放,体现着中国致力于推动全球化朝着更加包容的方向发展。”南非总统拉马福萨在致辞中如是表示。
“习近平主席的主旨演讲传递了新时代中国深化改革开放、推动合作共赢的强烈信号,彰显了中国推动建设开放型世界经济、携手共创美好未来的智慧与担当。”强生全球资深副总裁、中国区主席宋为群表示。</p>
<view v-html="obj.synopsis"></view>
</view>
</view>
</template>
<script>
import freeAudio from '../../components/free-audio/free-audio.vue'
import freeAudio from '../../components/free-audio/free-audio.vue'
import {getVideoDetailAPI,getFileAPI} from '../../api/index.js'
import { ApiUrl } from 'env.js'
export default {
components: {
freeAudio
},
data() {
return {
src: '../../static/yy.mp4',
src: '',
id:'',
obj:{},
imgFlag:true
}
},
onLoad(options) {
this.id = options.id
this.getVideoDetail()
},
onReady: function(res) {
// #ifndef MP-ALIPAY
......@@ -40,7 +50,32 @@
// #endif
},
methods: {
getVideoDetail(){
getVideoDetailAPI(this.id).then(res => {
if(res.data.code == 0){
this.obj = res.data.data
let video = res.data.data.video
this.getFile(video)
}
})
},
goback(){
uni.navigateBack({
delta: 1
});
},
getFile(video){
getFileAPI({fileName:video}).then(res => {
if(res.data.code == 0){
this.src = `${ApiUrl}/`+ res.data.data
console.log(this.src)
}
})
},
startPlay(){
this.imgFlag = false
}
}
}
</script>
......@@ -51,7 +86,23 @@
background: #f2f2f2;
.audioCon {
width: 100%;
height: 390upx;
height: 420upx;
position: relative;
.topImg{
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
}
.back{
width: 20rpx;
height: 34rpx;
position: absolute;
left: 24rpx;
top: 67rpx;
z-index: 999;
}
#myVideo {
width: 100%;
height: 100%;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论