WEBQQ2.0协议分析(qqweb.app.buddyfinder.js)

时间:2022-10-30 17:23:41
//这个文件是查找起始文件,里面包含后续步骤用到的信息

Jx().$package(alloy.app.buddyFinder = new alloy.businessClass.App(alloy.portal.getSystemConfig("buddyFinder")),
function(h) {
var f = this,
c = h.dom,
g = h.event,
B = {},
e = 1,
N = 1,
v = !1,
O = !1,
q = 0,
P = null,
t = null,
p = {},
x = !0,
n = null,
l = null,
w = "buddy",
u = "search",
y = "search",
C = !1,
D = !1,
d = {},
m = null,
r = null,
Q = null,
j = {},
E = 1,
b = {},
R = "buddy";
this.bfData = {
country: {
name: "alloy.app.buddyFinder.bfData.country",
data: []
},
state: {
name: "alloy.app.buddyFinder.bfData.state",
data: []
},
city: {
name: "alloy.app.buddyFinder.bfData.city",
data: []
},
age: {
name: "alloy.app.buddyFinder.bfData.age",
data: [["0", "\u4e0d\u9650"], ["1", "0-15\u5c81"], ["2", "16-22\u5c81"], ["3", "23-30\u5c81"], ["4", "31-40\u5c81"], ["5", "40\u5c81\u4ee5\u4e0a"]]
},
gender: {
name: "alloy.app.buddyFinder.bfData.gender",
data: [["0", "-"], ["1", "\u7537"], ["2", "\u5973"]]
},
lang: {
name: "alloy.app.buddyFinder.bfData.lang",
data: [["0", "-"], ["2052", "\u4e2d\u6587(\u7b80\u4f53)"], ["3076", "\u4e2d\u6587(\u7e41\u4f53)"], ["1078", "\u5357\u975e\u8377\u5170\u8bed"], ["1052", "\u963f\u5c14\u5df4\u5c3c\u4e9a\u8bed"], ["1025", "\u963f\u62c9\u4f2f\u8bed"], ["1067", "\u4e9a\u7f8e\u5c3c\u4e9a\u8bed"], ["2092", "\u963f\u585e\u62dc\u7586\u8bed"], ["1059", "\u767d\u4fc4\u7f57\u65af\u8bed"], ["5146", "\u6ce2\u65af\u5c3c\u4e9a\u8bed"], ["1026", "\u4fdd\u52a0\u5229\u4e9a\u8bed"], ["1109", "\u7f05\u7538\u8bed"], ["1027", "\u52a0\u6cf0\u7f57\u5c3c\u4e9a\u8bed"], ["1050", "\u514b\u7f57\u5730\u4e9a\u8bed"], ["1029", "\u6377\u514b\u8bed"], ["1030", "\u4e39\u9ea6\u8bed"], ["1043", "\u8377\u5170\u8bed"], ["1033", "\u82f1\u8bed"], ["1061", "\u7231\u6c99\u5c3c\u4e9a\u8bed"], ["1065", "\u6ce2\u65af\u8bed"], ["1035", "\u82ac\u5170\u8bed"], ["1036", "\u6cd5\u8bed"], ["2108", "\u76d6\u5c14\u8bed"], ["1031", "\u5fb7\u8bed"], ["1032", "\u5e0c\u814a\u8bed"], ["1095", "\u53e4\u5409\u62c9\u7279\u8bed"], ["1037", "\u5e0c\u4f2f\u6765\u8bed"], ["1081", "\u5370\u5730\u8bed"], ["1038", "\u5308\u7259\u5229\u8bed"], ["1039", "\u51b0\u5c9b\u8bed"], ["1057", "\u5370\u5ea6\u5c3c\u897f\u4e9a\u8bed"], ["1040", "\u610f\u5927\u5229\u8bed"], ["1041", "\u65e5\u8bed"], ["1107", "\u9ad8\u68c9\u8bed"], ["1042", "\u671d\u9c9c\u8bed"], ["1108", "\u8001\u631d\u8bed"], ["1062", "\u62c9\u8131\u7ef4\u4e9a\u8bed"], ["1063", "\u7acb\u9676\u5b9b\u8bed"], ["1071", "\u9a6c\u5176\u987f\u8bed"], ["1086", "\u9a6c\u6765\u897f\u4e9a\u8bed"], ["1104", "\u8499\u53e4\u8bed"], ["1044", "\u632a\u5a01\u8bed"], ["1045", "\u6ce2\u5170\u8bed"], ["2070", "\u8461\u8404\u7259\u8bed"], ["1094", "\u65c1\u906e\u666e\u8bed"], ["1048", "\u7f57\u9a6c\u5c3c\u4e9a\u8bed"], ["1049", "\u4fc4\u8bed"], ["3098", "\u585e\u5c14\u7ef4\u4e9a\u8bed"], ["1113", "\u4fe1\u5fb7\u8bed"], ["1051", "\u65af\u6d1b\u4f10\u514b\u8bed"], ["1060", "\u65af\u6d1b\u6587\u5c3c\u4e9a\u8bed"], ["1143", "\u7d22\u9a6c\u91cc\u8bed"], ["1034", "\u897f\u73ed\u7259\u8bed"], ["1089", "\u65af\u74e6\u897f\u91cc\u8bed"], ["1053", "\u745e\u5178\u8bed"], ["1097", "\u6cf0\u7c73\u5c14\u8bed"], ["1092", "\u9791\u977c\u8bed"], ["1054", "\u6cf0\u8bed"], ["1055", "\u571f\u8033\u5176\u8bed"], ["1058", "\u4e4c\u514b\u5170\u8bed"], ["1056", "\u4e4c\u5c14\u90fd\u8bed"], ["1066", "\u8d8a\u5357\u8bed"], ["1106", "\u5a01\u5c14\u58eb\u8bed"], ["1085", "\u610f\u7b2c\u7eea\u8bed"], ["1130", "\u7ea6\u9c81\u5df4\u8bed"]]
}
};
var S = function(a, k, i, b, c) {
alloy.rpcService.send(alloy.CONST.API_SERVER_URL + "get_single_info2", {
context: f,
data: {
tuin: a,
verifysession: k,
code: i,
vfwebqq: alloy.portal.getVfWebQQ()
},
arguments: {
uin: a,
verifysession: k,
code: i
},
onSuccess: b ||
function(a) {
a.retcode === 0 ? (a.result.uin = a.result.tuin, g.notifyObservers(f, "GetUserInfoSuccess", a), p[a.result.uin] = a) : c ? c() : g.notifyObservers(f, "GetUserInfoError", a)
},
onError: c ||
function(a) {
g.notifyObservers(f, "GetUserInfoError", a)
}
})
},
T = function(a) {
alloy.rpcService.send(alloy.CONST.API_SERVER_URL + "search_qq_by_nick2", {
context: this,
data: {
nick: a.nick,
page: a.page
},
onSuccess: function(a) {
a.retcode === 0 ? g.notifyObservers(f, "GetUserTinyInfosSuccess", a) : z(a)
},
onError: function(a) {
z(a)
}
})
},
U = function(a) {
alloy.rpcService.send(alloy.CONST.API_SERVER_URL + "search_qq_by_term", {
context: this,
data: a,
onSuccess: function(a) {
a.retcode === 0 ? g.notifyObservers(f, "GetUserInfosByTermsSuccess", a) : z(a)
},
onError: function(a) {
z(a)
}
})
},
z = function() {
b.resultBox.innerHTML = "\u670d\u52a1\u5668\u5fd9\u6216\u9a8c\u8bc1\u7801\u6709\u8bef"
},
ka = function() {
var a = this;
clearTimeout(P);
if (b.bfExactInputDom.checked && G()) {
var k = b.bfNickInputDom.value;
P = setTimeout(function() {
k && a.scrollHeight - a.scrollTop < 270 && T({
nick: k,
page: q
})
},
500)
} else if (b.bfFuzzyInputDom.checked) {
var i = V(b.countrySelect.value()),
c = W(b.stateSelect.value()),
d = X(b.citySelect.value()),
e = b.ageSelect.value(),
g = b.genderSelect.value(),
f = b.langSelect.value(),
h = b.onlineCheck.checked == !0 ? 1 : 0;
a.scrollHeight - a.scrollTop < 270 && U({
country: i,
province: c,
city: d,
agerg: e,
sex: g,
lang: f,
online: h,
vfwebqq: alloy.portal.getVfWebQQ(),
page: q
})
}
},
H = function() {
return !(c.hasClass(b.bfAccoutInputDom, "gray") || b.bfAccoutInputDom.value == "" || b.bfAccoutInputDom.value == "\u8bf7\u8f93\u5165\u5bf9\u65b9\u6570\u5b57\u5e10\u53f7\u6216Email\u5e10\u53f7")
},
G = function() {
return !(c.hasClass(b.bfFuzzyInputDom, "gray") || b.bfNickInputDom.value == "" || b.bfNickInputDom.value == "\u8bf7\u8f93\u5165\u5bf9\u65b9\u6635\u79f0")
},
Y = function(a, k) {
if (!c.id("buddyfinder_img_code")) {
var i = this;
if (!k) if (b.bfExactInputDom.checked && !H() && G()) {
b.resultBox.innerHTML = '<div class="loading">\u8f7d\u5165\u4e2d...</div>';
I.call(i, null, null, a, "byNick");
u = "result";
g.notifyObservers(f, "stepChanged");
return
} else if (b.bfFuzzyInputDom.checked) {
b.resultBox.innerHTML = '<div class="loading">\u8f7d\u5165\u4e2d...</div>';
I.call(i, null, null, a, "byFuzzy");
u = "result";
g.notifyObservers(f, "stepChanged");
return
}
n = alloy.layout.getWindowManager().createWindow("Window", {
title: "\u8eab\u4efd\u9a8c\u8bc1",
modeSwitch: !0,
dragable: !0,
resize: !0,
width: 380,
height: 123,
x: l.getX() + 60,
y: l.getY() + 90,
hasCloseButton: !0,
hasOkButton: !0,
isSetCentered: !1
});
n.setHtml('<div style="width:100%; height:100%; background-color:#FFFFFF; line-height:30px;">\t\t\t\t\t\t\t<div style="margin-left:10px;">\t\t\t\t\t\t\t\t<div>\u4e3a\u4e86\u60a8\u7684\u8d26\u53f7\u5b89\u5168\uff0c\u8bf7\u6267\u884c\u8eab\u4efd\u9a8c\u8bc1\uff0c\u5728\u8f93\u5165\u6846\u8f93\u5165\u4e0b\u56fe\u4e2d\u7684\u9a8c\u8bc1\u7801</div>\t\t\t\t\t\t\t\t<div>\u9a8c\u8bc1\u7801:  <input id="buddyfinder_input_code" type="text" style="vertical-align:middle;" />  <span id="buddyfinder_code_bf" style="color:red"></span></div>\t\t\t\t\t\t\t\t<img style="float:left;margin-right:10px" id="buddyfinder_img_code" src="" />\t\t\t\t\t\t\t\t<a style="display:inline;line-height:60px;" id="buddyfinder_a_code" alt="\u770b\u4e0d\u6e05\u6362\u4e00\u5f20" href="">\u770b\u4e0d\u6e05\u6362\u4e00\u5f20</a>\t\t\t\t\t\t\t\t<div id="buddyfinder_img_code_wrong" style="display:none;color:red;width:65px;">\u9a8c\u8bc1\u7801\u9519\u8bef</div>\t\t\t\t\t\t\t</div>\t\t\t\t\t\t</div>');
var d = c.id("buddyfinder_img_code"),
e = c.id("buddyfinder_a_code"),
j = c.id("buddyfinder_input_code"),
m = null;
g.on(d, "load",
function() {
m = h.cookie.get("verifysession", EQQ.CONST.MAIN_DOMAIN)
});
g.on(e, "click",
function(a) {
a.preventDefault();
c.id("buddyfinder_img_code").src = "http://captcha.qq.com/getimage?aid=1003901&" + Math.random()
});
g.addObserver(n, "clickOkButton",
function() {
var b = j.value;
if (b && m) return k ? k(m, b) : I.call(i, m, b, a),
u = "result",
g.notifyObservers(f, "stepChanged"),
x;
j.focus();
c.id("buddyfinder_code_bf").innerHTML = "\u8bf7\u5148\u8f93\u5165\u9a8c\u8bc1\u7801!";
return !1
});
j.focus();
g.on(j, "keydown",
function(a) {
a.keyCode == 13 && g.notifyObservers(n, "clickOkButton") && setTimeout(function() {
n.close()
},
0)
});
c.id("buddyfinder_img_code").src = "http://captcha.qq.com/getimage?aid=1003901&" + Math.random()
}
},
I = function(a, k, i, c) {
v = !0;
c = c || "byAccount";
if (c == "byAccount") i = h.string.trim(b.bfAccoutInputDom.value),
J() ? (i = h.string.isEmail(i) ? i : parseInt(i, 10), S(i, a, k, null,
function() {
b.resultBox.innerHTML = "\u670d\u52a1\u5668\u5fd9\u6216\u9a8c\u8bc1\u7801\u6709\u8bef\uff0c\u8bf7\u91cd\u8bd5";
v = !1
}), t && (clearTimeout(t), t = null), t = setTimeout(function() {
if (v) b.resultBox.innerHTML = "\u641c\u7d22\u65e0\u7ed3\u679c\u6216\u8005\u8d85\u65f6\uff0c\u8bf7\u91cd\u8bd5"
},
3E3), alloy.util.report2im("fgsearch|fspanel|accuratebyid")) : b.resultBox.innerHTML = "\u60a8\u8f93\u5165\u7684\u6570\u5b57\u5e10\u53f7\u6216Email\u5e10\u53f7\u6709\u8bef\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\uff01";
else if (c == "byNick") a = b.bfNickInputDom.value,
q = 0,
a && T({
nick: a,
page: 0
}),
alloy.util.report2im("fgsearch|fspanel|accuratebynickname");
else if (c == "byFuzzy") {
var a = V(b.countrySelect.value()),
k = W(b.stateSelect.value()),
i = X(b.citySelect.value()),
c = b.ageSelect.value(),
d = b.genderSelect.value(),
e = b.langSelect.value();
U({
country: a,
province: k,
city: i,
agerg: c,
sex: d,
lang: e,
online: b.onlineCheck.checked == !0 ? 1 : 0,
vfwebqq: alloy.portal.getVfWebQQ(),
page: 0
});
alloy.util.report2im("fgsearch|fspanel|condition")
}
},
ma = function(a) {
h.out("xxxxxxxxxxxxxxxxxxxx" + a);
if (a.length === 0 && q == 0) return b.resultBox.innerHTML = "\u6ca1\u6709\u4f60\u8981\u67e5\u627e\u7684\u7528\u6237",
0;
a = la(a);
if (b.resultBox.innerHTML == "\u6ca1\u6709\u4f60\u8981\u67e5\u627e\u7684\u7528\u6237" || b.resultBox.innerHTML == "") b.resultBox.innerHTML = "";
a.endflag == "1" ? q = 0 : q += 1;
var k = c.mini(".loading", b.resultBox);
if (s(k) && k.length > 0) b.resultBox.innerHTML = "";
if (!O) b.resultBox.innerHTML = "",
O = !0;
var i = [];
h.array.forEach(a.uinlist,
function(a) {
N += 1;
N % 2 == 1 ? i.push('<div class="buddyFinder_tinyInfo">') : i.push('<div class="buddyFinder_tinyInfo buddyFinder_tinyInfo_fix">');
i.push(h.string.template('\t\t\t\t\t<div class="buddyFinder_tinyInfo_info">\t\t\t\t\t\t<img src="<%=avatar%>" class="buddyFinder_tinyInfo_info_avatar" />\t\t\t\t\t\t<div class="buddyFinder_tinyInfo_info_t">\t\t\t\t\t\t\t<div class="buddyFinder_tinyInfo_info_t_showname"><%=nick%>(<%=uin%>)</div>\t\t\t\t\t\t\t<a href="http://user.qzone.qq.com/<%=uin%>" target="_blank" title="QQ\u7a7a\u95f4" class="EQQ_qZoneButton" ></a>\t\t\t\t\t\t</div>\t\t\t\t\t\t<div class="buddyFinder_tinyInfo_info_d">\t\t\t\t\t\t\t\t<span class="nbsp">\u6027\u522b: <%=gender%></span><span class="nbsp">\u5e74\u9f84: <%=age%></span><span class="nbsplast">\u6765\u81ea: <%=from%></span>\t\t\t\t\t\t</div>\t\t\t\t\t</div>\t\t\t\t\t<div class="buddyFinder_tinyInfo_button">\t\t\t\t\t\t<div id="buddyFinder_tiny_detailButton_<%=uin%>" rel="detail:<%=uin%>" class="buddyFinder_tinyInfo_button_l">\u8be6\u7ec6\u8d44\u6599</div>\t\t\t\t\t\t<div id="buddyFinder_tiny_adderButton_<%=uin%>" rel="add:<%=uin%>" class="buddyFinder_tinyInfo_button_r">\u52a0\u4e3a\u597d\u53cb</div>\t\t\t\t\t</div>\t\t\t', a) + "</div>")
});
a = document.createElement("div");
a.innerHTML = i.join("");
b.resultBox.appendChild(a);
if (q == 1) b.resultBox.scrollTop = 0
},
Z = function(a) {
var a = a || _uin,
k = p[a];
k ? (k = k.result, alloy.portal.runApp("buddyAdder", {
uin: k.uin,
nick: k.nick,
allow: k.allow,
token: k.token,
account: k.account
})) : (a = a || _info.account, alloy.rpcService.sendGetSingleInfo(a, null, null,
function(a) {
if (a.retcode === 0) a = a.result,
alloy.portal.runApp("buddyAdder", {
uin: a.uin,
nick: a.nick,
allow: a.allow,
token: a.token,
account: a.account
})
}))
},
oa = function(a, k) {
var i = na(a, k),
i = h.string.template('\t\t\t\t\t<div class="buddyFinder_simple_info">\t\t\t\t\t\t<div class="buddyFinder_simple_info_l">\t\t\t\t\t\t\t<div class="buddyFinder_simple_info_avatar"><img src="<%=avatar%>" class="buddyFinder_simple_info_pic" />\t\t\t\t\t\t\t\t<div class="buddyFinder_simple_info_base">\t\t\t\t\t\t\t\t\t<div class="buddyFinder_simple_info_name"><span class="buddyFinder_simple_info_showname" ><%=nick%></span><a class="buddyFinder_qZoneButton" title="QQ\u7a7a\u95f4" target="_blank" href="http://user.qzone.qq.com/<%=account%>"></a></div>\t\t\t\t\t\t\t\t\t<div class="buddyFinder_simple_info_uin">  (<%=account%>)</div>\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t<div class="buddyFinder_simple_info_r">\t\t\t\t\t\t\t\t<div id="buddyFinder_simple_detailButton_' + e + '" class="buddyFinder_simple_detailButton">\u8be6\u7ec6\u8d44\u6599</div>\t\t\t\t\t\t\t\t<div class="buddyFinder_simple_addBuddyButton">\t\t\t\t\t\t\t\t\t<div id="buddyFinder_simple_addBuddyButton_l" class="buddyFinder_simple_addBuddyButton_l"></div>\t\t\t\t\t\t\t\t\t<div id="buddyFinder_simple_addBuddyButton_m" class="buddyFinder_simple_addBuddyButton_m"></div>\t\t\t\t\t\t\t\t\t<div id="buddyFinder_simple_addBuddyButton_r" class="buddyFinder_simple_addBuddyButton_r"></div>\t\t\t\t\t\t\t\t\t<div class="buddyFinder_simple_addBuddyButton_content" id="buddyFinder_simple_addButton_' + e + '" >\u52a0\u4e3a\u597d\u53cb</div>\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t<div class="buddyFinder_simple_info_default">\u6027      \u522b:  <%=gender%></div>\t\t\t\t\t\t\t<div class="buddyFinder_simple_info_default">\u5e74      \u9f84:  <%=age%></div>\t\t\t\t\t\t\t<div class="buddyFinder_simple_info_default">\u6765      \u81ea:  <%=from%></div>\t\t\t\t\t\t\t<div class="buddyFinder_simple_info_default">\u4e2a\u4eba\u4e3b\u9875:  <%=homepage%></div>\t\t\t\t\t\t\t<div class="buddyFinder_simple_info_default personRm">\t\t\t\t\t\t\t<span class="personRmL">\u4e2a\u4eba\u8bf4\u660e:</span><div class="personRmR"><%=personal%></div></div>\t\t\t\t\t\t</div>\t\t\t\t\t</div>\t\t\t', i);
b.resultBox.innerHTML = i;
var i = c.id("buddyFinder_simple_detailButton_" + e + ""),
d = c.id("buddyFinder_simple_addButton_" + e);
g.on(d, "click",
function() {
Z(a);
alloy.util.report2im("fgsearch|fspanel|fresult1|add")
});
g.on(d, "mouseover",
function() {
c.addClass(c.id("buddyFinder_simple_addBuddyButton_l"), "buddyFinder_simple_addBuddyButton_l_over");
c.addClass(c.id("buddyFinder_simple_addBuddyButton_m"), "buddyFinder_simple_addBuddyButton_m_over");
c.addClass(c.id("buddyFinder_simple_addBuddyButton_r"), "buddyFinder_simple_addBuddyButton_r_over")
});
g.on(d, "mouseout",
function() {
c.removeClass(c.id("buddyFinder_simple_addBuddyButton_l"), "buddyFinder_simple_addBuddyButton_l_over");
c.removeClass(c.id("buddyFinder_simple_addBuddyButton_m"), "buddyFinder_simple_addBuddyButton_m_over");
c.removeClass(c.id("buddyFinder_simple_addBuddyButton_r"), "buddyFinder_simple_addBuddyButton_r_over")
});
g.on(i, "click",
function() {
alloy.portal.runApp("userDetails", {
uin: a,
data: p[a]
});
alloy.util.report2im("fgsearch|fspanel|fresult1|details")
})
},
pa = function(a) {
return h.array.map(a,
function(a) {
return {
uin: a.uin,
nick: h.string.encodeHtml(a.nick) || "-",
gender: {
1: "\u7537",
2: "\u5973"
}[a.sex] || "-",
from: a.country + (a.province != 0 ? a.province : a.city != 0 ? a.city : ""),
age: a.age || "-",
avatar: EQQ.getUserAvatar(a.uin, null, !0)
}
})
},
la = function(a) {
if (a && a !== void 0) var c = {
endflag: a.endflag,
count: a.count,
page: a.page,
uinlist: pa(a.uinlist)
};
return c
},
na = function(a, c) {
return {
nick: h.string.encodeHtml(c.nick),
uin: c.uin,
account: c.account,
allow: c.allow,
gender: {
unknown: "-",
male: "\u7537",
female: "\u5973"
}[c.gender] || "-",
from: h.string.encodeHtml(c.country + c.province) || "-",
homepage: h.string.encodeHtml(c.homepage) || "-",
personal: h.string.encodeHtml(c.personal) || "-",
age: function() {
var a = (new Date).getFullYear();
return c.birthday.year && parseInt(c.birthday.year) > 1800 && parseInt(c.birthday.year) <= a ? a - parseInt(c.birthday.year) : "-"
} (),
avatar: EQQ.getUserAvatar(a),
token: c.token
}
},
qa = function(a) {
var b = p[a];
b ? alloy.portal.runApp("userDetails", {
uin: b.result.uin,
data: p[a]
}) : Y(null,
function(b, d) {
x = !1;
S(a, b, d,
function(b) {
if (b.retcode == 0) b.result.uin = b.result.tuin,
p[a] = b,
alloy.portal.runApp("userDetails", {
uin: b.result.uin,
data: p[a]
}),
setTimeout(function() {
n.close()
},
0);
else if (b.retcode == 102) c.id("buddyfinder_img_code_wrong").style.display = "inline",
c.id("buddyfinder_img_code").src = "http://captcha.qq.com/getimage?aid=1003901&" + Math.random();
x = !0
},
function() {
x = !0
})
})
},
ra = function(a) {
var c = p[a];
c ? (c = c.result, alloy.portal.runApp("buddyAdder", {
uin: c.uin,
account: c.account,
nick: c.nick,
allow: c.allow,
token: c.token
})) : alloy.rpcService.sendGetSingleInfo(a, null, null,
function(a) {
if (a.retcode === 0) p[a.result.uin] = a,
a = a.result,
alloy.portal.runApp("buddyAdder", {
uin: a.uin,
account: a.account,
nick: a.nick,
allow: a.allow,
token: a.token
})
})
},
sa = function(a) {
var c = a.target;
if (c && (c = c.getAttribute("rel"))) switch (c = c.split(":"), c[1] = parseInt(c[1], 10), c[0]) {
case "detail":
a.stopPropagation();
a.preventDefault();
qa(c[1]);
break;
case "add":
a.stopPropagation(),
a.preventDefault(),
ra(c[1])
}
},
aa = function() {
if (!C) {
l.data.buddyFinderBody.innerHTML = '<div class="container">\t\t\t\t\t\t\t<div class="sBox" id="bf_sBox_' + e + '">\t\t\t\t\t\t\t\t<div class="buddyFinder_endline">\u67e5\u627e\u65b9\u5f0f<hr class="line" /></div>\t\t\t\t\t\t\t\t<div class="sOptionBox">\t\t\t\t\t\t\t\t\t<div><input type="radio" name="bf_s" id="bf_sExatInput_' + e + '" class ="typeInput" checked="checked" />\u7cbe\u786e\u67e5\u627e</div>\t\t\t\t\t\t\t\t\t<div><input type="radio" name="bf_s" id="bf_sFuzzyInput_' + e + '" class ="typeInput" />\u6309\u6761\u4ef6\u67e5\u627e</div>\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t\t<div class="sIpBox" id ="bf_sExat_' + e + '">\t\t\t\t\t\t\t\t\t<p class ="sIpBox_Txt">\u5e10\u53f7\uff1a</p>\t\t\t\t\t\t\t\t\t<input type="text" id="bf_account_' + e + '" value="\u8bf7\u8f93\u5165\u5bf9\u65b9\u6570\u5b57\u5e10\u53f7\u6216Email\u5e10\u53f7" class="searchInput gray">\t\t\t\t\t\t\t\t\t<p class = "sIpBox_tips" id="bf_tips_' + e + '"></p>\t\t\t\t\t\t\t\t\t<p class ="sIpBox_Txt">\u6635\u79f0\uff1a</p>\t\t\t\t\t\t\t\t\t<input type="text" id="bf_nick_' + e + '" value="\u8bf7\u8f93\u5165\u5bf9\u65b9\u6635\u79f0" class="searchInput gray">\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t\t<div class="sIpBox" id ="bf_sFuzzy_' + e + '" style="display:none;">\t\t\t\t\t\t\t\t\t<dl class="bf_basicList" id="bf_basicList_' + e + '">\t\t\t\t\t\t\t\t\t\t<div class="loading">\u8f7d\u5165\u4e2d...</div>\t\t\t\t\t\t\t\t\t</dl>\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t<div class="rBox" id="bf_rBox_' + e + '" style="display:none;" >\t\t\t\t\t\t\t\t\t<div class="buddyFinder_endline">\u67e5\u627e\u7ed3\u679c<hr class="line" /></div>\t\t\t\t\t\t\t\t\t<div class="resultBox" id="bf_resultBox_' + e + '">\t\t\t\t\t\t\t\t\t\t<div class="loading">\u8f7d\u5165\u4e2d...</div>\t\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t</div>\t\t\t\t\t\t</div>';
b.sBox = c.id("bf_sBox_" + e);
b.rBox = c.id("bf_rBox_" + e);
b.tBox = c.id("bf_tips_" + e);
b.resultBox = c.id("bf_resultBox_" + e);
b.basicList = c.id("bf_basicList_" + e);
var a = b.bfExactInputDom = c.id("bf_sExatInput_" + e),
d = b.bfFuzzyInputDom = c.id("bf_sFuzzyInput_" + e);
b.bfExactDom = c.id("bf_sExat_" + e);
b.bfFuzzyDom = c.id("bf_sFuzzy_" + e);
var i = b.bfAccoutInputDom = c.id("bf_account_" + e),
F = b.bfNickInputDom = c.id("bf_nick_" + e);
g.on(a, "click", $);
g.on(d, "click", $);
g.on(i, "focus", ta);
g.on(i, "blur", ua);
g.on(i, "keydown", va);
g.on(F, "focus", wa);
g.on(F, "blur", xa);
g.on(F, "keydown", ya);
g.addObserver(l, "close", o.onWindowClose);
g.addObserver(f, "GetUserInfoSuccess", o.onGetUserInfoSuccess);
g.addObserver(f, "GetUserTinyInfosSuccess", o.onGetUserTinyInfosSuccess);
g.addObserver(f, "GetUserInfosByTermsSuccess", o.onGetUserInfosByTermsSuccess);
h.platform.iPad && new h.ui.TouchScroller(b.resultBox);
g.on(b.resultBox, "scroll", ka);
g.on(b.resultBox, "click", sa);
C = !0;
u = "search"
}
},
$ = function() {
b.bfExactInputDom.checked ? (c.show(b.bfExactDom), c.hide(b.bfFuzzyDom)) : (alloy.util.loclist.isDataLoaded() ? ba() : alloy.util.loclist.loadData(ba), c.hide(b.bfExactDom), c.show(b.bfFuzzyDom))
},
ba = function() {
b.basicList.innerHTML = '\t\t\t\t<dt class="dItem_s">\u56fd\u5bb6\uff1a</dt>\t\t\t\t<dt class="dItem_s">\u7701\u4efd\uff1a</dt>\t\t\t\t<dd class="dItem_s"><div id ="bf_country_' + e + '"></div></dd>\t\t\t\t<dd class="dItem_s"><div id ="bf_state_' + e + '"></div></dd>\t\t\t\t<dt class="dItem_s">\u57ce\u5e02\uff1a</dt>\t\t\t\t<dt class="dItem_r">\u5e74\u9f84\uff1a</dt>\t\t\t\t<dt class="dItem_r">\u6027\u522b\uff1a</dt>\t\t\t\t<div style ="clear:both"></div>\t\t\t\t<dd class="dItem_s"><div id ="bf_city_' + e + '"></div></dd>\t\t\t\t<dd class="dItem_r"><div id ="bf_age_' + e + '"></div></dd>\t\t\t\t<dd class="dItem_r"><div id ="bf_gender_' + e + '"></div></dd>\t\t\t\t<dt class="dItem_s">\u8bed\u8a00\uff1a</dt>\t\t\t\t<dt class="dItem_s"></dt>\t\t\t\t<dd class="dItem_s"><div id ="bf_lang_' + e + '"></div></dd>\t\t\t\t<dd class="dItem_s" style="position:relative"><label class="lb_online"><input type="checkbox" id="bf_online_' + e + '" class ="online">\u5728\u7ebf</label></dd>\t\t\t\t';
b.locData = alloy.util.loclist.LOCLIST.Location;
var a;
a = b.locData.CountryRegion;
a = h.isObject(a) ? [a] : a;
b.countryRegion = a;
f.bfData.country.data[0] = ["0", "-"];
f.bfData.state.data[0] = ["0", "-"];
f.bfData.city.data[0] = ["0", "-"];
if (b.countryRegion) for (a = 0; a < b.countryRegion.length; a++) f.bfData.country.data[a + 1] = [],
f.bfData.country.data[a + 1][0] = a + 1,
f.bfData.country.data[a + 1][1] = b.countryRegion[a]._Name;
b.countrySelect = new h.ui.DivSelect("bf_country_" + e, "bf_country", alloy.app.buddyFinder.bfData.country, 0, 200);
g.addObserver(b.countrySelect, "selectedChanged", za);
b.stateSelect = new h.ui.DivSelect("bf_state_" + e, "bf_state", alloy.app.buddyFinder.bfData.state, 0, 200);
b.citySelect = new h.ui.DivSelect("bf_city_" + e, "bf_city", alloy.app.buddyFinder.bfData.city, 0, 200);
b.ageSelect = new h.ui.DivSelect("bf_age_" + e, "bf_age", alloy.app.buddyFinder.bfData.age, 0, 90);
b.genderSelect = new h.ui.DivSelect("bf_gender_" + e, "bf_gender", alloy.app.buddyFinder.bfData.gender, 0, 90);
b.langSelect = new h.ui.DivSelect("bf_lang_" + e, "bf_lang", alloy.app.buddyFinder.bfData.lang, 0, 200, !0);
b.onlineCheck = c.id("bf_online_" + e)
},
J = function() {
var a = /^\d*$/,
c = h.string.trim(b.bfAccoutInputDom.value),
d = !1;
c && !(c < 1E4 || !a.test(c) || c > 1E12) ? d = !0 : h.string.isEmail(c) && (d = !0);
return d
},
ua = function() {
if (b.bfAccoutInputDom.value != "") return !1;
c.addClass(b.bfAccoutInputDom, "gray");
b.bfAccoutInputDom.value = "\u8bf7\u8f93\u5165\u5bf9\u65b9\u6570\u5b57\u5e10\u53f7\u6216Email\u5e10\u53f7"
},
ta = function() {
b.bfAccoutInputDom.value == "\u8bf7\u8f93\u5165\u5bf9\u65b9\u6570\u5b57\u5e10\u53f7\u6216Email\u5e10\u53f7" ? (c.removeClass(b.bfAccoutInputDom, "gray"), b.bfAccoutInputDom.value = "") : this.select()
},
va = function(a) {
a.keyCode == 13 ? J() ? K(a) : (b.tBox.innerHTML = "\u60a8\u8f93\u5165\u7684\u6570\u5b57\u5e10\u53f7\u6216Email\u5e10\u53f7\u6709\u8bef\uff01", c.setStyle(b.tBox, "display", "block")) : c.setStyle(b.tBox, "display", "none")
},
xa = function() {
if (b.bfNickInputDom.value != "") return !1;
c.addClass(b.bfNickInputDom, "gray");
b.bfNickInputDom.value = "\u8bf7\u8f93\u5165\u5bf9\u65b9\u6635\u79f0"
},
wa = function() {
b.bfNickInputDom.value == "\u8bf7\u8f93\u5165\u5bf9\u65b9\u6635\u79f0" ? (c.removeClass(b.bfNickInputDom, "gray"), b.bfNickInputDom.value = "") : this.select()
},
ya = function(a) {
a.keyCode == 13 && K(a)
},
K = function(a) {
q = 0;
if (b.bfExactInputDom.checked && !H() && !G()) return b.bfAccoutInputDom.focus(),
!1;
Y.call(this, a)
},
za = function() {
var a = b.countrySelect.value(),
d = b.countrySelect.text();
if (a == "0") f.bfData.state.data = [],
f.bfData.state.data[0] = ["0", "-"],
c.id("bf_state_" + e).innerHTML = "",
b.stateSelect = new h.ui.DivSelect("bf_state_" + e, "bf_state", alloy.app.buddyFinder.bfData.state, 0, 200);
else {
a < 1 ? a = void 0 : (a = b.countryRegion[a - 1].State, a = h.isObject(a) ? [a] : a);
b.state = a;
f.bfData.state.data = [];
f.bfData.state.data[0] = ["0", "-"];
if (b.state) for (a = 0; a < b.state.length; a++) f.bfData.state.data[a + 1] = [],
f.bfData.state.data[a + 1][0] = a + 1,
f.bfData.state.data[a + 1][1] = b.state[a]._Name || d;
c.id("bf_state_" + e).innerHTML = "";
b.stateSelect = new h.ui.DivSelect("bf_state_" + e, "bf_state", alloy.app.buddyFinder.bfData.state, 0, 200);
g.addObserver(b.stateSelect, "selectedChanged", Aa);
f.bfData.city.data = [];
f.bfData.city.data[0] = ["0", "-"];
c.id("bf_city_" + e).innerHTML = "";
b.citySelect = new h.ui.DivSelect("bf_city_" + e, "bf_city", alloy.app.buddyFinder.bfData.city, 0, 200)
}
},
Aa = function() {
var a = b.stateSelect.value();
if (a == "0") f.bfData.city.data = [],
f.bfData.city.data[0] = ["0", "-"],
c.id("bf_city_" + e).innerHTML = "",
b.citySelect = new h.ui.DivSelect("bf_city_" + e, "bf_city", alloy.app.buddyFinder.bfData.city, 0, 200);
else {
a < 1 ? a = void 0 : (a = b.state[a - 1].City, a = h.isObject(a) ? [a] : a);
b.city = a;
f.bfData.city.data = [];
f.bfData.city.data[0] = ["0", "-"];
if (b.city) for (a = 0; a < b.city.length; a++) f.bfData.city.data[a + 1] = [],
f.bfData.city.data[a + 1][0] = a + 1,
f.bfData.city.data[a + 1][1] = b.city[a]._Name;
c.id("bf_city_" + e).innerHTML = "";
b.citySelect = new h.ui.DivSelect("bf_city_" + e, "bf_city", alloy.app.buddyFinder.bfData.city, 0, 200, !0)
}
},
ca = function() {
var a = qqweb.util.group.getTopCatalog(),
b = "<ul>",
e = "",
f;
for (f in a) f == 20 ? e = '<li><a href="###" class="sgClass" cid="' + f + '">' + a[f] + "</a></li>" : b += '<li><a href="###" class="sgClass" cid="' + f + '">' + a[f] + "</a></li>";
b += e + "</ul>";
d.classBox.innerHTML = b;
a = c.mini(".sgClass", d.classBox);
for (f in a) g.on(a[f], "click",
function(a) {
a.preventDefault();
j.c1 = this.getAttribute("cid");
L(0)
})
},
da = function() {
var a = /^\d*$/,
c = h.string.trim(d.gfAccoutInputDom.value),
b = !1;
if (c && !(c < 1E4 || !a.test(c) || c > 1E12)) b = !0;
return b
},
ea = function() {
d.gfExactInputDom.checked ? (c.show(d.gfExactDom), c.hide(d.gfFuzzyDom), c.hide(d.cBox)) : (qqweb.util.group.isLoadData() ? ca() : qqweb.util.group.loadGroupClass(ca), c.hide(d.gfExactDom), c.show(d.gfFuzzyDom), c.show(d.cBox), this._groupListInit = !0)
},
Ba = function() {
if (d.gfAccoutInputDom.value != "") return !1;
c.addClass(d.gfAccoutInputDom, "gray");
d.gfAccoutInputDom.value = "\u8bf7\u8f93\u5165\u7fa4\u53f7\u7801"
},
Ca = function() {
d.gfAccoutInputDom.value == "\u8bf7\u8f93\u5165\u7fa4\u53f7\u7801" ? (c.removeClass(d.gfAccoutInputDom, "gray"), d.gfAccoutInputDom.value = "") : this.select()
},
Da = function(a) {
a.keyCode == 13 ? da() ? M(a) : (d.tBox.innerHTML = "\u60a8\u8f93\u5165\u7684\u7fa4\u53f7\u7801\u6709\u8bef\uff01", c.setStyle(d.tBox, "display", "block")) : c.setStyle(d.tBox, "display", "none")
},
Ea = function() {
if (d.gfKeyInputDom.value != "") return !1;
c.addClass(d.gfKeyInputDom, "gray");
d.gfKeyInputDom.value = "\u8bf7\u8f93\u5165\u5173\u952e\u8bcd\u6216\u5173\u952e\u8bcd\u7ec4\u5408"
},
Fa = function() {
d.gfKeyInputDom.value == "\u8bf7\u8f93\u5165\u5173\u952e\u8bcd\u6216\u5173\u952e\u8bcd\u7ec4\u5408" ? (c.removeClass(d.gfKeyInputDom, "gray"), d.gfKeyInputDom.value = "") : this.select()
},
Ga = function(a) {
a.keyCode == 13 && M(a)
},
M = function() {
if ((c.hasClass(d.gfAccoutInputDom, "gray") || d.gfAccoutInputDom.value == "" || d.gfAccoutInputDom.value == "\u8bf7\u8f93\u5165\u7fa4\u53f7\u7801") && (c.hasClass(d.gfFuzzyInputDom, "gray") || d.gfFuzzyInputDom.value == "" || d.gfKeyInputDom.value == "\u8bf7\u8f93\u5165\u5173\u952e\u8bcd\u6216\u5173\u952e\u8bcd\u7ec4\u5408")) return d.gfExactDom.checked ? d.gfAccoutInputDom.focus() : d.gfKeyInputDom.focus(),
!1;
j = {
page: 1
};
j.key = d.gfAccoutInputDom.value;
var a = 1;
if (d.gfFuzzyInputDom.checked) j.key = d.gfKeyInputDom.value,
a = 2;
L(a);
switch (a) {
case 0:
case 2:
alloy.util.report2im("fgsearch|gspanel|keyword");
break;
case 1:
alloy.util.report2im("fgsearch|gspanel|accurate")
}
},
L = function(a) {
y = "result";
g.notifyObservers(f, "stepChanged");
E = 1;
j.isEndData = !1;
if (a == 0) d.gfKeyDom.checked = !0,
a = d.gfKeyInputDom.value,
d.gfKeyInputDom.value == "\u8bf7\u8f93\u5165\u5173\u952e\u8bcd\u6216\u5173\u952e\u8bcd\u7ec4\u5408" && (a = ""),
j.key = a;
d.resultBox.innerHTML = '<div class="loading">\u8f7d\u5165\u4e2d...</div>';
A()
},
Ha = function() {
if (!d.gfKeyDom.checked || j.isEndData) return !1;
clearTimeout(Q);
var a = this;
Q = setTimeout(function() {
E++;
if (E > 30) return !1;
if (a.scrollHeight - a.scrollTop < 270) j.page = j.page || 1,
++j.page,
A()
},
1E3)
},
A = function(a) {
a = {
pg: j.page || 1,
perpage: 10,
all: j.key || "",
c1: j.c1 || 0,
c2: j.c2 || 0,
c3: j.c3 || 0,
st: 0,
vfcode: a || ""
};
a.type = h.isUndefined(j.key) || j.key == "" ? 0 : d.gfKeyDom.checked ? 0 : 1;
if (r) return !1;
qqweb.rpcService.sendSearchGroup({
data: a,
onSuccess: fa,
onError: fa,
context: this
});
r = setTimeout(function() {
r && (clearTimeout(r), r = null)
},
3E3)
},
fa = function(a) {
r && (clearTimeout(r), r = null);
var b = c.mini("ul", d.resultBox);
if (a.retcode == 100110) Ia(a.arguments);
else if (a.retcode == 0) {
if (b.length < 1) d.resultBox.innerHTML = "",
a.result.length < 1 && ga();
Ja(a)
} else b.length < 1 && ga()
},
Ia = function() {
n = alloy.layout.getWindowManager().createWindow("Window", {
title: "\u8eab\u4efd\u9a8c\u8bc1",
modeSwitch: !0,
dragable: !0,
resize: !0,
width: 400,
height: 123,
x: l.getX() + 60,
y: l.getY() + 90,
hasCloseButton: !0,
hasOkButton: !0,
isSetCentered: !1
});
n.setWindowCenteredRelative(f.window);
n.setHtml('<div style="width:100%; height:100%; background-color:#FFFFFF; line-height:30px;">\t\t\t\t\t\t\t<div style="margin-left:10px;">\t\t\t\t\t\t\t\t<div>\u4e3a\u4e86\u60a8\u7684\u8d26\u53f7\u5b89\u5168\uff0c\u8bf7\u6267\u884c\u8eab\u4efd\u9a8c\u8bc1\uff0c\u5728\u8f93\u5165\u6846\u8f93\u5165\u4e0b\u56fe\u4e2d\u7684\u9a8c\u8bc1\u7801</div>\t\t\t\t\t\t\t\t<div>\u9a8c\u8bc1\u7801:  <input id="buddyfinder_input_code" type="text" style ="vertical-align:middle;" />  <span id="buddyfinder_code_gf" style="color:red"></span></div>\t\t\t\t\t\t\t\t<img style="float:left;margin-right:10px" id="buddyfinder_img_code" src="" />\t\t\t\t\t\t\t\t<a href="###" style="display:inline;line-height:60px;" id="buddyfinder_a_code" alt="\u770b\u4e0d\u6e05\u6362\u4e00\u5f20" href="">\u770b\u4e0d\u6e05\u6362\u4e00\u5f20</a>\t\t\t\t\t\t\t\t<div id="buddyfinder_img_code_wrong" style="display:none;color:red;width:65px;">\u9a8c\u8bc1\u7801\u9519\u8bef</div>\t\t\t\t\t\t\t</div>\t\t\t\t\t\t</div>');
var a = c.id("buddyfinder_img_code"),
b = c.id("buddyfinder_a_code"),
d = c.id("buddyfinder_input_code"),
e = null;
g.on(a, "load",
function() {
e = h.cookie.get("verifysession", EQQ.CONST.MAIN_DOMAIN)
});
g.on(b, "click",
function(a) {
a.preventDefault();
c.id("buddyfinder_img_code").src = "http://captcha.qq.com/getimage?aid=1003901&" + (new Date).getTime()
});
g.addObserver(n, "clickOkButton",
function() {
var a = d.value;
if (a && e) return A(a),
!0;
d.focus();
c.id("buddyfinder_code_gf").innerHTML = "\u8bf7\u5148\u8f93\u5165\u9a8c\u8bc1\u7801\uff01";
return !1
});
d.focus();
g.on(d, "keydown",
function(a) {
if (a.keyCode == 13 && (a = d.value) && e) return A(a),
n.close(),
!0
});
c.id("buddyfinder_img_code").src = "http://captcha.qq.com/getimage?aid=1003901&" + (new Date).getTime()
},
ga = function() {
var a = '<div class="resultMsgBox">';
a += d.gfKeyDom.checked ? "\u62b1\u6b49\uff0c\u6ca1\u6709\u60a8\u8981\u67e5\u627e\u7684\u7fa4<br>\t\t\t\t\t\t \u5efa\u8bae\u60a8\uff1a<br>\t\t\t\t\t\t<p>•\u66f4\u6362\u641c\u7d22\u5173\u952e\u5b57\u518d\u8bd5\uff0c\u7fa4\u540d\u79f0\u5efa\u8bae\u4e0d\u8981\u4f7f\u75281)\u751f\u50fb\u7684\u8bcd\u7ec42)\u706b\u661f\u6587</p>\t\t\t\t\t\t<p>•\u5c1d\u8bd5\u641c\u7d22\u5173\u952e\u8bcd\u7ec4\u5408\u6765\u67e5\u627e\u7fa4</p>" : "\u62b1\u6b49\uff0c\u6ca1\u6709\u60a8\u8981\u67e5\u627e\u7684\u7fa4";
a += "</div>";
d.resultBox.innerHTML = a
},
Ja = function(a) {
var b = c.mini(".loading", d.resultBox);
if (s(b) && b.length > 0) d.resultBox.innerHTML = "",
d.resultBox.scrollTop = 0;
if (a.result.length < 1) return j.isEndData = !0,
!1;
var b = "<ul>",
i;
for (i in a.result) {
var f = a.result[i];
b += "<li>";
b += '<div class="groupAvatar"><div class="ty' + f.GD + '"></div><img class="avatar" src="' + EQQ.getGroupAvatar(f.GEX) + '" /></div>';
b += '<div class="itemBox">\t\t\t\t\t\t\t<span class="fl"><a href="###" gcode="' + f.GEX + '" class="gName">' + f.TI + '</a></span>\t\t\t\t\t\t\t<span class="fl gray">(' + f.GE + ')</span>\t\t\t\t\t\t\t<span class="fl"><a target="_blank" href="http://qun.qq.com/air/#level"><div class="level lv' + f.LEVEL + '"></div></a></span>\t\t\t\t\t\t\t<div class="appylyJoin" gcode="' + f.GEX + '"><span class="iconJoin"></span><a href="###">\u7533\u8bf7\u52a0\u5165</a></div>\t\t\t\t\t\t\t<div class="viewDetail" gcode="' + f.GEX + '"><span class="iconDetail"></span><a href="###">\u8be6\u7ec6\u8d44\u6599</a></div>\t\t\t\t\t\t </div>';
f.GC != "" && f.RQ != "" && (b += '<div class="itemBox">\t\t\t\t\t\t\t\t<div class="fl">' + f.GC + '\u4eba |\t\t\t\t\t\t\t\t<span id="gClass_' + e + "_" + f.GE + "_" + f.GB + '" class="gClass"></span> |\t\t\t\t\t\t\t\t' + Ka(f.RQ) + '\u521b\u5efa |\t\t\t\t\t\t\t\t</div><span class="act' + (f.GA < 1 ? 0 : f.GA < 17 ? 1 : f.GA < 35 ? 2 : f.GA < 80 ? 3 : f.GA < 137 ? 4 : 5) + '"></span>\t\t\t\t\t\t\t </div>');
b += '<div class="itemBox">' + f.TX + "</div>";
b += "</li>"
}
i = document.createElement("div");
i.id = "groupList_" + j.page;
i.innerHTML = b;
d.resultBox.appendChild(i);
setTimeout(function() {
for (var b in a.result) {
var e = a.result[b];
La(e.GE, e.GB, e.CL)
}
e = c.mini(".sgClass", c.id("groupList_" + j.page));
for (b in e) {
var f = e[b];
g.on(f, "click",
function(a) {
a.preventDefault();
j.c1 = this.getAttribute("cid");
a = this.getAttribute("cid2");
if (s(a)) j.c2 = a;
a = this.getAttribute("cid3");
if (s(a)) j.c3 = a;
L(0)
})
}
e = c.mini(".gName", d.resultBox);
for (b in e) f = e[b],
g.on(f, "click", ha);
var e = c.mini(".viewDetail", d.resultBox),
i = d.gfKeyDom.checked ? !0 : !1;
for (b in e) if (f = e[b], i) c.hide(f);
else g.on(f, "click", ha);
e = c.mini(".appylyJoin", d.resultBox);
for (b in e) f = e[b],
g.on(f, "click", Ma)
},
0)
},
ha = function(a) {
a.preventDefault();
a = {
gid: "",
gcode: Number(this.getAttribute("gcode")),
from: "groupSystemMsg"
};
qqweb.portal.runApp("groupDetails", a);
alloy.util.report2im("fgsearch|gspanel|gresult1|details")
},
La = function(a, b, d) {
if (!s(b) || !b || !d) return !1;
var d = d.replace(";", ""),
d = d.split(":"),
f = '<a href="###" class="sgClass" cid="' + d[0] + '" >' + qqweb.util.group.getCtlgNameById(d[0]) + "</a>";
s(d[1]) && d[1] != "" && (f += '-<a href="###" class="sgClass" cid="' + d[0] + '" cid2="' + d[1] + '">' + qqweb.util.group.getCtlgNameById(d[1]) + "</a>");
s(d[2]) && d[2] != "" && (f += '-<a href="###" class="sgClass" cid="' + d[0] + '" cid2="' + d[1] + '" cid3="' + d[2] + '">' + qqweb.util.group.getCtlgNameById(d[2]) + "</a>");
d[0] == "" && (f = "\u672a\u5206\u7c7b");
c.id("gClass_" + e + "_" + a + "_" + b).innerHTML = f
},
Ma = function(a) {
a.preventDefault();
a = Number(this.getAttribute("gcode"));
qqweb.rpcService.sendGetGroupPublicInfo(a, {
gcode: a
},
qqweb.app.buddyFinder.onGetGroupPublicInfoSuccess,
function() { });
alloy.util.report2im("fgsearch|gspanel|gresult1|add")
};
this.onGetGroupPublicInfoSuccess = function(a) {
var b = 1;
if (a.retcode == 0) {
var f = a.result.ginfo;
f.member_cnt >= f.maxmember && (b = 2);
f.option == 3 && (b = 3);
EQQ.Model.BuddyList.getGroupByCode(f.code) && (b = 5)
} else b = 4;
m ? (d.joinBox.innerHTML = '<div class="loading">\u8f7d\u5165\u4e2d...</div>', m.setHeight(b == 1 ? 330 : 200), m.show(), m.setCurrent()) : (m = alloy.layout.getWindowManager().createWindow("Window", {
title: "\u7533\u8bf7\u52a0\u5165",
modeSwitch: !1,
dragable: !0,
resize: !1,
width: 380,
height: b == 1 ? 330 : 200,
hasCloseButton: !0,
hasOkButton: !0,
hasCancelButton: !0
}), a = '<div class="joinGroupBox" id="joinGroupBox_' + e + '">\t\t\t\t\t\t\t\t<div class="loading">\u8f7d\u5165\u4e2d...</div>\t\t\t\t\t\t\t </div>', m.setHtml(a), g.addObserver(m, "close", Na), g.addObserver(m, "clickOkButton", Oa), g.addObserver(m, "clickCancelButton", Pa), d.joinBox = c.id("joinGroupBox_" + e));
d.joinBox.gcode = b == 1 ? f.code : 0;
b == 1 ? (b = '<div>\u9700\u8981\u901a\u8fc7\u7fa4\u7ba1\u7406\u5458\u9a8c\u8bc1\u540e\u624d\u80fd\u52a0\u5165\u7fa4</div>\t\t\t\t\t\t\t <div class="checkInput"><textarea class="gray" id="gfCheckReason_' + e + '" name="reason" >\u8bf7\u586b\u5199\u9a8c\u8bc1\u4fe1\u606f</textarea></div>\t\t\t\t\t\t\t <div>\u9a8c\u8bc1\u7801\uff1a<input id="gfCheckCode_' + e + '" type="text" maxlength="8" /></div>\t\t\t\t\t\t\t <div class="codeBox">\t\t\t\t\t\t\t\t<span class="gray">\u8f93\u5165\u4e0b\u56fe\u4e2d\u7684\u5b57\u7b26\uff0c\u4e0d\u533a\u5206\u5927\u5c0f\u5199\uff1a</span><br>\t\t\t\t\t\t\t\t<img id="gfJvImage_' + e + '" src="http://ptlogin2.qq.com/getimage?aid=1003903&_=' + (new Date).getTime() + '" title="\u770b\u4e0d\u6e05,\u6362\u4e00\u5f20\uff1f\u70b9\u51fb\u66f4\u65b0\u9a8c\u8bc1\u7801" alt="\u770b\u4e0d\u6e05,\u6362\u4e00\u5f20\uff1f\u70b9\u51fb\u66f4\u65b0\u9a8c\u8bc1\u7801" class="jvImage">\t\t\t\t\t\t\t\t<a class="jvLink" id="gfRefreshCode_' + e + '" href="###">\u770b\u4e0d\u6e05\uff0c\u6362\u4e00\u5f20\uff01</a>\t\t\t\t\t\t\t</div>', d.joinBox.innerHTML = b, d.joinReason = c.id("gfCheckReason_" + e), d.joinCheckCode = c.id("gfCheckCode_" + e), d.refreshCode = c.id("gfRefreshCode_" + e), g.on(d.refreshCode, "click", Qa), g.on(d.joinReason, "focus", Ra), g.on(d.joinReason, "blur", Sa), g.on(d.joinReason, "keyup", Ta)) : (d.joinCheckCode = null, f = "\u5bf9\u4e0d\u8d77\uff0c\u8be5\u7fa4\u4eba\u6570\u5df2\u8fbe\u4e0a\u9650\u3002", b == 3 ? f = "\u5bf9\u4e0d\u8d77\uff0c\u8be5\u7fa4\u7981\u6b62\u52a0\u5165\u3002" : b == 4 ? f = "\u7cfb\u7edf\u7e41\u5fd9\uff0c\u7a0d\u5019\u518d\u8bd5\u3002" : b == 5 && (f = "\u60a8\u5df2\u662f\u672c\u7fa4\u6210\u5458\u3002"), d.joinBox.innerHTML = '<div class="msgBox">' + f + "</div>")
};
var Ra = function() {
if (d.joinReason.value == "\u8bf7\u586b\u5199\u9a8c\u8bc1\u4fe1\u606f") c.removeClass(d.joinReason, "gray"),
d.joinReason.value = ""
},
Sa = function() {
if (d.joinReason.value == "") c.addClass(d.joinReason, "gray"),
d.joinReason.value = "\u8bf7\u586b\u5199\u9a8c\u8bc1\u4fe1\u606f"
},
Ta = function() {
ia(d.joinReason, 10)
},
Qa = function(a) {
a.preventDefault();
c.id("gfJvImage_" + e).src = "http://ptlogin2.qq.com/getimage?aid=1003903&_=" + (new Date).getTime()
},
Pa = function() {
m.hide();
return !1
},
Na = function() {
m = null
},
Oa = function() {
if (s(d.joinCheckCode) && d.joinCheckCode != null) {
if (d.joinCheckCode.value == "") return d.joinCheckCode.focus(),
!1;
var a = {
gcode: d.joinBox.gcode,
code: d.joinCheckCode.value,
vfy: h.cookie.get("verifysession"),
msg: d.joinReason.value
};
Ua(a)
}
return !0
},
Ua = function(a) {
a.vfwebqq = qqweb.portal.getVfWebQQ();
qqweb.rpcService.send(qqweb.CONST.API_SERVER_URL + "apply_join_group2", {
context: this,
method: "POST",
data: {
r: h.json.stringify(a)
},
arguments: {},
onSuccess: function(a) {
a.retcode === 0 ? alloy.layout.alert("\u8bf7\u6c42\u5df2\u53d1\u9001\uff0c\u8bf7\u7b49\u5019\u9a8c\u8bc1\u3002") : (h.error("sendJoinGroup error:" + a.retcode), alloy.layout.alert("\u7533\u8bf7\u52a0\u5165\u5931\u8d25\uff0c\u8bf7\u7a0d\u5019\u518d\u8bd5\uff01"))
},
onError: function() {
h.error("sendJoinGroup error");
alloy.layout.alert("\u7533\u8bf7\u52a0\u5165\u5931\u8d25\uff0c\u8bf7\u7a0d\u5019\u518d\u8bd5\uff01")
}
})
};
this.init = function() {
hadSearchBuddy = hadSearchGroup = D = C = !1;
j = {};
l = f.window;
l.setTitle(f.option.title);
e += 1;
l.setHtml('\t\t\t\t\t\t<div class="buddyFinder_container">\t\t\t\t\t\t<div class="content_area">\t\t\t\t\t\t\t<div class="buddyFinder_tabHeadArea">\t\t\t\t\t\t\t\t<div id="tabBuddyHead_' + e + '">\u67e5\u627e\u597d\u53cb</div>\t\t\t\t\t\t\t\t<div id="tabGroupHead_' + e + '" >\u67e5\u627e\u7fa4</div>\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t<div class="buddyFinder_tabBodyArea finderBody">\t\t\t\t\t\t\t\t<div class="buddyFinder" id="tabBuddyBody_' + e + '">\t\t\t\t\t\t\t\t\t<div class="loading">\u8f7d\u5165\u4e2d...</div>\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t\t<div class="groupFinder" id="tabGroupBody_' + e + '" style="display:none">\t\t\t\t\t\t\t\t\t<div class="loading">\u8f7d\u5165\u4e2d...</div>\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t</div>\t\t\t\t\t\t</div>\t\t\t\t\t\t</div>\t\t\t\t');
l.data = {
buddyFinderHead: c.id("tabBuddyHead_" + e),
groupFinderHead: c.id("tabGroupHead_" + e),
buddyFinderBody: c.id("tabBuddyBody_" + e),
groupFinderBody: c.id("tabGroupBody_" + e)
};
l.tab = new h.ui.Tab;
l.tab.add({
trigger: l.data.buddyFinderHead,
sheet: l.data.buddyFinderBody
});
l.tab.add({
trigger: l.data.groupFinderHead,
sheet: l.data.groupFinderBody
});
l.tab.config.triggerEvent = "click";
l.tab.config.slideEnabled = !1;
l.tab.init();
f.setWindow(e, l);
g.addObserver(l.tab, "show", o.tabClick);
R == "group" ? l.tab.select(l.tab.tabs[1]) : aa()
};
var ja = function() {
var a = "";
return a = w == "buddy" ? w + "_" + u : w + "_" + y
},
o = {
onWindowCreate: function(a) {
a = a || {};
R = a.from || "buddy";
f._nextButton = f.window.getButtons().nextButton;
f._nextButton.setText("\u67e5\u627e");
g.addObserver(f.window, "clickNextButton", o.onClickNextButton);
g.addObserver(f, "stepChanged", o.onStepChanged);
this.init()
},
onRun: function(a) {
a.from == "group" && a.directJoin ? (f.window.hide(), a = a.directJoin, qqweb.rpcService.sendGetGroupPublicInfo(a, {
gcode: a
},
qqweb.app.buddyFinder.onGetGroupPublicInfoSuccess,
function() { })) : a.from == "buddy" && a.directJoin && (f.window.hide(), Z(a.directJoin))
},
onGetUserInfoSuccess: function(a) {
clearTimeout(t);
t = null;
if (v) a = a.result,
oa(a.uin, a);
v = !1
},
onGetUserTinyInfosSuccess: function(a) {
ma(a.result)
},
onGetUserInfosByTermsSuccess: function(a) {
o.onGetUserTinyInfosSuccess(a)
},
onWindowClose: function(a) {
m && m.close();
f.closeWindow(a.seed)
},
tabClick: function(a) {
switch (this.indexOf(a)) {
case 0:
w = "buddy";
aa();
g.notifyObservers(f, "stepChanged");
alloy.util.report2im("fgsearch|fspanel|tab");
break;
case 1:
w = "group";
if (!D) {
l.data.groupFinderBody.innerHTML = '<div class="container">\t\t\t\t\t\t\t<div class="sBox" id="gf_sBox_' + e + '">\t\t\t\t\t\t\t\t<div class="buddyFinder_endline">\u67e5\u627e\u65b9\u5f0f<hr class="line" /></div>\t\t\t\t\t\t\t\t<div class="sOptionBox">\t\t\t\t\t\t\t\t\t<div><input type="radio" name="gf_s" id="gf_sExatInput_' + e + '" checked="checked" class ="typeInput" />\u7cbe\u786e\u67e5\u627e</div>\t\t\t\t\t\t\t\t\t<div><input type="radio" name="gf_s" id="gf_sFuzzyInput_' + e + '" class ="typeInput" />\u6309\u5173\u952e\u8bcd\u67e5\u627e</div>\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t\t<div class="sIpBox" id ="gf_sExat_' + e + '">\t\t\t\t\t\t\t\t\t<p class ="sIpBox_Txt">\u7fa4\u53f7\u7801\uff1a</p>\t\t\t\t\t\t\t\t\t<input type="text" id="gf_account_' + e + '" value="\u8bf7\u8f93\u5165\u7fa4\u53f7\u7801" class="searchInput gray">\t\t\t\t\t\t\t\t\t<p class = "sIpBox_tips" id="gf_tips_' + e + '"></p>\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t\t<div class="sIpBox" id ="gf_sFuzzy_' + e + '" style="display:none;">\t\t\t\t\t\t\t\t\t<p class ="sIpBox_Txt">\u5173\u952e\u8bcd\uff1a</p>\t\t\t\t\t\t\t\t\t<input type="text" id="gf_key_' + e + '" value="\u8bf7\u8f93\u5165\u5173\u952e\u8bcd\u6216\u5173\u952e\u8bcd\u7ec4\u5408" class="searchInput gray">\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t<div class="rBox" id="gf_rBox_' + e + '" style="display:none;" >\t\t\t\t\t\t\t\t\t<div class="buddyFinder_endline">\u67e5\u627e\u7ed3\u679c<hr class="line" /></div>\t\t\t\t\t\t\t\t\t<div class="resultBox" id="gf_resultBox_' + e + '">\t\t\t\t\t\t\t\t\t\t<div class="loading">\u8f7d\u5165\u4e2d...</div>\t\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t<div class="cBox" id="gf_cBox_' + e + '" style="display:none;" >\t\t\t\t\t\t\t\t\t<div class="classTitle">\u6309\u5206\u7c7b\u67e5\u627e</div>\t\t\t\t\t\t\t\t\t<div class="classBox" id="gf_classBox_' + e + '">\t\t\t\t\t\t\t\t\t\t<div class="loading">\u8f7d\u5165\u4e2d...</div>\t\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t</div>\t\t\t\t\t\t</div>';
d.sBox = c.id("gf_sBox_" + e);
d.rBox = c.id("gf_rBox_" + e);
d.cBox = c.id("gf_cBox_" + e);
d.tBox = c.id("gf_tips_" + e);
d.resultBox = c.id("gf_resultBox_" + e);
d.classBox = c.id("gf_classBox_" + e);
var a = d.gfExactInputDom = c.id("gf_sExatInput_" + e),
b = d.gfFuzzyInputDom = d.gfKeyDom = c.id("gf_sFuzzyInput_" + e);
d.gfExactDom = c.id("gf_sExat_" + e);
d.gfFuzzyDom = c.id("gf_sFuzzy_" + e);
var i = d.gfAccoutInputDom = c.id("gf_account_" + e),
j = d.gfKeyInputDom = c.id("gf_key_" + e);
g.on(a, "click", ea);
g.on(b, "click", ea);
g.on(i, "focus", Ca);
g.on(i, "blur", Ba);
g.on(i, "keydown", Da);
g.on(j, "focus", Fa);
g.on(j, "blur", Ea);
g.on(j, "keydown", Ga);
g.addObserver(l, "close", o.onWindowClose);
g.on(d.resultBox, "scroll", Ha);
h.platform.iPad && new h.ui.TouchScroller(d.resultBox);
D = !0;
y = "search"
}
g.notifyObservers(f, "stepChanged");
alloy.util.report2im("fgsearch|gspanel|tab")
}
},
onClickNextButton: function(a) {
a: switch (ja()) {
case "buddy_search":
if (b.bfExactInputDom.checked && H() && !J()) {
b.tBox.innerHTML = "\u60a8\u8f93\u5165\u7684\u6570\u5b57\u5e10\u53f7\u6216Email\u5e10\u53f7\u6709\u8bef\uff01";
c.setStyle(b.tBox, "display", "block");
break a
}
K(a);
break;
case "buddy_result":
u = "search";
g.notifyObservers(f, "stepChanged");
b.bfExactInputDom.checked ? alloy.util.report2im("fgsearch|fspanel|fresult1|forward") : alloy.util.report2im("fgsearch|fspanel|fresult2|forward");
break;
case "group_search":
if (d.gfExactInputDom.checked && !da()) {
b.tBox.innerHTML = "\u60a8\u8f93\u5165\u7684\u7fa4\u53f7\u7801\u6709\u8bef\uff01";
c.setStyle(d.tBox, "display", "block");
break a
}
M(a);
break;
case "group_result":
y = "search",
g.notifyObservers(f, "stepChanged"),
d.gfExactInputDom.checked ? alloy.util.report2im("fgsearch|gspanel|gresult1|forward") : alloy.util.report2im("fgsearch|fspanel|gresult2|forward")
}
},
onStepChanged: function() {
switch (ja()) {
case "buddy_search":
c.hide(b.rBox);
c.show(b.sBox);
f._nextButton.setText("\u67e5\u627e");
break;
case "buddy_result":
c.hide(b.sBox);
c.show(b.rBox);
f._nextButton.setText("\u4e0a\u4e00\u6b65");
break;
case "group_search":
c.hide(d.rBox);
c.show(d.sBox);
d.gfFuzzyInputDom.checked && c.show(d.cBox);
f._nextButton.setText("\u67e5\u627e");
break;
case "group_result":
c.show(d.rBox),
c.hide(d.sBox),
c.hide(d.cBox),
f._nextButton.setText("\u4e0a\u4e00\u6b65")
}
}
};
g.addObserver(this, "run", o.onRun);
g.addObserver(this, "runFirst", o.onWindowCreate);
this.setWindow = function(a, b) {
B[a] = b;
b.seed = a
};
this.closeWindow = function(a) {
delete B[a];
return !0
};
this.getWindow = function(a) {
return B[a]
};
var Ka = function(a) {
try {
a = parseInt(a) * 1E3
} catch (b) {
return ""
}
var c = new Date;
c.setTime(a);
var a = c.getFullYear(),
d = c.getMonth() + 1,
c = c.getDate();
d < 10 && (d = "0" + d);
c < 10 && (c = "0" + c);
return a.toString() + "-" + d + "-" + c
},
s = function(a) {
return typeof a == "undefined" ? !1 : !0
},
ia = function(a, b) {
var c = String(a.value);
if (h.string.byteLength(c) > b) a.value = h.string.cutRight(c, 1),
ia(a, b)
},
V = function(a) {
return a < 1 ? 0 : b.countryRegion[a - 1]._Code
},
W = function(a) {
return a < 1 ? 0 : b.state[a - 1]._Code
},
X = function(a) {
return a < 1 ? 0 : b.city[a - 1]._Code
}
});