Browse Source

首页跳转,居民信息编辑完成后退一个页面

feature
mk 1 year ago
parent
commit
ca93b0cd26
  1. 15
      src/router/index.js
  2. 4
      src/views/discussion/index.vue
  3. 4
      src/views/home/index.vue
  4. 4
      src/views/register/index.vue
  5. 7
      src/views/userInfo/index.vue

15
src/router/index.js

@ -5,7 +5,7 @@ import { constantRouterMap } from './router.config.js'
import { checkWxmpRegister, login } from '@/api/user'
import { title } from '@/config'
const whiteList = ['/login', '/register', '/errorPage','/selectAgency','/houseQR','/']
const whiteList = ['/login', '/register', '/errorPage','/selectAgency','/houseQR']
const originalPush = Router.prototype.push
Router.prototype.push = function push(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) => {
console.log(to);
let urlParams = getQueryParams()
if(urlParams.houseId){
console.log(urlParams);
store.commit('SET_HOUSE_ID', urlParams.houseId)
}else{
store.commit('SET_HOUSE_ID', null)
@ -96,19 +96,18 @@ router.beforeEach((to, from, next) => {
login({ wxCode: getQueryStringByName('code'),appId:'wx1078fa1e99424de9'}).then(res => {
localStorage.setItem('token', res.token)
localStorage.setItem('userId', res.userH5DTO.id)
if(!res.userH5DTO.agencyId)next({ path: '/selectAgency'})
let state = decodeURIComponent(getQueryStringByName('state'))
state = state.replace(/[\\\b\f\n\r\t]/g, '')
state = state.replace(/(\s*?{\s*?|\s*?,\s*?)(['"])?([a-zA-Z0-9]+)(['"])?:/g, '$1"$3":')
state = state
.replace(/":/g, '":')
.replace(/,"/g, ',"')
.replace(/":/g, '":"')
.replace(/,"/g, '","')
.replace(/},/g, '"},')
.replace(/}]/g, '"}]')
.replace(/}}/g, '"}}')
.replace(/:{"}/g, ':{}"')
console.log(state)
.replace(/"{/g, '{')
.replace(/:{"}/g, ':{}')
state = JSON.stringify({ path: '/', query: {} });
let path = `${location.origin}${location.pathname === '/' ? '' : location.pathname}`
if (state && state != 'undefined') {
state = JSON.parse(state)

4
src/views/discussion/index.vue

@ -59,7 +59,7 @@ export default {
let parm = {
pageSize: 10,
pageNo: 1,
agencyId: null,
agencyId: this.agencyId,
icEventId:null,
content:this.searchValue
}
@ -101,7 +101,7 @@ export default {
let parm = {
pageSize: 10,
pageNo: 1,
agencyId: null,
agencyId: this.agencyId,
icEventId:null
}

4
src/views/home/index.vue

@ -103,8 +103,8 @@
<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 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" @click="$router.push({name:'communityPublicityDetail',query:{item:JSON.stringify(item)}})">
<div class="flex flex1 ">
<span class="van-multi-ellipsis--l2 flex1" style="line-height: 28px;" >
{{ item.title }}

4
src/views/register/index.vue

@ -88,10 +88,10 @@ export default {
return
}
editUser(params).then(res => {
localStorage.setItem('token', res.token)
// localStorage.setItem('token', res.token)
this.$toast.success('注册成功')
let query = this.$route.query
this.$router.replace({ path: query.redirect, query: query.params ? JSON.parse(query.params) : {} })
this.$router.go(-1)
})
},
getCode() {

7
src/views/userInfo/index.vue

@ -143,15 +143,16 @@ export default {
}
},
methods: {
init() {
async init() {
this.type = this.$route.params.type ? this.$route.params.type : ''
document.title = this.$route.params.type === 'edit' ? '编辑' : '注册'
this.userInfo = this.$store.state.app.userInfo
console.log(this.userInfo, 'this.userInfo');
if (this.type === 'edit') {
this.surName = this.userInfo.realName;
this.gender = this.userInfo.sex;
this.streetId = this.userInfo.streetId;
let streetId = this.userInfo.orgIdPath.split(':');
this.streetId = streetId[streetId.length - 2]
await this.getChildAgencyByPid()
this.customerId = this.userInfo.customerId;
this.communityId = this.userInfo.agencyId;
this.idNum = this.userInfo.idNum;

Loading…
Cancel
Save