Example #1
0
	exports.HuyuInform = function (ele, success, error) {
		var _params = $.parseJSON(ele.attr("lang"));
		if (_params.Type && _params.Value && _params.Title) {
			nav.showLogin(function () {
				if ($("#" + inforLayerId).length == 0) {
					$("body").append(inforHtml);
				}
				$("#" + inforLayerId + " table tr:eq(0) td:eq(0) span").html(_params.Title);
				$("#" + inforLayerId + " [name='huyuinformtype']").attr("checked", false);
				$("#" + inforLayerId + " #huyuinformtype5").next().next().val("");
				tools.ShowLayer({
					"LayerID": inforLayerId,
					"SubmitID": "#" + inforLayerId + " input[type='submit']",
					"SubmitFun": function () {
						var ckt = $("#" + inforLayerId + " [name='huyuinformtype']:checked");
						var content = ckt.next().html();
						if (!content) {
							$.joy.showMsg("请选择举报类型");
							return false;
						}
						if (content == "其它") {
							content = $.trim(ckt.next().next().val());
							if (content == "") {
								$.joy.showMsg("请填写举报内容");
								return false;
							}
						}
						$.ajax({
							url: config.urls.myUrl + "/Message/UserInform.html",
							dataType: "jsonp",
							data: { InformValue: _params.Value, InformType: _params.Type, InformContent: content },
							type: "get",
							success: function (res) {
								if (res && res.ResultNo == 0) {
									success(ele, res);
								} else {
									error(ele, res);
								}
							},
							error: function () {
								error(ele);
							},
							complete: function () {
								$.joy.closeLayer(inforLayerId);
							}
						});
						return false;
					}
				});
			});
		}
	};
Example #2
0
		Follow: function (friendId, callback) {
			$passport.showLogin(function () {
				$.post("/AjaxJson/AddFollow.html", { userId: friendId }, function (data) {
					if (data.ResultNo == 0) {
						if (typeof (callback) == "function") {
							callback();
						}
					} else {
						layer.showMsg("关注失败!");
					}
				});
			});
		},