码迷,mamicode.com
首页 > Web开发 > 详细

product页面加载信息ajax

时间:2015-07-08 20:37:59      阅读:126      评论:0      收藏:0      [点我收藏+]

标签:

js

//加载页面

技术分享
 1 //加载产品列表
 2 function GetProductList() {
 3     function PostParam(param) {
 4         param.key = "lm324";
 5         return param;
 6     }
 7     var PostExecParam = {
 8         ClassName: "AnxinE.BLL.Product.ProductInfoBLL",
 9         MethodName: "Search",
10         ParamModelName: "AnxinE.Model.Product.ProductInfoParam",
11         onRequest: PostParam,
12         onResponse: function (result) {
13             if (result != null) {
14                 var html = "";
15                 //汇率判断
16                 //<td>" + (result.SupplierProductList[i].ProductList[j].PriceUSD.toString() == ‘0‘ ? 1 : result.SupplierProductList[i].ProductList[j].USDPriceList[0].MinQuantity) + ":" + result.SupplierProductList[i].ProductList[j].PriceUSD + "</td>
17                 //展示搜索-产品信息列表
18                 for (var i = 0; i < result.SupplierProductList.length; i++) {
19                     for (var j = 0; j < result.SupplierProductList[i].ProductList.length; j++) {
20                         //if (result.SupplierProductList[i].ProductList[j].PriceUSD!=null) {
21 
22                         //}
23                         html += "<tr><td>" + result.SupplierProductList[i].ProductList[j].Model + "</td><td>" + result.SupplierProductList[i].ProductList[j].Manufacturer + "</td><td>" + (result.SupplierProductList[i].ProductList[j].Quantity) + "</td><td>" + result.SupplierProductList[i].ProductList[j].ShipDays + "</td><td>" + result.SupplierProductList[i].ProductList[j].MinOrderQuantity + "+</td><td>" + result.SupplierProductList[i].ProductList[i].DeliveryPoint + "</td><td>" + result.SupplierProductList[i].ProductList[j].PriceUSD + "</td><td>" + result.SupplierProductList[i].ProductList[j].PriceCNY + "</td><td><a href=‘‘>加入购物车</td></tr><br/>";
24                     }
25                 }
26                 //展示搜索--品牌列表
27                 var html2 = "<h2 class=‘cur1‘>全部</h2>";
28                 if (result.ManufacturerList.length > 0) {
29                     for (var i = 0; i < result.ManufacturerList.length ; i++) {
30                         if (result.ManufacturerList[i].KeyName != null) {
31                             if (i < 5) {
32                                 html2 += "<h2  href=‘javascript:void(0);‘ id=‘" + result.ManufacturerList[i].KeyName + "‘ onclick=‘Trademark(this)‘ >" + result.ManufacturerList[i].KeyName + "</h2>";
33                             }
34                         }
35                     }
36                     //<a href="javascript:void(0);" id="regain_r2">收回</a>
37                     html2 += "<a href=‘javascript:void(0);‘ id=‘more_r2‘ onclick=‘More_r2()‘>更多+</a>";
38                 }
39                 //不删除第一个内容,将产品信息表追加
40                 $("#r2_text2").not($(".cur1")).empty();
41                 $("#r2_text2").append(html2);
42                 //改写品牌行
43                 $(".tr3").empty();
44                 $(".tr3").append(html);
45             }
46         }
47     };
48     $.ajaxRequest(PostExecParam);
49 };
View Code

.cshtml

技术分享
 1  <div class="secect_r">
 2         <div class="top_right">
 3             <ul>
 4                 <li class="list1"><img src="~/MvcImages/ycysqd/sx_03.gif" /><p>筛选</p></li>
 5                 <li class="list2"><a href="">集成电路</a>&gt;&gt;</li>
 6                 @*<li class="list3"><a>INFINEON</a><span>&times;</span></li>
 7                 <li class="list3"><a>100-1000件</a><span>&times;</span></li>
 8                 <li class="list3"><a>国内</a><span>&times;</span></li>*@
 9             </ul>
10             <div class="r1"><h1>型号:</h1><div class="text1"><input id="typeofproduct" type="text" value="输入型号" /></div></div>
11             <div class="r2"><h1>品牌:</h1><div class="text2" id="r2_text2"><h2 class="cur1">全部</h2><h2>FTDI</h2><h2>WIINET</h2><h2>3M-STATIC CONTROL SOLUTIONS</h2><h2>AAVID THERMALLOY</h2><h2>ALLIANCE</h2><a href="javascript:void(0);" id="more_r2" onclick="More_r2()">更多+</a></div><div class="text2" id="r2_text2_2" style="display:none"></div></div>
12             <div class="r3"><h1>库存数量:</h1><div class="text1"><input type="text" class="ChangeInventoryquantity" id="startnumber" value="1000" /></div><a>-</a><div class="text2"><input class="ChangeInventoryquantity" id="endnumber" type="text" value="1000000" /></div><a>件</a></div>
13             <div class="r4"><h1>交货地:</h1><div class="text2"><h2 class="cur1">全部</h2><h2 onclick="Trademark(this)">国内</h2><h2 onclick="Trademark(this)">香港</h2></div></div>
14         </div>
15 
16     </div>
17     <table class="bottom_right">
18         <tr class="tr1">
19             <td class="td1"><p>型号</p></td>
20             <td class="td2"><p>品牌</p></td>
21             <td class="td3"><p>库存数量</p></td>
22             <td class="td4"><p>货期</p></td>
23             <td class="td5"><p>起订量</p></td>
24             <td class="td6"><p>交货地</p></td>
25             <td class="td7"><p>香港交货</p></td>
26             <td class="td8"><p>国内交货</p></td>
27             <td class="td9"><p>操作</p></td>
28         </tr>
29         <tr class="tr2">
30             <td></td>
31             <td></td>
32             <td></td>
33             <td><p>(工作日)</p></td>
34             <td></td>
35             <td></td>
36             <td></td>
37             <td><p>(含17%税)</p></td>
38             <td></td>
39         </tr>
40 
41         <tbody class="tr3"></tbody>
42 
43     </table>
View Code

 

product页面加载信息ajax

标签:

原文地址:http://www.cnblogs.com/zhaokunbokeyuan256/p/4631092.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!