Commit 7e9b19c4 authored by FE-安焕焕's avatar FE-安焕焕 👣

fix:页面title不变的问题

parent c74eb32d
......@@ -40,20 +40,17 @@ const mutations = {
if (title) {
state.title = title;
}
setTimeout(function() {
//利用iframe的onload事件刷新页面
document.title = state.title;
var iframe = document.createElement('iframe');
iframe.style.visibility = 'hidden';
iframe.style.width = '1px';
iframe.style.height = '1px';
iframe.onload = function() {
setTimeout(function() {
document.body.removeChild(iframe);
}, 0);
};
document.body.appendChild(iframe);
}, 0);
// 如果是 iOS 设备,则使用如下 hack 的写法实现页面标题的更新
if (/ip(hone|od|ad)/i.test(navigator.userAgent.toLowerCase())) {
const hackIframe = document.createElement('iframe');
hackIframe.style.display = 'none';
hackIframe.src = '/public/fixIosTitle.html?r=' + Math.random();
document.body.appendChild(hackIframe);
setTimeout(() => {
document.body.removeChild(hackIframe);
}, 300);
}
},
[types.CHANGE_META](state, meta) {
for (let i in meta) {
......
......@@ -71,10 +71,8 @@ export default {
async goOrderList(type) {
if (type === 'cs') {
this.$store.commit('CHANGE_TITLE', '客服中心'); // 改变title
setTimeout(() => {
window.location.href =
'https://kdspstatic.91xr.cn/kdsp/mine/service/customer-service/customer-service-prod2.html';
}, 0);
return;
}
const token = localStorage.get('vccToken');
......
......@@ -190,10 +190,8 @@ export default {
},
contractCS() {
this.$store.commit('CHANGE_TITLE', '客服中心'); // 改变title
setTimeout(() => {
window.location.href =
'https://kdspstatic.91xr.cn/kdsp/mine/service/customer-service/customer-service-prod2.html';
}, 0);
},
openCancelPopup() {
this.$dialog({
......
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