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

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

@ -16,9 +16,7 @@ export default {
this.serUrl(options); this.serUrl(options);
} }
/* #ifdef H5 */
this.getPostMessage(); this.getPostMessage();
/* #endif */
}, },
computed: mapState('user', ['isPC']), computed: mapState('user', ['isPC']),
@ -50,22 +48,31 @@ export default {
// //
getPostMessage() { getPostMessage() {
const that = this; /* #ifdef H5 */
window.addEventListener( window.addEventListener(
'message', 'message',
function (e) { e => {
console.log('e: ', e);
// REVIEW:
if (e.data.event === 'openDetail') { if (e.data.event === 'openDetail') {
if (that.isPC) { if (!e.data.data) return;
that.setTaskDetailUrl(e.data.data); if (e.data.local) {
// TODO:
// local singin
} else { } else {
const { p, u, pname, url } = that.urlOptions; // : urlproject
that.src = `${e.data.data}/${that.$t.app.version}/#/?u=${u}&p=${p}&url=${url}&pname=${pname}`; // e.data.data url
if (this.isPC) {
this.setTaskDetailUrl(e.data.data);
} else {
this.src = e.data.data;
}
} }
} }
}, },
false, false,
); );
/* #endif */
}, },
}, },
}; };

Loading…
Cancel
Save