接口对接

This commit is contained in:
yanran200730
2023-03-17 14:10:05 +08:00
parent 5e7bae967e
commit c276a3f908
3 changed files with 157 additions and 43 deletions

View File

@@ -1,35 +1,33 @@
<template>
<div class="Detail">
<div class="Detail" v-if="isShow">
<div class="top">
<div class="item-top">
<image src="https://cdn.cunwuyun.cn/wxmp/fengdu/ic-fangwuchuzu.png" />
<image :src="info.createUserAvatar" />
<div class="right">
<h3>李在地</h3>
<span>清风街道</span>
<h3>{{ info.createUserName }}</h3>
<span>{{ info.publishDepartName }}</span>
</div>
</div>
<div class="item-content">
<span @click="$linkTo('./TopicDetail')">#闲置物品交易</span>
<text>社家用闲置柜子自用原价212现价80要的联系</text>
<span v-if="name" @click="toTopic('./TopicDetail?themeId=' + themeId + '&name=' + name)">#{{ name }}</span>
<text>{{ info.content }}</text>
</div>
<div class="item-imgs">
<image src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/home-bg.png" />
<image src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/home-bg.png" />
<image src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/home-bg.png" />
<div class="item-imgs" v-if="info.files && info.files.length">
<image mode="aspectFill" v-for="(item, index) in item.files" :key="index" :src="item.url" />
</div>
<p>2020-12-11 10:10</p>
<p>{{ info.createTime }}</p>
<div class="item-bottom">
<div>
<image src="https://cdn.cunwuyun.cn/wxmp/fengdu/ic-zhuanfa.png" />
<i>10</i>
<i>{{ info.sharedCount }}</i>
</div>
<div>
<image src="https://cdn.cunwuyun.cn/wxmp/fengdu/zan.png" />
<i>10</i>
<i>{{ info.appreciateCount }}</i>
</div>
<div>
<image src="https://cdn.cunwuyun.cn/wxmp/fengdu/ic-pinglun.png" />
<i>10</i>
<i>{{ info.commentCount }}</i>
</div>
</div>
</div>
@@ -63,13 +61,46 @@
data () {
return {
id: '',
isShow: false,
info: {},
name: '',
themeId: '',
isFrom: ''
}
},
onLoad() {
onLoad (query) {
this.isFrom = query.isFrom
this.id = query.id
this.$loading()
this.getInfo(query.id)
this.themeId = query.themeId
this.name = query.name || ''
},
methods: {
getInfo (id) {
this.$instance.post(`/app/appneighborhoodassistance/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.info = res.data
this.isShow = true
}
uni.hideLoading()
})
},
toTopic (url) {
if (this.isFrom === 'topic') {
uni.navigateBack({
delta: 1
})
} else {
this.$linkTo(url)
}
}
}
}
</script>