提交 88d25b7a 编写于 作者: 杨广俊's avatar 杨广俊

返回刷新

上级 2a54d4cf
...@@ -120,7 +120,8 @@ export default { ...@@ -120,7 +120,8 @@ export default {
}, },
computed: { computed: {
...mapGetters({ ...mapGetters({
userInfo: 'userInfo' userInfo: 'userInfo',
refreshNum: 'refreshNum'
}), }),
cParamData() { cParamData() {
if(this.list && this.list.length){ if(this.list && this.list.length){
...@@ -130,6 +131,12 @@ export default { ...@@ -130,6 +131,12 @@ export default {
} }
} }
}, },
watch: {
refreshNum(val) {
alert('refreshNum: ' + refreshNum)
this.getData()
}
},
components: { components: {
GroupTitle GroupTitle
}, },
......
const getters = { const getters = {
userInfo: state => state.sousuo.userInfo, userInfo: state => state.sousuo.userInfo,
statusBarHeight: state => state.sousuo.statusBarHeight, statusBarHeight: state => state.sousuo.statusBarHeight,
cSearchText: state => state.sousuo.cSearchText cSearchText: state => state.sousuo.cSearchText,
refreshNum: state => state.sousuo.refreshNum
} }
export default getters export default getters
...@@ -2,7 +2,8 @@ const sousuo = { ...@@ -2,7 +2,8 @@ const sousuo = {
state: { state: {
userInfo: {}, userInfo: {},
statusBarHeight: {}, statusBarHeight: {},
cSearchText: '' cSearchText: '',
refreshNum: 1
}, },
mutations: { mutations: {
SET_USER_INFO: (state, userInfo) => { SET_USER_INFO: (state, userInfo) => {
...@@ -13,6 +14,9 @@ const sousuo = { ...@@ -13,6 +14,9 @@ const sousuo = {
}, },
SET_C_SEARCH_TEXT: (state, cSearchText) => { SET_C_SEARCH_TEXT: (state, cSearchText) => {
state.cSearchText = cSearchText state.cSearchText = cSearchText
},
SET_REFRESH_NUM: (state, refreshNum) => {
state.refreshNum = refreshNum
} }
}, },
actions: { actions: {
...@@ -23,9 +27,11 @@ const sousuo = { ...@@ -23,9 +27,11 @@ const sousuo = {
commit('SET_STATUS_BAR_HEIGHT', statusBarHeight) commit('SET_STATUS_BAR_HEIGHT', statusBarHeight)
}, },
setCSearchText({ commit }, cSearchText) { setCSearchText({ commit }, cSearchText) {
console.log('setCSearchText cSearchText', cSearchText)
commit('SET_C_SEARCH_TEXT', cSearchText) commit('SET_C_SEARCH_TEXT', cSearchText)
}, },
setRefreshNum({ commit }, refreshNum) {
commit('SET_REFRESH_NUM', refreshNum)
},
} }
} }
......
...@@ -171,6 +171,7 @@ export default { ...@@ -171,6 +171,7 @@ export default {
_this.search() _this.search()
} }
window.__refresh = function(){ window.__refresh = function(){
_this.setRefreshNum(++this.refreshNum)
_this.getUserInfo() _this.getUserInfo()
} }
if(window.__isWeb){ if(window.__isWeb){
...@@ -184,7 +185,8 @@ export default { ...@@ -184,7 +185,8 @@ export default {
}, },
methods: { methods: {
...mapActions({ ...mapActions({
setCSearchText: 'setCSearchText' setCSearchText: 'setCSearchText',
setRefreshNum: 'setRefreshNum'
}), }),
showAllItem(index) { showAllItem(index) {
console.log(typeof index) console.log(typeof index)
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册