cxs 7 rokov pred
rodič
commit
f0801f56b6

+ 62 - 0
new/404.html

@@ -0,0 +1,62 @@
+<html>
+<head>
+    <meta charset="utf-8">
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
+    <meta http-equiv="Cache-Control" content="no-siteapp">
+    <title>404页面</title>
+
+    <style>
+        .page-404 {
+            padding-right: 15px;
+            padding-left: 15px;
+            margin-right: auto;
+            margin-left: auto;
+            color: #afb5bf;
+            padding-top: 60px;
+            padding-bottom: 90px;
+            text-align: center;
+        }
+
+        .page-404 .error-title {
+            width: 350px;
+            font-size: 80px;
+            margin: 0 auto;
+            overflow: hidden;
+        }
+
+        .page-404 .icon{
+            display: block;
+            background-image: url(images/404.png);
+            width: 120px;
+            height: 120px;
+            background-repeat: no-repeat;
+            background-size: cover;
+            float: left;
+        }
+
+        .page-404 .va-m {
+            vertical-align: middle!important;
+            float: left;
+            padding-left: 50px;
+        }
+
+        .page-404 .error-description {
+            font-size: 24px;
+        }
+
+    </style>
+
+</head>
+<body>
+<div class="page-404 ">
+    <div class="error-title">
+        <p class="icon" style="font-size:80px"></p>
+        <p class="va-m"> 404</span>
+    </div>
+    <p class="error-description">ขอโทษที่คุณเข้าเยี่ยมชมหน้าเว็บที่ไม่มีอยู่ ~ ~ ~ ~ ~ ~ ~</p>
+
+</div>
+
+</body></html>

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 3 - 0
new/css/app.min.css


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 0
new/css/banner.css


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 6584 - 0
new/css/bootstrap.css


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 6362 - 0
new/css/goods.css


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 4140 - 0
new/css/new.css


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 951 - 0
new/css/new2.css


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1025 - 0
new/css/shop.css


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 15 - 0
new/css/swiper.min.css


+ 449 - 0
new/goods.html

@@ -0,0 +1,449 @@
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta content="yes" name="apple-mobile-web-app-capable">
+    <meta content="yes" name="apple-touch-fullscreen">
+    <meta content="telephone=no" name="format-detection">
+    <meta http-equiv="Content-type" content="text/html" charset="UTF-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=320, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
+    <meta name="viewport" content="width=device-width, target-densityDpi=medium-dpi">
+    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
+    <meta name="viewport"
+          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
+    <meta name="fragment" content="!">
+    <meta name="HandheldFriendly" content="true">
+    <link rel="stylesheet" href="css/new.css">
+    <link rel="stylesheet" href="css/new2.css">
+    <link rel="stylesheet" href="css/app.min.css">
+    <link rel="stylesheet" href="css/swiper.min.css">
+    <script src="js/jquery-2.2.3.min.js"></script>
+    <script src="js/glide.min.js"></script>
+    <script src="js/new.js"></script>
+    <script src="js/swiper.min.js"></script>
+
+</head>
+<body>
+
+<!--页面加载loading-->
+<div id="PageLoading" style="position: fixed;top: 50%;left: 50%;margin-left: -64px;margin-top: -64px;">
+    <img src="../images/loading.gif">
+</div>
+
+<!--页面内容-->
+<div id="PageWarp" class="page" style="display: none">
+
+    <!--&lt;!&ndash;头部导航&ndash;&gt;-->
+    <!--<div class="detail-header-bg">-->
+        <!--&lt;!&ndash;transparent&ndash;&gt;-->
+        <!--<div id="head" class="header-dom">-->
+            <!--<div class="mui-flex main-dom">-->
+                <!--<ul class="cell header-nav">-->
+                    <!--<li class="active" onclick="ToTop()">สินค้า</li>-->
+                    <!--<li onclick="ToProductInfo()">รายละเอียดสินค้า</li>-->
+                    <!--&lt;!&ndash; <li onclick="ToProductEvaluate()">การประเมิน</li> &ndash;&gt;-->
+                <!--</ul>-->
+            <!--</div>-->
+        <!--</div>-->
+    <!--</div>
+
+    <!--banner区域-->
+    <div id="content" class="content">
+        <div class="container">
+            <div class="group-warp">
+                <div class="module-wrap">
+                    <div class="module-preview glide">
+
+                        <div class="nav">
+                            <!--<i class="current">-->
+                            <!--<span class="pagination">1/5</span>-->
+                            <!--</i>-->
+                            <!--<i class="">-->
+                            <!--<span class="pagination">2/5</span>-->
+                            <!--</i>-->
+                            <!--<i class="">-->
+                            <!--<span class="pagination">3/5</span>-->
+                            <!--</i>-->
+                            <!--<i class="">-->
+                            <!--<span class="pagination">4/5</span>-->
+                            <!--</i>-->
+                            <!--<i class="">-->
+                            <!--<span class="pagination">5/5</span>-->
+                            <!--</i>-->
+                        </div>
+
+                        <div class="mui-slider preview-slider glide__track" data-glide-el="track">
+                            <ul class="scroller preview-scroller glide__slides">
+                                <!--<li class="item slide">-->
+                                <!--<img src="//img.alicdn.com/imgextra/i3/515258907/TB2b0FZC1OSBuNjy0FdXXbDnVXa_!!515258907-0-item_pic.jpg_760x760Q50s50.jpg_.webp">-->
+                                <!--</li>-->
+                            </ul>
+                        </div>
+                    </div>
+                </div>
+                <div class="module-wrap">
+                    <div class="module-jhs">
+                        <div class="pricebar">
+                            <div class="subleft avil ">
+                                <div class="price">฿<strong id="ProductPrice">3000</strong></div>
+                                <div class="information" style="display: inline-block;padding: 0;">
+                                    <div class="soldcount"><span id="Discount">ลดราคา54%</span></div>
+
+                                </div>
+
+                                <div class="information">
+                                    <div class="oprice">฿
+                                        <del id="ProductPrimeCost">149</del>
+                                    </div>
+                                    <div class="soldcount"><span id="Sold">ยอดขาย1000ชิ้น</span></div>
+
+                                </div>
+                            </div>
+                            <div class="countdown">
+                                <div id="J_CountDownTxt" class="txt">จบจากที่เหลืออยู่</div>
+                                <div class="clockrun">
+                                    <span class="tuan" id="J_tuanTime"></span>
+                                    <span class="num" id="J_TimeHour">36</span><span class="dot">:</span>
+                                    <span class="num" id="J_TimeMin">37</span><span class="dot">:</span>
+                                    <span class="num" id="J_TimeSec">02</span>
+
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+
+    <!--产品标题-->
+    <div class="module-wrap">
+        <div class="module-title">
+            <div class="share-warp mui-flex">
+                <div class="main cell" id="ProductName" style="font-size: 18px;">
+                    หูฟังบรูทูธไร้สายแบบเสียบหู4.1หูฟังแบบเอียร์บัดรองรับ4.0หูฟังสำหรับการขับรถ3
+                </div>
+            </div>
+        </div>
+    </div>
+
+    <!--产品说明-->
+    <div class="module-wrap">
+        <div class="module-adds">
+            <span class="postage" id="Promotion" style="font-size: 16px;font-weight: bolder;">เก็บเงินปลายทาง ค่าไปรษณีย์ฟรี  ราคาพิเศษในเวลาจำกัด </span>
+        </div>
+    </div>
+
+    <!--产品详情-->
+    <div class="group-warp ProductInfo">
+        <div class="module-wrap">
+            <div class="module-desc" id="p-desc">
+                <div class="scrolltips">
+            <div class="part-title mui-flex align-center" style="padding:10px 0;color: #fff;background: -webkit-gradient(linear, 0 0, 0 100%, from(#fa215f), to(#fa215f));text-align: left;position: relative;">
+                        <span class="txt fixed" style="color:#fff">รายละเอียดสินค้า</span>
+
+<span class="txt fixed" style="color:#fff;text-align: right;position: absolute;right: 0;top: 5px;">∨</span>
+
+
+                    <span class="txt fixed" style="color:#fff;text-align: right;position: absolute;right: 0;top: 15px;">∨</span></div>
+                </div>
+	   <div class= "ProductReview">
+<!--产品评价-->
+    <div class="group-warp ProductEvaluate">
+        <div class="module-wrap">
+            <div class="module-review">
+                <div class="mui-tagscloud">
+                    <div class="mui-tagscloud-main">
+                        <div class="mui-tagscloud-title" style="font-size: 16px;">การประเมิน</div>
+                        <div class="mui-tagscloud-comments">
+                            <div class="marquee">
+                                <ul id="comment" style="width: 100%">
+                                    <li>
+                                        <div>
+                                            <span>Oliver </span>
+                                            <span style="float: right;"><span
+                                                    lass="reviewStar size1 star5"></span></span>
+                                        </div>
+                                        <div>
+                                            <p style="margin-bottom: 8px;font-size: 14px">
+                                                ได้รับสินค้าแล้วคุณภาพดีมาก
+                                                ละเอียดประณีตดูเรียบง่ายและมีระดับ</p>
+                                            <p style="position: relative;min-height: 10px;">
+                                                <span style="position: absolute;bottom: 0;right: 15px;color:#8f8f94">05/08/2018</span>
+                                            </p>
+                                        </div>
+                                    </li>
+
+                                    <li>
+                                        <div>
+                                            <span>Muhammed</span>
+                                            <span style="float: right;"><span
+                                                    lass="reviewStar size1 star5"></span></span>
+                                        </div>
+                                        <div>
+                                            <p style="margin-bottom: 8px;font-size: 14px">
+                                                ได้รับสินค้าแล้ว คุณภาพดีมาก ละเอียดประณีต
+                                                ดูเรียบง่ายและมีระดับ</p>
+                                            <p style="position: relative;min-height: 10px;">
+                                                <span style="position: absolute;bottom: 0;right: 15px;color:#8f8f94">23/06/2018</span>
+                                            </p>
+                                        </div>
+                                    </li>
+
+                                    <li>
+                                        <div>
+                                            <span>Harley</span>
+                                            <span style="float: right;"><span
+                                                    lass="reviewStar size1 star5"></span></span>
+                                        </div>
+                                        <div>
+                                            <p style="margin-bottom: 8px;font-size: 14px">
+                                                คุณภาพดีมาก บริการลูกค้าดีมาก ส่งของเร็ว ฉันรู้สึกพอใจมาก</p>
+                                            <p style="position: relative;min-height: 10px;">
+                                                <span style="position: absolute;bottom: 0;right: 15px;color:#8f8f94">23/06/2018</span>
+                                            </p>
+                                        </div>
+                                    </li>
+
+                                    <li>
+                                        <div>
+                                            <span>Harper </span>
+                                            <span style="float: right;"><span
+                                                    lass="reviewStar size1 star5"></span></span>
+                                        </div>
+                                        <div>
+                                            <p style="margin-bottom: 8px;font-size: 14px">
+                                                สินค้ารุ่นนี้คุณภาพดีเยี่ยม จัดส่งรวดเร็ว
+                                                พนักงานร้านค้าอัธยาศัยดี</p>
+                                            <p style="position: relative;min-height: 10px;">
+                                                <span style="position: absolute;bottom: 0;right: 15px;color:#8f8f94">20/04/2018</span>
+                                            </p>
+                                        </div>
+                                    </li>
+
+                                    <li>
+                                        <div>
+                                            <span>Jenson </span>
+                                            <span style="float: right;"><span
+                                                    lass="reviewStar size1 star5"></span></span>
+                                        </div>
+                                        <div>
+                                            <p style="margin-bottom: 8px;font-size: 14px">
+                                                คุ้มค่ามาก</p>
+                                            <p style="position: relative;min-height: 10px;">
+                                                <span style="position: absolute;bottom: 0;right: 15px;color:#8f8f94">17/07/2018</span>
+                                            </p>
+                                        </div>
+                                    </li>
+
+                                    <li>
+                                        <div>
+                                            <span>Stanley</span>
+                                            <span style="float: right;"><span
+                                                    lass="reviewStar size1 star5"></span></span>
+                                        </div>
+                                        <div>
+                                            <p style="margin-bottom: 8px;font-size: 14px">
+                                                คุณภาพดี วันหลังจะมาซื้อใหม่</p>
+                                            <p style="position: relative;min-height: 10px;">
+                                                <span style="position: absolute;bottom: 0;right: 15px;color:#8f8f94">25/07/2018</span>
+                                            </p>
+                                        </div>
+                                    </li>
+
+                                    <li>
+                                        <div>
+                                            <span>Darcie</span>
+                                            <span style="float: right;"><span
+                                                    lass="reviewStar size1 star5"></span></span>
+                                        </div>
+                                        <div>
+                                            <p style="margin-bottom: 8px;font-size: 14px">
+                                                ไม่รับของแล้ว ดีมาก</p>
+                                            <p style="position: relative;min-height: 10px;">
+                                                <span style="position: absolute;bottom: 0;right: 15px;color:#8f8f94">10/05/2018</span>
+                                            </p>
+                                        </div>
+                                    </li>
+
+                                    <li>
+                                        <div>
+                                            <span>Luna </span>
+                                            <span style="float: right;"><span
+                                                    lass="reviewStar size1 star5"></span></span>
+                                        </div>
+                                        <div>
+                                            <p style="margin-bottom: 8px;font-size: 14px">
+                                                ได้รับพัสดุแล้ว พนักงานร้านค้าอัธยาศัยดีมาก</p>
+                                            <p style="position: relative;min-height: 10px;">
+                                                <span style="position: absolute;bottom: 0;right: 15px;color:#8f8f94">05/6/2018</span>
+                                            </p>
+                                        </div>
+                                    </li>
+
+                                    <li>
+                                        <div>
+                                            <span>Bluebell</span>
+                                            <span style="float: right;"><span
+                                                    lass="reviewStar size1 star5"></span></span>
+                                        </div>
+                                        <div>
+                                            <p style="margin-bottom: 8px;font-size: 14px">
+                                                พนักงานอบอุ่นดี คุณภาพสินค้าก็โอเค</p>
+                                            <p style="position: relative;min-height: 10px;">
+                                                <span style="position: absolute;bottom: 0;right: 15px;color:#8f8f94">02/07/2018</span>
+                                            </p>
+                                        </div>
+                                    </li>
+                                </ul>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+	         </div>
+                <div class="container" style="" id="ProductInfo">
+                </div>
+            </div>
+        </div>
+    </div>
+
+    
+
+    <!--购买按钮-->
+    <section class="actionBar-bg">
+        <div id="s-actionBar-container">
+            <div class="action-bar-wrap j-bottom-bar">
+                <div class="trade">
+                    <a class="buy" onclick="showPage()" href="javascript:void(0);">สั่งซื้อ</a>
+                </div>
+            </div>
+        </div>
+    </section>
+
+    <!--客服按钮-->
+    <div class="show_contact" style="display: block;position: fixed;bottom: 75px;right: 15px;z-index: 99;">
+        <div class="show_contact_box"
+             style="background: #129BF4;border-radius: 50%;width: 50px;height: 50px;display: block;text-align: center;">
+            <a href="https://www.facebook.com/pg/MinimatterTimes" style="display: block">
+                <img src="images/kf.png" style="margin-top: 5px;width: 40px;display: inline-block;">
+            </a>
+        </div>
+    </div>
+     
+</div>
+
+<div class="big_img">
+    <div class="swiper-container2 swiper-container-horizontal">
+        <div class="swiper-wrapper"> </div>
+    </div>
+</div>
+
+<div id="outerdiv" style="position:fixed;top:0;left:0;background:rgba(0,0,0,0.7);z-index:1000;width:100%;height:100%;display:none;">
+    <div id="innerdiv" style="position:absolute;">
+            <img id="bigimg" style="border:5px solid #fff;" src="" />
+    </div>
+</div>
+<div id="page-order">
+    <div class="tt" style="font-size: 16px;">
+        <div class="back" onclick="showPage()" href="javascript:void(0);"></div>
+        เลือกคุณลักษณะของผลิตภัณฑ์
+    </div>
+    <div class="dt-paramselect">
+        <div class="u-format count_classs">
+            <div class="tt">ชุด</div>
+            <div class="con">
+            </div>
+        </div>
+
+        <div class="meal">
+            <div class="u-format count_atrr">
+                <div class="tt">การจำแนกสี:<span></span></div>
+                <div class="con">
+                </div>
+            </div>
+            <div class="u-format count_size">
+                <div class="tt">ขนาด</div>
+                <div class="con">
+                </div>
+            </div>
+        </div>
+
+        <!--<div class="meal secondsetmeal" style="display:none">-->
+        <!--</div>-->
+
+        <div class="u-fornum">
+            <span>ปริมาณการซื้อ :</span>
+            <div class="con">
+                <div class="m-selnum dr">
+                    <div onclick="minnumber()" class="less z-dis">-</div>
+                    <div class="textWrap">
+                        <div class="num" id="number">1</div>
+                    </div>
+                    <div onclick="addnumber()" class="more">+</div>
+                </div>
+                <div>
+                    <a onclick="goShop()" href="javascript:void(0);">รีบซื้อเลย</a>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+
+
+
+
+
+<!--position: fixed;-->
+<!--top: 0px;-->
+<!--scroll-behavior: unset;-->
+
+
+<script type="text/javascript">
+    window._pt_lt = new Date().getTime();
+    window._pt_sp_2 = [];
+    _pt_sp_2.push('setAccount,19c40fc9');
+    var _protocol = (("https:" == document.location.protocol) ? " https://" : " http://");
+    (function () {
+        var atag = document.createElement('script');
+        atag.type = 'text/javascript';
+        atag.async = true;
+        atag.src = _protocol + 'js.ptengine.cn/19c40fc9.js';
+        var s = document.getElementsByTagName('script')[0];
+        s.parentNode.insertBefore(atag, s);
+    })();
+</script>
+</body>
+</html>
+<!-- Global site tag (gtag.js) - Google Analytics -->
+<script async="" src="https://www.googletagmanager.com/gtag/js?id=UA-122583135-1"></script>
+<script>
+    window.dataLayer = window.dataLayer || [];
+
+    function gtag() {
+        dataLayer.push(arguments);
+    }
+
+    gtag('js', new Date());
+    gtag('config', 'UA-122583135-1');
+</script>
+
+<!-- Facebook Pixel Code -->
+<script>
+  !function(f,b,e,v,n,t,s)
+  {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
+  n.callMethod.apply(n,arguments):n.queue.push(arguments)};
+  if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
+  n.queue=[];t=b.createElement(e);t.async=!0;
+  t.src=v;s=b.getElementsByTagName(e)[0];
+  s.parentNode.insertBefore(t,s)}(window, document,'script',
+  'https://connect.facebook.net/en_US/fbevents.js');
+  fbq('init', '524976641351633');
+  fbq('track', 'PageView');
+</script>
+<noscript>< img height="1" width="1" style="display:none"
+  src="https://www.facebook.com/tr?id=524976641351633&ev=PageView&noscript=1"
+/></noscript>
+<!-- End Facebook Pixel Code -->

BIN
new/images/1.mp3


BIN
new/images/404.png


BIN
new/images/Cart.png


BIN
new/images/addphoto.png


BIN
new/images/arrow.png


BIN
new/images/check.png


BIN
new/images/checkout-icons.png


BIN
new/images/close.png


BIN
new/images/closeicon.png


BIN
new/images/icon.png


BIN
new/images/img-sp.png


BIN
new/images/kf.png


BIN
new/images/left-arrow.png


BIN
new/images/loading.gif


BIN
new/images/review_1.png


BIN
new/images/right-arrow.png


BIN
new/images/star-.png


BIN
new/images/star.png


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 6 - 0
new/js/glide.min.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 4 - 0
new/js/jquery-2.2.3.min.js


+ 609 - 0
new/js/new.js

@@ -0,0 +1,609 @@
+var ProductId = "",
+    ProductIdCountDown = "",
+    ProductAttrId = [],
+    ProductAttrInfo = 0;
+
+$(document).ready(function () {
+    init();
+    $(window).scroll(WindowScroll);
+    imgShow();
+});
+
+
+init = function () {
+    getProductInfo();
+}
+
+var getProductInfo = function () {
+    var pid = getUrlParam("pid")|| window.location.pathname.substr(window.location.pathname.lastIndexOf("/")+1);
+    var parameter = urlEncode(["SelectProduct", pid]);
+    $.ajax({
+        type: "post",
+        url: "/new/php/index.php",
+        data: {mode: parameter},
+        dataType: "json",
+        success: function (data) {
+            $("#PageLoading").css({"display": "none"});
+            $("#PageWarp").css({"display": "block"});
+            printProductInfo(data[0][0]);
+            PrintProductAttribute(data[0][0].ProductAttr);
+        }
+    });
+}
+
+var printProductInfo = function (data) {
+    ProductAttrId = data;
+    ProductId = data.ProductId;
+    ProductIdCountDown = data.CountDown;
+    $("#ProductName").html(data.ProductName);
+    $("#ProductPrice").html(Math.ceil(data.ProductPrice));
+    $("#ColorPrice").html("฿" + Math.ceil(data.ProductPrice));
+    $("#ProductPrimeCost").html(Math.ceil(data.ProductPrimeCost));
+//    $("#ProductInfo").html(data.ProductInfo);
+    $("#ProductInfo").html(unescape(data.ProductInfo));
+    $("#Discount").html(data.Discount);
+    $("#Sold").html(data.Sold);
+    $("#Promotion").html(data.Promotion);
+
+$("#ProductInfo img").css({"width":"100%","height":"auto"});
+
+    // countTime(ProductIdCountDown);
+    // countDown(ProductIdCountDown);
+    setInterval(function () {
+        freshTime();
+    }, 1000);
+    var banner = JSON.parse(data.ProductAttr)["7b824b9c-738b-11e8-a479-0610c52349b6"],
+        color = JSON.parse(data.ProductAttr)["69d4e108-738a-11e8-a479-0610c52349b6"],
+        size = JSON.parse(data.ProductAttr)["d6d6361b-acea-11e8-bbc6-0a4b7569e232"],
+        classs = JSON.parse(data.ProductAttr)["cfb738c4-bff6-11e8-bbc6-0a4b7569e232"],
+        comment = JSON.parse(data.ProductAttr)["d5cca263-c224-11e8-bbc6-0a4b7569e232"];
+    $("#Color").html("");
+    for (var i in color) {
+        for (var j in color[i]) {
+            var a = '<a  _src=' + color[i][j] + ' onclick = itemClick(this)>' + j + '</a>';
+            $("#Color").append($(a));
+        }
+    }
+    $("#Color a").eq(0).addClass("checked");
+    $("#ColorBanner").attr("src", $("#Color a").eq(0).attr("_src"));
+    // ProductAttrId.push(escape($("#Color a").eq(0).html()), escape($("#Color a").eq(0).attr("_src")));
+
+
+    if (size && !$.isEmptyObject(size)) {
+        for (var i in size) {
+            for (var j in size[i]) {
+                var a = '<a onclick = itemClick(this)>' + size[i][j] + '</a>';
+                $("#Size").append($(a));
+            }
+        }
+        $("#Size a").eq(0).addClass("checked");
+    }
+    else {
+        $("#Size").parent().hide();
+    }
+
+    var num = 0;
+    for (var j in banner) {
+        num++;
+    }
+
+    for (var i in banner) {
+        for (var j in banner[i]) {
+            var li = '<li class="item slide"><img src="' + banner[i][j] + '"/></li>';
+            $(".scroller").append(li);
+            var i = '<i><span class="pagination">' + (parseInt(j) + 1) + '/' + num + '</span></i>';
+            $(".nav").append(i);
+            $(".nav i").eq(0).addClass("current");
+        }
+    }
+    bannerMove();
+
+    var mp4 = $("#ProductInfo img.edui-upload-video"), el;
+    for (var i = 0; i < mp4.length; i++) {
+        var url = mp4.eq(i).attr("_url");
+        el = '<video src=' + url + ' controls="controls" preload="auto" width = "100%"></video>';
+        mp4.eq(i).after(el);
+        mp4.eq(i).remove();
+    }
+    mp4.remove();
+    //就是这一块
+    if (comment && !$.isEmptyObject(comment)) {
+        $("#comment").eq(0).html("");
+        for (var i in comment) {
+            //for (var j = 0;j<=i;j++) {
+            $("#comment").eq(0).append(
+                $('<li>' +
+                    '<div style="margin-bottom:8px;  color: #999;font-size:12px">' +
+                    '<span>' + comment[i].name + '</span>' +
+                    '<span style="float: right;">' +
+                    '<span lass="reviewStar size1 star5">' + comment[i].time + '</span>' +
+                    '</span>' +
+                    '</div>' +
+                    '<div>' +
+                    '<p style="margin-bottom: 8px;font-size: 14px;word-break: break-all;">' + comment[i].text + '</p>' +
+                    '<div class="imgg" style="margin-bottom:10px;overflow: hidden">' + '</div>' +
+                    // '<p style="position: relative;min-height: 10px;">' +
+                    //     '<span style="position: absolute;bottom: 0;right: 15px;color:#8f8f94">' + comment[i].time + '</span>' +
+                    // '</p>' +
+                    '</div>' +
+                    '</li>'
+                ));
+            if (comment[i].imgurl != "") {
+                var CreateCommentImg = function (el, img, flag) {
+                    img = flag ? '/new/' + img : img;
+                    // var div = '<img class="pimg" style="z-index:0;" src="' + img + '">';
+                    // div.onclick=function(){
+                    //     var _this = $(this);//将当前的pimg元素作为_this传入函数  
+                    //     imgShow("#outerdiv", "#innerdiv", "#bigimg", _this);  
+                    // }
+                    $('<img>', {
+                        src: img,
+                    }).css({
+                        zIndex: 0
+                    }).appendTo($(".imgg").eq(i));
+                    //  $(".imgg").eq(i).append(div);
+                }
+                var img = comment[i]['imgurl'].split(",");
+                img.forEach(function (val) {
+                    CreateCommentImg(el, val, false);
+                });
+            }
+            //}
+        }
+        // $(".u-format .items").eq(0).eq(0).addClass("tab-sel");
+    }
+    else {
+        //Roll();
+	$(".ProductEvaluate")[0].style.display = "none";
+    }
+
+}
+
+var bannerMove = function () {
+    var glide = new Glide('.module-preview ', {
+        autoplay: 3000
+    });
+    glide.on(['mount', 'run.after'], function () {
+        $(".nav i").removeClass("current");
+        $(".nav i").eq(glide._i).addClass("current");
+    })
+    glide.mount();
+}
+
+
+var ToTop = function () {
+    $("html,body").scrollTop(0);
+}
+
+var ToProductInfo = function () {
+    $("html,body").scrollTop($(".ProductInfo").offset().top - 50);
+    // $("html,body").animate({scrollTop: $(".ProductInfo").offset().top - 50});
+}
+
+var ToProductEvaluate = function () {
+    $("html,body").scrollTop($(".ProductEvaluate").offset().top);
+
+    // $("html,body").animate({scrollTop: $(".ProductEvaluate").offset().top});
+}
+
+
+function freshTime() {
+    var arr = ProductIdCountDown.split(/[- : \/]/);
+    var endtime = new Date(arr[0], arr[1] - 1, arr[2], arr[3], arr[4], arr[5]);
+    var nowtime = new Date();
+    var lefttime = parseInt(endtime.getTime() - nowtime.getTime());//这是毫秒,如果再/1000就是秒
+    if (lefttime <= 0) {
+        var toyear = new Date().getFullYear();
+        var tomonth = new Date().getMonth() + 1;
+        var today = new Date().getDate() + 2;
+        arr[0] = toyear;
+        arr[1] = tomonth;
+        arr[2] = today;
+        endtime = new Date(arr[0], arr[1] - 1, arr[2], arr[3], arr[4], arr[5]);
+        lefttime = parseInt(endtime.getTime() - nowtime.getTime());//这是毫秒,如果再/1000就是秒
+    }
+    var hm = 60 * 60 * 1000;
+    var h = parseInt((lefttime / hm));
+    var mm = 60 * 1000;
+    var m = parseInt((lefttime / mm) % 60);
+    var s = parseInt((lefttime / 1000) % 60);
+    m = checktime(m);
+    s = checktime(s);
+    $("#J_TimeHour").html(h);
+    $("#J_TimeMin").html(m);
+    $("#J_TimeSec").html(s);
+    if (lefttime < 0) {
+        $("#J_TimeHour").html(0);
+        $("#J_TimeMin").html(0);
+        $("#J_TimeSec").html(0);
+    }
+}
+
+//倒计时效果js代码
+function checktime(i) {
+    if (i < 10) {
+        i = "0" + i;
+    }
+    else {
+        i = i;
+    }
+    return i;
+}
+
+
+var WindowScroll = function () {
+    var top = $(document).scrollTop();
+    if (top > $(".group-warp").eq(0).height() * 0.2) {
+        $("#head").addClass("transparent");
+    }
+
+    if (top >= $(".ProductInfo").offset().top - 100) {
+        $("#head").addClass("transparent");
+        $("#head li").removeClass("active");
+        $("#head li").eq(1).addClass("active");
+    }
+
+    if (top >= $(".ProductEvaluate").offset().top - 500) {
+        $("#head").addClass("transparent");
+        $("#head li").removeClass("active");
+        $("#head li").eq(2).addClass("active");
+    }
+
+    if (top < $(".ProductEvaluate").offset().top - 500) {
+        $("#head").addClass("transparent");
+        $("#head li").removeClass("active");
+        $("#head li").eq(1).addClass("active");
+    }
+
+
+    if (top <= $(".ProductInfo").offset().top - 100) {
+        $("#head").addClass("transparent");
+        $("#head li").removeClass("active");
+        $("#head li").eq(0).addClass("active");
+    }
+
+    if (top <= $(".group-warp").eq(0).height() * 0.2) {
+        $("#head").removeClass("transparent");
+    }
+}
+
+
+var showPage = function () {
+    // if ($(".widgets-cover").hasClass("show")) {
+    //     $(".widgets-cover").removeClass("show");
+    //     $("body").css({"position": "static", "top": "0px", "scroll-behavior": "unset"});
+    // }
+    // else {
+    //     $("body").css({"position": "fixed", "top": "0px", "scroll-behavior": "unset"});
+    //     $(".widgets-cover").addClass("show");
+    // }
+
+    if ($("#page-order").css("display") == "block") {
+        $("#PageWarp").css({display: "block"});
+        $("#page-order").animate({left: '100%'}, "", function () {
+            $("#page-order").css({display: "none"});
+        });
+    }
+    else {
+        $("#page-order").css({display: "block"});
+        $("#page-order").animate({left: '0'}, "", function () {
+            $("#PageWarp").css({display: "none"});
+        });
+    }
+}
+
+
+/*********************************************下单页面事件区域*************************************************/
+
+var PrintProductAttribute = function (obj) {
+    obj = JSON.parse(obj);
+    var classs = obj['cfb738c4-bff6-11e8-bbc6-0a4b7569e232'],
+        color = obj['69d4e108-738a-11e8-a479-0610c52349b6'],
+        size = obj['d6d6361b-acea-11e8-bbc6-0a4b7569e232'];
+    var
+        colorel = $(".count_atrr .con"),
+        sizeel = $(".count_size .con");
+    // var isclasss = true;
+
+    //打印图片颜色分类
+    colorel.html("");
+    for (var i in color) {
+        for (var j in color[i]) {
+            var div = '<div class="tab" onclick="ColorClick(this,\'' + j + '\')"><img src="' + color[i][j] + '"></div>';
+            colorel.append($(div));
+            if (i == 0) {
+                // ColorClick(colorel.find(".tab").eq(0), j);
+                colorel.find(".tab").eq(0).addClass("tab-sel");
+                colorel.eq(0).parent().find("span").html(j);
+            }
+        }
+    }
+
+    //打印尺寸分类
+    if (size && !$.isEmptyObject(size)) {
+        sizeel.html("");
+        for (var i in size) {
+            for (var j in size[i]) {
+                var div = '<label class="tab" onclick="SizeClick(this)"><span>' + size[i][j] + '</span></label>';
+                sizeel.append($(div));
+                if (i == 0) {
+                    sizeel.find(".tab").eq(0).addClass("tab-sel");
+                }
+            }
+        }
+    }
+    else {
+        sizeel.parent().remove();
+    }
+
+    var classsel = $(".count_classs .con"), classs_obj, classs_a;
+    //打印套餐
+    if ($.isEmptyObject(classs)) {
+        $(".count_classs .con").parent().remove();
+        ProductAttrId.OrderNum = 1;
+    }
+    else {
+        classsel.html("");
+        $.each(classs, function (i, val) {
+            ProductAttrInfo++;
+            classs_obj = val;
+            $.each(val, function (j, val1) {
+                if (j == "type") {
+                    if ($(".dt-paramselect .meal").length != parseInt(val1)) {
+
+                        while (parseInt(val1) > $(".dt-paramselect .meal").length) {
+                            classs_a = $(".meal").eq(0).clone();
+                            classs_a.hide();
+                            $(".dt-paramselect").append(classs_a);
+                        }
+                        // for (var k = 0; k < parseInt(val1) - $(".dt-paramselect .meal").length; k++) {
+                        //     classs_a = $(".meal").eq(0).clone();
+                        //     classs_a.hide();
+                        //     $(".dt-paramselect").append(classs_a);
+                        // }
+                    }
+                }
+                else if (j != "type") {
+                    var div = '<label class="tab" onclick="ClasssClick(this,\'' + j + '\',\'' + val.type + '\')"><span>' + val1 + '</span></label>';
+                    classsel.append($(div));
+                    // div.onclick = function () {
+                    //     alert();
+                    // }
+                    // $(div).bind('click', function () {
+                    //     alert();
+                    // });
+
+                }
+            });
+        });
+        $(".dt-paramselect").append($(".u-fornum"));
+        $(".count_classs label").eq(0).click();
+
+        /*
+                if (ProductAttrInfo == 1) {
+                    ClasssClick($(".count_classs label").eq(0), ProductAttrId.ProductPrice, classs[0].type);
+                }
+                else {
+                    ClasssClick($(".count_classs label").eq(0), ProductAttrId.ProductPrice, ProductAttrInfo);
+                }
+        */
+
+        // for (var i in classs) {
+        //     for (var j in classs[i]) {
+        //         if (j == "type") {
+        //             // $(".u-fornum").before(colorel.parent().clone().hide());
+        //             // $(".u-fornum").before(sizeel.parent().clone().hide());
+        //             $(".secondsetmeal").append(colorel.parent().clone());
+        //             $(".secondsetmeal").append(sizeel.parent().clone());
+        //         }
+        //         else if (j != "type") {
+        //             var div = '<label class="tab" onclick="ClasssClick(this,\'' + j + '\')"><span>' + classs[i][j] + '</span></label>';
+        //             classsel.append($(div));
+        //         }
+        //     }
+        // }
+        // ClasssClick($(".count_classs label").eq(0));
+    }
+
+
+    console.log(obj);
+}
+
+/**/
+var ClasssClick = function (el, val, type) {
+    $(el.parentNode).find(".tab").removeClass("tab-sel");
+    $(el).addClass("tab-sel");
+    $(".meal").hide();
+    $(".meal").eq(0).show();
+    for (var i = 0; i < parseInt(type); i++) {
+        $(".meal").eq(i).show();
+    }
+    type ? ProductAttrId.OrderNum = type : "";
+    val ? ProductAttrId.ProductPrice = val : "";
+}
+
+/*选择颜色点击事件*/
+var ColorClick = function (el, val) {
+    $(el.parentNode).find(".tab").removeClass("tab-sel");
+    $(el).addClass("tab-sel");
+    $(el.parentNode.parentNode).find("span").html(val);
+
+    // $(el.parentNode).children().removeClass("checked");
+    // // $("#Color a").removeClass("checked");
+    // $(el).addClass("checked");
+    // if ($(el.parentNode).attr("id") === "Color") {
+    //     $("#ColorBanner").attr("src", $(el).attr("_src"));
+    // }
+    // var banner = escape($("#ColorBanner").attr("src")),
+    //     color = escape($("#Color a.checked").html()),
+    //     size = escape($("#Size a.checked").html());
+    // ProductAttrInfo = [];
+    // ProductAttrInfo.push(banner, color, size);
+}
+
+/*选择尺寸点击事件*/
+var SizeClick = function (el) {
+    $(el.parentNode).find(".tab").removeClass("tab-sel");
+    $(el).addClass("tab-sel");
+}
+
+/*购买数量添加*/
+var addnumber = function () {
+    $('.textWrap .num').html(parseInt($('.textWrap .num').html()) + 1);
+}
+
+/*购买数量减少*/
+var minnumber = function () {
+    if (parseInt($('.textWrap .num').html()) > 1) {
+        $('.textWrap .num').html(parseInt($('.textWrap .num').html()) - 1);
+    }
+}
+
+
+/*点击购买函数*/
+var goShop = function () {
+    // var num = parseInt($("#number").val()),
+    //     attr = ProductAttrInfo.join(),
+    //     str = "shop.html?pid=" + ProductId + "&attr=" + attr + "&num=" + num;
+    var num = parseInt($("#number").text()),
+        obj = [],
+        attr = {},
+        numobj = {},
+        url = "shop.html?pid=" + ProductId + "&attr=",
+        str = "";
+
+    numobj["Number"] = num;
+    numobj["Money"] = ProductAttrId.ProductPrice;
+    obj.push(numobj);
+
+    for (var i = 0; i < ProductAttrId.OrderNum; i++) {
+        attr = {};
+        attr["color"] = $(".meal").eq(i).find(".tt span").eq(0).text();
+        attr["img"] = $(".meal").eq(i).find("div.tab-sel img").attr("src");
+        attr["size"] = $(".meal").eq(i).find("label.tab-sel span").text();
+        obj.push(attr);
+    }
+
+    OrderPrice = parseInt(obj[0].Number) * parseInt(obj[0].Money);
+//facebook购物车推广事件,请勿删除!
+  fbq('track', 'AddToCart', {
+    value: OrderPrice,
+    currency: 'THB',
+    content_ids: 'ProductAttrId.ProductRemarks',
+    content_type: 'product_group',
+  });
+
+    str = escape(JsonToString(obj));
+    url += str;
+    console.log(url);
+    window.location.href = url;
+
+
+}
+
+
+getUrlParam = function (name) {
+    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
+    var r = window.location.search.substr(1).match(reg);  //匹配目标参数
+    if (r != null) return unescape(r[2]);
+    return null; //返回参数值
+}
+
+urlEncode = function (arr) {
+    var i; //循环初始化
+    for (i = 0; i < arr.length; i++) {
+        arr[i] = encodeURIComponent(encodeURIComponent(arr[i]));
+    }
+    return arr.join();
+}
+
+
+Roll = function () {
+    //$(".marquee ul").css('position', 'absolute');
+    animate();
+};
+
+animate = function () {
+    var boxHeight = $('.marquee').height();
+    var ulHeight = $(".marquee ul").height();
+    $(".marquee").css('top', 0);
+    $(".marquee").animate({scrollTop: $(".marquee")[0].scrollTop == 0 ? (ulHeight - boxHeight) : 0}, 10000, animate);
+}
+
+
+//json转换为string
+var JsonToString = function (obj) {
+    var i,
+        _type = false,
+        _str = "",
+        _type = typeof (obj); //获取类型
+    //开始序列化
+    if (obj == null) {
+    }
+    else {
+        obj = obj.valueOf(); //获取值 同时类型也为对应
+        if ("boolean,number".indexOf(_type) > -1) {//bool和number类型转化
+            _str = obj.toString();
+        }
+        else if (_type == "string") {//json处理字符串时需要加上 "\""符号
+            _str = "\"" + obj + "\"";
+        }
+        else if (typeof obj == "array") { //数组处理
+            _str = "[";
+            for (i = 0; i < obj.length; i++) {
+                _str += JsonToString(obj[i]) + ((i < obj.length - 1) ? "," : "")
+            }
+            ;_str += "]";
+            return _str
+        }
+        else {//object处理
+            _str = "{";
+            for (i in obj) {
+                if (obj.hasOwnProperty(i)) {
+                    if (_str.length > 1) {
+                        _str += ","
+                    }
+                    ;_str += "\"" + i + "\":" + JsonToString(obj[i]);
+                }
+            }
+            _str += "}";
+        }
+        return _str;
+    }
+}
+//评论图片查看
+var imgShow = function () {
+    var mySwiper = new Swiper('.swiper-container2', {
+        loop: false,
+        pagination: '.swiper-pagination2',
+    });
+    $("#comment").on("click", ".imgg img",
+        function () {
+            // var imgBox = $(this).parents(".imgg").find("img");
+            var imgBox = $("#comment .imgg img");
+
+
+            var i = $(imgBox).index(this);
+            $(".big_img .swiper-wrapper").html("")
+
+            for (var j = 0, c = imgBox.length; j < c; j++) {
+                $(".big_img .swiper-wrapper").append('<div class="swiper-slide"><div class="cell"><img src="' + imgBox.eq(j).attr("src") + '" / ></div></div>');
+            }
+            mySwiper.updateSlidesSize();
+            mySwiper.updatePagination();
+            $(".big_img").css({
+                "z-index": 1001,
+                "opacity": "1"
+            });
+            mySwiper.slideTo(i, 0, false);
+            return false;
+        });
+
+    $(".big_img").on("click",
+        function () {
+            $(this).css({
+                "z-index": "-1",
+                "opacity": "0"
+            });
+        });
+}

+ 331 - 0
new/js/shop.js

@@ -0,0 +1,331 @@
+var ProductInfo = "";
+var number = "";
+$(document).ready(function () {
+    init();
+
+});
+
+/*
+* 页面初始化函数
+* */
+init = function () {
+    var pid = getUrlParam("pid"),
+        attr = getUrlParam("attr");
+    // num = getUrlParam("num");
+    if (pid === "" || attr === "") {
+        go404Html();
+    }
+    else {
+        $(".goback").attr("href", "goods.html?pid=" + pid);
+        getProductInfo(pid);
+        selectCity();
+    }
+}
+
+getProductInfo = function (pid) {
+    var parameter = urlEncode(["SelectProduct", pid]);
+    $.ajax({
+        type: "post",
+        url: "/new/php/index.php",
+        data: {mode: parameter},
+        dataType: "json",
+        success: function (data) {
+            printProductInfo(data);
+        }
+    });
+}
+
+printProductInfo = function (data) {
+    if (data == -1 || data[0].length === 0) {
+        go404Html();
+    }
+    else {
+        $("#PageLoading").css({"display": "none"});
+        $("#PageWarp").css({"display": "block"});
+        ProductInfo = data[0][0];
+        // $("#goodName").html(data[0][0].ProductIntroduce);
+        var attr = JSON.parse(unescape(getUrlParam("attr")));
+        $(".m-orderItem").html("");
+        for (var i in attr) {
+            if (i == 0) {
+                $("#payment_amount").html(parseInt(attr[0].Money) * parseInt(attr[0].Number));
+                $("#total").html(parseInt(attr[0].Money) * parseInt(attr[0].Number));
+                number = attr[0].Number;
+		ProductInfo.ProductPrice = parseInt(attr[0].Money) * parseInt(attr[0].Number);
+                $(".number").html(attr[0].Number);//数量
+            }
+
+            if (i != 0) {
+                var a = '<div class="row-2 flexbox">' +
+                    '<div class="goodImg">' +
+                    '<img src="' + attr[i]['img'] + '" width="100%"/>' +
+                    '</div>' +
+                    '                    <div class="goodInfo flex">\n' +
+                    '                        <div class="goodName">' + ProductInfo.ProductName + '</div>\n' +
+                    '                        <div class="goodName ti">\n' +
+                    '                        <div class="goodStatus f-fr"><span>การจำแนกสี: ' + attr[i]['color'] + '</span></div>' +
+                    (attr[i]['size'] ? '<div class="goodStatus f-fr"><span>ขนาด:' + attr[i]["size"] + '</span></div>' : '') +
+                    '<div class="goodStatus f-fr"><span>จำนวน: ' + attr[0].Number + '</span></div>' +
+                    '                        </div>' +
+                    '</div>' +
+                    '</div>';
+                $(".m-orderItem").append(a);
+            }
+        }
+    }
+}
+
+submit = function () {
+    var lid = "",
+        ordernum = orderNum(),
+        pid = getUrlParam("pid"),
+        pcid = escape(getUrlParam("attr")),
+        attr = "",
+        ppr = ProductInfo.ProductPrice,
+        pn = number,
+        urn = $("#UserReallyName").val().trim(),
+        upn = $("#thaphone").val().trim(),
+        uem = $("#UserEMail").val().trim(),
+        pc = $("#tha_postal").val().trim(),
+        p = $("#Province").html(),
+        c = "",
+        a = $("#Area").val().trim(),
+        address = $("#Address").val().trim(),
+        rem = $("#Remarks").val().trim(),
+        fr = 0,
+        am = ProductInfo.ProductPrice,
+        pay = ProductInfo.ProductPrice,
+        state = 1;
+
+    if (urn == "") {
+        // alert("请输入姓名");
+        alert("กรุณาป้อนชื่อ");
+        return;
+    }
+    else if (upn == "") {
+        // alert("请输入手机号码");
+        alert("โปรดระบุหมายเลขโทรศัพท์มือถือ");
+        return;
+    }
+/*
+    else if (uem == "") {
+        // alert("请输入电子邮件");
+        alert("กรุณาใส่อีเมล์");
+        return;
+    }
+*/
+    else if (pc == "") {
+        // alert("请输入邮编");
+        alert("กรุณาใส่รหัสไปรษณีย์");
+        return;
+    }
+    else if (p == "") {
+        // alert("请输入省份");
+        alert("โปรดระบุจังหวัด");
+        return;
+    }
+    else if (a == "") {
+        // alert("请输入直辖区");
+        alert("โปรดระบุเขตอำเภอเมือง");
+        return;
+    }
+    else if (address == "") {
+        // alert("请输入详细地址");
+        alert("โปรดระบุรายละเอียดที่อยู่");
+        return;
+    }
+/*
+    else if (rem == "") {
+        // alert("请输入留言");
+        alert("กรุณาป้อนข้อความ");
+        return;
+    }
+*/
+
+    $("#PageLoading").css({"display": "block"});
+    $("#PageWarp").css({"display": "none"});
+
+    var parameter = urlEncode(["InsertOrder", lid, ordernum, pid, pcid, attr, ppr, pn, urn, upn, uem, pc, p, c, a, address, rem, fr, am, pay, state]);
+    $.ajax({
+        type: "post",
+        url: "/new/php/index.php",
+        data: {mode: parameter},
+        dataType: "json",
+        success: function (data) {
+            if (data != -1 && data[0].OrderId) {
+
+/*
+                    console.log(data);
+                    $("#PageLoading").css({"display": "none"});
+                    $("#PageWarp").css({"display": "none"});
+                    $("#PageWarp").remove();
+                    $("#ts_OrderNum").html(data[0].OrderNum);
+                    $("#ts_UserReallyName").html(data[0].UserReallyName);
+                    $("#ts_ProductName").html(ProductInfo.ProductName);
+                    $("#ts_Payment").html(data[0].Payment);
+                    $("#ts_UserPhoneNum").html(data[0].UserPhoneNum);
+                    $("#ts_Address").html(data[0].Address);
+                    $("#TS").css({"display": "block"});
+                    $("#ts_back")[0].onclick = function () {
+                        window.location.href = "goods.html?pid=" + getUrlParam("pid");
+                    }
+                    $("#ts_lx")[0].onclick = function () {
+                        window.location.href = " https://www.facebook.com/pg/MinimatterTimes";
+                    }
+
+*/
+
+
+
+
+
+                insertUserIpAddress(ordernum, function () {
+                    console.log(data);
+                    $("#PageLoading").css({"display": "none"});
+                    $("#PageWarp").css({"display": "none"});
+                    $("#PageWarp").remove();
+                    $("#ts_OrderNum").html(data[0].OrderNum);
+                    $("#ts_UserReallyName").html(data[0].UserReallyName);
+                    $("#ts_ProductName").html(ProductInfo.ProductName);
+                    $("#ts_Payment").html(data[0].Payment);
+                    $("#ts_UserPhoneNum").html(data[0].UserPhoneNum);
+                    $("#ts_Address").html(data[0].Address);
+                    $("#TS").css({"display": "block"});
+                    $("#ts_back")[0].onclick = function () {
+                        window.location.href = "goods.html?pid=" + getUrlParam("pid");
+                    }
+                    $("#ts_lx")[0].onclick = function () {
+                        window.location.href = " https://www.facebook.com/pg/MinimatterTimes";
+                    }
+                });
+
+            }
+            else {
+                alert("ซื้อล้มเหลวกรุณาติดต่อฝ่ายบริการลูกค้า ต้องขอโทษด้วยครับไม่สะดวก!!!");
+            }
+        }
+    });
+
+    //facebook推广购物事件,请不要删除!!!!!
+    fbq('track', 'Purchase', {
+        value: ProductInfo.ProductPrice,
+        currency: 'THB',
+        content_ids: ProductInfo.ProductRemarks,
+        content_type: 'product_group'
+    });
+}
+
+
+/*
+* 获取下单用户ip地址插入数据库
+* */
+insertUserIpAddress = function (num, cb) {
+    var IPAddress = returnCitySN.cip,
+        country = returnCitySN.cname,
+        city = '',
+        parameter = urlEncode(["InsertOrderIPAddress", num, IPAddress, country, city]);
+    $.ajax({
+        type: "post",
+        url: "/new/php/index.php",
+        data: {mode: parameter},
+        dataType: "json",
+        success: function (data) {
+            if (data == 1) {
+                cb && cb();
+            }
+        }
+    });
+}
+
+
+/*
+* 根据当前时间,生成订单号
+* */
+orderNum = function () {
+    var vNow = new Date(), sNow = "";
+    sNow += String(vNow.getFullYear());
+    sNow += String(vNow.getMonth() + 1);
+    sNow += String(vNow.getDate());
+    sNow += String(vNow.getHours());
+    sNow += String(vNow.getMinutes());
+    sNow += String(vNow.getSeconds());
+    sNow += String(vNow.getMilliseconds());
+    return sNow;//返回订单号
+}
+
+/*
+* 输入泰国指定的邮政编码,生成指定的泰国地址。
+* */
+selectCity = function () {
+    $('#tha_postal').change(function () {
+        var id = $(this).val();
+        ajaxLocked = true;
+        $.ajax({
+            url: '/new/php/Forward.php',
+            type: 'post',
+            data: {'postName': id},
+            dataType: 'json',
+            success: function (ret) {
+                if (ret) {
+                    if (ret.length != 0) {
+                        var option = "";
+                        for (var i in ret) {
+                            option += '<option value="' + ret[i].name + '" data-city="' + ret[i].parent_name + '">' + ret[i].name + '</option>';
+                            $('.regions').html(ret[0].parent_name);
+                            $('input[name="city"]').val(ret[0].parent_name);
+                        }
+                        $(".tha_district").html('').append(option);
+                        ajaxLocked = false;
+                    } else {
+                        alert('รหัสไปรษณีย์ ผิด!');
+                        $('#tha_postal').val('');
+                        $('.tha_district').html('');
+                        $('.regions').html('');
+                        $('input[name="city"]').val('');
+                        ajaxLocked = true;
+                    }
+                } else {
+                    alert('รหัสไปรษณีย์ ผิด!');
+                    $('#tha_postal').val('');
+                    $('.tha_district').html('');
+                    $('.regions').html('');
+                    $('input[name="city"]').val('');
+                    ajaxLocked = true;
+                }
+            },
+            error: function (xhr, ajaxOptions, thrownError) {
+            }
+        });
+    });
+}
+
+/*
+* 获取url参数
+* @param {string} 需要获取参数的名字
+* */
+getUrlParam = function (name) {
+    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
+    var r = window.location.search.substr(1).match(reg);  //匹配目标参数
+    if (r != null) return unescape(r[2]);
+    return null; //返回参数值
+}
+
+/*
+* 将字符串拼接成数组,并且修改成指定格式。用于ajax上传。
+* @param {array}
+* */
+urlEncode = function (arr) {
+    var i; //循环初始化
+    for (i = 0; i < arr.length; i++) {//循环对数组各元素进行加密
+        arr[i] = encodeURIComponent(encodeURIComponent(arr[i]));
+    }
+    return arr.join();//转换为字符串返回
+}
+
+/*
+* 页面跳转指定的404页面
+* */
+go404Html = function () {
+    window.location.href = "../404.html";
+}
+

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 18 - 0
new/js/swiper.min.js


+ 115 - 0
new/php/Forward.php

@@ -0,0 +1,115 @@
+<?php
+/**
+ * ajax业务处理中的接口转发层,解决ajax跨域访问的问题
+ *   工作原理:问请求通过本程序做中转,在本地服务器层完成与远程服务接口的交互
+ *   备注:使用时 URL_ROOT 这个参数需要根据你的目标接口地址进行修改,本转发层之能用于单接口的Web Service接口服务
+ *        程序支持POST数据与GET数量的同时转发;
+ * @version 1.0.0.2
+ * @author JerryLi lijian@dzs.mobi
+ * @copyright b.dzs.mobi 2012-11-16
+ * */
+class interface_relay
+{
+    /**接口根地址(此处是需要修改的地方)*/
+    const URL_ROOT = 'http://www.uessq.com/region.php';
+    /**字符集*/
+    const CHARSET = 'UTF-8';
+    /**GET*/
+    private $msGets = '';
+    /**POST*/
+    private $maGetPostData = array();
+
+    function __construct()
+    {
+        $this->getPOST();
+        $this->getGET();
+        if($this->msGets != '' || count($this->maGetPostData) > 0)
+        {	//存在输入数据
+//            if(count($this->msGets) > 0)
+//                $sUrl = self::URL_ROOT .'?'. $this->msGets;
+//            else
+                $sUrl = self::URL_ROOT;
+            header('Content-Type: text/html; charset='. self::CHARSET);
+            echo $this->getContent($sUrl);
+        }
+        else
+        {
+            header('Content-Type: text/html; charset='. self::CHARSET);
+            echo $this->getContent(self::URL_ROOT);
+        }
+    }
+
+    function __destruct()
+    {
+        unset($maGetPostData, $msGets);
+    }
+
+    /**
+     * 载入POST数据
+     * @return bool
+     * */
+    private function getPOST()
+    {
+        $handle = @fopen('php://input', 'r');
+        $data = '';
+        do
+        {
+            $data = @fread($handle, 1024);
+            if (strlen($data) == 0)
+                break;
+            else
+                $this->maGetPostData[] = $data;
+        }while(true);
+        fclose($handle);
+        unset($data, $handle);
+        return count($this->maGetPostData) >= 1;
+    }
+
+    /**
+     * 载入GET数据
+     * @return bool
+     * */
+    private function getGET()
+    {
+        /*取得GET内容*/
+        if (count($_GET) > 0)
+        {
+            $aTmp = array();
+            foreach ($_GET as $sKey => $sVal)
+                $aTmp[] = $sKey .'='. urlencode($sVal);
+            $this->msGets = implode('&', $aTmp);
+            return true;
+        }
+        else
+            return false;
+    }
+
+    /**
+     * 读取远程接口返回的内容
+     * @return string
+     * */
+    private function getContent($sGetUrl)
+    {
+        /**/
+        $ch = curl_init();
+        curl_setopt ($ch, CURLOPT_URL, $sGetUrl); //设置GET的URL地址
+        curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);//将结果保存成字符串
+        curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 10);//连接超时时间s
+        curl_setopt ($ch, CURLOPT_TIMEOUT, 10);//执行超时时间s
+        curl_setopt ($ch, CURLOPT_DNS_CACHE_TIMEOUT, 1800);//DNS解析缓存保存时间半小时
+        curl_setopt($ch, CURLOPT_HEADER,0);//丢掉头信息
+        if (count($this->maGetPostData) > 0)
+        {	//存在POST数据需要提交
+            curl_setopt($ch, CURLOPT_POST, 1); //启用POST数据
+            curl_setopt($ch, CURLOPT_POSTFIELDS, implode('', $this->maGetPostData));//提交POST数据
+        }
+        $sData = curl_exec($ch);
+        curl_close($ch);
+        unset($ch);
+        return $sData;
+    }
+}
+
+$o = new interface_relay();
+unset($o);
+?>

+ 158 - 0
new/php/excel.php

@@ -0,0 +1,158 @@
+
+<?php
+error_reporting(0);
+/**
+ * 导出excel(csv)
+ * @data 导出数据
+ * @headlist 第一行,列名
+ * @fileName 输出Excel文件名
+ */
+// $data = print_r(base64_encode(unserialize($_POST['post_data'])));
+//$data = array(array( "产品编号"=>"51","产品Id"=>"555"), array("产品Id"=>"665", "产品编号"=>"50"));
+// print_r($data);
+
+//   }
+/*
+语法mysqli_connect(host,username,passwd,dbname,port);
+mysqli_connect()方法具有返回值,返回值就是PHP与MySQL数据库建立连接的连接对象
+*host - MySQL数据库所在的计算机的ip地址
+* username - 登陆MySQL数据库的用户名称
+* passwd - 登陆MySQL数据库的用户密码(如果密码为空则写  “” 站位)
+* dbname - 要操作的数据库的名称
+* port - MySQL数据库所使用的端口号
+*/
+    //1.建立连接
+    // $starttime=$_GET['val1'];
+    // $endtime=$_GET['val2'];
+    // $val3=$_GET['val3'];
+    // $val4=$_GET['val4'];
+    // $val5=$_GET['val5'];
+    // $val6=$_GET['val6'];
+
+    // $valArr = json_decode($_GET['vals']);
+    // echo $valArr;
+    $valArr = $_GET['vals'];
+    $m=mysqli_connect('127.0.0.1','root','usestudio-1','NewShop','3306');    
+    //判断如果数据库连接不成功
+    if ($m->connect_error) {
+        //返回错误,结束运行,退出脚本。
+        //echo json_encode(Array("Error" => $m->connect_errno . " - " . $m->connect_error));
+        return;
+    }
+    //2.定义sql语句,设置字符集
+    #$guid = trim(com_create_guid(),"{}");//随机生成的唯一标识码
+    #$sql = "insert into jyc_test(UserId,UserName,UserPassWord,time) values('".$guid."','jyc','123456',now())";    
+    #$sql = "select * from jyc_test";
+    //$sql = "CALL test_fc( '201810419327450') ";
+    // $sql = "CALL SelectOrderInfo( $starttime, $endtime,$val3,$val4,$val5,$val6) ";
+    // $sql = "CALL SelectOrderInfo( '2018-10-11','2018-10-12','','','1','10000') ";
+
+    $sql = "CALL PrintExcel('".$valArr."');";
+    //设置字符集
+    $m->set_charset('utf8');   
+    $m->query("set character set 'utf8';");
+    //执行存储过程语句
+   // $res = $m->query($sql);
+
+    //判断返回值的类型是否是布尔型,如果是布尔型,返回字符串"true";
+    $arr = array();
+    $arr1 = array();
+    $all_rows = array();  //定义一个数组,用于存放结果集
+    $r = array();
+    
+    $m -> multi_query(urldecode($sql));
+
+    $s = array();
+    if ($res=$m -> store_result()){
+        while($row = $res->fetch_array(MYSQLI_ASSOC)){
+            //   array_push($s, $v);
+                $arr["OrderId"]="A10107A";
+                $arr["LogisticsChannel"]=" ";
+                $arr["OrderNum"]="\t".$row['OrderNum'];
+                $arr['UserReallyName']=$row['UserReallyName'];
+                $arr['Address']=$row['Address'].$row['City'].$row['Province'];
+                $arr['1']=" ";
+                $arr['2']=" ";
+                $arr['Area']=$row['Area'];
+                $arr['City']=$row['City'];
+                $arr['Province']=$row['Province'];
+                $arr['CountryCode']="TH";
+                $arr['PostalCode']=$row['PostalCode'];
+                $arr['UserPhoneNum']=$row['UserPhoneNum'];
+                $arr['IsCOD']="Y";
+                $arr['Payment']=$row['Payment'];
+                $arr['Service1']=" ";
+                $arr['CurrencyCode']="THB";
+                $arr['DeclaredValue']=$row['Amount'];
+                $arr['Weight']="0.5";
+                $arr['Volume']="26*17*16*1";
+                $arr['IsInsured']="N";
+                $arr['Insurance']=" ";
+                $arr['Sensitive']="N";
+                $arr['ServiceCode']="PDO";
+                $arr['Remarks']=$row['Remarks'];
+                $arr['ProductRemarks']=$row['ProductRemarks'];
+                $arr['EnglishName']=' ';//$row['EnglishName'];
+                $arr['SKU']=" ";
+                $arr['attribute1']=" ";
+                $arr['ProductIntroduce']=$row['ProductIntroduce'];
+                $arr['ProductNumber']=$row['ProductNumber'];
+                $arr['ProductPrice']=$row['ProductPrice'];
+                //把结果集放入到数据中
+                // array_push($all_rows, $row); 
+                array_push($arr1,$arr);
+
+            //  print_r($arr);
+        }
+    // //  array_push($r, $s);
+     }
+
+		// $j = json_encode(count($r) > 1 ? $r : (count($r) == 0  ? $m -> affected_rows : $r[0]));
+    //    print_r($r);
+
+    // echo($arr[Address]);
+
+
+    //关闭数据库连接
+    mysqli_close($m);     
+    $data = $arr1;
+    $headlist= array('商家编码',   '物流渠道',  '销售订单号',  '收件人姓名',  '收件人地址','','', '收件人区/县', '收件人城市',  '收件人省份','收件人国家二字简码','收件人邮编','收件人电话','是否COD','应收款额','增值服务','币种','货值','包裹重量','客户自测体积','是否保险','保额','是否有敏感货:Y/N','PDO ','备注','报关商品名称','报关商品英文名称','商家商品编码','产品属性(如颜色,尺寸)','商品销售链接','包裹内商品数量','单价');
+    // print_r($headlist);
+    $fileName='商家订单';
+    // function csv_export($data = array(), $headlist = array(), $fileName) {
+
+
+         header('Content-Type: text/csv; charset=utf-8');
+         header('Content-Disposition: attachment;filename="'.$fileName.'.csv"'); 
+         header('Cache-Control: max-age=0');
+
+        //打开PHP文件句柄,php://output 表示直接输出到浏览器
+        $fp = fopen('php://output', 'a');
+    //    fwrite($fp,xEFxBBxBF);
+  fwrite($fp,chr(0xEF).chr(0xBB).chr(0xBF));
+        //输出Excel列名信息
+        foreach ($headlist as $key => $value) {
+            //CSV的Excel支持GBK编码,一定要转换,否则乱码
+              $headlist[$key] = iconv('gbk',  'utf-8', $value);
+        }
+      
+
+        //将数据通过fputcsv写到文件句柄
+       fputcsv($fp, $headlist);
+
+        $count = count($data);
+
+
+       for ($i = 0; $i <  $count; $i++) {
+            $row = $data[$i];
+
+	 foreach ($row as $key => $value) {
+            //CSV的Excel支持GBK编码,一定要转换,否则乱码
+              $row[$key] = iconv('utf-8',  'utf-8', $value);
+        	 }
+
+            fputcsv($fp, $row);
+       }
+fclose($fp);
+
+?>

+ 150 - 0
new/php/fc.php

@@ -0,0 +1,150 @@
+<?php
+error_reporting(0);
+/**
+ * 导出excel(csv)
+ * @data 导出数据
+ * @headlist 第一行,列名
+ * @fileName 输出Excel文件名
+ */
+// $data = print_r(base64_encode(unserialize($_POST['post_data'])));
+//$data = array(array( "产品编号"=>"51","产品Id"=>"555"), array("产品Id"=>"665", "产品编号"=>"50"));
+// print_r($data);
+
+//   }
+/*
+语法mysqli_connect(host,username,passwd,dbname,port);
+mysqli_connect()方法具有返回值,返回值就是PHP与MySQL数据库建立连接的连接对象
+*host - MySQL数据库所在的计算机的ip地址
+* username - 登陆MySQL数据库的用户名称
+* passwd - 登陆MySQL数据库的用户密码(如果密码为空则写  “” 站位)
+* dbname - 要操作的数据库的名称
+* port - MySQL数据库所使用的端口号
+*/
+    //1.建立连接
+    // $starttime=$_GET['val1'];
+    // $endtime=$_GET['val2'];
+    // $val3=$_GET['val3'];
+    // $val4=$_GET['val4'];
+    // $val5=$_GET['val5'];
+    // $val6=$_GET['val6'];
+
+    // $valArr = json_decode($_GET['vals']);
+    // echo $valArr;
+    $valArr = $_GET['vals'];
+    $m=mysqli_connect('18.222.144.77','root','usestudio-1','shop','3306');    
+    //判断如果数据库连接不成功
+    if ($m->connect_error) {
+        //返回错误,结束运行,退出脚本。
+        echo json_encode(Array("Error" => $m->connect_errno . " - " . $m->connect_error));
+        return;
+    }
+    //2.定义sql语句,设置字符集
+    #$guid = trim(com_create_guid(),"{}");//随机生成的唯一标识码
+    #$sql = "insert into jyc_test(UserId,UserName,UserPassWord,time) values('".$guid."','jyc','123456',now())";    
+    #$sql = "select * from jyc_test";
+    //$sql = "CALL test_fc( '201810419327450') ";
+    // $sql = "CALL SelectOrderInfo( $starttime, $endtime,$val3,$val4,$val5,$val6) ";
+    // $sql = "CALL SelectOrderInfo( '2018-10-11','2018-10-12','','','1','10000') ";
+
+    $sql = "CALL test_fc($valArr) ";
+    //设置字符集
+    $m->set_charset('utf8');   
+    $m->query("set character set 'utf8';");
+    //执行存储过程语句
+   // $res = $m->query($sql);
+
+    //判断返回值的类型是否是布尔型,如果是布尔型,返回字符串"true";
+    $arr = array();
+    $arr1 = array();
+    $all_rows = array();  //定义一个数组,用于存放结果集
+    $r = array();
+    
+    $m -> multi_query(urldecode($sql));
+
+    $s = array();
+    if ($res=$m -> store_result()){
+        while($row = $res->fetch_array(MYSQLI_ASSOC)){
+            //   array_push($s, $v);
+                $arr["OrderId"]="A10107A";
+                $arr["LogisticsChannel"]=" ";
+                $arr["OrderNum"]=$row['OrderNum'];
+                $arr['UserReallyName']=$row['UserReallyName'];
+                $arr['Address']=$row['Address'].$row['City'].$row['Province'];
+                $arr['1']=" ";
+                $arr['2']=" ";
+                $arr['Area']=$row['Area'];
+                $arr['City']=$row['City'];
+                $arr['Province']=$row['Province'];
+                $arr['CountryCode']="TH";
+                $arr['PostalCode']=$row['PostalCode'];
+                $arr['UserPhoneNum']=$row['UserPhoneNum'];
+                $arr['IsCOD']="Y";
+                $arr['Payment']=$row['Payment'];
+                $arr['Service1']=" ";
+                $arr['CurrencyCode']="THB";
+                $arr['DeclaredValue']=$row['Amount'];
+                $arr['Weight']="0.5";
+                $arr['Volume']="26*17*16*1";
+                $arr['IsInsured']="N";
+                $arr['Insurance']=" ";
+                $arr['Sensitive']="N";
+                $arr['ServiceCode']="PDO";
+                $arr['Remarks']=$row['Remarks'];
+                $arr['ProductRemarks']=$row['ProductRemarks'];
+                $arr['EnglishName']=' ';//$row['EnglishName'];
+                $arr['SKU']=" ";
+                $arr['attribute1']=" ";
+                $arr['ProductIntroduce']=$row['ProductIntroduce'];
+                $arr['ProductNumber']=$row['ProductNumber'];
+                $arr['ProductPrice']=$row['ProductPrice'];
+                //把结果集放入到数据中
+                // array_push($all_rows, $row); 
+                array_push($arr1,$arr);
+
+            //  print_r($arr);
+        }
+    // //  array_push($r, $s);
+     }
+
+		// $j = json_encode(count($r) > 1 ? $r : (count($r) == 0  ? $m -> affected_rows : $r[0]));
+    //    print_r($r);
+
+    // echo($arr[Address]);
+
+
+    //关闭数据库连接
+    mysqli_close($m);     
+    $data = $arr1;
+    $headlist= array('商家编码',   '物流渠道',  '销售订单号',  '收件人姓名',  '收件人地址','','', '收件人区/县', '收件人城市',  '收件人省份','收件人国家二字简码','收件人邮编','收件人电话','是否COD','应收款额','增值服务','币种','货值','包裹重量','客户自测体积','是否保险','保额','是否有敏感货:Y/N','PDO ','备注','报关商品名称','报关商品英文名称','商家商品编码','产品属性(如颜色,尺寸)','商品销售链接','包裹内商品数量','单价');
+    // print_r($headlist);
+    $fileName='商家订单';
+    // function csv_export($data = array(), $headlist = array(), $fileName) {
+    
+         header('Content-Type: application/vnd.ms-excel;charset=utf-8');
+         header('Content-Disposition: attachment;filename="'.$fileName.'.csv"');
+         header('Cache-Control: max-age=0');
+    //    echo(chr(255).chr(254));
+
+        //打开PHP文件句柄,php://output 表示直接输出到浏览器
+        $fp = fopen('php://output', 'a');
+        
+        //输出Excel列名信息
+        foreach ($headlist as $key => $value) {
+            //CSV的Excel支持GBK编码,一定要转换,否则乱码
+                $headlist[$key] = mb_convert_encoding($value,'UTF-8','UTF-8'). "\n"; //$value;// iconv('utf-8', 'gbk', $value);
+        }
+      
+    //  fwrite($fp, chr(0xEF).chr(0xBB).chr(0xBF));
+        //将数据通过fputcsv写到文件句柄
+        fputcsv($fp, $headlist);
+        $count = count($data);
+       for ($i = 0; $i < $count; $i++) {
+            $row = $data[$i];
+            foreach ($row as $key => $value) {
+             $row[$key] = mb_convert_encoding($value,'UTF-8', 'UTF-8'). "\n";// mb_convert_encoding($value, 'gbk','utf-8');; //$value;
+                //iconv('utf-8', 'ASCII//IGNORE', $value);
+            }
+            fputcsv($fp, $row);
+       }
+
+?>

+ 11 - 0
new/php/index.php

@@ -0,0 +1,11 @@
+<?php
+	header('text/html;application/json;charset=utf-8;');
+	header('Access-Control-Allow-Origin: *');
+	header('Access-Control-Allow-Headers:Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With;');
+	include('mysql.php'); //引用连接数据库接
+	if (isset($_POST['mode'])) { echo con::usselect($_POST['mode']); }
+	else if(isset($_GET['mode'])){ echo con::usselect($_GET['mode']); } //Ajax处理
+//	else if(isset($_GET['parame'])){ echo $_GET['callback']."(U.M.toList(".(con::usselect($_GET['parame']))."));"; } //Jsonp处理
+	else { echo ""; }//无参数错
+
+//echo $_POST['mode'];

+ 125 - 0
new/php/ip.php

@@ -0,0 +1,125 @@
+<?php
+
+// 指定允许其他域名访问
+header('Access-Control-Allow-Origin:*');
+// 响应类型
+header('Access-Control-Allow-Methods:POST');
+// 响应头设置
+header('Access-Control-Allow-Headers:x-requested-with,content-type');
+
+/**
+ * ajax业务处理中的接口转发层,解决ajax跨域访问的问题
+ *   工作原理:问请求通过本程序做中转,在本地服务器层完成与远程服务接口的交互
+ *   备注:使用时 URL_ROOT 这个参数需要根据你的目标接口地址进行修改,本转发层之能用于单接口的Web Service接口服务
+ *        程序支持POST数据与GET数量的同时转发;
+ * @version 1.0.0.2
+ * @author JerryLi lijian@dzs.mobi
+ * @copyright b.dzs.mobi 2012-11-16
+ * */
+class interface_relay
+{
+    /**接口根地址(此处是需要修改的地方)*/
+//    const URL_ROOT = 'http://gd.geobytes.com/GetCityDetails?ie=utf-8';
+    const URL_ROOT = 'http://pv.sohu.com/cityjson?ie=utf-8';
+//    const URL_ROOT = 'http://hs.1473.cn/php/index.php?mode=outside.1473.cn,US_HospitalSystem,HS_HT_SelectDepartment,,10,1';
+    /**字符集*/
+    const CHARSET = 'UTF-8';
+    /**GET*/
+    private $msGets = '';
+    /**POST*/
+    private $maGetPostData = array();
+
+    function __construct()
+    {
+        $this->getPOST();
+        $this->getGET();
+        if($this->msGets != '' || count($this->maGetPostData) > 0)
+        {	//存在输入数据
+//            if(count($this->msGets) > 0)
+//                $sUrl = self::URL_ROOT .'?'. $this->msGets;
+//            else
+                $sUrl = self::URL_ROOT;
+            header('Content-Type: text/html; charset='. self::CHARSET);
+            echo $this->getContent($sUrl);
+        }
+        else
+        {
+            header('Content-Type: text/html; charset='. self::CHARSET);
+            echo $this->getContent(self::URL_ROOT);
+        }
+    }
+
+    function __destruct()
+    {
+        unset($maGetPostData, $msGets);
+    }
+
+    /**
+     * 载入POST数据
+     * @return bool
+     * */
+    private function getPOST()
+    {
+        $handle = @fopen('php://input', 'r');
+        $data = '';
+        do
+        {
+            $data = @fread($handle, 1024);
+            if (strlen($data) == 0)
+                break;
+            else
+                $this->maGetPostData[] = $data;
+        }while(true);
+        fclose($handle);
+        unset($data, $handle);
+        return count($this->maGetPostData) >= 1;
+    }
+
+    /**
+     * 载入GET数据
+     * @return bool
+     * */
+    private function getGET()
+    {
+        /*取得GET内容*/
+        if (count($_GET) > 0)
+        {
+            $aTmp = array();
+            foreach ($_GET as $sKey => $sVal)
+                $aTmp[] = $sKey .'='. urlencode($sVal);
+            $this->msGets = implode('&', $aTmp);
+            return true;
+        }
+        else
+            return false;
+    }
+
+    /**
+     * 读取远程接口返回的内容
+     * @return string
+     * */
+    private function getContent($sGetUrl)
+    {
+        /**/
+        $ch = curl_init();
+        curl_setopt ($ch, CURLOPT_URL, $sGetUrl); //设置GET的URL地址
+        curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);//将结果保存成字符串
+        curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 10);//连接超时时间s
+        curl_setopt ($ch, CURLOPT_TIMEOUT, 10);//执行超时时间s
+        curl_setopt ($ch, CURLOPT_DNS_CACHE_TIMEOUT, 1800);//DNS解析缓存保存时间半小时
+        curl_setopt($ch, CURLOPT_HEADER,0);//丢掉头信息
+        if (count($this->maGetPostData) > 0)
+        {	//存在POST数据需要提交
+            curl_setopt($ch, CURLOPT_POST, 1); //启用POST数据
+            curl_setopt($ch, CURLOPT_POSTFIELDS, implode('', $this->maGetPostData));//提交POST数据
+        }
+        $sData = curl_exec($ch);
+        curl_close($ch);
+        unset($ch);
+        return $sData;
+    }
+}
+
+$o = new interface_relay();
+unset($o);
+?>

+ 90 - 0
new/php/mysql.php

@@ -0,0 +1,90 @@
+<?php
+
+//连接mysql类
+class con
+{
+    public static $all = array(); //连接数组
+    private $host = "127.0.0.1"; //数据库地址
+    private $un = "root"; //用户名
+    private $ps = "usestudio-1"; //密码
+    private $db = "NewShop"; //密码
+    public $sql; //连接
+
+//private $host = "18.222.144.77"; //数据库地址
+//    private $host = "127.0.0.1"; //数据库地址
+//    private $un = "root"; //用户名
+//    private $ps = ""; //密码
+//    private $db = "shop"; //密码
+//    public $sql; //连接
+
+    //处理结束
+    public static function close($s)
+    {
+        if (is_resource($s)) {
+            return mysqli_close($s);
+        } else {
+            return true;
+        }
+    }
+
+    //构造连接数据库
+    public function __construct()
+    {
+        //清除缓存
+        ob_clean();
+        $this->sql = new mysqli($this->host, $this->un, $this->ps, $this->db);
+    }
+
+    //mysql调用
+    public static function usselect($p)
+    {
+        $a = explode(",", $p);
+        $e = (new con());
+        $e = $e->sql;
+        $j = "";
+        //错误处理
+        if ($e->connect_error) {
+            return "";
+        }
+        $e->set_charset("utf8");
+        $s = "";
+
+        $e->query("set character set 'utf8';");
+        $res = "";
+        $sqlname = urldecode(urldecode($a[0]));
+        if (count($a) > 1) {
+            for ($i = 1; $i < count($a); $i++) {
+                $a[$i] = urldecode(urldecode($a[$i]));
+            }
+            $s = "CALL " . $sqlname . "('" . join("','", array_slice($a, 1)) . "');";
+        } else {
+            $s = "CALL " . $sqlname . "()";
+        }
+//       echo $s;
+        $r = array();
+
+        $e->multi_query(urldecode($s));
+        do {
+            $s = array();
+            if ($res = $e->store_result()) {
+                while ($v = $res->fetch_array(MYSQLI_ASSOC)) {
+                    array_push($s, $v);
+                }
+                array_push($r, $s);
+            }
+
+        } while ($e->more_results() && $e->next_result());
+
+        $j = json_encode(count($r) > 1 ? $r : (count($r) == 0 ? $e->affected_rows : $r[0]));
+        con::close($e);
+        return $j; //获取返回的值
+    }
+
+    //回收占用问题
+    function __destruct()
+    {
+        con::close($this->sql);
+    }
+}
+
+?>

+ 115 - 0
new/php/test.php

@@ -0,0 +1,115 @@
+<?php
+/**
+ * ajax业务处理中的接口转发层,解决ajax跨域访问的问题
+ *   工作原理:问请求通过本程序做中转,在本地服务器层完成与远程服务接口的交互
+ *   备注:使用时 URL_ROOT 这个参数需要根据你的目标接口地址进行修改,本转发层之能用于单接口的Web Service接口服务
+ *        程序支持POST数据与GET数量的同时转发;
+ * @version 1.0.0.2
+ * @author JerryLi lijian@dzs.mobi
+ * @copyright b.dzs.mobi 2012-11-16
+ * */
+class interface_relay
+{
+    /**接口根地址(此处是需要修改的地方)*/
+    const URL_ROOT = 'https://www.zaful.com';
+    /**字符集*/
+    const CHARSET = 'UTF-8';
+    /**GET*/
+    private $msGets = '';
+    /**POST*/
+    private $maGetPostData = array();
+
+    function __construct()
+    {
+        $this->getPOST();
+        $this->getGET();
+        if($this->msGets != '' || count($this->maGetPostData) > 0)
+        {	//存在输入数据
+//            if(count($this->msGets) > 0)
+//                $sUrl = self::URL_ROOT .'?'. $this->msGets;
+//            else
+                $sUrl = self::URL_ROOT;
+            header('Content-Type: text/html; charset='. self::CHARSET);
+            echo $this->getContent($sUrl);
+        }
+        else
+        {
+            header('Content-Type: text/html; charset='. self::CHARSET);
+            echo $this->getContent(self::URL_ROOT);
+        }
+    }
+
+    function __destruct()
+    {
+        unset($maGetPostData, $msGets);
+    }
+
+    /**
+     * 载入POST数据
+     * @return bool
+     * */
+    private function getPOST()
+    {
+        $handle = @fopen('php://input', 'r');
+        $data = '';
+        do
+        {
+            $data = @fread($handle, 1024);
+            if (strlen($data) == 0)
+                break;
+            else
+                $this->maGetPostData[] = $data;
+        }while(true);
+        fclose($handle);
+        unset($data, $handle);
+        return count($this->maGetPostData) >= 1;
+    }
+
+    /**
+     * 载入GET数据
+     * @return bool
+     * */
+    private function getGET()
+    {
+        /*取得GET内容*/
+        if (count($_GET) > 0)
+        {
+            $aTmp = array();
+            foreach ($_GET as $sKey => $sVal)
+                $aTmp[] = $sKey .'='. urlencode($sVal);
+            $this->msGets = implode('&', $aTmp);
+            return true;
+        }
+        else
+            return false;
+    }
+
+    /**
+     * 读取远程接口返回的内容
+     * @return string
+     * */
+    private function getContent($sGetUrl)
+    {
+        /**/
+        $ch = curl_init();
+        curl_setopt ($ch, CURLOPT_URL, $sGetUrl); //设置GET的URL地址
+        curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);//将结果保存成字符串
+        curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 10);//连接超时时间s
+        curl_setopt ($ch, CURLOPT_TIMEOUT, 10);//执行超时时间s
+        curl_setopt ($ch, CURLOPT_DNS_CACHE_TIMEOUT, 1800);//DNS解析缓存保存时间半小时
+        curl_setopt($ch, CURLOPT_HEADER,0);//丢掉头信息
+        if (count($this->maGetPostData) > 0)
+        {	//存在POST数据需要提交
+            curl_setopt($ch, CURLOPT_POST, 1); //启用POST数据
+            curl_setopt($ch, CURLOPT_POSTFIELDS, implode('', $this->maGetPostData));//提交POST数据
+        }
+        $sData = curl_exec($ch);
+        curl_close($ch);
+        unset($ch);
+        return $sData;
+    }
+}
+
+$o = new interface_relay();
+unset($o);
+?>

+ 270 - 0
new/shop.html

@@ -0,0 +1,270 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta content="yes" name="apple-mobile-web-app-capable">
+    <meta content="yes" name="apple-touch-fullscreen">
+    <meta content="telephone=no" name="format-detection">
+    <meta http-equiv="Content-type" content="text/html" charset="UTF-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=320, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
+    <meta name="viewport" content="width=device-width, target-densityDpi=medium-dpi">
+    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
+    <meta name="viewport"
+          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
+    <meta name="fragment" content="!">
+    <meta name="HandheldFriendly" content="true">
+    <link rel="stylesheet" href="css/shop.css">
+    <script src="js/jquery-2.2.3.min.js"></script>
+    <script src="js/shop.js"></script>
+</head>
+<body onunload="a()">
+
+<!--页面加载loading-->
+<div id="PageLoading" style="position: fixed;top: 50%;left: 50%;margin-left: -64px;margin-top: -64px;">
+    <img src="../images/loading.gif">
+</div>
+
+
+<div id="PageWarp" style="display: none">
+    <!--联系客服的按钮-->
+    <div class="show_contact" style="display: block;position: fixed;bottom: 75px;right: 15px;z-index: 99;">
+        <div class="show_contact_box"
+             style="background: #129BF4;border-radius: 50%;width: 50px;height: 50px;display: block;text-align: center;">
+            <a href="https://www.facebook.com/pg/MinimatterTimes" style="display: block">
+                <img src="images/kf.png" style="margin-top: 5px;width: 40px;display: inline-block;"/>
+            </a>
+        </div>
+    </div>
+
+    <!--中间填写资料页面内容-->
+    <div id="details">
+        <div>
+            <a class="goback" href="goods.html">
+                <i class="checkout-icons icon-goback"></i>
+                คลิ๊กเพื่อกลับหน้าหลัก
+            </a>
+        </div>
+        <div class="explain">
+            <h1>ตรวจสอบข้อมูล</h1>
+            <p>ทิปส์ รองรับบริการเก็บเงินปลายทาง +รวมค่าขนส่ง+ในกรณีที่ไม่มีผลกระทบต่อการขายครั้งที่สอง
+                คืนสินค้าได้ภายใน 7
+                วัน หลังจากท่านได้รับสินค้าแล้ว มีคำถามใดๆ โปรดติดต่อบริการลูกค้าออนไลน์ หรือติดต่อ email:
+                <a>mailboxฝ่ายบริการลูกค้าหลังการขายที่เขียนในใบพัสดุ</a> กรุณาใส่ชื่อและเบอร์มือถือของท่าน
+                พร้อมใส่เลขที่ใบสั่งซื้ออยู่ในอีเมลด้วย ขอบคุณค่ะ
+            </p>
+            <div style="font-size:12px;font-weight:900;">กรุณากรอกเบอร์โทรและรหัสไปรษณีย์ที่ถูกต้อง
+                เราจะจัดส่งให้เร็วขึ้นค่ะ
+            </div>
+        </div>
+
+        <div class="table">
+            <div class="flexbox ">
+                <div class="flex tab_two"><input type="text" required="required" name="name" placeholder="ชื่อ-นามสกุล"
+                                                 id="UserReallyName"></div>
+                <div class="flex tab_two">
+                    <input required="required" id="tha_postal" type="number" name="postal" placeholder="รหัสไปรษณีย์">
+                </div>
+            </div>
+            <div class="flexbox">
+                <div class="flex marleft" style="margin-left:0;">
+                    <div class="ui-col ui-col-100 ui-select">
+                        <input type="hidden" required="required" name="city" error="รหัสไปรษณีย์ ผิด!" value="">
+                        <select name="district" class="regions-city tha_district" required="" id="Area">
+                            <option>ตำบล อำเภอ</option>
+                        </select>
+                    </div>
+                </div>
+                <div class="flex regions" style="margin-left: 4px;" id="Province">จังหวัด</div>
+            </div>
+            <div class="table-row">
+                <input type="text" required="required" id="Address" name="address"
+                       placeholder="ที่อยู่ต้องมีเลขที่บ้าน……ถ.……ต.…… อ……จ.……">
+            </div>
+            <div class="flexbox"
+                 style="width: 95%;margin: 0 auto;line-height: 30px;padding: 10px 0;font-size: 12px;color: #ff5a5f;">
+                กรุณาระบุที่อยู่ที่ชัดเจน(เช่นบ้านเลขที่ หมู่ ซ. ถ. ต. อ. จ. ฯลฯ)
+            </div>
+
+
+            <div class="flexbox">
+                <div class="flex tab_two">
+                    <input type="number" required="required" name="mob" id="thaphone" error="กรุณากรอกเบอร์ที่ถูกต้อง"
+                           placeholder="เบอร์มือถือ">
+                </div>
+                <div class="flex tab_two">
+                    <input type="email" name="email" placeholder="อีเมล" id="UserEMail">
+                </div>
+            </div>
+            <div class="table-row">
+                <input type="text" maxlength="248" name="guest" id="Remarks" placeholder="ฝากข้อความ">
+            </div>
+            <div class="flexbox">
+                <div class="flex tab_two tab_sele action" rel="0"><i class="icon"></i>เก็บเงินปลายทาง</div>
+            </div>
+            <input name="payment_type" value="0" type="hidden">
+        </div>
+
+
+        <div class="this_box">
+            <div class="m-orderItem">
+                <div class="row-2 flexbox">
+                    <div class="goodImg">
+                        <img src="">
+                    </div>
+                    <div class="goodInfo flex">
+                        <div class="goodName"></div>
+                        <div class="goodName ti">
+                            <span>【ราคาต่ำมาก ซื้อ 2 ได้ 6 】฿1199</span>
+                            <span>【ราคาต่ำมาก ซื้อ 2 ได้ 6 】฿1199</span>
+                            <span>【ราคาต่ำมาก ซื้อ 2 ได้ 6 】฿1199</span>
+                            <span>【ราคาต่ำมาก ซื้อ 2 ได้ 6 】฿1199</span>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+
+        <ul class="row-2" id="list_cost">
+            <li>
+                <span class="tips">ค่าขนส่ง </span>
+                <span class="tips2">฿0.00</span>
+            </li>
+            <li>
+                <span class="tips">ยอดเงิน </span>
+                <span class="tips2" id="payment_amount">1199</span>
+                <span class="tips2">฿</span>
+            </li>
+            <li>
+                <span class="tips">ชำระเงิน </span>
+                <span class="tips2 total" style="color: #ff5a5f;font-weight: bold;">฿
+	            	<span id="total">1199</span>
+                </span>
+            </li>
+        </ul>
+
+        <input type="hidden" name="product_id" value="306964">
+        <div>
+            <a class="btn" data-wating-text="กำลังส่งค่ะ์" onclick="submit();" style="cursor: pointer"
+               href="javascript:void(0);">ยืนยัน
+            </a>
+            <input type="hidden" data-cuckootag="confirm_order">
+        </div>
+
+    </div>
+
+    <div class="timetips">
+        <ul class="flexbox">
+            <li class="flex" style="padding-left:16px;">
+                <i class="checkout-icons icon-7day"></i>
+                สินค้าเปลี่ยนหรือคืนได้ 7วัน
+            </li>
+            <li class="flex" style="padding-right:16px;">
+                <i class="checkout-icons icon-cod"></i>
+                เก็บเงินปลายทาง
+            </li>
+        </ul>
+    </div>
+</div>
+
+<div style="width: 100%;height: 100%;display: none" id="TS">
+    <div class="box" style="width: 100%;height: 100%;">
+        <div class="header" style="margin-top: 20px;">
+            <div class="true">√</div>
+            <div class="success">การสั่งซื้อสำเร็จ</div>
+        </div>
+        <div class="content">
+            <div class="show">
+                <div class="showcontent">หมายเลขคำสั่งซื้อ:</div>
+                <span class="textContent" id="ts_OrderNum">1</span></div>
+            <div class="show">
+                <div class="showcontent">ชื่อ:</div>
+                <span class="textContent" id="ts_UserReallyName">1</span></div>
+            <div class="show">
+                <div class="showcontent">สินค้า:</div>
+                <span class="textContent" id="ts_ProductName">1</span></div>
+            <div class="show">
+                <div class="showcontent">ราคา:</div>
+                <span class="textContent" id="ts_Payment">1</span></div>
+            <div class="show">
+                <div class="showcontent">เบอร์โทร:</div>
+                <span class="textContent" id="ts_UserPhoneNum">1</span></div>
+            <div class="show">
+                <div class="showcontent">ที่อยู่:</div>
+                <span class="textContent" id="ts_Address">1</span></div>
+        </div>
+        <div class="notice">สินค้าของคุณจะใช้เวลา10-15วันในการจัดส่ง เก็บเงินปลายทาง ของคุณค่ะ</div>
+        <div class="footer">
+            <center>
+                <button id="ts_back">สั่งเพิ่ม</button>
+               <button id="ts_lx">
+	<a href="https://www.facebook.com/pg/MinimatterTimes" style="color: #fff;">
+     	ติดต่อเรา
+    </a>
+</button>
+            </center>
+        </div>
+    </div>
+
+</div>
+
+</div>
+
+
+
+
+</div>
+</body>
+</html>
+
+
+<!-- 谷歌统计 -->
+<script async src="https://www.googletagmanager.com/gtag/js?id=UA-122583135-1"></script>
+<script>
+    window.dataLayer = window.dataLayer || [];
+
+    function gtag() {
+        dataLayer.push(arguments);
+    }
+
+    gtag('js', new Date());
+    gtag('config', 'UA-122583135-1');
+</script>
+
+<!-- Facebook Pixel Code -->
+<script>
+  !function(f,b,e,v,n,t,s)
+  {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
+  n.callMethod.apply(n,arguments):n.queue.push(arguments)};
+  if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
+  n.queue=[];t=b.createElement(e);t.async=!0;
+  t.src=v;s=b.getElementsByTagName(e)[0];
+  s.parentNode.insertBefore(t,s)}(window, document,'script',
+  'https://connect.facebook.net/en_US/fbevents.js');
+  fbq('init', '524976641351633');
+  fbq('track', 'PageView');
+</script>
+<noscript>< img height="1" width="1" style="display:none"
+  src="https://www.facebook.com/tr?id=524976641351633&ev=PageView&noscript=1"
+/></noscript>
+<!-- End Facebook Pixel Code -->
+
+
+
+
+<!-- ptengine统计 -->
+<script type="text/javascript">
+    window._pt_lt = new Date().getTime();
+    window._pt_sp_2 = [];
+    _pt_sp_2.push('setAccount,19c40fc9');
+    var _protocol = (("https:" == document.location.protocol) ? " https://" : " http://");
+    (function () {
+        var atag = document.createElement('script');
+        atag.type = 'text/javascript';
+        atag.async = true;
+        atag.src = _protocol + 'js.ptengine.cn/19c40fc9.js';
+        var s = document.getElementsByTagName('script')[0];
+        s.parentNode.insertBefore(atag, s);
+    })();
+</script>
+<script src="https://pv.sohu.com/cityjson?ie=utf-8" language="Javascript">
+</script>