sheshuangning 1 день тому
коміт
a300754daa
8 змінених файлів з 445 додано та 0 видалено
  1. BIN
      24_bev3_0911_01.apk
  2. BIN
      24_hk_1214_01.apk
  3. BIN
      24_hk_1216_01.apk
  4. BIN
      24_jz_1204_01.apk
  5. 43 0
      demo.html
  6. 4 0
      demotest.svg
  7. 132 0
      photo1.html
  8. 266 0
      ppishow.html

BIN
24_bev3_0911_01.apk


BIN
24_hk_1214_01.apk


BIN
24_hk_1216_01.apk


BIN
24_jz_1204_01.apk


+ 43 - 0
demo.html

@@ -0,0 +1,43 @@
+<!doctype html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
+    <meta name="apple-mobile-web-app-capable" content="yes" />
+    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
+    <meta name="format-detection" content="telephone=no" />
+    <title>用户使用协议</title>
+    <style>
+        p {
+            line-height: 25px;
+        }
+
+        table td {
+            line-height: 1.8em;
+            padding-left: 0.5em;
+        }
+
+        h2 {
+            font-weight: normal;
+        }
+
+        table {
+            font-size: 12px;
+        }
+
+        .textt {
+            font-weight: bold;
+        }
+    </style>
+</head>
+
+<body>
+    <!-- <a href="agoo://cn.co.toyota_ms.smartGLINK/thirdpush?uuid=asdaiuhiasdaaaaaaaaa&AuthorizationLinksList=Q3oX0/2OvhK9kSRpzsyvXBwyEyt4/ACsuNtcVivbdgMRrGbTJ2Y%2BCp%2BT0%2B%2Bg%2Bu/miaffqKZfR25jLJQzDxMKzqS%2BvmOGCORMIEjMIJNIn4pGSzItkOF9vEyaT8UkHctsdRO93LBWetkD8mrFdimRfq8pKI0NQVa6IgAp/kiKRpBlp663ufkhv5MvHB2KRZrNgmCwMJ7kiU2Q34gTgvN7yPIT1aKQBWSSaId0ufhl4muIYaMv85NJwXIxsdrf4RBRvCNh4HPCS8KakY8U60viAg==">点击按钮</a> -->
+    <!-- <a href="openelc://acceptAuthorizationH5?uuid=asdaiuhiasdaaaaaaaaa&AuthorizationLinksList=Q3oX0/2OvhK9kSRpzsyvXBwyEyt4/ACsuNtcVivbdgMRrGbTJ2Y%2BCp%2BT0%2B%2Bg%2Bu/miaffqKZfR25jLJQzDxMKzqS%2BvmOGCORMIEjMIJNIn4pGSzItkOF9vEyaT8UkHctsdRO93LBWetkD8mrFdimRfq8pKI0NQVa6IgAp/kiKRpBlp663ufkhv5MvHB2KRZrNgmCwMJ7kiU2Q34gTgvN7yPIT1aKQBWSSaId0ufhl4muIYaMv85NJwXIxsdrf4RBRvCNh4HPCS8KakY8U60viAg==">点击按钮</a> -->
+    <a href="openelc://24aiche">点击按钮</a>
+</body>
+
+</html>

+ 4 - 0
demotest.svg

@@ -0,0 +1,4 @@
+<svg xmlns="https://www.w3.org/2000/svg" width="401" height="121" >
+<rect  height="121" width="401" stroke="#f5f5f5" fill="#f5f5f5"/>
+<rect  height="61" width="401" stroke="#000000" fill="#000000"/>
+<ellipse stroke="#000000" ry="46" rx="210" cy="61" cx="201" fill="#000000"/></svg>

+ 132 - 0
photo1.html

@@ -0,0 +1,132 @@
+
+<!DOCTYPE html>
+<html lang="zh-CN">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Android相机调用演示</title>
+    <style>
+        html {
+            background-color: #00f5f500;
+        }
+        head{
+            background-color: #00f5f500;
+        }
+        body {
+            font-family: 'Arial', sans-serif;
+            display: flex;
+            flex-direction: column;
+            align-items: center;
+            padding: 20px;
+            border-radius: 10px;
+            background-color: #00f5f500;
+        }
+        .container {
+            max-width: 500px;
+            width: 100%;
+            background: white;
+            padding: 20px;
+            border-radius: 10px;
+            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
+        }
+        .btn {
+            background: #4285f4;
+            color: white;
+            border: none;
+            padding: 12px 20px;
+            border-radius: 5px;
+            font-size: 16px;
+            cursor: pointer;
+            width: 100%;
+            margin: 10px 0;
+            transition: background 0.3s;
+        }
+        .btn:hover {
+            background: #3367d6;
+        }
+        .preview {
+            width: 100%;
+            max-height: 400px;
+            object-fit: contain;
+            margin: 20px 0;
+            border: 1px dashed #ccc;
+            display: none;
+        }
+        .status {
+            margin: 10px 0;
+            padding: 10px;
+            border-radius: 5px;
+            text-align: center;
+        }
+        .error {
+            background: #ffebee;
+            color: #c62828;
+        }
+        .success {
+            background: #e8f5e9;
+            color: #2e7d32;
+        }
+    </style>
+</head>
+<body>
+    <div class="container">
+        <h1>相机调用演示</h1>
+        <p>点击下方按钮调用Android相机拍照</p>
+        
+        <button class="btn" id="openCameraBtn">打开相机</button>
+        
+        <div id="statusMsg" class="status" style="display: none;"></div>
+        
+        <img id="preview" class="preview" alt="拍摄预览">
+        
+        <input type="file" id="cameraInput" accept="image/*" capture="camera" style="display: none;">
+    </div>
+
+    <script>
+        document.addEventListener('DOMContentLoaded', function() {
+            const openCameraBtn = document.getElementById('openCameraBtn');
+            const cameraInput = document.getElementById('cameraInput');
+            const preview = document.getElementById('preview');
+            const statusMsg = document.getElementById('statusMsg');
+            
+            openCameraBtn.addEventListener('click', function() {
+                cameraInput.click();
+            });
+            
+            cameraInput.addEventListener('change', function(e) {
+                if (e.target.files && e.target.files[0]) {
+                    const file = e.target.files[0];
+                    
+                    if (!file.type.match('image.*')) {
+                        showStatus('请选择图片文件', 'error');
+                        return;
+                    }
+                    
+                    const reader = new FileReader();
+                    
+                    reader.onload = function(event) {
+                        preview.src = event.target.result;
+                        preview.style.display = 'block';
+                        showStatus('图片加载成功', 'success');
+                    };
+                    
+                    reader.onerror = function() {
+                        showStatus('图片读取失败', 'error');
+                    };
+                    reader.readAsDataURL(file);
+                }
+            });
+            function showStatus(message, type) {
+                statusMsg.textContent = message;
+                statusMsg.className = 'status ' + type;
+                statusMsg.style.display = 'block';
+                
+                setTimeout(function() {
+                    statusMsg.style.display = 'none';
+                }, 3000);
+            }
+        });
+    </script>
+</body>
+</html>
+ 

+ 266 - 0
ppishow.html

@@ -0,0 +1,266 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>原生方法调用示例</title>
+    <script src="https://cdn.tailwindcss.com"></script>
+    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
+    <style>
+        html {
+            background-color: #00f5f500;
+        }
+
+        head {
+            background-color: #00f5f500;
+        }
+
+        .btn {
+            background: #4285f4;
+            color: white;
+            border: none;
+            padding: 12px 20px;
+            border-radius: 5px;
+            font-size: 16px;
+            cursor: pointer;
+            width: 100%;
+            margin: 10px 0;
+            transition: background 0.3s;
+        }
+
+
+        .device-badge {
+            animation: pulse 2s infinite;
+        }
+
+        @keyframes pulse {
+            0% {
+                opacity: 1;
+            }
+
+            50% {
+                opacity: 0.7;
+            }
+
+            100% {
+                opacity: 1;
+            }
+        }
+
+        .fade-in {
+            animation: fadeIn 0.5s ease-in;
+        }
+
+        @keyframes fadeIn {
+            from {
+                opacity: 0;
+                transform: translateY(10px);
+            }
+
+            to {
+                opacity: 1;
+                transform: translateY(0);
+            }
+        }
+    </style>
+</head>
+
+<body>
+
+    <div class="bg-white rounded-2xl shadow-xl p-8">
+        <!-- 按钮组 -->
+        <div class="space-y-4">
+            <!-- 关闭WebView按钮 -->
+            <button id="closeBtn" class="btn">
+                <i class="fas fa-times-circle"></i>
+                关闭WebView
+            </button>
+
+            <!-- 跳转Termination Activity按钮 -->
+            <button id="terminationBtn" class="btn">
+                <i class="fas fa-external-link-alt"></i>
+                跳转服务解约页面
+            </button>
+        </div>
+
+        <!-- 功能说明 -->
+        <div class="mt-6 p-4 bg-gray-50 rounded-lg">
+            <h3 class="font-semibold text-gray-700 mb-2">功能说明</h3>
+            <ul class="text-sm text-gray-600 space-y-1">
+                <li>• 自动检测Android/iOS/HM设备</li>
+                <li>• 调用相应的原生关闭方法</li>
+                <li>• 调用跳转终止页面方法</li>
+                <li>• 实时状态反馈</li>
+            </ul>
+        </div>
+    </div>
+    <script>
+        class DeviceDetector {
+            constructor() {
+                this.deviceType = this.detectDevice();
+                this.displayDeviceInfo();
+            }
+
+            detectDevice() {
+                const u = navigator.userAgent;
+                const isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1;
+                const isIOS = /\(i[^;]+;( U;)? CPU.+Mac OS X/.test(u);
+                const match = u.match(/OpenHarmony (\d+\.?\d*)/)
+                const isHM = (match?.length && Number(match[1]) >= 5)
+                if (isAndroid) return 'android';
+                if (isIOS) return 'ios';
+                if (isHM) return 'HM';
+                return 'unknown';
+            }
+
+            displayDeviceInfo() {
+                const deviceInfoEl = document.getElementById('deviceInfo');
+                let badgeClass = '';
+                let deviceText = '';
+
+                switch (this.deviceType) {
+                    case 'android':
+                        badgeClass = 'bg-green-100 text-green-800';
+                        deviceText = 'Android 设备';
+                        break;
+                    case 'ios':
+                        badgeClass = 'bg-blue-100 text-blue-800';
+                        deviceText = 'iOS 设备';
+                        break;
+                    case 'HM':
+                        badgeClass = 'bg-blue-100 text-blue-800';
+                        deviceText = 'HM 设备';
+                        break;
+                    default:
+                        badgeClass = 'bg-gray-100 text-gray-800';
+                        deviceText = '未知设备';
+                }
+                console.log(deviceText)
+            }
+
+            callNativeCloseMethod() {
+                let success = false;
+                let message = '';
+
+                try {
+                    switch (this.deviceType) {
+                        case 'android':
+                            if (typeof window.android !== 'undefined' &&
+                                typeof window.android.jsCLoseWebView === 'function') {
+                                window.android.jsCLoseWebView();
+                                success = true;
+                                message = '成功调用 Android 原生关闭方法';
+                            } else {
+                                message = 'Android 原生方法不可用';
+                            }
+                            break;
+                        case 'ios':
+                            if (window.webkit &&
+                                window.webkit.messageHandlers &&
+                                window.webkit.messageHandlers.jsCLoseWebView) {
+                                window.webkit.messageHandlers.jsCLoseWebView.postMessage({});
+                                success = true;
+                                message = '成功调用 iOS 原生关闭方法';
+                            } else {
+                                message = 'iOS 原生方法不可用';
+                            }
+                            break;
+                        case 'HM':
+                            // if (typeof window.OpenHarmony !== 'undefined' &&
+                            //     window.OpenHarmony.jsCLoseWebView) {
+                                window.OpenHarmony.jsCLoseWebView();
+                                success = true;
+                                message = '成功调用 HM 原生关闭方法';
+                            // } else {
+                            //     message = 'HM 原生方法不可用';
+                            // }
+                            break;
+                        default:
+                            message = '未知设备类型,无法调用原生方法';
+                    }
+                } catch (error) {
+                    message = `调用原生方法时出错: ${error.message}`;
+                }
+
+                console.log(message)
+
+                return success;
+            }
+
+            callTerminationActivity() {
+                let success = false;
+                let message = '';
+
+                try {
+                    switch (this.deviceType) {
+                        case 'android':
+                            if (typeof window.android !== 'undefined' &&
+                                typeof window.android.jsToTerminationActivity === 'function') {
+                                window.android.jsToTerminationActivity();
+                                success = true;
+                                message = '成功调用 Android 跳转终止页面方法';
+                            } else {
+                                message = 'Android 跳转终止页面方法不可用';
+                            }
+                            break;
+                        case 'ios':
+                            if (window.webkit &&
+                                window.webkit.messageHandlers &&
+                                window.webkit.messageHandlers.jsToTerminationActivity) {
+                                window.webkit.messageHandlers.jsToTerminationActivity.postMessage({});
+                                success = true;
+                                message = '成功调用 iOS 跳转终止页面方法';
+                            } else {
+                                message = 'iOS 跳转终止页面方法不可用';
+                            }
+                            break;
+                        case 'HM':
+                            // if (typeof window.OpenHarmony !== 'undefined' && window.OpenHarmony.jsCLoseWebView) {
+                                window.OpenHarmony.jsToTerminationActivity();
+                                success = true;
+                                message = '成功调用 HM 跳转终止页面方法';
+                            // } else {
+                            //     message = 'HM 跳转终止页面方法不可用';
+                            // }
+                            break;
+                        default:
+                            message = '未知设备类型,无法调用跳转方法';
+                    }
+                } catch (error) {
+                    message = `调用跳转方法时出错: ${error.message}`;
+                }
+                console.log(message)
+
+                return success;
+            }
+        }
+
+        // 页面加载完成后初始化
+        document.addEventListener('DOMContentLoaded', function () {
+            const detector = new DeviceDetector();
+            const closeBtn = document.getElementById('closeBtn');
+            const terminationBtn = document.getElementById('terminationBtn');
+
+            closeBtn.addEventListener('click', function () {
+                detector.callNativeCloseMethod();
+            });
+
+            terminationBtn.addEventListener('click', function () {
+                detector.callTerminationActivity();
+            });
+
+            // 添加键盘快捷键支持
+            document.addEventListener('keydown', function (e) {
+                if (e.key === 'Escape') {
+                    detector.callNativeCloseMethod();
+                } else if (e.key === 't' || e.key === 'T') {
+                    detector.callTerminationActivity();
+                }
+            });
+        });
+    </script>
+</body>
+
+</html>
+<code_end>