Browse Source

社区活动跟活动详情

dev
mk 1 year ago
parent
commit
16530115f9
  1. 17
      src/assets/css/index.less
  2. BIN
      src/assets/images/icons/add.png
  3. BIN
      src/assets/images/icons/del.png
  4. BIN
      src/assets/images/icons/share.png
  5. 4
      src/plugins/vant.js
  6. 13
      src/router/router.config.js
  7. 92
      src/views/activity/detail.vue
  8. 105
      src/views/activity/index.vue
  9. 37
      src/views/home/index.vue

17
src/assets/css/index.less

@ -25,6 +25,7 @@ body #app {
align-items: center;
:nth-child(1){
font-family:pingfang-bold;
font-size: 17px;
}
:nth-child(2){
color: #B4B4B4;
@ -94,7 +95,7 @@ body #app {
&-top5{
margin-top: 5px;
}
&-bottom{
&-bottom5{
margin-bottom: 5px;
}
&-right10{
@ -109,6 +110,9 @@ body #app {
&-top18{
margin-top: 18px;
}
&-bot50{
margin-bottom: 50px;
}
}
.p{
@ -174,6 +178,9 @@ body #app {
width: 20px;
height: 20px;
}
&_round{
border-radius: 5px;
}
}
.font-size13{
font-size: 13px;
@ -187,3 +194,11 @@ body #app {
.font-bold{
font-weight: bold;
}
.bot_btn{
position: fixed;
bottom: 0;
left: 0;
background: #ffffff;
width: 100%;
right: 0;
}

BIN
src/assets/images/icons/add.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
src/assets/images/icons/del.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
src/assets/images/icons/share.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

4
src/plugins/vant.js

@ -26,7 +26,8 @@ import {
Search,
Swipe,
SwipeItem,
NoticeBar
NoticeBar,
CellGroup
} from 'vant'
Vue.use(Button)
@ -55,3 +56,4 @@ Vue.use(Button)
.use(Swipe)
.use(SwipeItem)
.use(NoticeBar)
.use(CellGroup)

13
src/router/router.config.js

@ -78,11 +78,20 @@ export const constantRouterMap = [
name: 'selectAgency',
component: () => import('@/views/selectAgency'),
meta: { title: '选择所在社区', keepAlive: false }
}
,{
},{
path: '/houseQR',
name: 'houseQR',
component: () => import('@/views/houseQR'),
meta: { title: '电子门牌', keepAlive: false }
},{
path: '/activity',
name: 'activity',
component: () => import('@/views/activity'),
meta: { title: '社区活动', keepAlive: false }
},{
path: '/activityDetail',
name: 'activityDetail',
component: () => import('@/views/activity/detail'),
meta: { title: '活动详情', keepAlive: false }
}
]

92
src/views/activity/detail.vue

@ -0,0 +1,92 @@
<template>
<div class='container m-bot50'>
<div class="card">
<img src="@/assets/images/zhishu.png" alt="" style="width: 100%;">
<div class="m-top15 p0">
<h2 style="margin: 0; font-size: 21px;">春天植树节邀您行</h2>
<van-cell class="m-top15" :border="false" :title-style="{ 'max-width': '80px' }" title="活动时间:"
value="2024-03-12 09:00 至 2024-03-12 17:00"></van-cell>
<van-cell :border="false" :title-style="{ 'max-width': '115px' }" title="报名开始时间:"
value="2024-03-12 09:00"></van-cell>
<van-cell :border="false" :title-style="{ 'max-width': '115px' }" title="报名截止时间:"
value="2024-03-12 09:00"></van-cell>
<van-cell :border="false" :title-style="{ 'max-width': '80px' }" title="活动地点:"
value="重庆南路90号嘉定山森林公园南门"></van-cell>
<van-cell :border="false" :title-style="{ 'max-width': '65px' }" title="举办方:"
value="嘉定山社区 重庆路小学"></van-cell>
<van-divider />
<div
v-html="`<p>&nbsp; &nbsp; 春风催心律,正是指数是。为积极响应茂名市全民义务旅意,我是将于近期开展2021“绿名贸易”好心林工艺素知书货哦你的</p><p>&nbsp; &nbsp; &nbsp; &nbsp;刺死活动以再深入贯彻党的二十大精神和习近平生态文明思想,认真贯彻落实习近平总书记是擦广东的重要指示精神。</p><p>&nbsp; &nbsp; &nbsp; 持续性增强全民志绿护绿关铝的自觉性</p>`">
</div>
</div>
</div>
<div class="card m-top10">
<div class="title"><span>活动报名</span></div>
<van-cell-group v-for="(item,index) in signUp" :border="false">
<van-field v-model="signUp[index].name" required :label="`姓名${index+1}`" placeholder="请输入用户名" />
<van-field v-model="signUp[index].mobile" required label="联系电话" placeholder="请输入您的电话号码" />
<van-field v-model="signUp[index].remark" required label="备注" placeholder="请输入" rows="3" autosize type="textarea" />
</van-cell-group>
<div class="flex flex-center1 m-top12">
<div class="flex flex-center2 flex-center1 flex1" @click="handelAddResi"> <img src="@/assets/images/icons/add.png" alt="" class="img_20 m-right7">添加</div>
<div class="flex flex-center2 flex-center1 flex1" v-show="signUp.length>1" @click="handelDelResi"> <img src="@/assets/images/icons/del.png" alt="" class="img_20 m-right7">删除</div>
</div>
</div>
<div class="bot_btn flex flex-center2" style="height: 50px;">
<div class="flex1 flex flex-center1 flex-center2">报名人数<span class="orange font-size18">30</span> /35</div>
<div class="flex1 flex flex-center1 flex-center2"> <van-button size="small" class="m-right7" round>
<template #icon>
<img src="@/assets/images/icons/share.png" alt="" class="img_20">
</template> 转发</van-button> <van-button type="info" size="small" round></van-button></div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
signUp:[
{name:"",mobile:"",remark:""},
]
};
},
created() {
},
methods: {
handelAddResi(){
this.signUp.push({name:"",mobile:"",remark:""})
},
handelDelResi(){
this.signUp.pop()
}
},
components: {},
computed: {},
watch: {},
}
</script>
<style lang='less' scoped>
:deep(.p0>.van-cell) {
padding: 0;
}
:deep(.van-cell) {
padding: 16px 8px;
}
:deep(.van-cell__title) {
color: #666666;
}
:deep(.van-cell__value) {
text-align: left;
}
:deep(.van-cell--required){
&::before{
left: -5px;
}
}
</style>

105
src/views/activity/index.vue

@ -0,0 +1,105 @@
<template>
<div class='container'>
<van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="communityActivity" class="card"
:offset="50">
<div class="activity_content flex" v-for="(item, index) in activityList" :key="index"@click="$router.push({ path: `/activityDetail` })">
<img :src="item.coverPic" alt="" class="mr10 img_round" style="width: 75px;height: 95px;">
<div class="flex flex-y flex1 flex-end" style="overflow: hidden;">
<div class="van-ellipsis">{{ item.activityName }}</div>
<div class="address font-size14 van-ellipsis gray">地点{{ item.address }}</div>
<div class="time gray font-size14">时间{{ item.startTime }}</div>
<div class="flex flex-end">
<div>
<span>报名人数</span> <span class="font-size18 orange">{{ item.participants }}</span>/<span
class="font-size14">{{ item.participants }}</span>
</div>
<van-button type="info" size="small" round @click="handelClickJump('activityDetail')"
:disabled="item.online !== 1">报名</van-button>
</div>
</div>
</div>
</van-list>
<register-dialog v-if="showRegister" @close="showRegister = false"></register-dialog>
</div>
</template>
<script>
import { communityActivity } from '@/api/home';
import registerDialog from '@/components/registerDialog';
export default {
data() {
return {
activityList: [],
pageSize: 5,
pageNo: 1,
agencyId: null,
finished: false,
loading: true,
showRegister: false,
};
},
created() {
this.agencyId = this.$store.state.app.agencyId;
this.communityActivity();
},
methods: {
async communityActivity() {
let parm = {
pageSize: this.pageSize,
pageNo: this.pageNo++,
agencyId: this.agencyId,
activityName: "",
status: "",
typeId: "",
startTime: "",
endTime: "",
address: "",
assistingParty: ""
}
let res = await communityActivity(parm)
if (res) {
this.loading = false;
if (res.list.length < this.pageSize) {
this.finished = true;
}
this.activityList = this.activityList.concat(res.list);
}
},
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>
.activity_content {
padding-bottom: 15px;
box-sizing: border-box;
width: 100%;
border-bottom: 1px solid #EAEAEA;
margin-top: 14px;
min-height: 110px;
.img {
width: 231px;
height: 33px;
}
&:last-child {
border-bottom: none;
}
}
</style>

37
src/views/home/index.vue

@ -56,21 +56,21 @@
<div class="card m-top10">
<div class="title">
<span>社区活动</span>
<span>更多</span>
<span @click="$router.push('/activity')">更多</span>
</div>
<div class="activity_content flex" v-for="(item, index) in activityList">
<img :src="item.imgSrc" alt="" class="mr10" style="width: 75px;height: 95px;">
<div class="activity_content flex" v-for="(item, index) in activityList" :key="index">
<img :src="item.coverPic" alt="" class="mr10" style="width: 75px;height: 95px;">
<div class="flex flex-y flex1 flex-end" style="overflow: hidden;">
<div class="van-ellipsis">{{ item.title }}</div>
<div class="van-ellipsis">{{ item.activityName }}</div>
<div class="address font-size14 van-ellipsis gray">地点{{ item.address }}</div>
<div class="time gray font-size14">时间{{ item.date }}</div>
<div class="time gray font-size14">时间{{ item.startTime }}</div>
<div class="flex flex-end">
<div>
<span>报名人数</span> <span class="font-size18 orange">{{ item.resiNum }}</span>/<span
class="font-size14">{{ item.total }}</span>
<span>报名人数</span> <span class="font-size18 orange">{{ item.participants }}</span>/<span
class="font-size14">{{ item.participants }}</span>
</div>
<van-button type="info" size="small" round
@click="handelClickJump('activity')">报名</van-button>
@click="handelClickJump('activity')" :disabled="item.online !== 1">报名</van-button>
</div>
</div>
</div>
@ -135,24 +135,7 @@ export default {
path: 'service'
}
],
activityList: [
{
title: '社区活动测试测试测试时杀死还是上海市普陀区金沙江路',
address: '上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路',
date: '2021-09-22',
imgSrc: require('@/assets/images/zhishu1.png'),
resiNum: 10,
total: 50
},
{
title: '社区活动测试测试测试时杀死还是上海市普陀区金沙江路',
address: '上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路',
date: '2021-09-22',
imgSrc: require('@/assets/images/zhishu1.png'),
resiNum: 10,
total: 50
}
],
activityList: [],
eventList: [
{
total: 100,
@ -190,7 +173,7 @@ export default {
}
let res = await communityActivity(parm)
if (res) {
console.log(res);
this.activityList = res.list
}
},
handelClickJump(path) {

Loading…
Cancel
Save