<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>首页_深圳兆同星科技有限公司</title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="viewport" content="width=1380">
<link rel="shortcut icon" href="pth/favicon/favicon.ico" type="image/x-icon" />
<link href="css/aos.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="css/common.css" rel="stylesheet">
<link href="css/index.css" rel="stylesheet">
<script src="js/jquery.js"></script>
<script src="js/jquery.superslide.2.1.1.js"></script>
<script src="js/common.js"></script>
<script src="js/config.js?t=812"></script>
<script type="text/javascript">if(window.location.toString().indexOf('pref=padindex') != -1){}else{if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))){if(window.location.href.indexOf("?mobile")<0){try{if(/Android|Windows Phone|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){}else if(/iPad/i.test(navigator.userAgent)){}else{}}catch(e){}}}}</script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.4/xlsx.full.min.js"></script>

<script type="text/javascript">

  // 动态获取产品分类菜单
  fetch(API_BASE_URL + "/web/categories/parents")
    .then((response) => response.json())
    .then((result) => {
      const categories = result.data;

      // 按 sort_order 排序（降序）
      categories.sort((a, b) => b.sort_order - a.sort_order);

      var categoryMenuHtml = "";
      for (const cat of categories) {
        // 只显示一级分类 (level=1)
        if (cat.level === 1) {
          categoryMenuHtml += '<li><a href="javascript:;">' + cat.name + '</a>';

          // 检查是否有子分类
          if (cat.children && cat.children.length > 0) {
            // 子分类按 sort_order 排序
            cat.children.sort((a, b) => b.sort_order - a.sort_order);

            categoryMenuHtml += '<dl>';
            for (const child of cat.children) {
              categoryMenuHtml += '<dd><a href="index.html?category_id=' + child.id + '">' + child.name + '</a></dd>';
            }
            categoryMenuHtml += '</dl>';
          }

          categoryMenuHtml += '</li>';
        }
      }
      $("#productCategories").html(categoryMenuHtml);
    })
    .catch((error) => {
      console.error("Error fetching product categories: ", error);
      $("#productCategories").html('<li>加载失败</li>');
    });

  // 动态获取产品分类
  fetch(API_BASE_URL + "/web/categories?level=2")
    .then((response) => response.json())
    .then((result) => {
      const categories = result.data;

      // 按 sort_order 排序（降序）
      categories.sort((a, b) => b.sort_order - a.sort_order);

      // 生成导航菜单
      var navCategoriesHtml = "";
      for (const cat of categories) {
        navCategoriesHtml += '<dd><a href="product.html?category=' + cat.id + '" title="' + cat.name + '">' + cat.name + '</a></dd>';
      }
      $("#navCategories").html(navCategoriesHtml);

      // 生成底部菜单
      var footerCategoriesHtml = "";
      for (const cat of categories) {
        footerCategoriesHtml += '<a href="product.html?category=' + cat.id + '" title="' + cat.name + '">' + cat.name + '</a>';
      }
      $("#footerCategories").html(footerCategoriesHtml);

      // 生成首页产品分类 tab
      // var categoryTabHtml = "";
      // for (const cat of categories) {
      //   categoryTabHtml += '<a href="product.html?category=' + cat.id + '" title="' + cat.name + '">' + cat.name + '</a>';
      // }
      // $("#categoryTab").html(categoryTabHtml);
    })
    .catch((error) => {
      console.error("Error fetching categories: ", error);
      $("#navCategories").html('<dd><a href="product.html">产品中心</a></dd>');
      $("#footerCategories").html('<a href="product.html">产品中心</a>');
      $("#categoryTab").html('<a href="product.html">产品中心</a>');
    });

  // 动态获取产品列表并生成表格
  // 获取 URL 参数 category_id
  function getUrlParam(name) {
    const reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    const r = window.location.search.substr(1).match(reg);
    if (r != null) return decodeURIComponent(r[2]);
    return null;
  }

  const categoryId = getUrlParam("category_id") || "3";

  fetch(API_BASE_URL + "/web/products?category_id=" + categoryId)
    .then((response) => response.json())
    .then((result) => {
      const products = result.data;

      if (!products || products.length === 0) {
        $("#productTableBody").html('<tr><td colspan="9">暂无数据</td></tr>');
        return;
      }

      // 收集所有属性名（按 sort_order 降序排序）
      const attributeMap = new Map(); // 使用 Map 保持顺序
      for (const product of products) {
        if (product.product_attributes) {
          // 按 sort_order 降序排序
          const sortedAttrs = [...product.product_attributes].sort((a, b) => b.sort_order - a.sort_order);
          for (const attr of sortedAttrs) {
            if (attr.is_visible && !attributeMap.has(attr.category_attribute_name)) {
              attributeMap.set(attr.category_attribute_name, attr.category_attribute_id);
            }
          }
        }
      }

      // 生成表头
      let tableHtml = '<tr class="tr1">';
      tableHtml += '<th scope="col">产品型号</th>';
      // 按添加顺序遍历属性
      for (const attrName of attributeMap.keys()) {
        tableHtml += '<th scope="col">' + attrName + '</th>';
      }
      tableHtml += '<th scope="col">规格文档</th>';
      tableHtml += '</tr>';

      // 生成数据行
      for (const product of products) {
        tableHtml += '<tr>';
        tableHtml += '<td>' + (product.title || '') + '</td>';

        // 创建属性值映射
        const attrValueMap = new Map();
        if (product.product_attributes) {
          for (const attr of product.product_attributes) {
            attrValueMap.set(attr.category_attribute_name, attr.value);
          }
        }

        // 按表头顺序输出属性值
        for (const attrName of attributeMap.keys()) {
          tableHtml += '<td>' + (attrValueMap.get(attrName) || '') + '</td>';
        }

        // 规则文档列（取 product_files 第一个元素）
        if (product.product_files && product.product_files.length > 0) {
          const file = product.product_files[0];
          tableHtml += '<td><a style="color:blue;" href="' + API_BASE_URL  + file.url + '" target="_blank">' + file.name + '</a></td>';
        } else {
          tableHtml += '<td></td>';
        }

        tableHtml += '</tr>';
      }

      $("#productTableBody").html(tableHtml);
    })
    .catch((error) => {
      console.error("Error fetching products: ", error);
      $("#productTableBody").html('<tr><td colspan="9">加载失败</td></tr>');
    });

  // fetch(API_BASE_URL + "/web/activity/index/products")
  //   .then((response) => response.json())
  //   .then((result) => {
  //     const products = result.data;
  //     var goodscenterHtml = "";

  //     for (const product of products) {
  //       var imgUrl = API_BASE_URL + product.url;
  //       goodscenterHtml += '<li>';
  //       goodscenterHtml += '  <a href="prductdetail.html?category=' + product.category_id + '&id=' + product.product_id + '" title="' + product.title + '"><img src="' + imgUrl + '" alt="' + product.title + '"/>';
  //       goodscenterHtml += '    <div class="title clearfix">';
  //       goodscenterHtml += '      <h3 class="tit fl">' + product.title + '</h3>';
  //       goodscenterHtml += '      <em class="icon fr"></em>';
  //       goodscenterHtml += '    </div>';
  //       goodscenterHtml += '  </a>';
  //       goodscenterHtml += '</li>';
  //     }
  //     $("#goodscenter").html(goodscenterHtml);
  //   })
  //   .catch((error) => {
  //     console.error("Error fetching index products: ", error);
  //   });
</script>
</head>
<body>

<!--页头开始-->
<div class="header_main">
  <div class="header w1200 clearfix">
	  <a class="logo fl" href="javascript:void(0);" title="深圳兆同星科技有限公司" aos="fade-right" aos-easing="ease" aos-duration="700" aos-delay="100" aos-duration="700"> <img src="pth/logo.png" alt="深圳兆同星科技有限公司"/></a>
    <div class="tel fl" style="width:400px" aos="fade-left" aos-easing="ease" aos-duration="700" aos-delay="100"><s class="ico"></s>
      <span>+86 755-83925006</span><br />
      <span>13925225061</span>
    </div>
  </div>
</div>
<!--页头结束-->

<!--导航开始-->
<div class="nav_main" aos="fade-down" aos-easing="ease" aos-duration="700">
  <div class="nav w1200">
    <ul class="list clearfix" id="nav">
      <li id="cur"  class='hover' ><a href="index.html" title="网站首页">网站首页</a></li>
      <li><a href="product.html" title="产品中心" class=''>产品中心</a>
        <dl id="navCategories">
          <dd>加载中...</dd>
        </dl>
      </li>
      <li><a href="file.html" title="支持与下载" class=''>支持与下载</a>
        <dl>

        </dl>
      </li>
      <li><a href="about.html" title="关于我们" class=''>关于我们</a>
        <dl>
          <dd><a href="about.html" title="公司简介">公司简介</a> </dd>
          <dd><a href="honor.html" title="公司荣誉">公司荣誉</a> </dd>
        </dl>
      </li>
	    <li><a href="contact.html" title="联系我们" class=''>联系我们</a>
        <dl>

        </dl>
      </li>
	    <li><a href="news.html" title="新闻" class=''>新闻</a>
	      <dl>
	        <dd><a href="news.html?type=1" title="行业资讯">行业资讯</a> </dd>
	        <dd><a href="news.html?type=2" title="公司新闻">公司新闻</a> </dd>
	      </dl>
	    </li>
	    <li><a href="message.html" title="给我留言" class=''>给我留言</a>
        <dl>

        </dl>
      </li>
    </ul>
  </div>
</div>
<!--导航结束-->
<!--幻灯片大图开始-->
<div id="banner_main" aos="fade-up" aos-easing="ease" aos-duration="700" aos-delay="100">
  <div id="banner" class="banner">
    <ul class="list clearfix">
      <!-- http://pixabay.com/zh/photos/shenzhen-city-building-4681267 -->
      <li><a href="javascript:void(0);" ><img src="pth/banner/2501010101.jpg" alt="深圳兆同星科技有限公司"/></a></li>
      <!-- http://pixabay.com/photos/star-ferry-victoria-harbour-5403942 -->
      <li><a href="javascript:void(0);" ><img src="pth/banner/2501010102.jpg" alt="深圳兆同星科技有限公司"/></a></li>
    </ul>
    <div class="tip"></div>
    <a href="javascript:;" id="btn_prev" class="ico"></a> <a href="javascript:;" id="btn_next" class="ico"></a> </div>
</div>
<!--幻灯片大图结束-->

<div class="index">
  <!--产品中心开始-->
  <div id="floor_2_main">
    <div class="floor_2 w1200">
      <div class="in_title clearfix" aos="fade-up" aos-easing="ease" aos-duration="700">
        <p class="entit" aos="fade-up" aos-easing="ease" aos-duration="700">PRODUCT</p>
        <h3 class="tit clearfix" aos="fade-up" aos-easing="ease" aos-duration="700" aos-delay="100"><em class="line fl"></em><span class="word">产品中心</span><em class="line fr"></em></h3>
      </div>
      <!--产品分类开始-->
      <div aos="fade-up" aos-easing="ease" aos-duration="700" aos-delay="200">
        <div class="inside_con">
          <div class="pro_t wow zoomIn animated" style="visibility: visible; animation-name: zoomIn;">
            <ul class="centerBox" id="productCategories">
              <li>加载中...</li>
            </ul>
          </div>
          <div class="product2">
            <div class="p_list">
              <table width="100%" border="0" cellspacing="0" cellpadding="0" id="productTable">
                <tbody id="productTableBody">
                  <tr><td colspan="8">加载中...</td></tr>
                </tbody>
              </table>
              <div class="clear"></div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <!--产品中心结束-->
  <!--关于我们开始-->
  <div id="floor_1_main">
    <div class="floor_1 w1200">
      <!-- 图片来源免费地址http://pixabay.com/photos/star-ferry-victoria-harbour-5403942/-->
      <div class="about clearfix"> <a class="item fl" href="about.html" aos="fade-right" aos-easing="ease" aos-duration="700"> <img src="pth/fafeng.jpg" alt="关于我们"/></a>
        <div class="contW fl">
          <div class="title">
            <p class="entit" aos="fade-up" aos-easing="ease" aos-duration="700" aos-delay="300">About Us</p>
            <h3 class="tit" aos="fade-up" aos-easing="ease" aos-duration="700" aos-delay="400">关于我们</h3>
          </div>
          <a  href="about.html">
          <p class="cont" aos="fade-up" aos-easing="ease" aos-duration="700" aos-delay="500">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;深圳兆同星科技有限公司是香港澳康电子有限公司（成立于1995年）为拓展内地业务，在深圳成立的一家集设计、生产、营销于一体的高新技术企业，凭借近30年来的市场探索,在内地的业务发展迅速。 目前产品序列中包括了公司自行设计......</p>
          <p class="view_detail" aos="fade-up" aos-easing="ease" aos-duration="700" aos-delay="600">详情>></p>
          </a> </div>
      </div>
    </div>
  </div>
  <!--关于我们结束-->

  <div id="floor_5_main">

  </div>

</div>
<!--页尾开始-->

<div class="footer">
  <div class="w1200 clearfix">

    <!--联系方式开始-->
    <div class="contact tel fl" aos="fade-up" aos-easing="ease" aos-duration="700" aos-delay="300">
      <!--二维码开始-->
      <div class="ewm fl"> <img src="pth/erweima.png" alt="深圳兆同星科技有限公司"/></div>
      <!--二维码结束-->
      <div class="contact_info fl">
        <p class="p1">咨询热线:</p>
        <p class="tel">0755-83925006</p>
        <p class="p2">手机：13925225061</p>
        <p class="p1">邮箱：luhuaiju@aukx.com</p>
        <p class="p1" style="padding-top:5px">邮箱：13925225061@163.com</p>
      </div>
    </div>
    <!--联系方式结束-->

    <!--底部导航开始-->
    <div class="bNav fr" aos="fade-up" aos-easing="ease" aos-duration="700" aos-delay="300">
      <div class="item">
        <h3><a href="about.html" title="关于我们">关于我们</a></h3>
        <a href="about.html" title="公司简介">公司简介</a>
        <a href="honor.html" title="公司荣誉">公司荣誉</a>
      </div>
      <div class="item">
        <h3><a href="product.html" title="产品中心">产品中心</a></h3>
        <div id="footerCategories">
          <a href="product.html">加载中...</a>
        </div>
      </div>

      <div class="item">
        <h3><a href="file.html" title="支持与下载">支持与下载</a></h3>
        <a href="file.html" title="支持与下载">支持与下载</a>
      </div>
      <div class="item">
        <h3><a href="contact.html" title="联系我们">联系我们</a></h3>
        <a href="contact.html" title="联系我们">联系我们</a>
      </div>
    </div>
  <!--底部导航结束-->
  </div>
</div>
<!--页尾结束-->

<!--版权开始-->
<div class="copyright">
  <div class="w1200">
    Copyright &copy; 2018-2025 深圳兆同星科技有限公司 版权所有　地址：深圳市福田区莲花街道新洲路立交桥西北侧新洲广场华丰大厦2508房　备案号：<a href="http://beian.miit.gov.cn"  target="_blank" title="粤ICP备20036863号-1">粤ICP备20036863号-1</a>
  </div>
</div>
<!--版权结束-->

<script src="js/aos.js"></script>
<script src="js/app.js"></script>
<script type="text/javascript">
	AOS.init({
		easing: 'ease-out-back',
		duration: 1000
	});
</script>
</body>
</html>
