1 Star 0 Fork 0

高瑞山/pda-h5

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
说明.txt 5.84 KB
一键复制 编辑 原始数据 按行查看 历史
高瑞山 提交于 2024-09-13 15:13 . 兼容鸿蒙
1,文件位置;D:\dev\nginx-1.10.2\html\pda
先启动nginx D:\dev\nginx-1.10.2\nginx.exe
配置文件
D:\dev\nginx-1.10.2\conf\nginx.conf
# http块配置
http {
# server块配置 监听本地1443端口请求
server {
listen 1443;
server_name localhost;
# 匹配url /,会在html目录下,访问index.html或index.htm文件
location / {
root html;
index index.html index.htm;
}
# 指定500 502 503 504出错的错误页面
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# 将PHP脚本代理到Apache监听 "http://10.1.20.152:1443/imedical/webservice/Nur.MNIS.Service.WebService.cls"
location ~ /imedical/webservice {
proxy_pass https://82.157.186.213:1443;
#CORS 配置
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE';
#是否允许cookie传输
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,X-Data-Type,X-Requested-With,X-Data-Type,X-Auth-Token';
add_header 'Access-Control-Allow-Headers' 'SOAPAction';
add_header 'Access-Control-Max-Age' '1728000';
}
}
}
2,模块页面
//手术查询
http://10.1.20.152:1443/pda/OperationFragment.html
//检验报告
http://10.1.20.152:1443/pda/LabPatsFragment.html
//检查报告
http://10.1.20.152:1443/pda/CheckPatsFragment.html
//医嘱单
http://10.1.20.152:1443/pda/DocOrderListFragment.html
//医嘱查询
http://10.1.20.152:1443/pda/OrderSearchFragment.html
测试资料包:https://82.157.186.213:1443/imedical/web/pda/ 目录下
http://10.1.20.152:8080/pda/fogbreath-scanpat.html
//添加鸿蒙 传递用户信息
window.addEventListener('message', function (event) {
if (event.data === 'init_web_messageport') {
if (event.ports[0] != null) {
h5Port = event.ports[0]; // 1. 保存从ets侧发送过来的端口
h5Port.onmessage = function (event) {
var result = event.data;// 2. 接收ets侧发送过来的消息.
console.log("In html got message, result: ", (result));
if (typeof (result) == "string") {
//固定格式:hospitalId,groupId,wardId,userId,locId
var arr = result.split(",");
tHospitalId = arr[0];
tGroupId = arr[1];
tWardId = arr[2];
tUserId = arr[3];
tLocId = arr[4];
var txt = tHospitalId + "-" + tGroupId + "-" + tWardId + "-" + tUserId + "-" + tLocId
//document.getElementById("msg").innerHTML = "String:" + result + "=" + txt
initVue();
}
}
}
}
})
//Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0
var ua = navigator.userAgent
if (ua.includes("OpenHarmony")){
//鸿蒙不处理
} else if (ua.includes("Mozilla") || ua.includes("AppleWebKit") || ua.includes("Safari") || ua.includes("Chrome") || ua.includes("Edg")) {
initVue() //浏览器 直接打开
}
===============================代码使用=========================
1,主页模块添加
s mainObjTemp=mainObj.GetAt(1).GetAt("mainSubList")
s mainArr=##class(%ArrayOfDataTypes).%New()
d mainArr.SetAt("/pda/hello.html","moduleUrl")
d mainArr.SetAt("web请求扫码","moduleDesc")
d mainArr.SetAt("web","moduleCode")
d mainObjTemp.Insert(mainArr)
OrderFragment
d ..addTest(.mainObjTemp,"web请求扫码","/pda/hello.html")
d ..addTest(.mainObjTemp,"web扫码页面","/pda/test-scanpat.html")
d ..addTest(.mainObjTemp,"web测试Vue","/pda/test-vue.html")
d ..addTest(.mainObjTemp,"web请求扫码","/pda/hello.html")
subList.add(new MainConfigBean.MainListBean.MainSubListBean("web","web测试","/pda/hello.html"));
2,支持功能
1)网络请求(实例:test.html)
var content = { params: { password: "1", logonWardId: "", userCode: "hs01" }, method: "Logon", version: "3.3" }
var content = JSON.stringify(content)
window.android.callAndroid(content, "request");
2)扫码(实例:test.html)
function getScanMsg(scanInfo) {
alert("获取扫码="+scanInfo)
showElement("Js收到消息--> scanInfo:" + scanInfo);
}
3)组件:loading加载框
//显示
window.android.callAndroid("show", "loading");
//隐藏
window.android.callAndroid("", "loading");
4)组件:dialog提示框
window.android.callAndroid("fail:" + objs.msg, "dialog");
5)使用Vue(实例:test-vue.html)
引入:vue.min.js
mounted() {
//将要给原生调用的方法挂载到 window 上面
window.Config = this.Config
window.Logon = this.Logon
window.getScanMsg = this.getScanMsg
}
6)使用HISUI(实例:test-hisui-list.html)
<link rel="stylesheet" type="text/css" href="../scripts_lib/hisui-0.1.0/dist/css/hisui.css">
<script type="text/javascript" src="../scripts_lib/hisui-0.1.0/dist/js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="../scripts_lib/hisui-0.1.0/dist/js/jquery.hisui.js"></script>
7)自定义js组件(实例:fogbreath-scanpat.html)
在components文件下,1)患者信息组件: patinfo.js
2)日期时间组件:datetime.js
8) 自定义调用Android方法(实例:hello.hml)
window.android.callAndroid("com.base.commlibs.utils.AppUtil:getAppName", "call");
如果有返回值(默认string):function getAppName(s){}
如果有参数(默认只有一个string)
var s = "hs01"
android.callAndroid("com.base.commlibs.utils.AppUtil:test2("+s+")", "call");
并返回:function test2(s){}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
HTML
1
https://gitee.com/gaoruishan/pda-h5.git
git@gitee.com:gaoruishan/pda-h5.git
gaoruishan
pda-h5
pda-h5
master

搜索帮助