# Webview Jacketing Frame **Repository Path**: FengXuanJi/webview-jacketing ## Basic Information - **Project Name**: Webview Jacketing Frame - **Description**: 🌈桌 面 应 用 开 发,适 应 于 php、 webview、js 套 壳 版 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 4 - **Created**: 2024-10-23 - **Last Updated**: 2025-05-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # webview-jacketing [下载](https://gitee.com/kllxs_admin/webview-jacketing/releases) > webview桌面应用套壳版 ## 执行文件 windows系统为:`windows.exe` linux系统为:`linux` ## 配置文件 `config.json` ```json { "windows":{ "icon":"./favicon.ico", // 图标 "title":"php-desktop", // 窗口标题 "width":600, // 窗口宽度 "height":400, // 窗口高度 "hint":"auto", // 窗口大小 auto:自动 min:固定最小 max:固定最大 fixed:固定大小 "debug":false // debug模式 }, "php":{ "file":"./php/windows/php.exe", // 执行文件 "address":"127.0.0.1", // url地址 "port":"*", // 端口号 *:随机端口 其他:固定端口号 "entrance":"./www/route.php", // 执行路由 // php -S 127.0.0.1:8080 route.php 开启php内置web "is_custom_instruction":false, // 是否开启自定义命令 true:就不按照开启php内置web来执行 "start_instruction":"", // 开启命令 "stop_instruction":"", // 结束命令 "auto_stop":true // 关闭窗口时是否自动关闭php,若为false则需要填写 结束命令 来关闭 } } ``` ### 纯JavaScript版 ```json { "windows":{ "icon":"./favicon.ico", // 图标 "title":"php-desktop", // 窗口标题 "width":600, // 窗口宽度 "height":400, // 窗口高度 "hint":"auto", // 窗口大小 auto:自动 min:固定最小 max:固定最大 fixed:固定大小 "debug":false // debug模式 }, "php":{ "file":"", // 为空就行 "address":"", // 为空就行:默认127.0.0.1 "port":"*", // 端口号 *:随机端口 其他:固定端口号 "entrance":"", //不用填 "is_custom_instruction":false, // 不用管 "start_instruction":"", // 不用管 "stop_instruction":"", // 不用管 "auto_stop":true // 必须为true } } ``` ### windows 配置 #### webman框架 ```json { "windows":{ "icon":"./favicon.ico", // 图标 "title":"php-desktop", // 窗口标题 "width":600, // 窗口宽度 "height":400, // 窗口高度 "hint":"auto", // 窗口大小 auto:自动 min:固定最小 max:固定最大 fixed:固定大小 "debug":false // debug模式 }, "php":{ "file":"./php/windows/php.exe", // 执行文件 "address":"127.0.0.1", // url地址 "port":"8787", // 必须-固定端口号 "entrance":"", //不用填 "is_custom_instruction":true, // 开启 "start_instruction":"./webman/start.php", // 开启命令 "stop_instruction":"", // win系统不用填 "auto_stop":true // 必须为true } } ``` #### 其他框架 ```json { "windows":{ "icon":"./favicon.ico", // 图标 "title":"php-desktop", // 窗口标题 "width":600, // 窗口宽度 "height":400, // 窗口高度 "hint":"auto", // 窗口大小 auto:自动 min:固定最小 max:固定最大 fixed:固定大小 "debug":false // debug模式 }, "php":{ "file":"./php/windows/php.exe", // 执行文件 "address":"127.0.0.1", // url地址 "port":"*", // 端口号 *:随机端口 其他:固定端口号 "entrance":"./www/route.php", // 执行路由文件,具体参考route.php文件内容 // php -S 127.0.0.1:8080 route.php 开启php内置web "is_custom_instruction":false, // 必须为false "start_instruction":"", // 不用填 "stop_instruction":"", // 不用填 "auto_stop":true // 必须为true } } ``` ### linux 配置 #### webman框架 ```json { "windows":{ "icon":"./favicon.ico", // 图标 "title":"php-desktop", // 窗口标题 "width":600, // 窗口宽度 "height":400, // 窗口高度 "hint":"auto", // 窗口大小 auto:自动 min:固定最小 max:固定最大 fixed:固定大小 "debug":false // debug模式 }, "php":{ "file":"./php/linux/php", // 执行文件 "address":"127.0.0.1", // url地址 "port":"8787", // 必须-固定端口号 "entrance":"", //不用填 "is_custom_instruction":true, // 开启 "start_instruction":"./webman/start.php start -d", // 开启命令 "stop_instruction":"./php/windows/php.exe ./webman/start.php stop", // 结束命令 "auto_stop":false // false } } ``` #### 其他框架 ```json { "windows":{ "icon":"./favicon.ico", // 图标 "title":"php-desktop", // 窗口标题 "width":600, // 窗口宽度 "height":400, // 窗口高度 "hint":"auto", // 窗口大小 auto:自动 min:固定最小 max:固定最大 fixed:固定大小 "debug":false // debug模式 }, "php":{ "file":"./php/linux/php", // 执行文件 "address":"127.0.0.1", // url地址 "port":"*", // 端口号 *:随机端口 其他:固定端口号 "entrance":"./www/route.php", // 执行路由文件,具体参考route.php文件内容 // php -S 127.0.0.1:8080 route.php 开启php内置web "is_custom_instruction":false, // 必须为false "start_instruction":"", // 不用填 "stop_instruction":"", // 不用填 "auto_stop":true // 必须为true } } ``` # 示例 ```html ``` # 接口 ```js /** * 弹出消息框 * @param {string} str 标题 * @param {num} num 类型 0~2 * @returns {bool} */ async function win_alert(str, num) /** * 弹出选择文件框 * @returns {string} 不选择为空字符串 */ async function win_file_dialog() /** * 弹出选择文件夹框 * @returns {string} 不选择为空字符串 */ async function win_open_dir() /** * 打开读取文件内容框 * @param {string} path 文件 如:D:/asd.txt * @returns {string} 失败为 false字符串 */ async function win_read_file_dialog(path) /** * 打开保存文件内容框 * @param {string} content 内容 * @param {string} path 路径 如何:D:/ * @param {string} filename 文件名称 asd.txt * @returns {bool} 成功为true 反之为false */ async function win_save_file_dialog(content, path, filename) /** * 判断是否为文件 * @param {string} path 文件 * @returns {bool} */ async function win_is_file(path) /** * 获取当前工作目录的绝对路径 * @param {string} path 拼接路径 * @returns {string} */ async function win_abs_path(path = "") /** * 返回可写用户特定文件夹的路径,该文件夹适用于写入非必要数据。 * @returns {string} */ async function win_cache_dir() /** * 返回当前目录的绝对路径。 * @returns {string} */ async function win_getwd() /** * 判断是否是文件夹 * @param {string} path 路径目录 * @returns {bool} */ async function win_is_dir(path) /** * 读取文件并返回所有字节。 * @param {string} path 文件路径 * @returns {string} "[13,12]" 自行转换 */ async function win_read_bytes(path) /** * 文件夹或文件重命名 使用 mv 以独立于平台的方式移动或重命名文件。 * @param {string} src 文件夹或文件路径 * @param {string} dst 新的 文件夹或文件夹路径 * @returns {bool} */ async function win_rename(src,dst) /** * 将文件夹重命名 * @param {string} src 文件夹 * @param {string} dst 新的文件夹 * @returns {bool} */ async function win_rename_dir(src,dst) /** * 删除文件 * @param {string} path 文件 * @returns {bool} */ async function win_rm(path) /** * 删除目录 * @param {string} path 文件夹 * @returns {bool} */ async function win_rmdir(path) /** * 递归删除目录 * @param {string} path 文件夹 * @returns {bool} */ async function win_rmdir_all(path) /** * 复制 * @param {string} src 文件或文件夹 * @param {string} dsr 新的 文件或文件夹 * @returns {bool} */ async function win_cp(src,dsr) /** * 递归复制 * @param {string} src 文件或文件夹 * @param {string} dsr 新的 文件或文件夹 * @param {bool} overwrite 是否覆盖 * @returns {bool} */ async function win_cp_all(src,dst,overwrite) ``` #效果 ![](效果.png) # 相关项目 webman框架: [图压](https://gitee.com/kllxs_admin/webman-tuya-desktop)