kimi
2021-02-18 749a5510a9f014446a3cd6ba57b3cb0cc8148dc1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*720代表设计师给的设计稿的宽度,你的设计稿是多少,就写多少;100代表换算比例,这里写100是
  为了以后好算,比如,你测量的一个宽度是100px,就可以写为1rem,以及1px=0.01rem等等*/
/* window.onload = function(){
    getRem(720,100)
}; */
var callback;
login_data={
    userId:"12345",
    params: {}
}
 
function setLoginUser(ocValueOne) {
    login_data = ocValueOne;
}
 
function setRouteParams(ocValueOne) {
    if(ocValueOne instanceof String) {
    ocValueOne = JSON.pause(ocValueOne);
    }
   login_data = ocValueOne;
   console.info("JS INIT");
   console.info(JSON.stringify(login_data));
}
 
window.onresize = function(){
    getRem(720,100)
};
function getRem(pwidth,prem, callback){
    var html = document.getElementsByTagName("html")[0];
    var oWidth = document.body.clientWidth || document.documentElement.clientWidth;
    html.style.fontSize = oWidth/pwidth*prem + "px";
    if(callback) {
        callback();
    }
}
////以上是设置1rem = 100px的屏幕适配
 
//调用Android或ios的事件
function toIosOrAndroid(functionName, parameter, callback) {
    var u = navigator.userAgent;
    var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
    var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
    var systemType = null;
    if (isiOS) {
        systemType = ios;
    }
    else if (isAndroid) {
        systemType = android;
    }
    if (systemType[functionName]) {
        systemType[functionName](parameter);
        if(callback) {
            callback();
        }
    }
}
 
function showloading(itemid) {
    document.getElementById(itemid).style.display = "display";
}
function hideloading(itemid) {
    document.getElementById(itemid).style.display = "none";
}
 
function app_click(fun, pam, callback) {
    // document.getElementById(itemid).style.display = "none";
    window.webBridge.callAppRouter(fun, pam, function(err, resultObj) {
        if (callback) {
            callback(err, resultObj)
        }
    });
}
 
function click_row2(path) {
    mui.openWindow({
      url: path + '.html'
    });
}
 
// app_click("route", pam, callback);