接口对接
This commit is contained in:
@@ -11,46 +11,44 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav">
|
<div class="nav">
|
||||||
<div class="nav-item" hover-class="text-hover" v-for="(item, index) in 7" :key="index" @click="$linkTo('./TopicDetail')">
|
<div class="nav-item" hover-class="text-hover" v-for="(item, index) in topic" :key="index" @click="$linkTo('./TopicDetail')">
|
||||||
<image src="https://cdn.cunwuyun.cn/wxmp/fengdu/ic-fangwuchuzu.png" />
|
<image :src="item.picUrl" mode="aspectFill" />
|
||||||
<h2>物品交易</h2>
|
<h2>{{ item.title }}</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-item" @click="$linkTo('./Topic')">
|
<div class="nav-item" @click="$linkTo('./Topic')" v-if="topicList.length > 7">
|
||||||
<image src="https://cdn.cunwuyun.cn/wxmp/fengdu/ic-more.png" />
|
<image src="https://cdn.cunwuyun.cn/wxmp/fengdu/ic-more.png" />
|
||||||
<h2>更多</h2>
|
<h2>更多</h2>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="AppCircle-list">
|
<div class="AppCircle-list">
|
||||||
<div class="item" v-for="(item, index) in 10" :key="index" @click="$linkTo('./Detail')" hover-class="bg-hover">
|
<div class="item" v-for="(item, index) in list" :key="index" @click="$linkTo('./Detail')" hover-class="bg-hover">
|
||||||
<div class="item-top">
|
<div class="item-top">
|
||||||
<image src="https://cdn.cunwuyun.cn/wxmp/fengdu/ic-fangwuchuzu.png" />
|
<image :src="item.createUserAvatar" />
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<h3>李在地</h3>
|
<h3>{{ item.createUserName }}</h3>
|
||||||
<span>清风街道</span>
|
<span>{{ item.publishDepartName }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-content">
|
<div class="item-content">
|
||||||
<span @click="$linkTo('./TopicDetail')">#【闲置物品交易】</span>
|
<span v-if="item.themeId" @click="$linkTo('./TopicDetail')">#【{{ item.topicName }}】</span>
|
||||||
<text>社家用闲置柜子自用,原价212,现价80要的联系</text>
|
<text>{{ item.content }}</text>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-imgs">
|
<div class="item-imgs" v-if="item.files.length">
|
||||||
<image src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/home-bg.png" />
|
<image mode="aspectFill" v-for="(item, index) in item.files" :key="index" :src="item.url" />
|
||||||
<image src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/home-bg.png" />
|
|
||||||
<image src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/home-bg.png" />
|
|
||||||
</div>
|
</div>
|
||||||
<p>2020-12-11 10:10</p>
|
<p>{{ item.createTime }}</p>
|
||||||
<div class="item-bottom">
|
<div class="item-bottom">
|
||||||
<div>
|
<div>
|
||||||
<image src="https://cdn.cunwuyun.cn/wxmp/fengdu/ic-zhuanfa.png" />
|
<image src="https://cdn.cunwuyun.cn/wxmp/fengdu/ic-zhuanfa.png" />
|
||||||
<i>10</i>
|
<i>{{ item.sharedCount }}</i>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<image src="https://cdn.cunwuyun.cn/wxmp/fengdu/zan.png" />
|
<image src="https://cdn.cunwuyun.cn/wxmp/fengdu/zan.png" />
|
||||||
<i>10</i>
|
<i>{{ item.appreciateCount }}</i>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<image src="https://cdn.cunwuyun.cn/wxmp/fengdu/ic-pinglun.png" />
|
<image src="https://cdn.cunwuyun.cn/wxmp/fengdu/ic-pinglun.png" />
|
||||||
<i>10</i>
|
<i>{{ item.commentCount }}</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -70,26 +68,88 @@
|
|||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
currIndex: 0
|
currIndex: 0,
|
||||||
|
topicList: [],
|
||||||
|
list: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['user', 'token'])
|
...mapState(['user', 'token']),
|
||||||
|
|
||||||
|
topic () {
|
||||||
|
return this.topicList.filter((v, index) => index < 8)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
this.getTopicList()
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(['autoLogin', 'authCheck'])
|
getTopicList () {
|
||||||
|
this.$instance.post(`/app/appneighborhoodassistancetheme/list`, null, {
|
||||||
|
// withoutToken: true,
|
||||||
|
params: {
|
||||||
|
current: 1,
|
||||||
|
size: 100
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.topicList = res.data.records
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getList () {
|
||||||
|
if (this.isMore) return
|
||||||
|
|
||||||
|
this.$loading()
|
||||||
|
this.$instance.post(`/app/appneighborhoodassistance/list`, null, {
|
||||||
|
params: {
|
||||||
|
current: this.current,
|
||||||
|
size: 10,
|
||||||
|
source: 0,
|
||||||
|
visibleRange: this.currIndex === 0 ? 1 : 0
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.$hideLoading()
|
||||||
|
if (this.current > 1) {
|
||||||
|
this.list = [...this.list, ...res.data.records.map(e => {
|
||||||
|
return {
|
||||||
|
...e,
|
||||||
|
topicName: this.topicList.filter(v => v.id === e.themeId).length ? this.topicList.filter(v => v.id === e.themeId)[0].title : ''
|
||||||
|
}
|
||||||
|
})]
|
||||||
|
} else {
|
||||||
|
this.list = res.data.records.map(e => {
|
||||||
|
return {
|
||||||
|
...e,
|
||||||
|
topicName: this.topicList.filter(v => v.id === e.themeId).length ? this.topicList.filter(v => v.id === e.themeId)[0].title : ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.data.records.length < 10) {
|
||||||
|
this.isMore = true
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
this.current = this.current + 1
|
||||||
|
} else {
|
||||||
|
this.isMore = true
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.$hideLoading()
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onShareAppMessage() {
|
onReachBottom () {
|
||||||
return {
|
this.getList()
|
||||||
title: '欢迎使用数字乡村治理服务一体化平台~',
|
|
||||||
path: `/pages/AppCircle/AppCircle`
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -118,7 +178,6 @@
|
|||||||
.nav {
|
.nav {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
margin: 0 32px 24px;
|
margin: 0 32px 24px;
|
||||||
padding-top: 30px;
|
padding-top: 30px;
|
||||||
@@ -227,9 +286,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.item-content {
|
.item-content {
|
||||||
margin: 16px;
|
margin: 16px 0;
|
||||||
line-height: 1.3;
|
line-height: 1.3;
|
||||||
// text-align: justify;
|
text-align: justify;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
|
|||||||
@@ -137,12 +137,63 @@
|
|||||||
...mapState(['user', 'token']),
|
...mapState(['user', 'token']),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onLoad () {
|
||||||
|
this.getTopicList()
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
getTopicList () {
|
||||||
|
this.$instance.post(`/api/appneighborhoodassistancetheme/list`, null, {
|
||||||
|
withoutToken: true,
|
||||||
|
params: {
|
||||||
|
current: 1,
|
||||||
|
size: 1000
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
|
||||||
},
|
}
|
||||||
onShow() {
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getList () {
|
||||||
|
if (this.isMore) return
|
||||||
|
|
||||||
|
this.$loading()
|
||||||
|
this.$instance.post(`/api/appactivityinfo/list`, null, {
|
||||||
|
withoutToken: true,
|
||||||
|
params: {
|
||||||
|
current: this.current,
|
||||||
|
size: 10
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.$hideLoading()
|
||||||
|
if (this.current > 1) {
|
||||||
|
this.list = [...this.list, ...res.data.records]
|
||||||
|
} else {
|
||||||
|
this.list = res.data.records
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.data.records.length < 10) {
|
||||||
|
this.isMore = true
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
this.current = this.current + 1
|
||||||
|
} else {
|
||||||
|
this.isMore = true
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.$hideLoading()
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onReachBottom () {
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user