Commit 2d45a297 authored by 袁玲利's avatar 袁玲利

Merge branch 'v_req_11.2' into uat

parents cccb3f8e 6f9f1713
...@@ -114,19 +114,6 @@ export default { ...@@ -114,19 +114,6 @@ export default {
}; };
}, },
mounted() { mounted() {
const that = this;
// 监听返回
this.pushHistory();
window.addEventListener(
"popstate",
function (e) {
// 为了避免只调用一次
that.pushHistory("title1");
// 自定义方法, 直接关闭网页或返回小程序上一页
that.goBack();
},
false
);
this.games.sort(() => 0.5 - Math.random()); this.games.sort(() => 0.5 - Math.random());
this.params.userid = this.getQueryParams("userId"); this.params.userid = this.getQueryParams("userId");
this.params.sessionid = this.getQueryParams("sessionid"); this.params.sessionid = this.getQueryParams("sessionid");
...@@ -136,18 +123,6 @@ export default { ...@@ -136,18 +123,6 @@ export default {
this.init(); this.init();
}, },
methods: { methods: {
// 添加一条 history 实体作为替代原来的 history 实体
pushHistory(str = "title", url = "#") {
const state = {
title: str,
url,
};
window.history.pushState(state, state.title, state.url);
},
goBack() {
console.log('游戏排行榜的物理返回按钮')
wx.miniProgram.postMessage({ data: { behavior: 'back'} })
},
init() { init() {
const self = this; const self = this;
this.timer = setInterval(() => { this.timer = setInterval(() => {
...@@ -254,6 +229,7 @@ export default { ...@@ -254,6 +229,7 @@ export default {
}, },
}, },
onHide() { onHide() {
console.log('111111111')
this.params.behavior = "viewPage"; this.params.behavior = "viewPage";
this.params.data = "closePage"; this.params.data = "closePage";
this.GameStatistics(); this.GameStatistics();
...@@ -262,6 +238,16 @@ export default { ...@@ -262,6 +238,16 @@ export default {
this.timer = null; this.timer = null;
} }
}, },
beforeRouteLeave(to,from,next){
console.log('222222222222')
wx.miniProgram.postMessage({
data: {
cardId: 0,
title: '电子名片'
}
})
next()
},
}; };
</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