代码拉取完成,页面将自动刷新
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){}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。