B2BÍøÂçÈí¼þ

 ÕÒ»ØÃÜÂë
 Á¢¼´×¢²á ÉóºËÍøÕ¾ºÅ:QQ:896757558
ËÑË÷
²é¿´: 12|»Ø¸´: 0
´òÓ¡ ÉÏÒ»Ö÷Ìâ ÏÂÒ»Ö÷Ìâ

Ô­ÉúwebviewµÄh5ÈçºÎ¸úaiwork½»»¥

[¸´ÖÆÁ´½Ó]

802

Ö÷Ìâ

807

Ìû×Ó

6484

»ý·Ö

abc

Rank: 9Rank: 9Rank: 9

»ý·Ö
6484
Ìøתµ½Ö¸¶¨Â¥²ã
Â¥Ö÷
Ô­ÉúwebviewµÄh5ÈçºÎ¸úaiwork½»»¥
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>ºÏ²¢Ò³Ãæ</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
background-color: #fff; /* ¸ÄΪ°×É« */
color: #333; /* µ÷ÕûÎÄ×ÖÑÕÉ«ÒÔÆ¥Åä°×É«±³¾° */
font-family: Arial, sans-serif;
padding: 20px;
}

.navbar {
background-color: #f0f0f0; /* ¸ÄΪdzɫÒÔÓë°×É«±³¾°Çø·Ö */
padding: 10px;
display: flex;
justify-content: space-around;
color: #000;
}

.navbar a {
text-decoration: none;
color: inherit;
font-weight: bold;
}

.section, .submenu {
background-color: #fff; /* ¸ÄΪ°×É« */
color: #333; /* µ÷ÕûÎÄ×ÖÑÕÉ« */
padding: 20px;
margin-bottom: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.section input[type="checkbox"],
.submenu input[type="checkbox"],
input[type="radio"],
input[type="text"],
select,
button {
color: #333; /* µ÷ÕûÎÄ×ÖÑÕÉ« */
background-color: #ddd; /* ¸ÄΪdzɫ */
border: none;
border-radius: 5px;
padding: 10px;
margin-right: 10px;
box-sizing: border-box;
}

button {
background-color: #4CAF50;
width: 60%;
font-size: 20px;
cursor: pointer;
margin-top: 20px;
color: #fff; /* °´Å¥ÎÄ×ÖÑÕÉ« */
}

h1 {
color: #e91e63;
}
</style>
</head>

<body>
<div class="navbar">
<a href="#">Ê×Ò³</a>
<a href="#">»°Êõ</a>
<a href="#">Ñ¡Ôñƽ̨</a>
<a href="#">ÅäÖÃ</a>
<a href="#">ÆäËû</a>
</div>

<h1>ºÏ²¢Ò³Ãæ</h1>

<div class="section">
<h2>³¬¼¶ÑÓ³Ù</h2>
<input type="checkbox" id="charDelay" name="charDelay">
<label for="charDelay">°´´ò×ÖÊýÁ¿ÑÓ³Ù</label>
<!-- Ê¡ÂÔÆäËûÑ¡Ïî... -->
</div>

<div class="submenu">
<h2>ÕкôÉèÖÃ</h2>
<input type="checkbox" id="fixed-greeting" name="fixed-greeting">
<label for="fixed-greeting">¶¤¶¨ÕкôÓï---¹´Ñ¡ÉúЧ</label>
<input type="text" placeholder="ÇëÊäÈëÕкô1">
<input type="text" placeholder="ÇëÊäÈëÕкô2">
<input type="text" placeholder="ÇëÊäÈëÕкô3">
</div>

<!-- Ê¡ÂÔÆäËû²¿·Ö... -->

<form>
<div class="section">
<h2>¶¨Ê±</h2>
<input type="checkbox" id="enableTiming" name="enableTiming">
<label for="enableTiming">¿ªÆô¶¨Ê±</label><br>
<!-- Ê¡ÂÔÆäËûÑ¡Ïî... -->
</div>

<button type="button" onClick="callHelloAI();">µ÷ÓÃÔ­Éú·½·¨</button>
<button type="button" onClick="runJS();">Ö´Ðнű¾´úÂë</button>
<button type="button" onClick="runJsFile();">Ö´Ðнű¾Îļþ</button>
<button type="button" onClick="sendText();">´«µÝ¿Ø¼þÖµ</button>
</form>

<script language="JavaScript">
function callHelloAI() {
window.at.callFun('main', 'hello');
}

function runJS() {
window.at.runJs(function () {
printl("ÄãºÃ");
auto.recents();
}.toString());
}

function runJsFile() {
window.at.runJsFile('Ö÷½Å±¾.js');
}

function sendText() {
var inputValue = document.getElementById('input1').value;
window.at.runJsFile('²âÊÔ´«Öµ.js');
}
</script>

</body>

</html>




Ô­ÉúwebviewµÄh5ÈçºÎ¸úaiwork½»»¥ B2BÍøÂçÈí¼þ

Ô­ÉúwebviewµÄh5ÈçºÎ¸úaiwork½»»¥ B2BÍøÂçÈí¼þ




Ô­ÉúactivityºÍh5½»»¥°¸Àý.zip



void runJs(function code)h5Ö´ÐÐapp JS½Å±¾

window.at.runJs(function (){
     //ÕâÀïдATjs´úÂë
     printl("ÄãºÃ");
     auto.home();
}.toString());

void runJsFile(String file) H5ÔËÐÐAPP JSÎļþ

window.at.runJsFile('Ö÷½Å±¾.js');

void callFunction£¨String funname,String arg) H5Ö´Ðнű¾·½·¨

window.at.callFun('main',"hello");

String getRootPath() »ñÈ¡ÏîÄ¿¸ùĿ¼

window.at.getRootPath();

String getResourcesPath() »ñÈ¡ÏîÄ¿×ÊԴĿ¼

window.at.getResourcesPath();

void setConfig(String path,String arg,String value) ´æ´¢Êý¾Ý
path:´æ´¢Â·¾¶,ÀýÈç/sdcard/1.txt;
arg:²ÎÊý
value:´æ´¢Öµ

window.at.setConfig('/sdcard/1.txt','a','1');
//ÀýÈç´æ´¢µ½×ÊԴĿ¼
let res=window.at.getResourcesPath();
window.at.setConfig(res+'1.txt','a','1');

String getConfig(String path,String arg,String value) ¶ÁÈ¡Êý¾Ý
path:´æ´¢Â·¾¶,ÀýÈç/sdcard/1.txt;
arg:²ÎÊý
value:ĬÈÏÖµ,ûÓÐÊý¾ÝµÄÇé¿öÏÂĬÈÏ·µ»Ø

window.at.getConfig('/sdcard/1.txt','a','1');

//´Ó×ÊԴĿ¼ȡÊý¾Ý
let res=window.at.getResourcesPath();
window.at.getConfig(res+'1.txt','a','1');

publicSet(String key,String value) ¹«¹²±äÁ¿´«²Î

window.at.publicSet('a','1');

//¶ÔÓ¦aiworkÈ¡Öµ¾ÍÊÇ
publicData.get('a')

publicGet(String key) ¹«¹²±äÁ¿¶Á²Î

window.at.publicGet('a');


//¶ÔÓ¦aiworkдֵ¾ÍÊÇ
publicData.set('a','1')

ÍêÕûHTML°¸Àý

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>·½Ê½Ò»</title>
    <script language="JavaScript">
        function test() {

           window.at.runJs(function (){
                //ÕâÀïдjs´úÂë
                printl("ÄãºÃ");
           }.toString());

           /*
           window.at.close();
           window.at.runJsFile('Ö÷½Å±¾.js');
          */
        }
    </script>
</head>
<body>
<input type="Button" width="300" value="Æô¶¯½Å±¾"  onClick="test()"  />
</body>
</html>

APPµ÷ÓÃH5:

Ê×ÏÈ»ñÈ¡web¿Ø¼þ,ÀýÈçweb¿Ø¼þµÄ×Ô¶¨ÒåIDÊÇweb

//³õʼ»¯Ò»¸öactivityÒ³Ãæ
var ac = new activity();
ac.loadXML(`
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    androidrientation="vertical"
 >

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="H5ÑÝʾ"
        android:textSize="18sp"
        android:textStyle="bold"
        android:gravity="center"
        android:paddingBottom="8dp" />

    <WebView
        android:id="@+id/web"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1" />

</LinearLayout>
`)

sleep.millisecond(ºÁÃë = 400);

var web1 = ac.findWebViewById('web');

¼ÓÔØÍøÖ·loadUrl(url)

¸´ÖÆweb1.url('/´úÂë/h5.html');

Ö´ÐÐh5µÄjs·½·¨£¬×¢Òâ´úÂëÊÂ×Ö·û´®http://bbs.aiwork24.com/thread-124-1-1.html
String runWebJs(String jscode)
·µ»ØÖµ:ÀàËÆjsÖÐevalÖ´ÐÐjs´úÂëµÄ·µ»ØÖµ£¬Ò»°ãÊÇ·µ»Ø×îºóÒ»¸ö±äÁ¿µÄÖµhttp://www.postbbs.com/thread-2894-1-1.html

//ÈÃä¯ÀÀÆ÷ÔËÐÐjs´úÂë
web1.runWebJs(`alert("123")`);

»Ø¸´

ʹÓõÀ¾ß ¾Ù±¨

±¾°æ»ý·Ö¹æÔò

¹Ø±Õ

QQ|»ÓªÏúÈí¼þ×ÛºÏÌÖÂÛ|»ÓªÏúÈí¼þÓÐÎʱشð|»ÓªÏúÈí¼þ½Ì³ÌרÇø|»ÓªÏúÈí¼þPOST½Å±¾·ÖÏí|»ÓªÏúÈí¼þÆÕͨ½Å±¾·ÖÏí|»ÓªÏúÈí¼þÈí¼þ×ÊѶ|»ÓªÏúÈí¼þ¾«Æ·Èí¼þ|»ÓªÏúÈí¼þ¸üй«¸æ|ÓªÏúÈí¼þ|B2BÈí¼þ|B2BÍøÂçÈí¼þ ( ¾©ICP±¸09078825ºÅ )±¾ÍøÕ¾¿ª·¢µÄÓªÏúÈí¼þÊÇÒ»¿îеÄÍøÂçÓªÏúÈí¼þ£¬Õâ¿îÓªÏú¿ÉÒÔÈ¥ÍøÕ¾Èí¼þ£¬²©¿ÍÈí¼þ£¬B2BÈí¼þ£¬·ÖÀàÐÅÏ¢Íø·¢Ìù£¬¿ÉÒÔÇÀɳ·¢£¬¿ÉÒÔµ½°Ù¶ÈÎÄ¿âÉÏ´«WORDÎĵµ£¬¿ÉÒÔµ½Ò»Ð©ÊÇÏà²áÍøÕ¾×Ô¶¯ÉÏ´«Í¼Æ¬£¬Õâ¸ö×Ô¶¯·¢ÌûÈí¼þ×Ô´øÔÆÖ©Ö룬¼Ó¿ìÊÕ¼£¬ÓÐ6ÖÖ¶Ô½Ó´òÂë½Ó¿Ú£¬·½±ã£¬Ð§Âʸߣ¬Ëٶȿ죬¶øÇÒ¶ÔÍ϶¯µÄÑéÖ¤ÂëÈ«ÍøµÚÒ»¼Ò¶À¼ÒÖ§³Ö£¬È«²¿Ô­´´¼¼Êõ£¬¶À¼ÒÑз¢£¬Õý°æÔ­´´´ø°æȨÈí¼þ¡£Ñ¡ÔñÍòÄÜÓªÏúÈí¼þ£¬¾ÍÑ¡ÔñÁËÒ»ÖÖ׬ǮµÄЧÂÊ£¬´ÓûÓб»³¬Ô½¹ý£¬Ò»Ö±ÔÚŬÁ¦Ñз¢Ð¼¼Êõ¡£·Å·ÉÃÎÏ룬½â·ÅË«ÊÖ£¬À´µã´´Ò⣬³É¾ÍÄãµÄÃÎÏ룬¾ÍÔÚÍòÄÜÓªÏúÈí¼þ¿ªÊ¼

map2

GMT+8, 2025-2-21 05:08 , Processed in 0.128418 second(s), 35 queries .

¿ìËٻظ´ ·µ»Ø¶¥²¿ ·µ»ØÁбí