|
@@ -5,7 +5,8 @@ import uploadInstance from "../utils/UploadUtil"
|
|
|
|
|
|
|
|
|
const TAG = "openHarmonyBridge" //webview和vue沟通的名称
|
|
|
-const webUrl = "http://10.88.11.200:11000"
|
|
|
+// const webUrl = "http://192.168.1.4:11000/"
|
|
|
+const webUrl = "http://192.168.0.49:3005/"
|
|
|
|
|
|
// const webUrl = "http://10.88.20.88:3005/"
|
|
|
|
|
@@ -37,11 +38,16 @@ class BridgeModel {
|
|
|
|
|
|
startCamera(params: string): void {
|
|
|
console.info(TAG, `startCamera:`, params);
|
|
|
+ // 如果在web端第的登录页面传参数不对,这里要注释掉以免报错
|
|
|
uploadInstance.configUploadParam(params)
|
|
|
- router.pushUrl({ url: "pages/CameraPage" })
|
|
|
+ // router.pushUrl({ url: "pages/CameraPage" })
|
|
|
+ router.pushUrl({
|
|
|
+ url: "pages/CameraVersion2"
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
exitApp(params: string): void {
|
|
|
+ console.info(TAG, `exitApp:`, params);
|
|
|
let pro = new process.ProcessManager();
|
|
|
pro.exit(0);
|
|
|
}
|
|
@@ -75,10 +81,11 @@ struct Index {
|
|
|
// 这个webview调用相机不知道为什么只能执行一次,选择文件的回到还行,但是为了统一写法还是用registerJavaScriptProxy,但是有时候注册的方法也只能执行一次,不知道为什么。
|
|
|
// Web({ src: $rawfile('doc_old.html'), controller: this.controller })//测试官方文档 这个是好使的
|
|
|
|
|
|
- // Web({
|
|
|
- // src: "http://192.168.101.118:3005/login",
|
|
|
- // controller: this.controller
|
|
|
- // })
|
|
|
+ Button("跳转到相机页面").onClick(() => {
|
|
|
+ router.pushUrl({
|
|
|
+ url: "pages/CameraVersion2"
|
|
|
+ })
|
|
|
+ })
|
|
|
Web({
|
|
|
src: webUrl,
|
|
|
controller: this.controller
|
|
@@ -109,10 +116,11 @@ struct Index {
|
|
|
|
|
|
// event.request.grant([""])
|
|
|
})
|
|
|
- // .onConsole((e) => {
|
|
|
- // console.log(TAG, "onConsole", JSON.stringify(e))
|
|
|
- // return true
|
|
|
- // })
|
|
|
+ .onConsole((e) => {
|
|
|
+ console.log(TAG, "onConsole", JSON.stringify(e))
|
|
|
+ return true
|
|
|
+ })
|
|
|
+
|
|
|
|
|
|
|
|
|
// 退出程序
|