Bladeren bron

手机端桌面隐藏消息;通讯录去掉点击事件

临城职教中职
ndbs 2 jaren geleden
bovenliggende
commit
05bb8528f0
2 gewijzigde bestanden met toevoegingen van 114 en 114 verwijderingen
  1. +107
    -107
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/contacts/contacts.js
  2. +7
    -7
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/scripts/index.js

+ 107
- 107
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/contacts/contacts.js Bestand weergeven

@@ -1,4 +1,4 @@
/*页面js模板,必须有init方法*/
/*页面js模板,必须有init方法*/
(function () {
var companyMap;
var departmentMap;
@@ -104,112 +104,112 @@
}


// 注册点击事件
$('#lr_contact_companylist').on('tap', function (e) {
e = e || window.event;
console.log(1213);
var et = e.target || e.srcElement;
var $et = $(et);
if (et.tagName === 'IMG' || et.tagName === 'SPAN') {
$et = $et.parent();
}
var $list = $('<div class="lr-user-list" ></div>');
var flag = false;
var id = $et.attr('data-value');
console.log(id);
if ($et.hasClass('company')) {
if ($et.hasClass('bottom')) {
$et.removeClass('bottom');
$et.parent().find('.lr-user-list').remove();
}
else {
$list.css({ 'padding-left': '10px' });
// 加载人员
$.each(userMap[id] || [], function (_index, _item) {
var _html = '\
<div class="lr-list-item user" data-value="'+ _item.id + '" >\
<img src="'+ getHeadImg(_item) + '" >\
<span >' + _item.name + '</span>\
</div>';
$list.append(_html);
flag = true;
});
// 加载部门
$.each(departmentMap[id] || [], function (_index, _item) {
var _html = '\
<div class="lr-list-item" >\
<a class="lr-nav-left department" data-value="'+ _item.id + '" >' + _item.name + '</a>\
</div>';
$list.append(_html);
flag = true;
});
// 加载公司
$.each(companyMap[id] || [], function (_index, _item) {
var _html = '\
<div class="lr-list-item" >\
<a class="lr-nav-left company" data-value="'+ _item.id + '" >' + _item.name + '</a>\
</div>';
$list.append(_html);
flag = true;
});
if (flag) {
$et.parent().append($list);
}
$et.addClass('bottom');
}
$list = null;
return false;
}
else if ($et.hasClass('department')) {
if ($et.hasClass('bottom')) {
$et.removeClass('bottom');
$et.parent().find('.lr-user-list').remove();
}
else {
$list.css({ 'padding-left': '10px' });
// 加载人员
$.each(userMap[id] || [], function (_index, _item) {
var _html = '\
<div class="lr-list-item user" data-value="'+ _item.id + '" >\
<img src="'+ getHeadImg(_item) + '" >\
<span >' + _item.name + '</span>\
</div>';
$list.append(_html);
flag = true;
});
// 加载部门
$.each(departmentMap[id] || [], function (_index, _item) {
var _html = '\
<div class="lr-list-item" >\
<a class="lr-nav-left department" data-value="'+ _item.id + '" >' + _item.name + '</a>\
</div>';
$list.append(_html);
flag = true;
});
if (flag) {
$et.parent().append($list);
}
$et.addClass('bottom');
}
$list = null;
return false;
}
else if ($et.hasClass('user')) {
var userName = $et.find('span').text();
learun.nav.go({ path: 'chat', title: userName, isBack: true, isHead: true, param: { hasHistory: true, userId: id }, type: 'right' });
$list = null;
return false;
}
});
// 注册点击事件
$('#lr_contact_companylist').on('tap', function (e) {
e = e || window.event;
console.log(1213);
var et = e.target || e.srcElement;
var $et = $(et);
if (et.tagName === 'IMG' || et.tagName === 'SPAN') {
$et = $et.parent();
}
var $list = $('<div class="lr-user-list" ></div>');
var flag = false;
var id = $et.attr('data-value');
console.log(id);
if ($et.hasClass('company')) {
if ($et.hasClass('bottom')) {
$et.removeClass('bottom');
$et.parent().find('.lr-user-list').remove();
}
else {
$list.css({ 'padding-left': '10px' });
// 加载人员
$.each(userMap[id] || [], function (_index, _item) {
var _html = '\
<div class="lr-list-item user" data-value="'+ _item.id + '" >\
<img src="'+ getHeadImg(_item) + '" >\
<span >' + _item.name + '</span>\
</div>';
$list.append(_html);
flag = true;
});
// 加载部门
$.each(departmentMap[id] || [], function (_index, _item) {
var _html = '\
<div class="lr-list-item" >\
<a class="lr-nav-left department" data-value="'+ _item.id + '" >' + _item.name + '</a>\
</div>';
$list.append(_html);
flag = true;
});
// 加载公司
$.each(companyMap[id] || [], function (_index, _item) {
var _html = '\
<div class="lr-list-item" >\
<a class="lr-nav-left company" data-value="'+ _item.id + '" >' + _item.name + '</a>\
</div>';
$list.append(_html);
flag = true;
});
if (flag) {
$et.parent().append($list);
}
$et.addClass('bottom');
}
$list = null;
return false;
}
else if ($et.hasClass('department')) {
if ($et.hasClass('bottom')) {
$et.removeClass('bottom');
$et.parent().find('.lr-user-list').remove();
}
else {
$list.css({ 'padding-left': '10px' });
// 加载人员
$.each(userMap[id] || [], function (_index, _item) {
var _html = '\
<div class="lr-list-item user" data-value="'+ _item.id + '" >\
<img src="'+ getHeadImg(_item) + '" >\
<span >' + _item.name + '</span>\
</div>';
$list.append(_html);
flag = true;
});
// 加载部门
$.each(departmentMap[id] || [], function (_index, _item) {
var _html = '\
<div class="lr-list-item" >\
<a class="lr-nav-left department" data-value="'+ _item.id + '" >' + _item.name + '</a>\
</div>';
$list.append(_html);
flag = true;
});
if (flag) {
$et.parent().append($list);
}
$et.addClass('bottom');
}
$list = null;
return false;
}
// else if ($et.hasClass('user')) {
// var userName = $et.find('span').text();
// learun.nav.go({ path: 'chat', title: userName, isBack: true, isHead: true, param: { hasHistory: true, userId: id }, type: 'right' });
// $list = null;
// return false;
// }
});

// 点击搜索框
$page.find('.searchBox').on('tap', function () {


+ 7
- 7
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/scripts/index.js Bestand weergeven

@@ -1,4 +1,4 @@
// 有关“空白”模板的简介,请参阅以下文档:
// 有关“空白”模板的简介,请参阅以下文档:
// http://go.microsoft.com/fwlink/?LinkID=397704
// 若要在 cordova-simulate 或 Android 设备/仿真器上在页面加载时调试代码: 启动应用,设置断点,
// 然后在 JavaScript 控制台中运行 "window.location.reload()"。
@@ -12,12 +12,12 @@
img: 'images/tab10.png',
fillimg: 'images/tab11.png'
},
{
page: 'message',
text: '消息',
img: 'images/tab20.png',
fillimg: 'images/tab21.png'
},
// {
// page: 'message',
// text: '消息',
// img: 'images/tab20.png',
// fillimg: 'images/tab21.png'
// },
{
page: 'contacts',
text: '通讯录',


Laden…
Annuleren
Opslaan