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