宣传资讯

This commit is contained in:
shijingjing
2022-04-24 17:42:09 +08:00
parent 86dd335cae
commit 93a636bca7
5 changed files with 444 additions and 347 deletions

View File

@@ -1,361 +1,91 @@
<template>
<div class="AppInfotainment">
<div class="header">
<div class="header-tab">
<img src="https://cdn.cunwuyun.cn/dvcp/live/dh.png" alt="" class="more-icon" @click="toSelect()">
<u-tabs :list="tabList" :current="currIndex" @change="changeTab" style="width:650rpx" :font-size="26"></u-tabs>
<!-- <div v-for="(item, index) in tabList" :key="index" @click="changeTab(index)" v-if="index < 5" :class="currIndex == index ? 'tab-item active-item' : 'tab-item'">{{item}}<span class="active-line" v-if="currIndex == index"></span></div> -->
<div class="fiveIndustry">
<div class="title">
<h2>{{ title }}</h2>
<p>实现乡村振兴的物质基础</p>
</div>
<div class="list">
<div class="item" v-for="(item,index) in list" :key="index">
<span>产业资讯</span>
<span><u-icon name="arrow-right"></u-icon></span>
</div>
</div>
<div class="news-list">
<div class="item" hover-class="bg-hover" v-for="(item, index) in newsList" :key="index" @click="toDetail(item)">
<div class="item-wrapper solid" :style="{display: type === '1' ? 'block' : 'flex'}">
<div class="item-left flex1">
<h2 :style="{marginBottom: item.type === '1' ? '16rpx' : '30rpx'}" v-if="item.type != '1'">{{ item.title }}</h2>
<div class="item-video" v-if="item.type === '1'">
<p class="item-title">{{item.title}}</p>
<image class="play-btn" src="https://cdn.cunwuyun.cn/dvcp/pay-btn.png" />
<div class="mask"></div>
<image class="cover" :src="item.coverFile" mode="aspectFill" />
</div>
<div class="item-left__bottom item-active" :class="[item.photo ? 'item-active' : '']">
<span class="top-text" v-if="item.top == 1">置顶</span>
<span>{{tabList[item.detailType].name || ''}}</span>
<span>{{ item.createTime ? item.createTime.split(' ')[0] : '' }}</span>
</div>
</div>
<image v-if="item.type === '0'" :src="item.coverFile" mode="aspectFill" />
</div>
</div>
<AiEmpty v-if="!newsList.length && isShowEmpty"/>
<div class="noMore" v-if="isMore && current !== 0">没有更多了噢</div>
</div>
<!-- <AiEmpty description="暂无数据" v-else /> -->
</div>
</template>
<script>
export default {
export default {
name: 'AppInfotainment',
appName: '宣传资讯',
data () {
data() {
return {
currIndex: 0,
title: '',
// isLoading: false,
newsList: [],
isShowEmpty: false,
isMore: false,
current: 0,
areaId: '',
tabList: [{name: '全部'}, {name: '通知公告'}, {name: '工作动态'},
{name: '惠民政策'}, {name: '中央精神'},{name: '旅游故事'},{name: '特色农产品'}]
fiveList: [],
title: '产业振兴',
current: 1,
categoryType: '0',
list: [],
}
},
onLoad (params) {
// this.areaId = params.areaId
// uni.setStorageSync('newTypeIndex', '')
// this.$loading()
// this.getNewsList()
// uni.setNavigationBarTitle({
// title: params.title || '乡村资讯', //页面标题
// })
},
onShow() {
// if(uni.getStorageSync('newTypeIndex')) {
// this.currIndex = uni.getStorageSync('newTypeIndex')
// this.getListInit()
// }
document.title = this.title
this.getFiveList()
},
methods: {
toSelect() {
// this.$linkTo(`./select?index=${this.currIndex}`)
uni.navigateTo({url: './select'})
},
changeTab(index) {
this.currIndex = index
this.getListInit()
},
onConfirm () {
this.isMore = false
this.current = 0
this.$loading()
this.$nextTick(() => {
this.getNewsList(this.areaId)
getFiveList() {
this.$http.post('/app/apppublicitycategory/list',null,{
params: {
categoryType: '0',
}
}).then((res)=>{
console.log(res);
this.fiveList = res.data.records
})
},
getListInit() {
this.isMore = false
this.current = 0
this.newsList = []
this.$loading()
this.getNewsList()
},
getNewsList() {
if (this.isMore || this.isLoading) return
var type = this.currIndex
if(this.currIndex == 0) {
type = ''
}
this.isLoading = true
this.$instance.post(`/app/appnewscenterinfo/listForWxNew?current=${this.current + 1}&type=${type}&size=10&title=${this.title}&areaId=${this.areaId}`, null, {
withoutToken: 1
}).then(res => {
if (res.code === 0) {
this.isShowEmpty = true
this.$hideLoading()
if (this.current === 0) {
this.newsList = []
}
if (!res.data.records.length) {
this.isMore = true
this.isLoading = false
this.$nextTick(() => {
this.pageShow = true
})
return false
}
const data = res.data.records
this.newsList.push(...data)
this.current = this.current + 1
this.isLoading = false
this.$nextTick(() => {
this.pageShow = true
})
} else {
this.$hideLoading()
}
}).catch(() => {
this.$hideLoading()
this.isShowEmpty = true
this.isLoading = false
})
},
toDetail(item) {
if(item.detailType == 6 || item.detailType == 5) { //特色农产品 旅游故事
this.$linkTo(`/subPages/live/products?id=${item.id}&detailType=${item.detailType}`)
}else {
this.$linkTo(`/subPages/live/newsDetail?id=${item.id}&areaId=${this.areaId}&type=${this.currIndex}`)
}
},
},
onReachBottom () {
this.getNewsList(this.areaId)
}
}
}
</script>
<style lang="scss" scoped>
.header-tab{
background-color: #fff;
position: relative;
padding: 0 100rpx 0 0;
.more-icon{
position: absolute;
width: 40rpx;
height: 38rpx;
right: 32rpx;
top: 20rpx;
}
.tab-item{
color: #666;
}
.active-item{
color: #3376FD;
}
.active-line{
background-color: #3376FD;
}
}
.news-list{
padding-top: 20rpx;
}
.news {
min-height: 100vh;
padding-top: 96rpx;
background: #fff;
.AppInfotainment {
::v-deep .AppInfotainment {
background: none;
}
.fiveIndustry {
.item-video {
position: relative;
height: 388rpx;
margin-bottom: 24rpx;
.mask {
position: absolute;
width: 100%;
height: 100%;
z-index: 11;
background: rgba(0, 0, 0, 0.16);
}
.play-btn {
position: absolute;
top: 50%;
left: 50%;
z-index: 121;
width: 80rpx;
height: 80rpx;
margin: 0;
transform: translate(-50%, -50%);
}
.item-title{
width: 100%;
padding: 0 30rpx 10rpx;
font-size: 28rpx;
font-weight: 500;
color: #FFF;
line-height: 40rpx;
position: absolute;
bottom: 0;
left: 0;
word-break: break-all;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
background: rgba(0, 0, 0, .4);
.title {
padding: 30px 32px;
box-sizing: border-box;
}
.cover {
display: block;
width: 100%!important;
height: 388rpx!important;
margin-left: 0!important;
}
}
div {
box-sizing: border-box;
}
.noMore {
line-height: 90rpx;
text-align: center;
color: #999;
font-size: 26rpx;
}
.news {
background: #fff;
}
.header {
position: fixed;
left: 0;
top: 0;
z-index: 10000;
width: 100%;
padding: 8rpx 0;
background: #fff;
.header-search {
display: flex;
align-items: center;
width: 690rpx;
height: 60rpx;
margin: 0 auto 8rpx;
padding: 0 32rpx;
background: #0D6DDC;
border-radius: 30rpx;
image {
flex-shrink: 1;
width: 32rpx;
height: 32px;
margin-right: 12rpx;
}
input {
flex: 1;
height: 100%;
font-size: 28rpx;
color: #fff;
}
}
}
.item {
padding: 0 30rpx;
&:first-child {
.item-wrapper {
padding-top: 0!important;
}
}
.item-wrapper {
padding: 30rpx 0 20rpx;
display: flex;
align-items: center;
}
.item-left {
flex: 1;
height: 256px;
background: #FFF url('./components/bg.png') no-repeat right;
background-size: 336px 256px;
h2 {
margin-bottom: 32rpx;
color: #333333;
font-size: 30rpx;
font-weight: 700;
margin-top: 20px;
font-size: 50px;
font-weight: 800;
}
.item-left__bottom {
display: flex;
span {
margin-right: 10rpx;
color: #999999;
font-size: 22rpx;
&:last-child {
margin-right: 0;
}
}
.top-text{
font-size: 22rpx;
color: #EF4645;
margin-right: 16rpx;
}
}
}
image {
flex-shrink: 0;
width: 224rpx;
height: 140rpx;
// margin-left: 46rpx;
}
}
.no-more {
margin-top: 20rpx;
text-align: center;
color: #999;
image {
width: 400rpx;
height: 240rpx;
}
p {
text-align: center;
color: #999;
font-size: 28rpx;
margin-top: 16px;
font-size: 30px;
color: #999999;
}
}
.list {
margin-top: 24px;
background: #FFF;
padding: 0 32px;
box-sizing: border-box;
.item {
display: flex;
justify-content: space-between;
padding: 30px 0;
border-bottom: 1px solid #D8DDE6;
}
}
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -0,0 +1,360 @@
<template>
<div class="newList">
<div class="header">
<div class="header-tab">
<img src="https://cdn.cunwuyun.cn/dvcp/live/dh.png" alt="" class="more-icon" @click="toSelect()">
<u-tabs :list="tabList" :current="currIndex" @change="changeTab" style="width:650rpx" :font-size="26"></u-tabs>
<!-- <div v-for="(item, index) in tabList" :key="index" @click="changeTab(index)" v-if="index < 5" :class="currIndex == index ? 'tab-item active-item' : 'tab-item'">{{item}}<span class="active-line" v-if="currIndex == index"></span></div> -->
</div>
</div>
<div class="news-list">
<div class="item" hover-class="bg-hover" v-for="(item, index) in newsList" :key="index" @click="toDetail(item)">
<div class="item-wrapper solid" :style="{display: type === '1' ? 'block' : 'flex'}">
<div class="item-left flex1">
<h2 :style="{marginBottom: item.type === '1' ? '16rpx' : '30rpx'}" v-if="item.type != '1'">{{ item.title }}</h2>
<div class="item-video" v-if="item.type === '1'">
<p class="item-title">{{item.title}}</p>
<image class="play-btn" src="https://cdn.cunwuyun.cn/dvcp/pay-btn.png" />
<div class="mask"></div>
<image class="cover" :src="item.coverFile" mode="aspectFill" />
</div>
<div class="item-left__bottom item-active" :class="[item.photo ? 'item-active' : '']">
<span class="top-text" v-if="item.top == 1">置顶</span>
<span>{{tabList[item.detailType].name || ''}}</span>
<span>{{ item.createTime ? item.createTime.split(' ')[0] : '' }}</span>
</div>
</div>
<image v-if="item.type === '0'" :src="item.coverFile" mode="aspectFill" />
</div>
</div>
<AiEmpty v-if="!newsList.length && isShowEmpty"/>
<div class="noMore" v-if="isMore && current !== 0">没有更多了噢</div>
</div>
</div>
</template>
<script>
export default {
name: 'newList',
data () {
return {
currIndex: 0,
title: '',
isLoading: false,
newsList: [],
isShowEmpty: false,
isMore: false,
current: 0,
areaId: '',
tabList: [{name: '全部'}, {name: '通知公告'}, {name: '工作动态'},
{name: '惠民政策'}, {name: '中央精神'},{name: '旅游故事'},{name: '特色农产品'}]
}
},
onLoad (params) {
// this.areaId = params.areaId
// uni.setStorageSync('newTypeIndex', '')
// this.$loading()
// this.getNewsList()
// uni.setNavigationBarTitle({
// title: params.title || '乡村资讯', //页面标题
// })
},
onShow() {
// if(uni.getStorageSync('newTypeIndex')) {
// this.currIndex = uni.getStorageSync('newTypeIndex')
// this.getListInit()
// }
},
methods: {
toSelect() {
// this.$linkTo(`./select?index=${this.currIndex}`)
uni.navigateTo({url: './select'})
},
changeTab(index) {
this.currIndex = index
this.getListInit()
},
onConfirm () {
this.isMore = false
this.current = 0
// this.$loading()
this.$nextTick(() => {
this.getNewsList(this.areaId)
})
},
getListInit() {
this.isMore = false
this.current = 0
this.newsList = []
// this.$loading()
this.getNewsList()
},
getNewsList() {
if (this.isMore || this.isLoading) return
var type = this.currIndex
if(this.currIndex == 0) {
type = ''
}
this.isLoading = true
this.$instance.post(`/app/appnewscenterinfo/listForWxNew?current=${this.current + 1}&type=${type}&size=10&title=${this.title}&areaId=${this.areaId}`, null, {
withoutToken: 1
}).then(res => {
if (res.code === 0) {
this.isShowEmpty = true
// this.$hideLoading()
if (this.current === 0) {
this.newsList = []
}
if (!res.data.records.length) {
this.isMore = true
this.isLoading = false
this.$nextTick(() => {
this.pageShow = true
})
return false
}
const data = res.data.records
this.newsList.push(...data)
this.current = this.current + 1
this.isLoading = false
this.$nextTick(() => {
this.pageShow = true
})
} else {
// this.$hideLoading()
}
}).catch(() => {
// this.$hideLoading()
this.isShowEmpty = true
this.isLoading = false
})
},
toDetail(item) {
if(item.detailType == 6 || item.detailType == 5) { //特色农产品 旅游故事
this.$linkTo(`/subPages/live/products?id=${item.id}&detailType=${item.detailType}`)
}else {
this.$linkTo(`/subPages/live/newsDetail?id=${item.id}&areaId=${this.areaId}&type=${this.currIndex}`)
}
},
},
onReachBottom () {
this.getNewsList(this.areaId)
}
}
</script>
<style lang="scss" scoped>
.header-tab{
background-color: #fff;
position: relative;
padding: 0 100rpx 0 0;
.more-icon{
position: absolute;
width: 40rpx;
height: 38rpx;
right: 32rpx;
top: 20rpx;
}
.tab-item{
color: #666;
}
.active-item{
color: #3376FD;
}
.active-line{
background-color: #3376FD;
}
}
.news-list{
padding-top: 20rpx;
}
.news {
min-height: 100vh;
padding-top: 96rpx;
background: #fff;
}
.item-video {
position: relative;
height: 388rpx;
margin-bottom: 24rpx;
.mask {
position: absolute;
width: 100%;
height: 100%;
z-index: 11;
background: rgba(0, 0, 0, 0.16);
}
.play-btn {
position: absolute;
top: 50%;
left: 50%;
z-index: 121;
width: 80rpx;
height: 80rpx;
margin: 0;
transform: translate(-50%, -50%);
}
.item-title{
width: 100%;
padding: 0 30rpx 10rpx;
font-size: 28rpx;
font-weight: 500;
color: #FFF;
line-height: 40rpx;
position: absolute;
bottom: 0;
left: 0;
word-break: break-all;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
background: rgba(0, 0, 0, .4);
box-sizing: border-box;
}
.cover {
display: block;
width: 100%!important;
height: 388rpx!important;
margin-left: 0!important;
}
}
div {
box-sizing: border-box;
}
.noMore {
line-height: 90rpx;
text-align: center;
color: #999;
font-size: 26rpx;
}
.news {
background: #fff;
}
.header {
position: fixed;
left: 0;
top: 0;
z-index: 10000;
width: 100%;
padding: 8rpx 0;
background: #fff;
.header-search {
display: flex;
align-items: center;
width: 690rpx;
height: 60rpx;
margin: 0 auto 8rpx;
padding: 0 32rpx;
background: #0D6DDC;
border-radius: 30rpx;
image {
flex-shrink: 1;
width: 32rpx;
height: 32px;
margin-right: 12rpx;
}
input {
flex: 1;
height: 100%;
font-size: 28rpx;
color: #fff;
}
}
}
.item {
padding: 0 30rpx;
&:first-child {
.item-wrapper {
padding-top: 0!important;
}
}
.item-wrapper {
padding: 30rpx 0 20rpx;
display: flex;
align-items: center;
}
.item-left {
flex: 1;
h2 {
margin-bottom: 32rpx;
color: #333333;
font-size: 30rpx;
font-weight: 700;
}
.item-left__bottom {
display: flex;
span {
margin-right: 10rpx;
color: #999999;
font-size: 22rpx;
&:last-child {
margin-right: 0;
}
}
.top-text{
font-size: 22rpx;
color: #EF4645;
margin-right: 16rpx;
}
}
}
image {
flex-shrink: 0;
width: 224rpx;
height: 140rpx;
// margin-left: 46rpx;
}
}
.no-more {
margin-top: 20rpx;
text-align: center;
color: #999;
image {
width: 400rpx;
height: 240rpx;
}
p {
text-align: center;
color: #999;
font-size: 28rpx;
}
}
</style>

View File

@@ -25,7 +25,7 @@
<!-- <u-parse className="articalContent" :html="info.content"/> -->
</div>
</div>
<div class="detail-comments">
<!-- <div class="detail-comments">
<h2>全部评论({{ commentsTotal }})</h2>
<div class="comments-list">
<div class="item" v-for="(item, index) in commentList" :key="index">
@@ -59,9 +59,9 @@
<p>暂无评论</p>
</div>
</div>
</div>
<AiTransSpeech :src="info.speech"></AiTransSpeech>
<div class="footer-bar">
</div> -->
<!-- <AiTransSpeech :src="info.speech"></AiTransSpeech> -->
<!-- <div class="footer-bar">
<input
:cursor-spacing="10"
:placeholder="focus ? '' : '我来说两句…'"
@@ -91,8 +91,8 @@
<span>分享</span>
</button>
</div>
</div>
<div class="comments" v-if="isShowComment" mode="bottom" @close="focus = false" :closeable="false">
</div> -->
<!-- <div class="comments" v-if="isShowComment" mode="bottom" @close="focus = false" :closeable="false">
<div class="mask" @click="isShowComment = false"></div>
<div class="comments-wrapper" :style="{bottom: bottom + 'px'}">
<div class="textarea">
@@ -115,9 +115,16 @@
<span @click="commnet = ''">清空内容</span>
<div @click="onConfirm">发表</div>
</div>
</div>
</div> -->
<!-- <ai-login ref="login"></ai-login> -->
<div class="accessory-list">
<p><u-icon name="attach" color="#2979ff" size="28"></u-icon>附件</p>
<div class="card-list">
<div class=""></div>
</div>
</div>
<ai-login ref="login"></ai-login>
</div>
</template>

View File

@@ -20,7 +20,7 @@
</div>
<div class="flex-info">
<div class="label">地址</div>
<div class="value">{{info.address}}</div>
<div class="value">{{ info.address }}</div>
</div>
</div>
<!-- <p class="content" v-html="info.content"></p> -->