BUG 29419
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<div class="header" v-if="tabList.length">
|
||||
<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" is-scroll :font-size="26"></u-tabs>
|
||||
<u-tabs :list="tabList" :current="currIndex" @change="changeTab" style="width:650px" is-scroll :font-size="26"></u-tabs>
|
||||
<!-- <div v-for="(item, index) in tabList" :key="index" @click="changeTab(item.id)" v-if="index < 5" :class="currId == item.id ? 'tab-item active-item' : 'tab-item'">{{item.name}}<span class="active-line" v-if="currId == item.id"></span></div> -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -11,7 +11,7 @@
|
||||
<!-- <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: flex">
|
||||
<div class="item-left flex1">
|
||||
<h2 :style="{marginBottom: item.type === '1' ? '16rpx' : '30rpx'}" v-if="item.type != '1'">{{ item.title }}</h2>
|
||||
<h2 :style="{marginBottom: item.type === '1' ? '16px' : '30px'}" 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" />
|
||||
@@ -44,370 +44,383 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'newsList',
|
||||
data () {
|
||||
return {
|
||||
currIndex: 0,
|
||||
title: '',
|
||||
isLoading: false,
|
||||
newsList: [],
|
||||
isShowEmpty: false,
|
||||
current: 1,
|
||||
areaId: '',
|
||||
tabList: [],
|
||||
parentId: '',
|
||||
parentName: '',
|
||||
}
|
||||
},
|
||||
|
||||
onLoad (params) {
|
||||
this.parentId = params.id
|
||||
this.parentName = params.parentName
|
||||
},
|
||||
onShow() {
|
||||
document.title = this.parentName
|
||||
this.getList()
|
||||
this.getListInit()
|
||||
uni.$on('update', (tabIndex)=>{
|
||||
this.currIndex = tabIndex
|
||||
this.getListInit()
|
||||
})
|
||||
// this.getListInit()
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 查看分类
|
||||
toSelect() {
|
||||
uni.navigateTo({url: `./select?parentId=${this.parentId}&index=${this.currIndex}`})
|
||||
},
|
||||
// 切换tab栏
|
||||
changeTab(index) {
|
||||
this.newsList = []
|
||||
this.currIndex = index
|
||||
this.current = 1
|
||||
this.getListInit()
|
||||
},
|
||||
|
||||
// onConfirm () {
|
||||
// this.current = 1
|
||||
// this.$nextTick(() => {
|
||||
// this.getNewsList(this.areaId)
|
||||
// })
|
||||
// },
|
||||
|
||||
// 获取新闻分类
|
||||
getList() {
|
||||
this.$http.post('/app/apppublicitycategory/list',null,{
|
||||
params: {
|
||||
parentId: this.parentId,
|
||||
categoryType: '2',
|
||||
}
|
||||
}).then((res)=>{
|
||||
var array = []
|
||||
res.data.records.map(item=>{
|
||||
array.push({
|
||||
name: item.categoryName,
|
||||
id: item.id,
|
||||
parentId: item.parentId,
|
||||
})
|
||||
})
|
||||
this.tabList = array
|
||||
})
|
||||
},
|
||||
|
||||
getListInit() {
|
||||
this.current = 1
|
||||
this.newsList = []
|
||||
this.getNewsList()
|
||||
},
|
||||
// 获取新闻列表
|
||||
getNewsList() {
|
||||
this.$http.post(`/app/apppublicityinfo/list?`, null, {
|
||||
params: {
|
||||
current: this.current,
|
||||
moduleId: this.currIndex == 0? this.tabList[0].parentId : this.tabList[this.currIndex].parentId,
|
||||
categoryId: this.tabList[this.currIndex].id,
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.newsList = this.current == 1 ? res.data.records : [...this.newsList, ...res.data.records]
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查详情
|
||||
toDetail(id) {
|
||||
uni.navigateTo({url: `./newsDetail?id=${id}`})
|
||||
},
|
||||
},
|
||||
|
||||
onReachBottom () {
|
||||
this.current ++,
|
||||
this.getNewsList()
|
||||
export default {
|
||||
name: 'newsList',
|
||||
data() {
|
||||
return {
|
||||
currIndex: 0,
|
||||
title: '',
|
||||
isLoading: false,
|
||||
newsList: [],
|
||||
isShowEmpty: false,
|
||||
current: 1,
|
||||
areaId: '',
|
||||
tabList: [],
|
||||
parentId: '',
|
||||
parentName: '',
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
this.parentId = params.id
|
||||
this.parentName = params.parentName
|
||||
},
|
||||
onShow() {
|
||||
document.title = this.parentName
|
||||
this.getList().then(() => this.getListInit())
|
||||
|
||||
uni.$on('update', (tabIndex) => {
|
||||
this.currIndex = tabIndex
|
||||
this.getListInit()
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 查看分类
|
||||
toSelect() {
|
||||
uni.navigateTo({url: `./select?parentId=${this.parentId}&index=${this.currIndex}`})
|
||||
},
|
||||
// 切换tab栏
|
||||
changeTab(index) {
|
||||
this.newsList = []
|
||||
this.currIndex = index
|
||||
this.current = 1
|
||||
this.getListInit()
|
||||
},
|
||||
|
||||
// onConfirm () {
|
||||
// this.current = 1
|
||||
// this.$nextTick(() => {
|
||||
// this.getNewsList(this.areaId)
|
||||
// })
|
||||
// },
|
||||
|
||||
// 获取新闻分类
|
||||
getList() {
|
||||
return this.$http.post('/app/apppublicitycategory/list', null, {
|
||||
params: {
|
||||
parentId: this.parentId,
|
||||
categoryType: '2',
|
||||
}
|
||||
}).then((res) => {
|
||||
var array = []
|
||||
res.data.records.map(item => {
|
||||
array.push({
|
||||
name: item.categoryName,
|
||||
id: item.id,
|
||||
parentId: item.parentId,
|
||||
})
|
||||
})
|
||||
return this.tabList = array
|
||||
})
|
||||
},
|
||||
|
||||
getListInit() {
|
||||
this.current = 1
|
||||
this.newsList = []
|
||||
this.getNewsList()
|
||||
},
|
||||
// 获取新闻列表
|
||||
getNewsList() {
|
||||
this.$http.post(`/app/apppublicityinfo/list?`, null, {
|
||||
params: {
|
||||
current: this.current,
|
||||
moduleId: this.currIndex == 0 ? this.tabList[0].parentId : this.tabList[this.currIndex].parentId,
|
||||
categoryId: this.tabList[this.currIndex].id,
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.newsList = this.current == 1 ? res.data.records : [...this.newsList, ...res.data.records]
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查详情
|
||||
toDetail(id) {
|
||||
uni.navigateTo({url: `./newsDetail?id=${id}`})
|
||||
},
|
||||
},
|
||||
|
||||
onReachBottom() {
|
||||
this.current++,
|
||||
this.getNewsList()
|
||||
}
|
||||
}
|
||||
</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;
|
||||
}
|
||||
div {
|
||||
height: 80px;
|
||||
line-height: 80px;
|
||||
font-size: 26px;
|
||||
transition-duration: 1s;
|
||||
padding: 0px 30px;
|
||||
}
|
||||
.tab-item{
|
||||
color: #666;
|
||||
position: relative;
|
||||
}
|
||||
.active-item{
|
||||
color: #3376FD;
|
||||
font-weight: 600;
|
||||
|
||||
}
|
||||
.active-line{
|
||||
width: 48px;
|
||||
height: 4px;
|
||||
background: #FFF;
|
||||
position: absolute;
|
||||
bottom: 14px;
|
||||
left: 50%;
|
||||
margin-left: -24px;
|
||||
background-color: #3376FD;
|
||||
}
|
||||
}
|
||||
.news-list{
|
||||
background: #FFF;
|
||||
padding-top: 90px;
|
||||
box-sizing: border-box;
|
||||
.item {
|
||||
padding: 30px 30px 20px 30px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid #DDDDDD;
|
||||
.left {
|
||||
h2 {
|
||||
font-size: 30px;
|
||||
color: #333333;
|
||||
font-weight: 600;
|
||||
overflow:hidden;
|
||||
text-overflow:ellipsis;
|
||||
display:-webkit-box;
|
||||
-webkit-box-orient:vertical;
|
||||
-webkit-line-clamp:2;
|
||||
}
|
||||
p {
|
||||
margin-top: 30px;
|
||||
font-size: 22px;
|
||||
color: #999999;
|
||||
span {
|
||||
margin-right: 15px;
|
||||
}
|
||||
}
|
||||
.header-tab {
|
||||
background-color: #fff;
|
||||
position: relative;
|
||||
padding: 0 100px 0 0;
|
||||
|
||||
}
|
||||
.right {
|
||||
width: 224px;
|
||||
height: 140px;
|
||||
margin-left: 40px;
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.more-icon {
|
||||
position: absolute;
|
||||
width: 40px;
|
||||
height: 38px;
|
||||
right: 32px;
|
||||
top: 20px;
|
||||
}
|
||||
|
||||
div {
|
||||
height: 80px;
|
||||
line-height: 80px;
|
||||
font-size: 26px;
|
||||
transition-duration: 1s;
|
||||
padding: 0px 30px;
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
color: #666;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.active-item {
|
||||
color: #3376FD;
|
||||
font-weight: 600;
|
||||
|
||||
}
|
||||
|
||||
.active-line {
|
||||
width: 48px;
|
||||
height: 4px;
|
||||
background: #FFF;
|
||||
position: absolute;
|
||||
bottom: 14px;
|
||||
left: 50%;
|
||||
margin-left: -24px;
|
||||
background-color: #3376FD;
|
||||
}
|
||||
}
|
||||
|
||||
.news-list {
|
||||
background: #FFF;
|
||||
padding-top: 90px;
|
||||
box-sizing: border-box;
|
||||
|
||||
.item {
|
||||
padding: 30px 30px 20px 30px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid #DDDDDD;
|
||||
|
||||
.left {
|
||||
h2 {
|
||||
font-size: 30px;
|
||||
color: #333333;
|
||||
font-weight: 600;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-top: 30px;
|
||||
font-size: 22px;
|
||||
color: #999999;
|
||||
|
||||
span {
|
||||
margin-right: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 224px;
|
||||
height: 140px;
|
||||
margin-left: 40px;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.news {
|
||||
min-height: 100vh;
|
||||
padding-top: 96px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.item-video {
|
||||
position: relative;
|
||||
height: 388px;
|
||||
margin-bottom: 24px;
|
||||
|
||||
.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: 80px;
|
||||
height: 80px;
|
||||
margin: 0;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
.item-title {
|
||||
width: 100%;
|
||||
padding: 0 30px 10px;
|
||||
font-size: 28px;
|
||||
font-weight: 500;
|
||||
color: #FFF;
|
||||
line-height: 40px;
|
||||
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;
|
||||
}
|
||||
|
||||
.noMore {
|
||||
line-height: 90rpx;
|
||||
text-align: center;
|
||||
color: #999;
|
||||
font-size: 26rpx;
|
||||
.cover {
|
||||
display: block;
|
||||
width: 100% !important;
|
||||
height: 388px !important;
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.news {
|
||||
background: #fff;
|
||||
}
|
||||
div {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.header {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 10000;
|
||||
width: 100%;
|
||||
padding: 8rpx 0;
|
||||
background: #fff;
|
||||
.noMore {
|
||||
line-height: 90px;
|
||||
text-align: center;
|
||||
color: #999;
|
||||
font-size: 26px;
|
||||
}
|
||||
|
||||
.header-search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 690rpx;
|
||||
height: 60rpx;
|
||||
margin: 0 auto 8rpx;
|
||||
padding: 0 32rpx;
|
||||
background: #0D6DDC;
|
||||
border-radius: 30rpx;
|
||||
.news {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
image {
|
||||
flex-shrink: 1;
|
||||
width: 32rpx;
|
||||
height: 32px;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.header {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 10000;
|
||||
width: 100%;
|
||||
padding: 8px 0;
|
||||
background: #fff;
|
||||
|
||||
input {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
.header-search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 690px;
|
||||
height: 60px;
|
||||
margin: 0 auto 8px;
|
||||
padding: 0 32px;
|
||||
background: #0D6DDC;
|
||||
border-radius: 30px;
|
||||
|
||||
.item {
|
||||
padding: 0 30rpx;
|
||||
|
||||
&:first-child {
|
||||
.item-wrapper {
|
||||
padding-top: 0!important;
|
||||
}
|
||||
image {
|
||||
flex-shrink: 1;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin-right: 12px;
|
||||
}
|
||||
|
||||
.item-wrapper {
|
||||
padding: 30rpx 0 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.item-left {
|
||||
input {
|
||||
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;
|
||||
}
|
||||
}
|
||||
height: 100%;
|
||||
font-size: 28px;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
image {
|
||||
flex-shrink: 0;
|
||||
width: 224rpx;
|
||||
height: 140rpx;
|
||||
// margin-left: 46rpx;
|
||||
.item {
|
||||
padding: 0 30px;
|
||||
|
||||
&:first-child {
|
||||
.item-wrapper {
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.no-more {
|
||||
margin-top: 20rpx;
|
||||
.item-wrapper {
|
||||
padding: 30px 0 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.item-left {
|
||||
flex: 1;
|
||||
|
||||
h2 {
|
||||
margin-bottom: 32px;
|
||||
color: #333333;
|
||||
font-size: 30px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.item-left__bottom {
|
||||
display: flex;
|
||||
|
||||
span {
|
||||
margin-right: 10px;
|
||||
color: #999999;
|
||||
font-size: 22px;
|
||||
|
||||
&:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.top-text {
|
||||
font-size: 22px;
|
||||
color: #EF4645;
|
||||
margin-right: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
image {
|
||||
flex-shrink: 0;
|
||||
width: 224px;
|
||||
height: 140px;
|
||||
// margin-left: 46px;
|
||||
}
|
||||
}
|
||||
|
||||
.no-more {
|
||||
margin-top: 20px;
|
||||
text-align: center;
|
||||
color: #999;
|
||||
|
||||
image {
|
||||
width: 400px;
|
||||
height: 240px;
|
||||
}
|
||||
|
||||
p {
|
||||
text-align: center;
|
||||
color: #999;
|
||||
|
||||
image {
|
||||
width: 400rpx;
|
||||
height: 240rpx;
|
||||
}
|
||||
|
||||
p {
|
||||
text-align: center;
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
font-size: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .emptyWrap .emptyImg {
|
||||
margin-top: 40px;
|
||||
}
|
||||
::v-deep .emptyWrap .emptyImg {
|
||||
margin-top: 40px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user