Browse Source

接口联调,首页跳转修改

feature
mk 1 year ago
parent
commit
ff577761c2
  1. 11
      src/api/user.js
  2. 4
      src/router/index.js
  3. 2
      src/store/modules/app.js
  4. 28
      src/views/Enjoyableservices/index.vue
  5. 3
      src/views/activity/index.vue
  6. 18
      src/views/home/index.vue
  7. 3
      src/views/mine/myActivity/index.vue

11
src/api/user.js

@ -24,7 +24,7 @@ export function getUserWechatByUserId(id) {
return request({ return request({
url: `epmetuser/user/getH5LoginUserInfo/${id}`, url: `epmetuser/user/getH5LoginUserInfo/${id}`,
method: 'get', method: 'get',
message: '获取用户信息中...', message: '加载中...',
}) })
} }
@ -115,7 +115,6 @@ export function querystaffmessage(params) {
params params
}) })
} }
//
// 获取消息列表 // 获取消息列表
export function getWxmpEventAndDemandMessageList(params) { export function getWxmpEventAndDemandMessageList(params) {
return request({ return request({
@ -132,3 +131,11 @@ export function getAllOrgTreeList(params) {
params params
}) })
} }
//获取可享服务
export function myCommonsService(params) {
return request({
url: `/actual/base/residentBaseInfo/myCommonsService`,
method: 'post',
params
})
}

4
src/router/index.js

@ -5,7 +5,7 @@ import { constantRouterMap } from './router.config.js'
import { checkWxmpRegister, login } from '@/api/user' import { checkWxmpRegister, login } from '@/api/user'
import { title } from '@/config' import { title } from '@/config'
const whiteList = ['/login', '/register', '/errorPage','/selectAgency','/houseQR'] const whiteList = ['/login', '/register', '/errorPage','/selectAgency','/houseQR','/']
const originalPush = Router.prototype.push const originalPush = Router.prototype.push
Router.prototype.push = function push(location, onResolve, onReject) { Router.prototype.push = function push(location, onResolve, onReject) {
if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject) if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
@ -50,9 +50,9 @@ function paramsFormat(params) {
} }
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
console.log(to);
let urlParams = getQueryParams() let urlParams = getQueryParams()
if(urlParams.houseId){ if(urlParams.houseId){
console.log(urlParams);
store.commit('SET_HOUSE_ID', urlParams.houseId) store.commit('SET_HOUSE_ID', urlParams.houseId)
}else{ }else{
store.commit('SET_HOUSE_ID', null) store.commit('SET_HOUSE_ID', null)

2
src/store/modules/app.js

@ -17,7 +17,7 @@ const mutations = {
state.appId = appId state.appId = appId
}, },
SET_HOUSE_ID(state, houseId){ SET_HOUSE_ID(state, houseId){
console.log(houseId,'houseIdVueX'); // console.log(houseId,'houseIdVueX');
state.houseId = houseId; state.houseId = houseId;
}, },
} }

28
src/views/Enjoyableservices/index.vue

@ -1,7 +1,9 @@
<template> <template>
<div> <div>
<div class="container"> <div class="container">
<div class="card m-bottom10" v-for="(item,index) in EnjoyableList" :key="index" @click="$router.push({ path: `/detailServices` })"> <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="myCommonsService" class="card"
:offset="50">
<div class="card m-bottom10" v-for="(item,index) in EnjoyableList" :key="index" @click="$router.push({ path: `/detailServices` })">
<div class="flex flex-x flex-center2"> <div class="flex flex-x flex-center2">
<van-tag v-if="item.status" color="#EBF1FE" text-color="#3974F6" size="large">{{ item.status? "进行中":"已结束" }}</van-tag> <van-tag v-if="item.status" color="#EBF1FE" text-color="#3974F6" size="large">{{ item.status? "进行中":"已结束" }}</van-tag>
<van-tag v-if="!item.status" color="#F5F5F5" text-color="#AAAAAA" size="large">{{ item.status? "进行中":"已结束" }}</van-tag> <van-tag v-if="!item.status" color="#F5F5F5" text-color="#AAAAAA" size="large">{{ item.status? "进行中":"已结束" }}</van-tag>
@ -13,10 +15,12 @@
<div class="font-size15 AAA">{{ item.context }}</div> <div class="font-size15 AAA">{{ item.context }}</div>
</div> </div>
</div> </div>
</van-list>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { myCommonsService } from '@/api/user'
export default{ export default{
data(){ data(){
return{ return{
@ -27,8 +31,28 @@
context:'退役军人 40-60岁'}, context:'退役军人 40-60岁'},
{status:2, date:'2024-05-08 09:30',title:'鞠源社区为退役待就业的军人提供就业岗位。', {status:2, date:'2024-05-08 09:30',title:'鞠源社区为退役待就业的军人提供就业岗位。',
context:'退役军人 40-60岁'}, context:'退役军人 40-60岁'},
] ],
finished: false,
loading: true,
showRegister: false,
pageSize:10,
pageNo:1
} }
},
created(){
this.myCommonsService()
},
methods:{
async myCommonsService() {
let res = await myCommonsService()
if (res) {
this.loading = false;
if (res.list.length < this.pageSize) {
this.finished = true;
}
this.EnjoyableList = this.EnjoyableList.concat(res.list);
}
},
} }
} }
</script> </script>

3
src/views/activity/index.vue

@ -53,7 +53,8 @@ export default {
startTime: "", startTime: "",
endTime: "", endTime: "",
address: "", address: "",
assistingParty: "" assistingParty: "",
online:1
} }
let res = await communityActivity(parm) let res = await communityActivity(parm)
if (res) { if (res) {

18
src/views/home/index.vue

@ -78,7 +78,7 @@
<span>居民议事</span> <span>居民议事</span>
<span @click="$router.push('/discussion')">更多</span> <span @click="$router.push('/discussion')">更多</span>
</div> </div>
<div class="activity_content flex" v-for="(item, index) in eventList"> <div class="activity_content flex" v-for="(item, index) in eventList" :key="index" @click="$router.push({ path: `/discusionDetail`,query: { eventId:item.eventId} })">
<div class="flex flex-y flex1 flex-end" style="overflow: hidden;"> <div class="flex flex-y flex1 flex-end" style="overflow: hidden;">
<span class="van-multi-ellipsis--l2"> <span class="van-multi-ellipsis--l2">
{{ item.eventContent }} {{ item.eventContent }}
@ -162,7 +162,7 @@ export default {
{ {
imgSrc: require('@/assets/images/nav/4.png'), imgSrc: require('@/assets/images/nav/4.png'),
title: '满意度测评', title: '满意度测评',
path: 'notice' path: 'mySatisfaction'
}, },
{ {
imgSrc: require('@/assets/images/nav/5.png'), imgSrc: require('@/assets/images/nav/5.png'),
@ -194,6 +194,9 @@ export default {
this.day = this.$dayjs(date).format('MM-DD'); this.day = this.$dayjs(date).format('MM-DD');
}, },
methods: { methods: {
toDetail(item){
this.$router.push({name:'communityPublicityDetail',query:{item:JSON.stringify(item)}})
},
async querystaffmessage(){ async querystaffmessage(){
let parm = { let parm = {
agencyId: this.agencyId, agencyId: this.agencyId,
@ -244,7 +247,8 @@ export default {
startTime: "", startTime: "",
endTime: "", endTime: "",
address: "", address: "",
assistingParty: "" assistingParty: "",
online:1
} }
let res = await communityActivity(parm) let res = await communityActivity(parm)
if (res) { if (res) {
@ -267,7 +271,7 @@ export default {
let parm = { let parm = {
pageSize: 10, pageSize: 10,
pageNo: 1, pageNo: 1,
status: 0, status: 1,
tagName: null tagName: null
} }
let res = await advertisingTag(parm) let res = await advertisingTag(parm)
@ -300,7 +304,11 @@ export default {
this.communityPublicity() this.communityPublicity()
}, },
filterTagId(tagId){ filterTagId(tagId){
return this.tagList.filter(item=>item.id === tagId)[0].tagName || '--'; if(this.tagList.filter(item=>item.id === tagId)[0]){
return this.tagList.filter(item=>item.id === tagId)[0].tagName;
}else{
return '--';
}
}, },
handelClickJump(path,item) { handelClickJump(path,item) {
if (path === 'event' || path === 'service' || path === 'activity') { if (path === 'event' || path === 'service' || path === 'activity') {

3
src/views/mine/myActivity/index.vue

@ -48,7 +48,8 @@ export default {
agencyId, agencyId,
pageNo:this.pageNo++, pageNo:this.pageNo++,
pageSize, pageSize,
userId:this.$store.state.app.userInfo.id userId:this.$store.state.app.userInfo.id,
online:1
} }
let res = await communityActivity(parm) let res = await communityActivity(parm)
if (res) { if (res) {

Loading…
Cancel
Save