|
|
@ -16,9 +16,7 @@ export default { |
|
|
|
this.serUrl(options); |
|
|
|
} |
|
|
|
|
|
|
|
/* #ifdef H5 */ |
|
|
|
this.getPostMessage(); |
|
|
|
/* #endif */ |
|
|
|
}, |
|
|
|
|
|
|
|
computed: mapState('user', ['isPC']), |
|
|
@ -50,22 +48,31 @@ export default { |
|
|
|
|
|
|
|
// 接收消息 |
|
|
|
getPostMessage() { |
|
|
|
const that = this; |
|
|
|
|
|
|
|
/* #ifdef H5 */ |
|
|
|
window.addEventListener( |
|
|
|
'message', |
|
|
|
function (e) { |
|
|
|
e => { |
|
|
|
console.log('e: ', e); |
|
|
|
// REVIEW: |
|
|
|
if (e.data.event === 'openDetail') { |
|
|
|
if (that.isPC) { |
|
|
|
that.setTaskDetailUrl(e.data.data); |
|
|
|
if (!e.data.data) return; |
|
|
|
if (e.data.local) { |
|
|
|
// TODO: |
|
|
|
// local 代表打开的不是外部链接 比如singin |
|
|
|
} else { |
|
|
|
const { p, u, pname, url } = that.urlOptions; |
|
|
|
that.src = `${e.data.data}/${that.$t.app.version}/#/?u=${u}&p=${p}&url=${url}&pname=${pname}`; |
|
|
|
// 约定: url在project那边拼接好 这边不管 |
|
|
|
// 主框架认为 e.data.data 就是完整的url |
|
|
|
if (this.isPC) { |
|
|
|
this.setTaskDetailUrl(e.data.data); |
|
|
|
} else { |
|
|
|
this.src = e.data.data; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
false, |
|
|
|
); |
|
|
|
/* #endif */ |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|