您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

wv0.native.js 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. import { WebView } from 'react-native-webview';
  2. import React, { PureComponent,Component } from 'react';
  3. // Button as R_Button
  4. import { Button, useTheme } from 'react-native-paper';
  5. import {
  6. Animated,
  7. Keyboard,
  8. SafeAreaView,
  9. TextInput,
  10. TouchableHighlight,
  11. TouchableOpacity,
  12. View,
  13. // Text,
  14. } from 'react-native';
  15. import * as rn from 'react-native';
  16. var Text2 = rn.Text
  17. import {AbstractButton} from '../react/features/base/toolbox/components';
  18. import { Header, LoadingIndicator, Text } from '../react/features/base/react';
  19. function onMsg(event ){
  20. clog("OBMSG>>>>")
  21. var onMsg = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("onMsg",{that:this,event},{}) : {}
  22. }
  23. type Props = {}
  24. // class Wview_ui extends AbstractButton<Props> {
  25. class Wview_ui extends PureComponent<Props> {
  26. // class Wview_ui extends AbstractButton<Props, any> {
  27. // icon = "IconMessage";
  28. constructor(props) {
  29. super(props);
  30. this.v1="a"
  31. clog("Wview_v1 init")
  32. }
  33. render() {
  34. // return
  35. }
  36. }
  37. class Wview_v1 extends PureComponent<Props> {
  38. constructor(props) {
  39. super(props);
  40. this.v1="a"
  41. clog("Wview_v1 init")
  42. }
  43. componentDidMount() {
  44. setInterval(() => {
  45. this.setState(() => {
  46. // console.log('setting state');
  47. var wv0_dev = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("wv0_dev",{that:this},{}) : {}
  48. // return { unseen: "does not display" }
  49. return { unseen: wv0_dev.ret }
  50. });
  51. }, 1000);
  52. }
  53. render() {
  54. var wb_url
  55. clog("Wview_v1 render")
  56. // console.log("wview_v1 render.")
  57. if (glob_vhook?.fns?.gen_xcal_room3) {
  58. wb_url = glob_vhook.fns.gen_xcal_room3().room_url
  59. } else {
  60. // wb_url = "https://excalidraw.videocorners.com/#room=4zmaf7d5jtcx4pqgruba,4zmaf7BMXbI6tCEiW7rbgy"
  61. wb_url = "https://excalidraw.videocorners.com/#room=4zxcald5jtcx4pqgruba,4zxcalBMXbI6tCEiW7rbgy"
  62. }
  63. var webview_style = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("webview_style",{that:this},{}) : {}
  64. var wv0_styles = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("wv0_styles",{that:this},{}) : {}
  65. // <View
  66. // style = {wv0_styles.v1 || {}}
  67. // >
  68. var wv0_styles_dev = this.wv0_styles_dev || {}
  69. // window.postMessage("Your message");
  70. console.log(">>>>>>>..?")
  71. var injectedJs = `(function(){
  72. console.log(">>>>>>>..")
  73. this.webView.postMessage("ZZ")
  74. return "Send me back!"}());
  75. `;
  76. injectedJs =`
  77. setTimeout(function () {
  78. window.ReactNativeWebView.postMessage("Hello!")
  79. console.log("QWETUI\n")
  80. window.top.postMessage('hello2', '*')
  81. }, 2000)
  82. `
  83. // <View style = { wv0_styles.v1 || {} }>
  84. // style = {webview_style}
  85. // <WebView source = {{uri:"https://excalidraw.videocorners.com/#room=4zxcald5jtcx4pqgruba,4zxcalBMXbI6tCEiW7rbgy"}}
  86. // <WebView source = {{uri:"https://excalidraw.videocorners.com/#room=4zxcald5jtcx4pqgruba,4zxcalBMXbI6tCEiW7rbgy"}}
  87. // <Wview_ui style = { wv0_styles_dev.vb1 || {}} />
  88. return (
  89. <View style = { wv0_styles_dev.v1 || {} }>
  90. <Button style = { wv0_styles_dev.vb1 || {}} >
  91. {t('polls.create.create')}
  92. </Button>
  93. <Text style = { wv0_styles_dev.txt || {} }
  94. >
  95. Z??
  96. </Text>
  97. <WebView source = {{uri:wb_url}}
  98. style = {wv0_styles_dev.webview_style || {}}
  99. injectedJavaScript={injectedJs}
  100. startInLoadingState
  101. javaScriptEnabledAndroid={true}
  102. javaScriptEnabled={true}
  103. onMessage={onMsg}
  104. ></WebView>
  105. <Text2 style = { wv0_styles_dev.txt2 || {} }
  106. >
  107. Z2
  108. </Text2>
  109. </View>
  110. )
  111. }
  112. }
  113. export {Wview_v1}