Commit c8deaa76 authored by agping's avatar agping

优化

parent c5fcae55
......@@ -110,8 +110,8 @@
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="end_date" name="end_date" type="date">
<span class="btn btn-default btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-default btn3 ld-Marheight" id="reset">重置</span>
<span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="reset">重置</span>
<!-- 批量修改客方 -->
<a href="#modal_modify_user" data-toggle="modal" class="btn btn-info btn3 margin-top-ld"><i class="icon-plus"></i>
批量修改盘方</a>
......
define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_template_tpl.html','text!temp/pcBinding_template_tpl.html', 'css!style/home.css', 'pagination', 'bootstrapJs', 'ckfinder', 'ckfinderStart', 'blow-up'], function(doT, template, template_binding,pctemplate_binding) {
define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_template_tpl.html', 'text!temp/pcBinding_template_tpl.html', 'css!style/home.css', 'pagination', 'bootstrapJs', 'ckfinder', 'ckfinderStart', 'blow-up'], function(doT, template, template_binding, pctemplate_binding) {
var agent = {
pageNo: 1,
pageSize: 15,
......@@ -16,7 +16,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
_doc.on('input', '[name=district_id],#district_id2', function() {
var _this = $(this);
var _id = _this.val();
_this.next().html('');//先清空
_this.next().html(''); //先清空
//新增 编辑
var _objTemp = _this.parent().next().find('select');
_objTemp.html(''); //先清空
......@@ -29,32 +29,108 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
});
_objTemp.html(_str);
_this.next().html(_str);
});
} else {};
});
});
//新增 编辑
// agent.getDistrict(function(){
// _doc.on('input', '[name=district_id]', function(){
// var _this = $(this);
// var _id = _this.val();
// var _objTemp = _this.parent().next().find('select');
// _objTemp.html('');//先清空
// if(_id && _id != '0'){
// agent.getDistrictStoreList(_id, function(_data){
//// var _str = '';
// var _str = '<option value="0">全部</option>';
// $.each(_data, function(i,item) {
// _str += '<option value="'+item.id+'">'+item.store_name+'</option>';
// });
// _objTemp.html(_str);
// });
// }else{
// };
// });
// })
// 判断浏览器型号判断内核的 区分不了 浏览器 像搜狗 360
// function getBrowserInfo()
// {
// var agent = navigator.userAgent.toLowerCase() ;
//
// var regStr_ie = /msie [\d.]+;/gi ;
// var regStr_ff = /firefox\/[\d.]+/gi
// var regStr_chrome = /chrome\/[\d.]+/gi ;
// var regStr_saf = /safari\/[\d.]+/gi ;
// //IE
// if(agent.indexOf("msie") > 0)
// {
// return agent.match(regStr_ie) ;
// }
//
// //firefox
// if(agent.indexOf("firefox") > 0)
// {
// return agent.match(regStr_ff) ;
// }
//
// //Chrome
// if(agent.indexOf("chrome") > 0)
// {
// return agent.match(regStr_chrome) ;
// }
//
// //Safari
// if(agent.indexOf("safari") > 0 && agent.indexOf("chrome") < 0)
// {
// return agent.match(regStr_saf) ;
// }
//
// }
// var browser = getBrowserInfo() ;
// alert(browser);
// 判断浏览器型号判断内核的 区分 浏览器 像搜狗 360
var NV = {};
var UA = navigator.userAgent.toLowerCase();
try {
NV.name = !-[1, ] ? 'ie' :
(UA.indexOf("firefox") > 0) ? 'firefox' :
(UA.indexOf("chrome") > 0) ? 'chrome' :
window.opera ? 'opera' :
window.openDatabase ? 'safari' :
'unkonw';
} catch(e) {};
try {
NV.version = (NV.name == 'ie') ? UA.match(/msie ([\d.]+)/)[1] :
(NV.name == 'firefox') ? UA.match(/firefox\/([\d.]+)/)[1] :
(NV.name == 'chrome') ? UA.match(/chrome\/([\d.]+)/)[1] :
(NV.name == 'opera') ? UA.match(/opera.([\d.]+)/)[1] :
(NV.name == 'safari') ? UA.match(/version\/([\d.]+)/)[1] :
'0';
} catch(e) {};
try {
NV.shell = (UA.indexOf('360ee') > -1) ? '360极速浏览器' :
(UA.indexOf('360se') > -1) ? '360安全浏览器' :
(UA.indexOf('qqbrowser') > -1) ? 'QQ浏览器' :
(UA.indexOf('se') > -1) ? '搜狗浏览器' :
(UA.indexOf('aoyou') > -1) ? '遨游浏览器' :
(UA.indexOf('theworld') > -1) ? '世界之窗浏览器' :
(UA.indexOf('worldchrome') > -1) ? '世界之窗极速浏览器' :
(UA.indexOf('greenbrowser') > -1) ? '绿色浏览器' :
(UA.indexOf('baidu') > -1) ? '百度浏览器' :
NV.name;
} catch(e) {};
//判断 谷歌 360 application/vnd.chromium.remoting-viewer 可能为360特有
if(NV.name=='chrome'){
var is360 = _mime("type", "application/vnd.chromium.remoting-viewer");
if(isChrome() && is360) {
NV.shell='360浏览器'
}
//检测是否是谷歌内核(可排除360及谷歌以外的浏览器)
function isChrome() {
var ua = navigator.userAgent.toLowerCase();
return ua.indexOf("chrome") > 1;
}
//测试mime
function _mime(option, value) {
var mimeTypes = navigator.mimeTypes;
for(var mt in mimeTypes) {
if(mimeTypes[mt][option] == value) {
return true;
}
}
return false;
}
}
// alert('浏览器UA=' + UA +
// '\n\n浏览器名称=' + NV.name +
// '\n\n浏览器版本=' + NV.version +
// //'\n\n浏览器版本='+parseInt(NV.version)+
// '\n\n浏览器外壳=' + NV.shell);
var browser_version=NV.shell+'/'+NV.version;
alert(browser_version)
$('#search').click(function(pageNo) {
agent.getList(1);
});
......@@ -84,11 +160,11 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
$(this).val('').attr('type', 'password');
});
$(document).on("click", ".phone-bundling", function() {//点击绑定手机
$(document).on("click", ".phone-bundling", function() { //点击绑定手机
agent.agent_id = $(this).attr("data-id");
agent.getPhoneBindingList();
});
$(document).on("click", ".pc-bundling", function() {//点击绑定电脑
$(document).on("click", ".pc-bundling", function() { //点击绑定电脑
agent.agent_id = $(this).attr("data-id");
agent.getPcBindingList();
});
......@@ -184,7 +260,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
}
});
});
//电脑绑定状态切换
$(document).delegate(".is_showpc", "click", function() { //点击禁用
if(!confirm('是否继续?')) {
......@@ -236,8 +312,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
} else {
if(data.code == 200) {} else {
alert("重复提交");
}
}
......@@ -365,7 +440,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
params.groupname = $("input[name='groupname']").val();
params.district_id = $("#district_id2").val();
params.store_id = $("#guest_stores").val();
$.ajax({
url: '/index/AgentList',
type: 'GET',
......@@ -415,13 +490,13 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
}
})
},
//电脑绑定权限
getPcBindingList: function(pageNo) {
//电脑绑定权限
getPcBindingList: function(pageNo) {
var params = {};
params.agent_id = agent.agent_id;
console.log(agent.agent_id);
$.ajax({
url: '/index/deviceList',//电脑绑定权限
url: '/index/deviceList', //电脑绑定权限
type: 'GET',
async: true,
data: params,
......@@ -436,7 +511,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
}
})
},
getRole: function(tempval) {
$.ajax({
url: '/index/getAuth2',
......@@ -477,7 +552,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
});
$('[name=district_id]').append(str);
$('#district_id2').append(str);
fn && fn();
}
}
......@@ -518,16 +593,16 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
// console.log(data.data[0].agent_evaluate_num);
// console.log(data.data[0].agent_evaluate_num);
$("#agentlist tr").each(function(e) {
//e代表索引 从0开始 eq(0)就是第一行
//e代表索引 从0开始 eq(0)就是第一行
$("#agentlist").find("tr").eq(e).find("td").eq(9).html(data.data[e].agent_evaluate_num); //获取一列的值
$("#agentlist").find("tr").eq(e).find("td").eq(10).html(data.data[e].agent_evaluate_fraction);
})
}
})
}
}
});
}
};
return agent;
});
});
\ No newline at end of file
......@@ -43,7 +43,7 @@
[% } %]
[% if(check_auth('index/updateRole')) {%]
<a href="#modal-user" class="btn1 btn-danger" id='role' href="#modal-edit" data-toggle="modal" data-id='[%= it[item]["id"] %]'>角色设置</a>
<a href="#modal-user" class="btn1 btn-success" id='role' href="#modal-edit" data-toggle="modal" data-id='[%= it[item]["id"] %]'>角色设置</a>
[% } %]
<!--绑定手机权限-->
[% if(check_auth('index/updateDevice')) {%]
......
......@@ -7,7 +7,7 @@
<td>[%= it[item]['address'] %]</td>
<td>[%= it[item]['remark'] %]</td>
<td>
<a class="btn1 btn-info review-images" href="#modal-time" data-toggle="modal" data-img='[%= it[item]["supervise_img"] %]'>查看</a>
<a class="btn1 btn-success review-images" href="#modal-time" data-toggle="modal" data-img='[%= it[item]["supervise_img"] %]'>查看</a>
<!--<a class="btn1 btn-info timeline" href="#modal-time" data-toggle="modal" data-id='[%= it[item]["order_id"] %]'>查看</a>-->
</td>
......
......@@ -15,7 +15,7 @@
</a>
[% if(check_auth('index/delNotice')) { %]
<!--删除权限-->
<a class="btn1 btn-success announcement-del" href="#modal-delete" data-toggle="modal" data-id='[%= it[item]["id"] %]'>删除</a>
<a class="btn1 btn-danger announcement-del" href="#modal-delete" data-toggle="modal" data-id='[%= it[item]["id"] %]'>删除</a>
[% } %]
</td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment