暂无数据
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<!-- <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>
|
||||
<div class="news-list" v-if="newsList.length">
|
||||
<div class="news-list" v-if="tabList.length">
|
||||
<!-- <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">
|
||||
@@ -28,17 +28,18 @@
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="item" v-for="(item,index) in newsList" :key="index">
|
||||
<div class="item" v-for="(item,index) in newsList" :key="index" v-if="newsList.length">
|
||||
<div class="left">
|
||||
<h2>{{ item.title }}</h2>
|
||||
<p><span>通知公告</span>{{ item.createTime }}</p>
|
||||
</div>
|
||||
<div class="right">
|
||||
<div class="right" v-if="item.pictureUrl.length">
|
||||
<img :src="item.pictureUrl" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty description="暂无数据" v-if="!newsList.length" style="background: #f3f4f5;"/>
|
||||
</div>
|
||||
<AiEmpty v-if="!newsList.length && isShowEmpty"/>
|
||||
<AiEmpty description="暂无数据" v-else/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -68,6 +69,8 @@
|
||||
this.parentName = params.parentName
|
||||
},
|
||||
onShow() {
|
||||
document.title = this.parentName
|
||||
this.getList()
|
||||
if(uni.getStorageSync('newTypeIndex')) {
|
||||
this.currIndex = uni.getStorageSync('newTypeIndex')
|
||||
this.getListInit()
|
||||
@@ -75,8 +78,6 @@
|
||||
// uni.$on('update',()=>{
|
||||
// this.getListInit()
|
||||
// })
|
||||
document.title = this.parentName
|
||||
this.getList()
|
||||
this.getListInit()
|
||||
},
|
||||
|
||||
@@ -86,8 +87,9 @@
|
||||
uni.navigateTo({url: `./select?parentId=${this.parentId}&index=${this.currIndex}`})
|
||||
},
|
||||
changeTab(index) {
|
||||
this.newsList = []
|
||||
this.currIndex = index
|
||||
// this.newsList = []
|
||||
this.current = 1
|
||||
this.getListInit()
|
||||
},
|
||||
|
||||
@@ -130,13 +132,6 @@
|
||||
},
|
||||
// 获取新闻列表
|
||||
getNewsList() {
|
||||
// if (this.isMore || this.isLoading) return
|
||||
// var type = this.currIndex
|
||||
// if(this.currIndex == 0) {
|
||||
// type = ''
|
||||
// }
|
||||
// this.isLoading = true
|
||||
|
||||
this.$http.post(`/app/apppublicityinfo/list?`, null, {
|
||||
params: {
|
||||
current: this.current,
|
||||
@@ -145,35 +140,14 @@
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
|
||||
if (res.code === 0) {
|
||||
this.isShowEmpty = true
|
||||
|
||||
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
|
||||
this.isLoading = false
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.pageShow = true
|
||||
})
|
||||
} else {}
|
||||
}).catch(() => {
|
||||
this.isShowEmpty = true
|
||||
this.isLoading = false
|
||||
this.current = this.current
|
||||
}
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
})
|
||||
},
|
||||
toDetail(item) {
|
||||
@@ -185,9 +159,10 @@
|
||||
},
|
||||
},
|
||||
|
||||
// onReachBottom () {
|
||||
// this.getNewsList(this.areaId)
|
||||
// }
|
||||
onReachBottom () {
|
||||
this.current ++,
|
||||
this.getNewsList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -254,12 +229,16 @@
|
||||
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%;
|
||||
|
||||
Reference in New Issue
Block a user