---
title: "发送好友邀请页面实现"
author: "mjs123"
date: "2010-07-07T11:07:46Z"
tags: []
categories: ["Web前端"]
slug: "untitled"
draft: false
lastmod: "2010-07-07T11:07:46Z"
id: 707206
url: "https://mjs123.iteye.com/blog/707206"
---

&lt;%@ page language="java" contentType="text/html; charset=utf-8"  
    pageEncoding="utf-8"%&gt;  
&lt;%@ page import="com.siku.manorage.common.renrenApi.QiDianApi" %&gt;  
&lt;%@ taglib prefix="s" uri="/struts-tags"%&gt;  
&lt;%@ page import="java.util.\*" %&gt;  
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd](http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd)"&gt;  
&lt;html xmlns="[http://www.w3.org/1999/xhtml](http://www.w3.org/1999/xhtml)"&gt;  
&lt;head&gt;  
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;  
&lt;title&gt;庄园时代&lt;/title&gt;  
&lt;style type="text/css"&gt;  
\* {  
 margin: 0px;  
 padding: 0px;  
}

body {  
 font-size: 12px;  
 color: #333333  
}

a {  
 color: #895f02;  
 text-decoration: none;  
}

a:hover {  
 color: #bb943e;  
 text-decoration: underline;  
}

ul,ul li {  
 list-style: none;  
 padding: 0px;  
 margin: 0px;  
}

.box {  
 width: 700px;  
 margin: 10px 0;  
}

.cont {  
 width: 95%;  
 margin-left: auto;  
 margin-right: auto;  
}

h3 {  
 padding: 0px;  
 margin: 0px;  
}

.box h3 {  
 line-height: 30px;  
 text-align: center;  
 font-size: 15px;  
}

.cont\_msg {  
 width: 95%;  
 border: solid 1px #ccc;  
 margin: 10px 0;  
 height: 400px;  
 line-height: 22px;  
 /\*\*/  
 overflow: scroll;  
}

.cont\_msg ul {  
 width: 98%;  
 margin-top: 10px;  
 margin-bottom: 10px;  
 /\*margin:10px;  
width:21%;  
list-style:none;  
border:solid 1px #CCC;\*/  
}

.cont\_msg ul li {  
 float: left;  
 line-height: 21px;  
 list-style: none;  
 text-align: center;  
 display: inline;  
 margin-left: 20px;  
 margin-top: 15px;  
}

.cont\_msg ul li img {  
 width: 60px;  
 height: 60px;  
 padding: 2px;  
 border: solid 1px #ccc;  
}

.clear {  
 clear: both;  
}

.input {  
 background-color: #FFFFFF;  
 height: 16px;  
 width: 180px;  
 border: solid 1px #ccc;  
}

.btn a {  
 background-color: #d5ac4f;  
 padding: 0 8px;  
 line-height: 16px;  
 border: solid 1px #c39839;  
 text-align: center;  
 color: #fff;  
 float: left;  
 margin-right: 10px;  
 display: block;  
}

.btn a:hover {  
 color: #aa7e1d;  
 background-color: #dec282;  
 border: solid 1px #d1ab54;  
}

.tLeft {  
 float: left;  
 width: 225px;  
}

h3 {  
 color: #a77609;  
}  
&lt;/style&gt;

&lt;script&gt;  
   var ids="";  
   function fmsubmit(){  
  var userids=document.getElementsByName("uid");  
  for(var i=0;i&lt;userids.length;i++){  
   if(userids\[i].checked==true){  
    ids+=","+userids\[i].value;  
    alert(userids\[i].value);  
   }  
  }  
  var id = document.invitefm.sessionId.value;    
  if(ids!=""){  
   ids=ids.substr(1);  
   window.location.href="[http://192.168.1.119:8080/manorage/invite?ids="+ids+"&id="+id](http://192.168.1.119:8080/manorage/invite?ids=%22%20ids%20%22&id=%22%20id);  
  }else{  
   alert("请选择好友！！");  
   return false;  
  }  
    
    }  
&lt;/script&gt;  
&lt;/head&gt;

&lt;body&gt;

&lt;%  
   List&lt;HashMap&gt; list = new ArrayList&lt;HashMap&gt;();  
   Map map1 = new HashMap();  
   for(int i =0;i&lt;1;i++){  
    map1.put("1" ,"img/ph01.jpg");  
    map1.put("2" ,"张三");  
    map1.put("3" ,"12131");  
    list.add((HashMap) map1);  
   }  
    
%&gt;

&lt;div class="box"&gt;  
&lt;h3&gt;请选择您要添加的好友&lt;/h3&gt;  
&lt;br /&gt;  
&lt;div class="cont"&gt;  
&lt;p&gt;&lt;span class="tLeft"&gt;输入：&lt;input name="" type="text"  
 class="input" /&gt;&lt;/span&gt; &lt;span class="btn"&gt;&lt;a href="#"&gt;查找&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;  
&lt;div class="clear"&gt;&lt;/div&gt;

&lt;p&gt;  
&lt;form action="test" name="invitefm"&gt;  
&lt;input type="hidden" id="sessionId" value="&lt;%=request.getParameter("id")%&gt;"&gt;  
&lt;div class="cont\_msg"&gt;  
&lt;ul&gt;

&lt;%  
   for (HashMap hashMap : list) {   
       %&gt;  
        &lt;li&gt;&lt;a href="#"&gt;&lt;img src="&lt;%=hashMap.get("1") %&gt;" border="0" /&gt;&lt;br /&gt;  
         &lt;input name="uid" type="checkbox" id ="uid" value="&lt;%=hashMap.get("3") %&gt;" /&gt;  
 &lt;%=hashMap.get("2") %&gt;&lt;/a&gt;&lt;/li&gt;  
      
       &lt;%  
      }  
   %&gt;

 &lt;div class="clear"&gt;&lt;/div&gt;  
&lt;/ul&gt;  
&lt;div class="clear"&gt;&lt;/div&gt;  
&lt;/div&gt;

&lt;/p&gt;  
&lt;p&gt;&lt;span class="btn"&gt;&lt;a href="#" onclick="return fmsubmit();"&gt;发送好友请求&lt;/a&gt;&lt;/span&gt; &lt;span  
 class="btn"&gt;&lt;a href="#"&gt;跳过&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;  
&lt;/div&gt;  
&lt;/form&gt;  
&lt;/body&gt;  
&lt;/html&gt;