|
@@ -147,19 +147,17 @@
|
|
|
*/
|
|
|
var onlyPostmessage = (instanceKey) => {
|
|
|
var _a, _b
|
|
|
- const win = window
|
|
|
+ const win = window;
|
|
|
win.originalPostMessage = win.originalPostMessage || window.postMessage
|
|
|
- const instance =
|
|
|
- win[instanceKey] ||
|
|
|
- ((_b = (_a = win.webkit) === null || _a === void 0 ? void 0 : _a.messageHandlers) === null || _b === void 0
|
|
|
- ? void 0
|
|
|
- : _b[instanceKey])
|
|
|
+ const instance = window.ORCHESTRA || (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.ORCHESTRA)
|
|
|
+ console.log("🚀 ~ instance", instance)
|
|
|
return function (data) {
|
|
|
+ console.log("🚀 ~ data", data)
|
|
|
if (instance) {
|
|
|
const uuid = getRandomKey()
|
|
|
data.content = data.content ? Object.assign(Object.assign({}, data.content), { uuid }) : { uuid }
|
|
|
+ console.log('index-send:', JSON.stringify(data))
|
|
|
instance.postMessage(JSON.stringify(data))
|
|
|
- console.log('send:', JSON.stringify(data))
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -167,30 +165,29 @@
|
|
|
return onlyPostmessage
|
|
|
})()
|
|
|
|
|
|
- window._setupMessage = _onlyPostmessage('COLEXIU')
|
|
|
+ window._setupMessage = _onlyPostmessage('ORCHESTRA')
|
|
|
if (location.origin.indexOf('192.168') > -1 && location.href.indexOf('&acc=1') === -1 && !document.hidden) {
|
|
|
- window._setupMessage({
|
|
|
- api: 'openAccompanyWebView',
|
|
|
- content: {
|
|
|
- // url: location.origin + '/accompany?id=' + item.id,
|
|
|
- url: location.origin + location.pathname + '?id=50970&acc=1',
|
|
|
- orientation: 0,
|
|
|
- isHideTitle: true,
|
|
|
- statusBarTextColor: false,
|
|
|
- isOpenLight: true,
|
|
|
- },
|
|
|
- })
|
|
|
+ // window._setupMessage({
|
|
|
+ // api: 'openAccompanyWebView',
|
|
|
+ // content: {
|
|
|
+ // url: location.origin + location.pathname + '?id=50970&acc=1',
|
|
|
+ // orientation: 0,
|
|
|
+ // isHideTitle: true,
|
|
|
+ // statusBarTextColor: false,
|
|
|
+ // isOpenLight: true,
|
|
|
+ // },
|
|
|
+ // })
|
|
|
}
|
|
|
|
|
|
;(function () {
|
|
|
window.isLoading = true
|
|
|
- window._setupMessage({
|
|
|
- api: 'cloudLoading',
|
|
|
- content: {
|
|
|
- show: true,
|
|
|
- type: 'fullscreen',
|
|
|
- },
|
|
|
- })
|
|
|
+ // window._setupMessage({
|
|
|
+ // api: 'cloudLoading',
|
|
|
+ // content: {
|
|
|
+ // show: true,
|
|
|
+ // type: 'fullscreen',
|
|
|
+ // },
|
|
|
+ // })
|
|
|
try {
|
|
|
setTimeout(() => {
|
|
|
var tips = document.querySelector('#loading div')
|