Commit 7fb39e95 authored by 袁玲利's avatar 袁玲利

Merge branch 'v_req_11.2' into uat

parents 6750e8b4 ef75ba86
...@@ -115,7 +115,20 @@ export default { ...@@ -115,7 +115,20 @@ export default {
second: 0, second: 0,
}; };
}, },
onShow() {
uni.$on("refreshPage", (data) => {
console.log(data, "ttttttttttttt");
if (data.reload) {
this.init();
}
});
},
mounted() { mounted() {
this.init();
},
methods: {
init() {
const self = this;
this.games.sort(() => 0.5 - Math.random()); this.games.sort(() => 0.5 - Math.random());
this.params.userid = this.params.userid =
...@@ -132,12 +145,6 @@ export default { ...@@ -132,12 +145,6 @@ export default {
if (this.params.sessionid) { if (this.params.sessionid) {
uni.setStorageSync("sessionid", this.params.sessionid); uni.setStorageSync("sessionid", this.params.sessionid);
} }
this.init();
},
methods: {
init() {
const self = this;
this.timer = setInterval(() => { this.timer = setInterval(() => {
this.second += 1; this.second += 1;
if (this.second == 5) { if (this.second == 5) {
...@@ -255,6 +262,8 @@ export default { ...@@ -255,6 +262,8 @@ export default {
clearInterval(this.timer); clearInterval(this.timer);
this.timer = null; this.timer = null;
} }
// 移除监听,避免内存泄露
uni.$off("refreshPage");
}, },
}; };
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment