Browse Source

首页轮播图,议事接口

feature
mk 1 year ago
parent
commit
c4e729a8ff
  1. 9
      src/api/home.js
  2. 7
      src/utils/request.js
  3. 15
      src/views/activity/detail.vue
  4. 45
      src/views/home/index.vue
  5. 2
      vue.config.js

9
src/api/home.js

@ -9,3 +9,12 @@ export function communityActivity(data) {
data
})
}
// 【居民议事】列表
export function icEventOldDiscuss(data) {
return request({
url: `/governance/icEventOldDiscuss/pageList`,
method: 'post',
data
})
}

7
src/utils/request.js

@ -27,7 +27,12 @@ service.interceptors.request.use(
if (store.state.app.appId) {
config.headers['AppId'] = store.state.app.appId
}
if (store.state.app.userInfo.customerId) {
config.headers['customerId'] = store.state.app.userInfo.customerId
}
if (store.state.app.userInfo.id) {
config.headers['userId'] = store.state.app.userInfo.id
}
config.baseURL = config.baseURL + '/'
return config
},

15
src/views/activity/detail.vue

@ -25,11 +25,14 @@
<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-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 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;">
@ -76,14 +79,18 @@ export default {
:deep(.van-cell) {
padding: 16px 8px;
}
:deep(.van-cell__title) {
color: #666666;
display: flex;
&>span {
flex: 1;
}
}
:deep(.van-cell__value) {
text-align: left;
}
:deep(.van-cell--required) {
&::before {
left: -5px;

45
src/views/home/index.vue

@ -18,11 +18,9 @@
</div>
<div class="swipe">
<van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
<van-swipe-item><img src="@/assets/images/zhishu.png" alt=""
style="width: 100%; margin: 0 auto;"></van-swipe-item>
<van-swipe-item>2</van-swipe-item>
<van-swipe-item>3</van-swipe-item>
<van-swipe-item>4</van-swipe-item>
<van-swipe-item v-for="item in activityList">
<img :src="item.coverPic" alt="" style="width: 100%;height: 150px; margin: 0 auto;border-radius: 15px;">
</van-swipe-item>
</van-swipe>
</div>
<div class="card flex flex-end flex-center2 m-top15 notice">
@ -83,15 +81,15 @@
<div class="activity_content flex" v-for="(item, index) in eventList">
<div class="flex flex-y flex1 flex-end" style="overflow: hidden;">
<span class="van-multi-ellipsis--l2">
{{ item.title }}
{{ item.eventContent }}
</span>
<div class="flex flex-end flex-center gray m-top10 font-size13">
<div class="flex flex-center"><img src="@/assets/images/icons/resi.png"
class="img_16 m-right7" alt=""><span>参与 {{ item.total }}</span></div>
<div class="flex flex-center"><img src="@/assets/images/icons/support.png" alt=""
class="img_16 m-right7"><span>支持 {{ item.support }}</span></div>
class="img_16 m-right7"><span>支持 {{ item.supportNum }}</span></div>
<div class="flex flex-center"><img src="@/assets/images/icons/oppose.png" alt=""
class="img_16 m-right7"><span>反对 {{ item.oppose }}</span></div>
class="img_16 m-right7"><span>反对 {{ item.opposeNum }}</span></div>
</div>
</div>
</div>
@ -103,7 +101,7 @@
<script>
import registerDialog from '@/components/registerDialog';
import { communityActivity } from '@/api/home';
import { communityActivity,icEventOldDiscuss } from '@/api/home';
export default {
data() {
return {
@ -136,26 +134,14 @@ export default {
}
],
activityList: [],
eventList: [
{
total: 100,
support: 50,
title: '社区活动测试测试测试时杀死社区活动测试测试测试时杀死还是上海市普陀区金沙江路还是上海市普陀区金沙江路',
oppose: 10
},
{
total: 100,
support: 50,
title: '社区活动测试测试测试时杀死社区活动测试测试测试时杀死还是上海市普陀区金沙江路还是上海市普陀区金沙江路',
oppose: 10
}
],
eventList: [],
showRegister: false
};
},
created() {
this.agencyId = this.$store.state.app.agencyId;
this.communityActivity()//
this.icEventOldDiscuss()//
},
methods: {
async communityActivity() {
@ -176,6 +162,19 @@ export default {
this.activityList = res.list.slice(0, 2);
}
},
async icEventOldDiscuss(){
let parm = {
pageSize: 10,
pageNo: 1,
agencyId: null,
icEventId:null
}
let res = await icEventOldDiscuss(parm)
if (res) {
console.log(res);
this.eventList = res.list.slice(0, 2)
}
},
handelClickJump(path) {
if (path === 'event' || path === 'service' || path === 'activity') {
if (this.$store.state.app.userInfo.mobile) {

2
vue.config.js

@ -31,7 +31,7 @@ module.exports = defineConfig({
proxy: {
//配置跨域
'/api': {
target: `http://219.146.91.110:30801`,
target: `http://192.168.1.144`,
// target: `http://127.0.0.1:8080`,
changeOrigin: true,
ws: false,

Loading…
Cancel
Save