Showing
5 changed files
with
7 additions
and
7 deletions
| @@ -7,7 +7,7 @@ export class CallBackMessage { | @@ -7,7 +7,7 @@ export class CallBackMessage { | ||
| 7 | callbackId: string = ""; //callbackId | 7 | callbackId: string = ""; //callbackId |
| 8 | responseId: string = ""; //responseId | 8 | responseId: string = ""; //responseId |
| 9 | responseData: string = ""; //responseData | 9 | responseData: string = ""; //responseData |
| 10 | - data?: object; //data of message | 10 | + data?: string; //data of message |
| 11 | handlerName: string = ""; //name of handler | 11 | handlerName: string = ""; //name of handler |
| 12 | 12 | ||
| 13 | /** | 13 | /** |
| @@ -128,11 +128,11 @@ export class BridgeWebViewControl extends webview.WebviewController { | @@ -128,11 +128,11 @@ export class BridgeWebViewControl extends webview.WebviewController { | ||
| 128 | * native 主动调用JSBridge方法 | 128 | * native 主动调用JSBridge方法 |
| 129 | * @param msg | 129 | * @param msg |
| 130 | */ | 130 | */ |
| 131 | - callHandle(handlerName: string, data: object, callBack: Callback) { | 131 | + callHandle(handlerName: string, data: string, callBack: Callback) { |
| 132 | this.doSend(handlerName, data, callBack) | 132 | this.doSend(handlerName, data, callBack) |
| 133 | } | 133 | } |
| 134 | 134 | ||
| 135 | - private doSend(handlerName: string, data: object, callBack: Callback) { | 135 | + private doSend(handlerName: string, data: string, callBack: Callback) { |
| 136 | let msg: CallBackMessage = new CallBackMessage() | 136 | let msg: CallBackMessage = new CallBackMessage() |
| 137 | if (StringUtils.isNotEmpty(data)) { | 137 | if (StringUtils.isNotEmpty(data)) { |
| 138 | msg.data = data | 138 | msg.data = data |
| @@ -94,7 +94,7 @@ export struct ImageAndTextPageComponent { | @@ -94,7 +94,7 @@ export struct ImageAndTextPageComponent { | ||
| 94 | .height(24) | 94 | .height(24) |
| 95 | .margin({ right: 5 }) | 95 | .margin({ right: 5 }) |
| 96 | } | 96 | } |
| 97 | - if (this.interactData?.likeNum !== '0') { | 97 | + if (this.interactData?.likeNum != '0') { |
| 98 | Text(`${this.interactData?.likeNum}`) | 98 | Text(`${this.interactData?.likeNum}`) |
| 99 | .fontSize(16) | 99 | .fontSize(16) |
| 100 | .fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999') | 100 | .fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999') |
| @@ -117,9 +117,9 @@ export struct ImageAndTextWebComponent { | @@ -117,9 +117,9 @@ export struct ImageAndTextWebComponent { | ||
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | private sendContentData2H5(h5ReceiveAppData: H5ReceiveDetailBean) { | 119 | private sendContentData2H5(h5ReceiveAppData: H5ReceiveDetailBean) { |
| 120 | - Logger.debug('ImageAndTextWebComponent', 'jsCall_receiveAppData'); | 120 | + Logger.debug('ImageAndTextWebComponent', 'jsCall_receiveAppData',JSON.stringify(h5ReceiveAppData)); |
| 121 | this.webviewControl.callHandle(NativeCallH5Type.jsCall_receiveAppData, | 121 | this.webviewControl.callHandle(NativeCallH5Type.jsCall_receiveAppData, |
| 122 | - h5ReceiveAppData, (data: string) => { | 122 | + JSON.stringify(h5ReceiveAppData), (data: string) => { |
| 123 | Logger.debug('ImageAndTextWebComponent', "from js data = " + data); | 123 | Logger.debug('ImageAndTextWebComponent', "from js data = " + data); |
| 124 | }) | 124 | }) |
| 125 | } | 125 | } |
| @@ -39,7 +39,7 @@ export struct SpacialTopicPageComponent { | @@ -39,7 +39,7 @@ export struct SpacialTopicPageComponent { | ||
| 39 | 39 | ||
| 40 | private sendContentData2H5(h5ReceiveAppData: H5ReceiveDetailBean) { | 40 | private sendContentData2H5(h5ReceiveAppData: H5ReceiveDetailBean) { |
| 41 | this.webviewControl.callHandle(NativeCallH5Type.jsCall_receiveAppData, | 41 | this.webviewControl.callHandle(NativeCallH5Type.jsCall_receiveAppData, |
| 42 | - h5ReceiveAppData, (data: string) => { | 42 | + JSON.stringify(h5ReceiveAppData), (data: string) => { |
| 43 | }) | 43 | }) |
| 44 | } | 44 | } |
| 45 | 45 |
-
Please register or login to post a comment