给定默认值
This commit is contained in:
@@ -2,7 +2,7 @@ const getVuex = () => {
|
|||||||
return JSON.parse(uni.getStorageSync('vuex') || {})
|
return JSON.parse(uni.getStorageSync('vuex') || {})
|
||||||
}
|
}
|
||||||
const setVuex = vuex => {
|
const setVuex = vuex => {
|
||||||
uni.setStorageSync("vuex", vuex)
|
uni.setStorageSync("vuex", JSON.stringify(vuex))
|
||||||
}
|
}
|
||||||
export default {
|
export default {
|
||||||
instance: null,
|
instance: null,
|
||||||
@@ -14,8 +14,8 @@ export default {
|
|||||||
let vuex = getVuex()
|
let vuex = getVuex()
|
||||||
this.instance?.post("/app/appgirdmemberinfo/checkLogOnUser").then(res => {
|
this.instance?.post("/app/appgirdmemberinfo/checkLogOnUser").then(res => {
|
||||||
if (res?.data) {
|
if (res?.data) {
|
||||||
let {girdId, girdMemberId, girdName, checkType: girdCheckType} = res.data
|
let {girdId, girdMemberId, girdName, checkType: girdCheckType, appGirdInfo: gridInfo} = res.data
|
||||||
vuex.user = {...vuex.user, girdId, girdMemberId, girdName, girdCheckType}
|
vuex.user = {...vuex.user, girdId, girdMemberId, girdName, girdCheckType, gridInfo}
|
||||||
setVuex(vuex)
|
setVuex(vuex)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
</AiPagePicker>
|
</AiPagePicker>
|
||||||
<span @click="linkTo('./SetGird')" v-if="isGridAdmin">网格配置</span>
|
<span @click="linkTo('./SetGird')" v-if="isGridAdmin">网格配置</span>
|
||||||
</div>
|
</div>
|
||||||
<component v-if="refresh && isGridMember" :is="component" @change="onChange" :params="params"></component>
|
<component v-if="refresh && isGridMember" :is="component" @change="onChange" :params="params"/>
|
||||||
<div class="tabs" v-if="isTab && isGridMember">
|
<div class="tabs" v-if="isTab && isGridMember">
|
||||||
<div class="item" @click="tabClick(index, item.component)" v-for="(item, index) in tabs" :key="index">
|
<div class="item" @click="tabClick(index, item.component)" v-for="(item, index) in tabs" :key="index">
|
||||||
<img :src="tabIndex == index ? item.activeImg : item.img" alt=""/>
|
<img :src="tabIndex == index ? item.activeImg : item.img" alt=""/>
|
||||||
@@ -101,6 +101,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
this.handleSelectGird(this.user.gridInfo)
|
||||||
uni.$on('hideTab', () => {
|
uni.$on('hideTab', () => {
|
||||||
this.isTab = false
|
this.isTab = false
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -30,9 +30,7 @@
|
|||||||
<div class="girdCont">
|
<div class="girdCont">
|
||||||
<div class="boxes">
|
<div class="boxes">
|
||||||
<span class="boxesLeft">网格名称</span>
|
<span class="boxesLeft">网格名称</span>
|
||||||
|
|
||||||
<span class="boxesRight">{{ gridInfo.girdName || '' }}</span>
|
<span class="boxesRight">{{ gridInfo.girdName || '' }}</span>
|
||||||
<!-- <span class="boxesRight">{{ girdUser.appGirdInfo.girdName }}</span> -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="boxes">
|
<div class="boxes">
|
||||||
@@ -56,14 +54,12 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
girdUser: [],
|
|
||||||
peopleList: {},
|
peopleList: {},
|
||||||
gridInfo: {},
|
gridInfo: {},
|
||||||
checkType: '',
|
checkType: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.isGirdUser()
|
|
||||||
this.gridInfo = this.params
|
this.gridInfo = this.params
|
||||||
this.getList()
|
this.getList()
|
||||||
uni.$on('goback', (res) => {
|
uni.$on('goback', (res) => {
|
||||||
@@ -72,17 +68,9 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
isGirdUser() {
|
|
||||||
this.$http.post('/app/appgirdmemberinfo/checkLogOnUser').then((res) => {
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.girdUser = res.data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
getList() {
|
getList() {
|
||||||
this.$http.post(`/app/appgirdmemberinfo/girdMemberAndResidentStatistic?girdId=${this.gridInfo.id}`).then((res) => {
|
this.$http.post(`/app/appgirdmemberinfo/girdMemberAndResidentStatistic?girdId=${this.gridInfo.id}`).then((res) => {
|
||||||
if (res.code == 0) {
|
if (res?.data) {
|
||||||
this.peopleList = res.data
|
this.peopleList = res.data
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import Vuex from 'vuex'
|
|||||||
import perState from 'vuex-persistedstate'
|
import perState from 'vuex-persistedstate'
|
||||||
import http from '../common/axios'
|
import http from '../common/axios'
|
||||||
import CryptoJS from '../utils/crypto-js'
|
import CryptoJS from '../utils/crypto-js'
|
||||||
|
import action from "../common/action";
|
||||||
|
|
||||||
Vue.use(Vuex)
|
Vue.use(Vuex)
|
||||||
let agentSignURL = "", apiList = []
|
let agentSignURL = "", apiList = []
|
||||||
@@ -210,7 +211,7 @@ const store = new Vuex.Store({
|
|||||||
return http.post("/admin/user/detail-phone").then(res => {
|
return http.post("/admin/user/detail-phone").then(res => {
|
||||||
if (res?.code == 0) {
|
if (res?.code == 0) {
|
||||||
state.commit('setUser', res.data)
|
state.commit('setUser', res.data)
|
||||||
this.$action.getGridInfo()
|
action.getGridInfo()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user