/**
* 来自:信呼开发团队
* 作者:磐石(rainrock)
* 网址:http://www.rockoa.com/
* 修改时间:2020-03-20
* 移动端应用主js文件,请不要去修改
*/
var myScroll=false,yy={
sousoukey:'',
onshowdata:function(){},
loadci:0,
searchparams:{},
resizehei:function(){
var hei= this.getheight();
if(agentlx==0){
var ob = this.showobj.css({'height':''+hei+'px'});
return ob;
}
},
getheight:function(ss){
return this.geth(ss);
},
scrollnew:function(){
var top = $(document).scrollTop();
if(top>50){
if(!get('backtuodiv')){
var s = '
';
$('body').append(s);
}
}else{
$('#backtuodiv').remove();
}
},
loadshow:function(){
var url = location.href,arr = json.menu;
var urla= url.split('#'),darr = this.getfirstnum(arr);
var dkey= darr[0];
if(urla[1])dkey = urla[1];
this.getdata(dkey,1);
if(darr[1]>-1){
var tit = arr[darr[1]].name;
if(darr[2]>-1)tit = arr[darr[1]].submenu[darr[2]].name;
this.showtabstr(darr[1], tit);
}
},
getfirstnum:function(d){
var dbh = 'def',bh='',a = d[0],i,len,lens,subs;
if(a){
bh = a.url;
if(a.submenu[0])bh=a.submenu[0].url;
}
try{
var site = sessionStorage.getItem(''+json.num+'_event');
if(site)bh = site;
}catch(e){}
if(isempt(bh))bh=dbh;
len = d.length;
var goi = -1,goj=-1;
for(i=0;i-1)break;
if(lens>0){
for(var j=0;j0)return;
var sid='menushoess_'+oi+'';
if(get(sid)){
$('#'+sid+'').remove();
return;
}
$("div[id^='menushoess']").remove();
var a = json.menu[oi],slen=a.submenu.length,i,a1;
this.menuname1 = a.name;
this.menuname2 = '';
if(slen<=0){
this.clickmenus(a,oi);
}else{
if(agentlx==0){
var o=$(o1),w=1/json.menu.length*100;
var s='';
}
s+='';
$('body').append(s);
}
if(agentlx==1){
var da = [];
for(i=0;i '+this.bd6('5Yqg6L296I!c5Y2V5LitLi4u')+'',lx:999});
this.loadoptnum(nus,ids);
}
js.showmenu({
data:da,
width:150,
onclick:function(d){
yy.showmenuclick(d);
}
});
this.suboptmenu={};
},
loadoptnum:function(nus,id){
js.ajax('agent','getoptnum',{num:nus,mid:id},function(ret){
yy.suboptmenu[''+nus+'_'+id+'']=ret;
yy.showmenu(yy.temparr.oi);
},'none',false,function(estr){
yy.suboptmenu[''+nus+'_'+id+'']=[];
yy.showmenu(yy.temparr.oi);
});
},
getupgurl:function(str){
if(str.substr(0,4)=='http')return str;
var a1 = str.split('|'),lx = a1[0],mk = a1[1],cs=a1[2];
var url= '';
if(lx=='add')url='?a=lum&m=input&d=flow&num='+mk+'';
if(lx=='xiang')url='task.php?a=x&num='+mk+'';
if(cs)url+='&'+cs;
return url;
},
showmenuclick:function(d){
d.num=this.num;d.mid=this.tempid;
d.modenum = this.tempnum;
var lx = d.lx;if(!lx)lx=0;
if(lx==999)return;
if(lx==998){this.xiang(d.oi);return;}
if(lx==996){this.xiang(this.temparr.oi);return;}
xrockcd={inputblur:function(){},selectdata:function(){js.msg('msg','此功能未开发')}}
this.changdatsss = d;
if(lx==2 || lx==3){
var clx='changeuser';if(lx==3)clx='changeusercheck';
$('body').chnageuser({
'changetype':clx,
'titlebool':get('header_title'),
'onselect':function(sna,sid){
yy.xuanuserok(sna,sid);
}
});
return;
}
if(lx==5){
var upg = d.upgcont;
if(isempt(upg)){
js.msg('msg',this.bd6('5rKh5pyJ6K6!572u5omT5byA55qE5pON5L2c5Zyw5Z2A'));
}else{
var url = this.getupgurl(upg);
js.location(url);
}
return;
}
if(lx==7){
var upg = d.upgcont;
if(isempt(upg)){
js.msg('msg',this.bd6('5rKh5pyJ6K6!572u6Ieq5a6a5LmJ5pa55rOV'));
}else{
if(!window[upg]){
js.msg('msg',this.bd6('6K6!572u55qE5pa55rOV4oCcezB94oCd5LiN5a2Y5ZyoJw::').replace('{0}',upg));
}else{
window[upg](this.temparr.da,d);
}
}
return;
}
if(lx==1 || lx==9 || lx==10 || lx==13 || lx==15 || lx==16 || lx==17 || lx==19 || lx==4){
var bts = (d.issm==1)?'必填':'选填';
var str1= '请输入['+d.name+']说明('+bts+'):';
if(lx==4)str1=''+str1+'';
js.prompt(d.name,str1,function(jg,text){
if(jg=='yes'){
if(!text && d.issm==1){
js.msg('msg','没有输入['+d.name+']说明');
return true;
}else{
if(lx==4){
var ad=js.getformdata('myformsbc');
for(var i in ad)d['fields_'+i+'']=ad[i];
}
yy.showmenuclicks(d, text);
}
}
});
if(lx==4){
var url='index.php?a=lus&m=input&d=flow&num='+d.modenum+'&menuid='+d.optmenuid+'&mid='+d.mid+'';
$.get(url, function(s1){
s1=s1.replace(/c\./gi, 'xrockcd.');
var s='';
$('#showmenusss').html(s);
js.resizetan('confirm');
});
}
return;
}
if(lx==14){
var url='index.php?a=lum&m=input&d=flow&num=remind&mid='+d.djmid+'&def_modenum='+d.modenum+'&def_mid='+d.mid+'&def_explain=basejm_'+jm.base64encode(d.smcont)+'&show=we';
js.location(url);
return;
}
if(lx==18){
var url='index.php?a=lum&m=input&d=flow&num=receipt&mid='+d.djmid+'&def_modenum='+d.modenum+'&def_mid='+d.mid+'&def_modename=basejm_'+jm.base64encode(d.modename)+'&def_explain=basejm_'+jm.base64encode(d.smcont)+'&show=we';
js.location(url);
return;
}
if(lx==11){
var url='index.php?a=lum&m=input&d=flow&num='+d.modenum+'&mid='+d.mid+'&show=we';
js.location(url);
return;
}
this.showmenuclicks(d,'');
},
xuanuserok:function(nas,sid){
if(!sid)return;
var d = this.changdatsss,sm='';
d.changename = nas;
d.changenameid = sid;
this.showmenuclicks(d,sm);
},
showmenuclicks:function(d, sm){
if(!sm)sm='';
d.sm = sm;
for(var i in d)if(d[i]==null)d[i]='';
js.ajax('index','yyoptmenu',d,function(ret){
yy.suboptmenu[''+d.modenum+'_'+d.mid+'']=false;
yy.getdata(yy.nowevent, 1);
});
},
showdata:function(a){
this.overend = true;
var s='',i,len=a.rows.length,d,st='',oi;
$('#showblank').remove();
$('#notrecord').remove();
if(typeof(a.stotal)=='object')this._showstotal(a.stotal);
if(a.page==1){
this.showobj.html('');
this.data=[];
}
for(i=0;i';
}else{
if(!d.statuscolor)d.statuscolor='';
var bstr = new touchclass({
xuhao:oi,
onlongclick:function(){
yy.showmenu(this.xuhao);
},
onclick:function(){
yy.xiang(this.xuhao);
}
}).touchstring();
st='';
if(d.ishui==1)st='color:#aaaaaa;';
s='';
s+='
';
if(d.title){
if(d.face){
s+='

'+d.title+'
';
}else{
s+='
'+d.title+'
';
}
}
if(d.optdt)s+='
'+d.optdt+'
';
if(d.picurl)s+='
';
if(d.cont)s+='
'+d.cont.replace(/\n/g,'
')+'
';
s+='
';
if(d.id && d.modenum && !d.noshowopt){
s+='
操作详情>>';
s+='
';
}
if(d.xiangurl){
s+='
详情>>
';
}
if(d.statustext)s+='
'+d.statustext+'
';
s+='
';
}
this.showobj.append(s);
}
var count=a.count;
if(count==0)count=len;
if(count>0){
this.nowpage = a.page;
s = '共'+count+'条记录';
if(a.maxpage>1)s+=',当前'+a.maxpage+'/'+a.page+'页';
if(a.page
点击加载';
this.overend = false;
}
s+= ' ';
this.showobj.append(s);
if(a.count==0)$('#showblank').html('');
}else{
this.showobj.html('暂无记录
');
}
this.onshowdata(a);
},
scrollEndevent:function(){
yy.regetdata(get('showblankss'),yy.nowpage+1);
},
clad:function(){
var str = this.bd6('5bqU55So6aaW6aG15pi!56S6');
if(json.iscy==1)str=this.bd6('5Y!W5raI5bqU55So6aaW6aG15pi!56S6');
if(apicloud){
api.actionSheet({
title: this.bd6('6YCJ5oup6I!c5Y2V'),
cancelTitle: this.bd6('5Y!W5raI'),
buttons: [str,this.bd6('5YWz6Zet5bqU55So')]
}, function(ret, err) {
var index = ret.buttonIndex;
if(index==1)yy.addchangying();
if(index==2)js.back();
});
}else{
js.showmenu({
data:[{name:str,lx:1}],
width:170,
onclick:function(d){
if(d.lx==1)yy.addchangying();
}
});
}
},
addchangying:function(){
js.ajax('indexreim','shecyy',{yynum:json.num},function(ret){
json.iscy = ret.iscy;
js.wx.msgok(ret.msg, false, 1);
},'mode', false,false, 'get');
},
init:function(){
for(var i in js.main)this[i]=js.main[i];
this.zhuinit();
this.num = json.num;
this.showobj = $('#mainbody');
$('.weui_navbar').click(function(){return false;});
$('body').click(function(){
$("div[id^='menushoess']").remove();
});
this.resizehei();
$(window).resize(function(){yy.resizehei();});
if(agentlx==1){$(window).scroll(function(){yy.scrollnew();});}
if(!this.checkyz()){this.clickmenu=this.showdata=function(){};return;}
},
getdata:function(st,p, mo, cas){
this.getdatamain(st,p, mo, cas);
}
}