城阳居民端公众号前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

200 lines
5.1 KiB

1 year ago
<template>
<div>
<div class="flex flex-mean" style="background-color: #FFFFFF;">
<van-search class=".flex flex-1" v-model="searchValue" left-icon="" shape="round" placeholder="请输入搜索关键词" />
<van-button round type="info" class="custom-button font-size13 m-top10 m-right12 ">查询</van-button>
</div>
<div class='container'>
1 year ago
<van-list class="card" :offset="50">
<div class="activity_content " v-for="(item, index) in discussionList" :key="index" >
<div class="van-multi-ellipsis--l2 m-bottom10" @click="$router.push({ path: `/discusionDetail` })">
{{ item.eventContent }}
1 year ago
</div>
1 year ago
<div class="flex flex-end">
1 year ago
<div class=""><img src="@/assets/images/icons/resi.png" class="img_17"> 参加{{ item.total }}
1 year ago
</div>
1 year ago
<div><img src="@/assets/images/icons/support.png" class="img_17" @click="handelClicsupport(item.eventId)">支持{{ item.supportNum }}</div>
<div><img src="@/assets/images/icons/oppose.png" class="img_17" @click="handelClicopposeNum(item.eventId)">反对{{ item.opposeNum }}</div>
1 year ago
</div>
</div>
</van-list>
<register-dialog v-if="showRegister" @close="showRegister = false"></register-dialog>
</div>
</div>
</template>
<script>
1 year ago
import { communityActivity,icEventOldDiscuss,handelClicsupport } from '@/api/home';
1 year ago
import registerDialog from '@/components/registerDialog';
export default {
data() {
return {
discussionList: [
],
pageSize: 5,
pageNo: 1,
agencyId: null,
finished: false,
1 year ago
loading: false,
1 year ago
showRegister: false,
1 year ago
searchValue: "",
userId:""
1 year ago
};
},
created() {
this.agencyId = this.$store.state.app.agencyId;
1 year ago
this.userId = this.$store.state.app.appId;
this.icEventOldDiscuss();
1 year ago
},
methods: {
1 year ago
async handelClicsupport(data){
1 year ago
let parm = {
1 year ago
eventId:data,
1 year ago
agencyId: this.agencyId,
1 year ago
userId: this.userId,
opinionFlag:0
1 year ago
}
1 year ago
console.log(parm);
let res = await handelClicsupport(parm)
this.icEventOldDiscuss()
},
async handelClicopposeNum(data){
let parm = {
eventId:data,
agencyId: this.agencyId,
userId: this.userId,
opinionFlag:1
}
console.log(parm);
let res = await handelClicsupport(parm)
this.icEventOldDiscuss()
},
async icEventOldDiscuss(){
let parm = {
pageSize: 10,
pageNo: 1,
agencyId: null,
icEventId:null
}
let res = await icEventOldDiscuss(parm)
1 year ago
if (res) {
1 year ago
console.log(res);
this.discussionList = res.list
1 year ago
}
1 year ago
1 year ago
},
1 year ago
1 year ago
handelClickJump(path) {
if (path === 'activityDetail') {
if (this.$store.state.app.userInfo.mobile) {
this.$router.push({ path: `/${path}` });
} else {
this.showRegister = true;
}
}
}
},
components: { registerDialog },
computed: {},
watch: {},
}
</script>
<style lang='less' scoped>
.custom-button {
width: 60px;
height: 33px;
}
.activity_content {
padding-bottom: 10px;
box-sizing: border-box;
width: 100%;
border-bottom: 1px solid #EAEAEA;
margin-top: 14px;
min-height: 50px;
.img {
width: 231px;
height: 33px;
margin: 5px 3px 0 3px;
}
&:last-child {
border-bottom: none;
}
.content {
width: 325px;
height: 40px;
font-family: PingFang SC;
font-weight: 500;
font-size: 16px;
color: #333333;
line-height: 23px;
}
.dianzan {
width: 325px;
height: 20px;
display: flex;
font-size: 13px;
color: #AAAAAA;
flex-direction: row;
justify-content: space-evenly;
align-items: center;
.img {
width: 14.5px;
height: 15px;
}
}
}
.header {}
.header .input_search {
width: 279px;
height: 33px;
background: rgba(193, 193, 193, 0.16);
border-radius: 17px;
// flex: 1;
color: #333333;
border: none;
/* 取消边框 */
margin-left: 10px;
}
.header .btn_search {
width: 60px;
height: 33px;
background: #3974F6;
border-radius: 17px;
font-family: PingFang SC;
font-weight: 500;
font-size: 14px;
color: #FFFFFF;
line-height: 23px;
border: none;
/* 取消边框 */
margin-right: 10px;
}
</style>