landray-JS脚本(移动端和PC端的差异)

635 阅读1分钟
/**
移动端和PC端的差异
**/
AttachXFormValueChangeEventById("控件Id",function(){
    var notifyLevelPC = GetXFormFieldValueById("控件Id");//该取值方式为PC端
    var notifyLevelPCMBInput = $("input[name=extendDataFormInfo.value('控件Id')]").val();//输入框取值方式为PC端和移动端都适用
    var notifyLevelPCMBC = $("input[name=extendDataFormInfo.value('控件Id')]:checked").val();//单选/多选取值方式为PC端和移动端都适用
    var notifyLevelPCMBS = $("select[name=extendDataFormInfo.value('控件Id')] option:checked").val();//下拉框取值方式为PC端和移动端都适用
    if(navigator.platform.indexOf('Win32')!=-1){//PC端标识方式1
        seajs.use(['lui/dialog'],function(dialog){
            if(notifyLevel=='4'||notifyLevel=='5'){
                dialog.alert("提示有问题!");
            }
        })
    }else{
        require(['mui/dialog/Tip'],function(Tip){
            if(notifyLevel=='4'||notifyLevel=='5'){
                Tip.tip({text:'提示有问题!'});
            }
        })
    }
    
    if(!window.dojoConfig ){//PC端标识方式2
        seajs.use(['lui/dialog'],function(dialog){
            if(notifyLevel=='4'||notifyLevel=='5'){
                dialog.alert("提示有问题!");
            }
        })
    }else{
        require(['mui/dialog/Tip'],function(Tip){
            if(notifyLevel=='4'||notifyLevel=='5'){
                Tip.tip({text:'提示有问题!'});
            }
        })
    }
        
})

$("input[name='extendDataFormInfo_value(fd_eating_time)_single']:checkbox").closest(".muiFieldOptions").addClass("muiFormCheckBoxChecked")//移动端单选框怎么通过JS默认勾上