This commit is contained in:
花有清香月有阴
2022-02-23 11:19:32 +08:00
parent 9dfcf99125
commit 8a1d74d57b

View File

@@ -9,8 +9,7 @@
</div>
</div>
<div class="activity-list">
<div class="item" hover-class="bg-hover" @click="$linkTo(`/village/villageActivity/ActivityDetail?id=${item.id}`)"
v-for="(item, index) in list" :key="index">
<div class="item" hover-class="bg-hover" @click="$linkTo(`./ActivityDetail?id=${item.id}`)" v-for="(item, index) in list" :key="index">
<div class="left">
<h2>{{ item.title }}</h2>
<div class="left-info">
@@ -23,7 +22,7 @@
</div>
<div class="right">
<span :class="'status' + item.status">{{ item.statusName }}</span>
<image :src="item.url" mode="aspectFill"/>
<image :src="item.url" mode="aspectFill" />
</div>
</div>
<AiEmpty v-if="!list.length"></AiEmpty>
@@ -33,15 +32,15 @@
<script>
export default {
name: "AppVillageActivity",
appName: "居民活动",
name: 'AppVillageActivity',
appName: '居民活动',
data() {
return {
list: [],
pageShow: false,
current: 1,
total: 0,
isMore: false
isMore: false,
}
},
@@ -56,53 +55,56 @@ export default {
getList() {
if (this.isMore) return
this.$instance.post(`/app/appvillageactivityinfo/listUp`, null, {
params: {
current: this.current,
size: 15,
areaId: uni.getStorageSync('areaId')
}
}).then(res => {
if (res.code == 0) {
this.total = res.data.total
if (this.current > 1) {
this.list = [...this.list, ...res.data.records].map(v => {
return {
...v,
statusName: this.$dict.getLabel('villageActivityStatus', v.status),
url: v.url ? JSON.parse(v.url)[0].url : ''
}
})
this.$instance
.post(`/app/appvillageactivityinfo/listUp`, null, {
params: {
current: this.current,
size: 15,
areaId: uni.getStorageSync('areaId'),
},
})
.then((res) => {
if (res.code == 0) {
this.total = res.data.total
if (this.current > 1) {
this.list = [...this.list, ...res.data.records].map((v) => {
return {
...v,
statusName: this.$dict.getLabel('villageActivityStatus', v.status),
url: v.url ? JSON.parse(v.url)[0].url : '',
}
})
} else {
this.list = res.data.records.map((v) => {
return {
...v,
statusName: this.$dict.getLabel('villageActivityStatus', v.status),
url: v.url ? JSON.parse(v.url)[0].url : '',
}
})
}
uni.hideLoading()
this.pageShow = true
if (res.data.records.length < 15) {
this.isMore = true
return false
}
this.current = this.current + 1
} else {
this.list = res.data.records.map(v => {
return {
...v,
statusName: this.$dict.getLabel('villageActivityStatus', v.status),
url: v.url ? JSON.parse(v.url)[0].url : ''
}
})
uni.hideLoading()
}
})
.catch(() => {
uni.hideLoading()
this.pageShow = true
if (res.data.records.length < 15) {
this.isMore = true
return false
}
this.current = this.current + 1
} else {
uni.hideLoading()
}
}).catch(() => {
uni.hideLoading()
})
}
})
},
},
onReachBottom() {
this.getList()
}
},
}
</script>
@@ -133,7 +135,7 @@ export default {
}
i {
color: #4181FF;
color: #4181ff;
font-style: normal;
font-size: 28px;
}
@@ -173,7 +175,7 @@ export default {
align-items: center;
i {
color: #4181FF;
color: #4181ff;
font-style: normal;
font-size: 26px;
}
@@ -207,15 +209,15 @@ export default {
}
.status0 {
background: #42D784;
background: #42d784;
}
.status1 {
background: #1AAAFF;
background: #1aaaff;
}
.status2 {
background: #E4E4E4;
background: #e4e4e4;
}
}
}