﻿
     $(function() {
     var qtcpbj = $('#qtcpbj');
     var d = new Date();
     var i=0;
     var MemberID = $('input[name=MemberID]').val();
     $.get(
        '/XMl/XMLProductDetail.aspx',
        { MemberID: MemberID,type:1, item: 12, timespan: d },
        function(xml) {
            var sTemp = '';
            $(xml).find('Item').each(function() {
                var title = $(this).attr('title');
                var amount = $(this).attr('amount');
                var unit = $(this).attr('unit');
                var httppath = $(this).attr('httppath');
                var specification = $(this).attr('specification');
                var price = $(this).attr('price');
                i++;
                if(i%2!=0)
                { 
                    sTemp += '<div style="float:left; width:70px;height:22px;padding:4px 6px 0px 10px; text-align:left; overflow:hidden;line-height:19px;">';
                    sTemp += '<a href="' + httppath + '" target="_blank" title="' + title + '">';
                    sTemp += title;
                    sTemp += '</a></div><div style="float:left;width:115px;height:22px;padding-right:5px;padding-top:4px; text-align:left; overflow:hidden;line-height:19px;" title="'+specification+'">';
                    sTemp += specification;
                    sTemp += '</div><div style="float:left;width:57px;height:22px;padding-right:5px;padding-top:4px; text-align:left; overflow:hidden;line-height:19px;" title="';
                    if(price=='面议')
                    {
                        sTemp += price;
                    }
                    else
                    {
                        sTemp += price +(unit=='' ? "" : ("/"+unit));
                    }
                    sTemp += '">';
                    if(price=='面议')
                    {
                        sTemp += price;
                    }
                    else
                    {
                        sTemp += price +(unit=='' ? "" : ("/"+unit));
                    }
                    
                    sTemp += '</div>';
                }
                else
                {
                    sTemp += '<div style="float:left; width:70px;height:22px;padding:4px 6px 0px 10px; text-align:left; overflow:hidden;background-color:#ECEAEB;line-height:19px;">';
                    sTemp += '<a href="' + httppath + '" target="_blank" title="' + title + '">';
                    sTemp += title;
                    sTemp += '</a></div><div style="float:left;width:115px;height:22px;padding-right:5px;padding-top:4px; text-align:left; overflow:hidden; background-color:#ECEAEB;line-height:19px;" title="'+specification+'">';
                    sTemp += specification;
                    sTemp += '</div><div style="float:left;width:57px;height:22px;padding-right:5px;padding-top:4px; text-align:left; overflow:hidden; background-color:#ECEAEB;line-height:19px;" title="';
                     if(price=='面议')
                    {
                        sTemp += price;
                    }
                    else
                    {
                        sTemp += price +(unit=='' ? "" : ("/"+unit));
                    }
                    sTemp += '">';
                    if(price=='面议')
                    {
                        sTemp += price;
                    }
                    else
                    {
                        sTemp += price +(unit=='' ? "" : ("/"+unit));
                    }
                    sTemp += '</div>';
                }
               
            });
            qtcpbj.html(sTemp);
        }
    );
    
    
     var qygqxx = $('#qygqxx');
     $.get(
        '/XMl/XMLProductDetail.aspx',
        { MemberID: MemberID,type:2, item: 9, timespan: d },
        function(xml) {
            var sTemp = '';
            $(xml).find('Item').each(function() {
                var title = $(this).attr('title');
                var typeCode = $(this).attr('typeCode');
                var httppath = $(this).attr('httppath');
                sTemp += '<div style="float:left; width:252px;height:17px;padding:8px 0px 0px 0px; text-align:left; overflow:hidden;border-bottom:solid 1px #E0E0E0;line-height:19px;">';
                if(typeCode=="gy")
                {
                    sTemp += "<span style=\"color:#D25D18\">[供应]</span>";
                }
                else if(typeCode=="xq")
                {
                    sTemp += "<span style=\"color:#D25D18\">[需求]</span>";
                }
                else if(typeCode=="gcfw")
                {
                     sTemp += "<span style=\"color:#D25D18\">[工程服务]</span>";
                }
                else if(typeCode=="dlhz")
                {
                     sTemp += "<span style=\"color:#D25D18\">[代理合作]</span>";
                }
                else if(typeCode=="cgxj")
                {
                     sTemp += "<span style=\"color:#D25D18\">[采购询价]</span>";
                }
               sTemp += '<a href="' + httppath + '" target="_blank" title="' + title + '">';
               sTemp += title;
               sTemp += '</a></div>';
            });
            qygqxx.html(sTemp);
        }
    );
 });
