index bug

This commit is contained in:
花有清香月有阴
2021-12-23 10:31:10 +08:00
parent 8d52641c97
commit c635c55699
4 changed files with 67 additions and 25 deletions

View File

@@ -7,32 +7,32 @@
<div class="dataRight">
<span></span>
<span class="specialColor">12</span>
<span class="specialColor">{{ total }}</span>
<span>个活动</span>
</div>
</div>
<template v-if="datas.length > 0">
<AiCard v-for="(item, i) in 6" :key="i" @click.native="toDetail(item, 1)">
<AiCard v-for="(item, i) in datas" :key="i" @click.native="toDetail(item, 1)">
<template #custom>
<div class="left">
<div class="titles">敬老爱幼带你在洞庭湖兜兜风 寻觅江豚的身影</div>
<div class="titles">{{ item.title }}</div>
<div class="nums">
<span class="specialColor">6</span>
<span class="specialColor">{{ item.realNum }}</span>
<span>已报名</span>
</div>
<div class="times">
<span class="timesCont">2021-12-16</span>
<span class="timesCont">{{ item.beginTime }}</span>
<span>| 2</span>
</div>
<div class="areaNmae">湖南省岳阳市岳阳县荣家湾镇六湖南省岳阳市岳阳县荣家湾镇六</div>
<div class="areaNmae">{{ item.areaName }}</div>
</div>
<img src="./yan.jpg" alt="" />
<img :src="item.url[0].url" alt="" />
</template>
</AiCard>
</template>
@@ -44,6 +44,8 @@
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'AppResidentActivities',
appName: '居民活动',
@@ -62,16 +64,45 @@ export default {
],
currentTabs: 0,
current: 1,
size: 6,
total: '',
}
},
computed: {},
computed: {
...mapState(['user']),
},
watch: {},
onLoad() {
this.getList()
},
mounted() {},
methods: {
getList() {},
getList() {
this.$http
.post('/app/appvillageactivityinfo/list', null, {
params: {
size: this.size,
current: this.current,
createUserId: this.currentTabs == 1 ? this.user.id : '',
},
})
.then((res) => {
if (res.code == 0) {
this.datas = this.current > 1 ? [...this.datas, ...res.data.records] : res.data.records
this.total = res.data.total
this.pages = res.data.pages
if (this.datas) {
this.datas.map((item) => {
if (item.url) {
item.url = JSON.parse(item.url || '[]')
}
return item
})
}
}
})
},
change(index) {
this.currentTabs = index
@@ -83,8 +114,7 @@ export default {
},
toDetail(item) {
uni.navigateTo({ url: `./Detail` })
// uni.navigateTo({ url: `./Detail?id=${item.id}` })
uni.navigateTo({ url: `./Detail?id=${item.id}` })
},
},
onReachBottom() {
@@ -149,16 +179,19 @@ uni-page-body {
overflow: hidden;
}
.nums {
margin-top: 8px;
.specialColor {
color: #4181ff;
}
}
.times {
margin-top: 8px;
.timesCont {
margin-right: 10px;
}
}
.areaNmae {
margin-top: 8px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;