This commit is contained in:
shijingjing
2022-04-29 21:16:30 +08:00
parent 23e489294f
commit 8cd4edef16
3 changed files with 23 additions and 31 deletions

View File

@@ -3,31 +3,10 @@
<div class="header" v-if="tabList.length"> <div class="header" v-if="tabList.length">
<div class="header-tab"> <div class="header-tab">
<img src="https://cdn.cunwuyun.cn/dvcp/live/dh.png" alt="" class="more-icon" @click="toSelect()"> <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:650px" is-scroll :font-size="26"></u-tabs> <u-tabs :list="tabList" :current="currIndex" @change="changeTab" :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>
</div> </div>
<div class="news-list" v-if="tabList.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">
<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" />
<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> -->
<div class="item" v-for="(item,index) in newsList" :key="index" v-if="newsList.length" @click="toDetail(item.id)"> <div class="item" v-for="(item,index) in newsList" :key="index" v-if="newsList.length" @click="toDetail(item.id)">
<div class="left"> <div class="left">
<h2>{{ item.title }}</h2> <h2>{{ item.title }}</h2>
@@ -64,15 +43,24 @@ export default {
onLoad(params) { onLoad(params) {
this.parentId = params.id this.parentId = params.id
this.parentName = params.parentName this.parentName = params.parentName
uni.$on('update', (tabIndex) => {
this.currIndex = tabIndex
// setTimeout(() => {
// this.getListInit()
// },600)
})
}, },
onShow() { onShow() {
document.title = this.parentName document.title = this.parentName
this.getList().then(() => this.getListInit()) this.getList().then(() => this.getListInit())
// setTimeout(() => {
uni.$on('update', (tabIndex) => { // this.currIndex = 8
this.currIndex = tabIndex // // this.getListInit()
this.getListInit() // },600)
})
// })
}, },
methods: { methods: {

View File

@@ -21,13 +21,17 @@
this.tabIndex = option.index, this.tabIndex = option.index,
this.parentId = option.parentId this.parentId = option.parentId
this.getList() this.getList()
this.$forceUpdate()
}, },
methods: { methods: {
tabClick(index) { tabClick(index) {
this.tabIndex = index this.tabIndex = index
uni.$emit('update',this.tabIndex) uni.navigateBack({
uni.navigateBack({delta: 1}) success: ()=>{
uni.$emit('update',this.tabIndex)
}
})
}, },
getList() { getList() {
this.$http.post('/app/apppublicitycategory/list',null,{ this.$http.post('/app/apppublicitycategory/list',null,{

View File

@@ -587,7 +587,7 @@ export default {
nextStep() { nextStep() {
if (!this.isEdit) { if (!this.form.id) {
if (!this.form.objectType) { if (!this.form.objectType) {
return this.$u.toast('请选择监测对象类型') return this.$u.toast('请选择监测对象类型')
} }