Browse Source

refactor: p-task-title 接受消息处理url调整

PC
wally 4 years ago
parent
commit
a88a2f6bca
  1. 1
      CHANGELOG.md
  2. 25
      src/pages/project-webview/project-webview.vue

1
CHANGELOG.md

@ -230,6 +230,7 @@
- | merge globals | b0957cc
- | merge wrr | 5ccc7a5
- | mock | 51c24a5
- | npm package update | aa4105b
package manifest | 去掉了摇树 | f7c1dd4
pwa 小程序 | 移除了pwa,alloyFinger添加平台判断 | 875fab4
- | uview-ui | a9ea34b

25
src/pages/project-webview/project-webview.vue

@ -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}`;
// : urlproject
// e.data.data url
if (this.isPC) {
this.setTaskDetailUrl(e.data.data);
} else {
this.src = e.data.data;
}
}
}
},
false,
);
/* #endif */
},
},
};

Loading…
Cancel
Save