Browse Source

Merge branch 'dev' of http://120.46.222.128:10021/elink-star/epmet-wx-pa into xiaowang

# Conflicts:
#	src/api/home.js
#	src/views/home/index.vue
feature
是小王呀\24601 1 year ago
parent
commit
28f01ac47e
  1. 10
      src/api/event.js
  2. 21
      src/api/home.js
  3. 28
      src/assets/css/index.less
  4. 5
      src/router/router.config.js
  5. 14
      src/views/appeal/index.vue
  6. 220
      src/views/communityPublicity/index.vue
  7. 94
      src/views/home/index.vue

10
src/api/event.js

@ -29,7 +29,15 @@ export function eventList(params) {
params params
}) })
} }
//我的诉求列表
export function collects(params) {
return request({
url: `/governance/demandCollect/my/collects`,
method: 'get',
message: '获取诉求中...',
params
})
}
// 事件评价 // 事件评价
export function updateEvent(data) { export function updateEvent(data) {
return request({ return request({

21
src/api/home.js

@ -17,6 +17,7 @@ export function icEventOldDiscuss(data) {
data data
}) })
} }
<<<<<<< HEAD
// 点赞 // 点赞
export function handelClicsupport(data) { export function handelClicsupport(data) {
return request({ return request({
@ -29,10 +30,18 @@ export function handelClicsupport(data) {
export function keyWordSearch(data) { export function keyWordSearch(data) {
return request({ return request({
url: `/actual/base/communityActivity/keyWordSearch`, url: `/actual/base/communityActivity/keyWordSearch`,
=======
// 【社区讯息】菜单
export function advertisingTag(data) {
return request({
url: `/actual/base/advertisingTag/page`,
>>>>>>> b487435718ed41dce92441a54126caa0d073f824
method: 'post', method: 'post',
data data
}) })
} }
<<<<<<< HEAD
//热门词语 //热门词语
export function popularSearch(data) { export function popularSearch(data) {
return request({ return request({
@ -41,3 +50,15 @@ export function handelClicsupport(data) {
data data
}) })
} }
=======
// 【社区讯息】菜单
export function communityPublicity(data) {
return request({
url: `/actual/base/communityPublicity/page`,
method: 'post',
data
})
}
>>>>>>> b487435718ed41dce92441a54126caa0d073f824

28
src/assets/css/index.less

@ -33,6 +33,17 @@ body #app {
} }
} }
} }
.no-data{
height: 50px;
width: 100%;
color: #666666;
text-align: center;
line-height: 50px;
font-size: 15px;
}
.oh{
overflow: hidden;
}
.y66666{ .y66666{
color: #666666; color: #666666;
} }
@ -128,6 +139,9 @@ body #app {
&-right10{ &-right10{
margin-right: 10px; margin-right: 10px;
} }
&-right26{
margin-right: 26px;
}
&-top15{ &-top15{
margin-top: 15px; margin-top: 15px;
@ -187,7 +201,19 @@ body #app {
.mr10 { .mr10 {
margin-right: 10px; margin-right: 10px;
} }
.text{
&-align{
&-center{
text-align: center;
}
&-right{
text-align: right;
}
&-left{
text-align: left;
}
}
}
.primary-color { .primary-color {
color: @blue; color: @blue;
} }

5
src/router/router.config.js

@ -130,6 +130,11 @@ export const constantRouterMap = [
name: 'detailServices', name: 'detailServices',
component: () => import('@/views/Enjoyableservices/detail'), component: () => import('@/views/Enjoyableservices/detail'),
meta: { title: '服务详情', keepAlive: false } meta: { title: '服务详情', keepAlive: false }
},{
path: '/communityPublicity',
name: 'communityPublicity',
component: () => import('@/views/communityPublicity'),
meta: { title: '社区讯息', keepAlive: false }
} }
] ]

14
src/views/appeal/index.vue

@ -77,7 +77,7 @@
</template> </template>
<script> <script>
import { eventList } from '@/api/event' import { collects } from '@/api/event'
import { ImagePreview } from 'vant' import { ImagePreview } from 'vant'
import { requirementList } from '@/api/demand' import { requirementList } from '@/api/demand'
export default { export default {
@ -105,16 +105,8 @@ export default {
}, },
methods: { methods: {
getEventList() { getEventList() {
eventList({ collects().then(res => {
mobile: this.$store.state.app.userInfo.phone this.eventList = res.list;
}).then(res => {
res = res.map(item => {
return {
...item,
imageList: item.imageList.map(item2 => item2.url)
}
})
this.eventList = res
}) })
}, },
getDemandList() { getDemandList() {

220
src/views/communityPublicity/index.vue

@ -0,0 +1,220 @@
<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" @click="handleSearch">查询</van-button>
</div>
<div class='container'>
<van-tabs v-model="tagActive" style="width: 100%;" @change="handelChangeTags">
<van-tab v-for="item in tagList" :key="item.id" :title="item.tagName">
<div class="flex flex-y flex1 flex-end" v-if="PublicityList.length !== 0">
<van-list v-model="loading" :finished="finished" finished-text="没有更多了"
@load="communityPublicity" class="card" :offset="50">
<div class="activity_content flex flex-y" v-for="(item, index) in PublicityList"
:key="index">
<div class="flex flex1 oh">
<div class="flex flex-y flex1 m-right10 oh">
<span class="van-multi-ellipsis--l2 " style="line-height: 28px;">
{{ item.title }}
</span>
<span class="van-ellipsis y66666 font-size15">
{{ item.content }}
</span>
</div>
<img v-if="item.coverPic" :src="item.coverPic" style="width: 100px;height: 60px;"
alt="">
</div>
<div class="flex flex-end flex-center gray m-top10 font-size13">
<div class="flex flex-center"><img src="@/assets/images/icons/support.png" alt=""
class="img_16 m-right7"><span>{{ item.likes }}</span>
</div>
<div class="flex1 text-align-right">{{ item.releaseTime }}</div>
</div>
</div>
</van-list>
</div>
<div v-else class="no-data">
暂无数据~
</div>
</van-tab>
</van-tabs>
</div>
</div>
</template>
<script>
import { advertisingTag, communityPublicity } from '@/api/home';
export default {
data() {
return {
PublicityList: [],
tagList: [],
tagActive: 'new',
tagId: null,
pageSize: 5,
pageNo: 1,
agencyId: null,
finished: false,
loading: true,
showRegister: false,
searchValue: ""
};
},
created() {
this.agencyId = this.$store.state.app.agencyId;
this.advertisingTag();//
this.communityPublicity()//
},
methods: {
handleSearch(){
this.PublicityList = [];
this.pageNo = 1;
this.communityPublicity()
},
filterTagId(tagId) {
return this.tagList.filter(item => item.id === tagId)[0].tagName || '--';
},
async advertisingTag() {
let parm = {
pageSize: 10,
pageNo: 1,
status: 0,
tagName: null
}
let res = await advertisingTag(parm)
if (res) {
this.tagList = res.list;
this.tagList.unshift({ tagName: '最新', id: 'new' })
}
},
async communityPublicity() {
let parm = {
pageSize: 10,
pageNo: 1,
title: this.searchValue,
tagId: this.tagId,
startTime: '',
endTime: '',
agencyId: this.agencyId
}
let res = await communityPublicity(parm)
if (res) {
this.loading = false;
res.list.forEach(item => {
if (item.content) {
item.content = this.extractChineseCharactersAndPunctuation(item.content)
}
})
if (res.list.length < this.pageSize) {
this.finished = true;
}
this.PublicityList = this.PublicityList.concat(res.list);
}
},
extractChineseCharactersAndPunctuation(str) {
const chineseCharsAndPunctuation = str.match(/[\u4e00-\u9fa5\u3000-\u303F\uff00-\uffef]/g);
return chineseCharsAndPunctuation ? chineseCharsAndPunctuation.join('') : '';
},
handelChangeTags(val, title) {
if (val !== 0) {
this.tagId = this.tagList[val].id;
this.PublicityList = [];
} else {
this.tagId = '';
}
this.communityPublicity()
},
},
components: {},
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>

94
src/views/home/index.vue

@ -19,7 +19,8 @@
<div class="swipe"> <div class="swipe">
<van-swipe class="my-swipe" :autoplay="3000" indicator-color="white"> <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
<van-swipe-item v-for="item in activityList"> <van-swipe-item v-for="item in activityList">
<img :src="item.coverPic" alt="" style="width: 100%;height: 150px; margin: 0 auto;border-radius: 15px;"> <img :src="item.coverPic" alt=""
style="width: 100%;height: 150px; margin: 0 auto;border-radius: 15px;">
</van-swipe-item> </van-swipe-item>
</van-swipe> </van-swipe>
</div> </div>
@ -67,8 +68,8 @@
<span>报名人数</span> <span class="font-size18 orange">{{ item.participants }}</span>/<span <span>报名人数</span> <span class="font-size18 orange">{{ item.participants }}</span>/<span
class="font-size14">{{ item.participants }}</span> class="font-size14">{{ item.participants }}</span>
</div> </div>
<van-button type="info" size="small" round <van-button type="info" size="small" round @click="handelClickJump('activity')"
@click="handelClickJump('activity')" :disabled="item.online !== 1">报名</van-button> :disabled="item.online !== 1">报名</van-button>
</div> </div>
</div> </div>
</div> </div>
@ -94,6 +95,40 @@
</div> </div>
</div> </div>
</div> </div>
<div class="card m-top10">
<div class="title">
<span>社区讯息</span>
<span @click="$router.push('/communityPublicity')">更多</span>
</div>
<div class="activity_content flex">
<van-tabs v-model="tagActive" style="width: 100%;" @change="handelChangeTags">
<van-tab v-for="item in tagList" :key="item.id" :title="item.tagName">
<div class="flex flex-y flex1 flex-end" v-if="PublicityList.length !== 0">
<div class="activity_content flex flex-y" v-for="(item, index) in PublicityList" :key="index">
<div class="flex flex1 ">
<span class="van-multi-ellipsis--l2 flex1" style="line-height: 28px;" >
{{ item.title }}
</span>
<img v-if="item.coverPic" :src="item.coverPic" style="width: 100px;height: 60px;" alt="">
</div>
<div class="flex flex-end flex-center gray m-top10 font-size13">
<div class="flex">
<div class="flex flex-center m-right26" v-if="item.tagId && tagList">{{filterTagId(item.tagId)}}</div>
<div class="flex flex-center"><img src="@/assets/images/icons/support.png"
alt="" class="img_16 m-right7"><span>{{ item.likes }}</span>
</div>
</div>
<div class="flex1 text-align-right">{{item.releaseTime}}</div>
</div>
</div>
</div>
<div v-else class="no-data">
暂无数据~
</div>
</van-tab>
</van-tabs>
</div>
</div>
</div> </div>
<register-dialog v-if="showRegister" @close="showRegister = false"></register-dialog> <register-dialog v-if="showRegister" @close="showRegister = false"></register-dialog>
</div> </div>
@ -101,7 +136,11 @@
<script> <script>
import registerDialog from '@/components/registerDialog'; import registerDialog from '@/components/registerDialog';
<<<<<<< HEAD
import { communityActivity,icEventOldDiscuss,handelClicsupport} from '@/api/home'; import { communityActivity,icEventOldDiscuss,handelClicsupport} from '@/api/home';
=======
import { communityActivity, icEventOldDiscuss, advertisingTag, communityPublicity } from '@/api/home';
>>>>>>> b487435718ed41dce92441a54126caa0d073f824
export default { export default {
data() { data() {
return { return {
@ -136,7 +175,14 @@ export default {
activityList: [], activityList: [],
eventList: [], eventList: [],
showRegister: false, showRegister: false,
<<<<<<< HEAD
userId:"" userId:""
=======
tagList: [],
tagActive: 'new',
tagId: null,
PublicityList:[]
>>>>>>> b487435718ed41dce92441a54126caa0d073f824
}; };
}, },
created() { created() {
@ -145,6 +191,8 @@ export default {
this.userId = this.$store.state.app.appId; this.userId = this.$store.state.app.appId;
this.communityActivity()// this.communityActivity()//
this.icEventOldDiscuss()// this.icEventOldDiscuss()//
this.advertisingTag()//
this.communityPublicity()//
}, },
methods: { methods: {
async handelClicopposeNum(data){ async handelClicopposeNum(data){
@ -198,10 +246,48 @@ export default {
} }
let res = await icEventOldDiscuss(parm) let res = await icEventOldDiscuss(parm)
if (res) { if (res) {
console.log(res);
this.eventList = res.list.slice(0, 2) this.eventList = res.list.slice(0, 2)
} }
}, },
async advertisingTag() {
let parm = {
pageSize: 10,
pageNo: 1,
status: 0,
tagName: null
}
let res = await advertisingTag(parm)
if (res) {
this.tagList = res.list;
this.tagList.unshift({ tagName: '最新', id: 'new' })
}
},
async communityPublicity() {
let parm = {
pageSize: 10,
pageNo: 1,
title: '',
tagId: this.tagId,
startTime: '',
endTime: '',
agencyId: this.agencyId
}
let res = await communityPublicity(parm)
if (res) {
this.PublicityList = res.list.slice(0, 2)
}
},
handelChangeTags(val,title){
if(val !== 0){
this.tagId = this.tagList[val].id;
}else{
this.tagId = '';
}
this.communityPublicity()
},
filterTagId(tagId){
return this.tagList.filter(item=>item.id === tagId)[0].tagName || '--';
},
handelClickJump(path) { handelClickJump(path) {
if (path === 'event' || path === 'service' || path === 'activity') { if (path === 'event' || path === 'service' || path === 'activity') {
if (this.$store.state.app.userInfo.mobile) { if (this.$store.state.app.userInfo.mobile) {

Loading…
Cancel
Save