﻿/*首页幻灯片下产品*/
function GetProduct() {
//    http: //yi92010.yi9.com/product/productUnite.aspx?action=getProductByID&callback=?&PID=
    //var url = "http://yi92010.yi9.com/IndexHandler.ashx?Action=LoadProduct&CallBack=?";
    //    var url = "~/yi9shopNew/yi92010/IndexHandler.ashx?Action=LoadProduct&CallBack=?";
    //var url = "http://yi92010.yi9.com/Default.aspx?Action=LoadProduct&CallBack=?";
    //var url = "IndexHandler.ashx?Action=LoadProduct&CallBack=?";
    var url="http://yi92010.yi9.com/IndexHandler.ashx?Action=LoadProduct&CallBack=?";
    //alert(url);
    $.getJSON(url, function(json) {
        var htmlCode = "";
        //alert(htmlCode);
        for (var i = 0; i < json.ProductList.length; i++) {
            htmlCode += "<li>" +
                            "<div class='content_product_img'>" +
                                "<img class='rexiao' src='http://www.yi9.com/images/rexiao.gif'/>" +
                                "<a target='_blank' href='" + json.ProductList[i].FilePath + "'>" +
                                    "<img src='http://www.yi9.com/yi9ErpImages/" + json.ProductList[i].ImgSmall2 + "' width='139' height='148' title='" + json.ProductList[i].ChineseName + "' alt='" + json.ProductList[i].ChineseName + "'/>" +
                                "</a>" +
                             "</div>" +
                             "<div class='content_product_bg01'>" +
                                "<h1><a target='_blank' href='" + json.ProductList[i].FilePath + "'>" + json.ProductList[i].ChineseName + "</a></h1>" +
                              "<table cellspacing='0' cellpadding='0' border='0' align='left' width='100%' class='content_product_bg01_table'>" +
                                "<tbody>" +
                                    "<tr><td width='30%'>产地：</td><td width='70%'>" + json.ProductList[i].OriginCountryName + "</td></tr>" +
                                    "<tr><td style='height: 35px;'>等级：</td><td style='height: 35px;'>" + json.ProductList[i].ClassficationName + "</td></tr>" +
                                    "<tr><td>容量：</td><td>" + json.ProductList[i].CapacityName + "</td></tr>" +
                                    "<tr><td colspan='2'><p class='p01 mt_04'><font color='#6e4f41'><b>批发价(6支/箱):</b></font><span class='spak'>&yen;" + json.ProductList[i].ProductPrices.Price + "</span></p></td></tr>" +
                                    "<tr><td colspan='2' class='p02'>市场价:&yen;" + json.ProductList[i].ProductMarketPrice + "</td></tr>" +
                                    "<tr><td colspan='2'>" +
                                        "<div class='content_product_bimg02'>" +
                                            "<span><a href='javascript:buy(" + json.ProductList[i].ProductID + ",1)'>" +
                                                    "<img src='http://www.yi9.com/images/img_60.gif' width='66' height='20'/>" +
                                                   "</a>" +
                                             "</span>" +
                                             "<span class='ml_02'><a href='#'>" +
                                                                    "<img src='http://www.yi9.com/images/img_62.gif' width='65' height='20'/>" +
                                                                  "</a>" +
                                             "</span>" +
                                            "</div>" +
                                      "</td></tr>" +
                                 "</tbody>" +
                               "</table>" +
                            "</div>" +
                        "</li>";
        }
        //$("#productBody").html(json.Product.length);
       $("#productBody").html(htmlCode);
    });
}

/*
<li class="mff">
   <div class="content_product_img">
        <img class="rexiao" src="http://www.yi9.com/images/rexiao.gif" />
        <a target="_blank" href="http://www.yi9.com/products/20090423065014.html">
        <img src="http://www.yi9.com/yi9ErpImages/20091223111111.gif" width="139" height="148" title="玫瑰山庄之路西拉子干红葡萄酒" alt="玫瑰山庄之路西拉子干红葡萄酒" />
        </a>
   </div>
   <div class="content_product_bg01">
        <h1>
        <a target="_blank" href="http://www.yi9.com/products/20090423065014.html">玫瑰山庄之路西拉子干红葡萄酒</a></h1>
        <table cellspacing="0" cellpadding="0" border="0" align="left" width="100%" class="content_product_bg01_table">
               <tbody>
                  <tr><td width="40%">产地：</td>
                      <td width="60%">澳大利亚</td>
                  </tr>
                  <tr>
                      <td style="height: 35px;">等级:</td>
                      <td style="height: 35px;"> N/A</td>
                  </tr>
                  <tr>
                       <td>容量:</td>
                       <td>750毫升</td>
                   </tr>
                   <tr>
                        <td colspan="2">
                            <p class="p01 mt_04"><font color="#6e4f41"><b>易酒价：</b></font><span class="spak">￥ 158</span></p>
                        </td>
                    </tr>
                    <tr>
                         <td colspan="2" class="p02">市场价：￥180</td>
                    </tr>
                    <tr>
                         <td colspan="2">
                         <div class="content_product_bimg02"><span><a href="javascript:buy(127,1)">
                         <img src="http://www.yi9.com/images/img_60.gif" width="66" height="20" /></a></span>
                         <span class="ml_02"><a href="#">
                         <img src="http://www.yi9.com/images/img_62.gif" width="65" height="20" /></a></span></div>
                  
                  
                         </td>
                     </tr>
              </tbody>
       </table>
       <p class="clear"></p>
   </div>
</li>
*/
/*首页热销酒类产品*/
function GetHotProduct(){
      var url="http://yi92010.yi9.com/IndexHandler.ashx?Action=LoadHotProduct&CallBack=?"
      $.getJSON(url,function(json){
          var htmlCode="";
          for(var i=0;i<6;i++){
              htmlCode+="<li class='mff'>"+
                             "<div class='content_product_img'>"+
                                    "<img class='rexiao' src='http://www.yi9.com/images/rexiao.gif' />"+
                                    "<a target='_blank' href='"+json.ProductList[i].FilePath+"'>"+
                                        "<img src='http://www.yi9.com/yi9ErpImages/"+json.ProductList[i].ImgSmall2+"' width='139' height='148' title='"+json.ProductList[i].ChineseName+"' alt='"+json.ProductList[i].ChineseName+"' />"+
                                     "</a>"+
                               "</div>"+
                               "<div class='content_product_bg01'>"+
                                     "<h1>"+
                                           "<a target='_blank' href='"+json.ProductList[i].FilePath+"'>"+json.ProductList[i].ChineseName+"</a></h1>"+
                  "<table cellspacing='0' cellpadding='0' border='0' align='left' width='100%' class='content_product_bg01_table'>"+                           "<tbody>"+
                                 "<tr><td width='40%'>产地:</td>"+
                                      "<td width='60%'>"+json.ProductList[i].OriginCountryName+"</td>"+
                                  "</tr>"+
                                  "<tr>"+
                                        "<td style='height:35px;'>等级:</td>"+
                                        "<td style='height: 35px;'>"+json.ProductList[i].ClassficationName+"</td>"+
                                   "</tr>"+
                                   "<tr>"+
                                         "<td>容量:</td>"+
                                         "<td>"+json.ProductList[i].CapacityName+"</td>"+
                                    "</tr>"+
                                    "<tr>"+
                                          "<td colspan='2'>"+
                                          "<p class='p01 mt_04'><font color='#6e4f41'><b>批发价(6支/箱):</b></font>"+
                                          "<span class='spak'>&yen;"+json.ProductList[i].ProductPrices.Price+"</span></p>"+
                                          "</td>"+
                                    "</tr>"+
                                    "<tr>"+
                                           "<td colspan='2' class='p02'>市场价:&yen;"+json.ProductList[i].ProductMarketPrice+"</td>"+
                                    "</tr>"+
                                    "<tr>"+
                                          "<td colspan='2'>"+
                                               "<div class='content_product_bimg02'><span>"+
                                                     "<a href='javascript:buy("+json.ProductList[i].ProductID+",1)'>"+
                                                          "<img src='http://www.yi9.com/images/img_60.gif' width='66' height='20'/>"+
                                                     "</a></span>"+
                                                     "<span class='ml_02'><a href='#'>"+
                                                            "<img src='http://www.yi9.com/images/img_62.gif' width='65' height='20' /></a>"+
                                                     "</span></div>"+
                                            "</td>"+
                                       "</tr>"+
                               "</tbody>"+
                       "</table><p class='clear'></p></div>"+
                       "</li>";
          }
          $("#HotProduct").html(htmlCode);
      });
}
