zhangdehua преди 1 година
родител
ревизия
11c5e57fca

+ 9 - 2
app/api/controller/Checkout.php

@@ -21,6 +21,7 @@ use app\api\validate\order\Checkout as CheckoutValidate;
 use app\common\enum\order\PayType as OrderPayTypeEnum;
 use app\common\library\paypal\PayPal;
 use cores\exception\BaseException;
+use think\facade\Cache;
 use think\response\Json;
 
 /**
@@ -179,11 +180,17 @@ class Checkout extends Controller
      * returnUrl回来时继续调用执行扣款接口paypal
      * @return Json
      */
-    public function payPayExecutePay($orderNo)
+    public function payPayExecutePay($orderNo, $token)
     {
-        if (empty($orderNo)){
+        if (empty($orderNo) || empty($token)){
             return $this->renderError('something wrong!');
         }
+
+        $oriToken = Cache::get(PayPal::PRE_STR . $orderNo);
+        if ($token != $oriToken){
+            return $this->renderError('something wrong!');
+        }
+
         //dd($orderNo);
         //$paymentId = 'PAYID-MXUYFIQ9KF846046B114514M';
         $paymentId = $this->request->param('paymentId');

+ 18 - 0
app/api/controller/Index.php

@@ -4,6 +4,8 @@ namespace app\api\controller;
 
 use app\api\model\Article as ArticleModel;
 use app\api\model\Goods as GoodsModel;
+use think\response\Redirect;
+
 /**
  * 默认控制器
  * Class Index
@@ -57,4 +59,20 @@ class Index extends Controller
 
         echo '当前访问的index.php,请将index.html设为默认站点入口';
     }
+
+    public function productDetail()
+    {
+//        $goodsId = $this->request->param('goodsId',0);
+//        if (empty($goodsId)){
+//            return \redirect('index');
+//        }
+        $goodsId = 10001;
+        $goodsModel = new GoodsModel();
+        $goods =  $goodsModel->getDetails($goodsId)->toArray();
+        //dd(json_encode($goods['goods_images']));
+        $goods['content'] = html_entity_decode($goods['content']);
+        //dd($goods['content']);
+        return view('productDetails',['goods'=>$goods]);
+    }
+
 }

+ 235 - 0
app/api/view/cart/shoppingCart.html

@@ -0,0 +1,235 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport"
+        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
+    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
+    <meta name='apple-touch-fullscreen' content='yes'>
+    <meta name="apple-mobile-web-app-capable" content="yes" />
+    <meta content="fullscreen=yes,preventMove=no" name="ML-Config">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="renderer" content="webkit">
+    <meta name="apple-mobile-web-app-capable" content="yes" />
+    <meta name="keywords" content="电子烟,关键字" />
+    <meta name="Description" content="网站描述" />
+    <title>购物车</title>
+    <link rel="stylesheet" href="./css/common.css?t=108">
+</head>
+
+<body>
+    <!-- 头部导航栏 -->
+    <header class="headerContainer" id="headerContainer">
+        <!-- 顶部提示 -->
+        <div class="warnContainer">
+            <h4 class="warnText">containscontainscontainsWARNING: This product contains nicotine. Nicotine is an addicti
+            </h4>
+        </div>
+        <!-- pc端头部 -->
+        <div id="computerEndHeader">
+            <a href="./index.html">
+                <h1 class="computerLogo">
+                    <img src="./asstes/icon/logo.png" alt="Free Shipping Vapes" title="Free Shipping Vapes">
+                </h1>
+            </a>
+            <div class="headNavContainer">
+                <nav class="headNavItem active">
+                    <h2 class="headNavTitle">NEW VAPES</h2>
+                    <p class="back"></p>
+                </nav>
+                <nav class="headNavItem">
+                    <h2 class="headNavTitle">DISPOSABLES</h2>
+                    <p class="back"></p>
+                </nav>
+            </div>
+            <div class="headIconContainer">
+                <!-- 购物车 -->
+                <div class="headIconItem shoppingCartIcon">
+                    <img src="./asstes/icon/shoppingCart.png" alt="shoppingCart" tabindex="shoppingCart">
+                </div>
+                <!-- 收藏 -->
+                <div class="headIconItem collectIcon">
+                    <img src="./asstes/icon/collect.png" alt="collect" tabindex="collect">
+                </div>
+                <!-- 个人中心 -->
+                <div class="headIconItem userIcon">
+                    <img src="./asstes/icon/user.png" alt="user" tabindex="user">
+                </div>
+            </div>
+        </div>
+        <!-- 移动端头部 -->
+        <div id="mobileEndHeader">
+            <div class="mobileEndHeaderConten">
+                <a href="./index.html">
+                    <h1 class="mobileLogo">
+                        <img src="./asstes/icon/logo.png" alt="Free Shipping Vapes" title="Free Shipping Vapes">
+                    </h1>
+                </a>
+                <div class="mobileUserIconList">
+                    <div class="mobileUserIcon userIcon">
+                        <img src="./asstes/icon/user.png" alt="user" tabindex="user">
+                    </div>
+                </div>
+                <div class="mobileMenu">
+                    <p id="mobileMenuBot">
+                        <span id="mobileMenuLink"></span>
+                    </p>
+                </div>
+            </div>
+            <!-- 移动端菜单 -->
+            <section class="mobileMenuFixed">
+                <div class="mobileMenuItem active">
+                    <a href="#">
+                        <h2 class="menuItemTitle">NEW VAPES</h2>
+                    </a>
+                </div>
+                <div class="mobileMenuItem">
+                    <a href="#">
+                        <h2 class="menuItemTitle">DISPOSABLES</h2>
+                    </a>
+                </div>
+                <div class="mobileMenuItem">
+                    <h2 class="menuItemTitle shoppingCartIcon">Shopping Cart</h2>
+                </div>
+                <div class="mobileMenuItem">
+                    <h2 class="menuItemTitle collectIcon">Collect</h2>
+                </div>
+                <div class="mobileMenuItem">
+                    <h2 class="menuItemTitle userIcon">Personal</h2>
+                </div>
+            </section>
+        </div>
+    </header>
+    <main id="main">
+        <button id="orderPaymentBut" style="width: 100px; height: 100px;">支付</button>
+    </main>
+
+    <!-- 底部 -->
+    <footer class="footerContainer">
+        <section class="sectionContainer">
+            <div class="elementorContainer">
+                <div class="footerConter">
+                    <div class="leftText">
+                        <p class="ltK">NEWALETTER</p>
+                        <p class="ltV">Sign up for the Vapesourcing newsletter</p>
+                    </div>
+                    <div class="footerInuptBox">
+                        <img class="mailIcon" src="./asstes/icon//mailIcon.png" alt="">
+                        <input class="footerInupt" type="text">
+                        <img class="arrowIcon" src="./asstes/icon/arrowIcon.png" alt="">
+                    </div>
+                    <div class="footerIconContainer">
+                        <div class="footerIconList">
+                            <a href="#">
+                                <div class="footerIconItem">
+                                    <img src="https://i1.branchcn.com/social_media/Wechat.png" alt="">
+                                </div>
+                            </a>
+                            <a href="#">
+                                <div class="footerIconItem">
+                                    <img src="https://i1.branchcn.com/social_media/Wechat.png" alt="">
+                                </div>
+                            </a>
+                            <a href="#">
+                                <div class="footerIconItem">
+                                    <img src="https://i1.branchcn.com/social_media/Wechat.png" alt="">
+                                </div>
+                            </a>
+                        </div>
+                        <div class="footerVlsaImg">
+                            <a href="#">
+                                <div class="footerVlsaItem">
+                                    <img src="https://img2.baidu.com/it/u=1367821108,121397947&fm=253&fmt=auto&app=138&f=JPEG?w=1200&h=500"
+                                        alt="">
+                                </div>
+                            </a>
+                            <a href="#">
+                                <div class="footerVlsaItem">
+                                    <img src="https://img2.baidu.com/it/u=1367821108,121397947&fm=253&fmt=auto&app=138&f=JPEG?w=1200&h=500"
+                                        alt="">
+                                </div>
+                            </a>
+                            <a href="#">
+                                <div class="footerVlsaItem">
+                                    <img src="https://img2.baidu.com/it/u=1367821108,121397947&fm=253&fmt=auto&app=138&f=JPEG?w=1200&h=500"
+                                        alt="">
+                                </div>
+                            </a>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </section>
+    </footer>
+
+    <!-- 年龄提示层 -->
+    <section class="maskContainer">
+        <div class="ageReminderBox">
+            <img class="ageReminderBack"
+                src="https://img1.baidu.com/it/u=3449617615,1431463931&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1709485200&t=489bafcac7c5bebed91cf50c14356269"
+                alt="">
+            <div class="ageReminderInfo">
+                <h3>ARE YOU OF LEAAL SMOKIND AGE?</h3>
+                <div class="ageReminderButBox">
+                    <div class="ageRBut ageReminderNo"><span>NO</span></div>
+                    <div class="ageRBut ageReminderYes"><span>Yes, I am 21+</span></div>
+                </div>
+            </div>
+        </div>
+    </section>
+</body>
+<script src="./js/jquery-1.12.0.js"></script>
+<script src="./js/flexible.js"></script>
+<script src="./js/swiper.js?t=6"></script>
+<script src="./js/jquery.lazyload.js"></script>
+<script>
+    $(document).ready(function () {
+        const orderPayment = (params) => {
+            console.log(params)
+            const vapesToken = localStorage.getItem("vapes_token");
+            return new Promise(function (resolve, reject) {
+                $.ajax({
+                    url: "https://www.yhc.com/index.php?s=/api/cashier/orderPay",
+                    method: 'POST',
+                    data: params,
+                    headers: {
+                        'Content-Type': 'application/json',
+                        'storeId': '0001',
+                        'platform': 'H5',
+                        'Authorization': `Bearer ${vapesToken}`
+                    },
+                    dataType: 'json',
+                    success: function (response) {
+                        resolve(response);
+                    },
+                    error: function (xhr, status, error) {
+                        reject(error);
+                    }
+                });
+            });
+        }
+
+
+        $("#orderPaymentBut").on(tap, async function () {
+            const params = {
+                "method": "zfb",
+                "client": "H5",
+                "orderId": "00001",
+                "extra": {
+                    "returnUrl": "www"
+                },
+            }
+            console.log(params)
+            const res = await orderPayment(params)
+            console.log(res)
+            const { status, data } = res || {}
+            if (status === 200) {
+
+            }
+        });
+
+    })
+</script>
+
+</html>

+ 56 - 60
app/api/view/index/index.html

@@ -15,8 +15,8 @@
     <meta name="keywords" content="电子烟,关键字"/>
     <meta name="Description" content="网站描述"/>
     <title>首页</title>
-    <link rel="stylesheet" href="/assets/api/css/common.css?t=108">
-    <link rel="stylesheet" href="/assets/api/css/index.css?t=131">
+    <link rel="stylesheet" href="/assets/api/css/common.css?t=108211111">
+    <link rel="stylesheet" href="/assets/api/css/index.css?t=13121111">
 </head>
 
 <body>
@@ -29,24 +29,20 @@
     </div>
     <!-- pc端头部 -->
     <div class="computerEndHeader">
-        <a href="#">
+        <a href="./index.html">
             <h1 class="computerLogo">
                 <img src="/assets/api/asstes/icon/logo.png" alt="Free Shipping Vapes" title="Free Shipping Vapes">
             </h1>
         </a>
         <div class="headNavContainer">
-            <a href="#">
-                <nav class="headNavItem active">
-                    <h2 class="headNavTitle">NEW VAPES</h2>
-                    <p class="back"></p>
-                </nav>
-            </a>
-            <a href="#">
-                <nav class="headNavItem">
-                    <h2 class="headNavTitle">DISPOSABLES</h2>
-                    <p class="back"></p>
-                </nav>
-            </a>
+            <nav class="headNavItem active">
+                <h2 class="headNavTitle">NEW VAPES</h2>
+                <p class="back"></p>
+            </nav>
+            <nav class="headNavItem">
+                <h2 class="headNavTitle">DISPOSABLES</h2>
+                <p class="back"></p>
+            </nav>
         </div>
         <div class="headIconContainer">
             <!-- 购物车 -->
@@ -64,9 +60,9 @@
         </div>
     </div>
     <!-- 移动端头部 -->
-    <div class="mobileEndHeader">
+    <div id="mobileEndHeader">
         <div class="mobileEndHeaderConten">
-            <a href="#">
+            <a href="./index.html">
                 <h1 class="mobileLogo">
                     <img src="/assets/api/asstes/icon/logo.png" alt="Free Shipping Vapes" title="Free Shipping Vapes">
                 </h1>
@@ -152,7 +148,7 @@
             <!-- 新的商品模块 -->
             <div class="newGoodsContainer">
                 {foreach $newGoods as $goods}
-                <a href="">
+                <a href="./productDetails.html">
                     <div class="newGoodsItem">
                         <div class="goodsImgBox">
                             <img class="lazy" src="/assets/api/asstes/icon/transparent.png"
@@ -252,32 +248,32 @@
                     </div>
                 </a>
                 {/foreach}
-<!--                <a href="">-->
-<!--                    <div class="newConterItem">-->
-<!--                        <div class="newsDateBox">-->
-<!--                            <p>02-06</p>-->
-<!--                            <p class="year">2024</p>-->
-<!--                        </div>-->
-<!--                        <div class="newConterImg">-->
-<!--                            <img class="lazy" src="/assets/api/asstes/icon/transparent.png"-->
-<!--                                 data-original="https://img0.baidu.com/it/u=3316636492,2799302396&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1709398800&t=0b33f33f41e44709ced5e8c8a1113b6b"-->
-<!--                                 alt="">-->
-<!--                        </div>-->
-<!--                        <div class="newConterInfo">-->
-<!--                            <h3 class="newConterTitle">Explore a Variety of ChoicesExplore a Variety of Choices-->
-<!--                                Whether yoExplore a Variety of Choices Whether yoExplore a Variety of Choices-->
-<!--                                Whether yo Whether you're-->
-<!--                                aseasonedvaper or</h3>-->
-<!--                            <div class="newsInfoRl">-->
-<!--                                <p class="rlDate">2024-02-06</p>-->
-<!--                                <div class="newsMore active">-->
-<!--                                    <p class="textEllipsis">More</p>-->
-<!--                                    <span>+</span>-->
-<!--                                </div>-->
-<!--                            </div>-->
-<!--                        </div>-->
-<!--                    </div>-->
-<!--                </a>-->
+                <!--                <a href="">-->
+                <!--                    <div class="newConterItem">-->
+                <!--                        <div class="newsDateBox">-->
+                <!--                            <p>02-06</p>-->
+                <!--                            <p class="year">2024</p>-->
+                <!--                        </div>-->
+                <!--                        <div class="newConterImg">-->
+                <!--                            <img class="lazy" src="/assets/api/asstes/icon/transparent.png"-->
+                <!--                                 data-original="https://img0.baidu.com/it/u=3316636492,2799302396&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1709398800&t=0b33f33f41e44709ced5e8c8a1113b6b"-->
+                <!--                                 alt="">-->
+                <!--                        </div>-->
+                <!--                        <div class="newConterInfo">-->
+                <!--                            <h3 class="newConterTitle">Explore a Variety of ChoicesExplore a Variety of Choices-->
+                <!--                                Whether yoExplore a Variety of Choices Whether yoExplore a Variety of Choices-->
+                <!--                                Whether yo Whether you're-->
+                <!--                                aseasonedvaper or</h3>-->
+                <!--                            <div class="newsInfoRl">-->
+                <!--                                <p class="rlDate">2024-02-06</p>-->
+                <!--                                <div class="newsMore active">-->
+                <!--                                    <p class="textEllipsis">More</p>-->
+                <!--                                    <span>+</span>-->
+                <!--                                </div>-->
+                <!--                            </div>-->
+                <!--                        </div>-->
+                <!--                    </div>-->
+                <!--                </a>-->
             </div>
         </div>
     </article>
@@ -724,12 +720,15 @@
         </div>
     </div>
 </section>
+<!-- 吐司提示 -->
+<div id="toastContainer"></div>
 </body>
 <script src="/assets/api/js/jquery-1.12.0.js"></script>
 <script src="/assets/api/js/flexible.js"></script>
-<script src="/assets/api/js/swiper.js?t=6"></script>
+<script src="/assets/api/js/public.js?t=111"></script>
+<script src="/assets/api/js/swiper.js?t=61"></script>
 <script src="/assets/api/js/jquery.lazyload.js"></script>
-<script src="/assets/api/js/index.js?t=2"></script>
+<script src="/assets/api/js/index.js?t=211"></script>
 <script>
     $(document).ready(function () {
         //用户存储token名
@@ -737,36 +736,32 @@
         //触屏事件 || 点击事件
         const tap = "ontouchstart" in window ? "touchstart" : "click";
 
+
         /**
-         * 登录
+         * 吐司提示
+         * @param message 消息
          * @returns
          */
-        const login = () => {
-            localStorage.setItem(VAPES_TOKEN, "123")
+        function showToast(message) {
+            var toastElement = $('#toastContainer');
+            toastElement.text(message);
+            toastElement.stop(true, true).fadeIn(200).delay(2000).fadeOut(200);
         }
 
         /**
          * 登录校验点击
-         * @param state 是否弹窗登陆框
+         * @param state 是否需要跳转登录页
          * @returns
          */
         const isLogin = (state) => {
             const vapesToken = localStorage.getItem(VAPES_TOKEN);
             state = state || true;
-            //弹窗登陆框
-            if (state) {
-                console.log("弹窗登陆框")
+            if (!vapesToken || vapesToken == "" && state) {
+                window.location.href = "./login.html?return=1"
             }
             return vapesToken && vapesToken !== "";
         }
 
-        /**
-         * 退出登陆
-         * @returns
-         */
-        const loginOut = () => {
-            localStorage.removeItem(VAPES_TOKEN)
-        }
 
         //前往购物车
         $(".shoppingCartIcon").on(tap, function () {
@@ -795,4 +790,5 @@
     })
 </script>
 
+
 </html>

+ 404 - 0
app/api/view/index/productDetails.html

@@ -0,0 +1,404 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport"
+        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
+    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
+    <meta name='apple-touch-fullscreen' content='yes'>
+    <meta name="apple-mobile-web-app-capable" content="yes" />
+    <meta content="fullscreen=yes,preventMove=no" name="ML-Config">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="renderer" content="webkit">
+    <meta name="apple-mobile-web-app-capable" content="yes" />
+    <meta name="keywords" content="电子烟,关键字" />
+    <meta name="Description" content="网站描述" />
+    <title>商品详情</title>
+    <link rel="stylesheet" href="/assets/api/css/common.css?t=4111">
+    <link rel="stylesheet" href="/assets/api/css/productDetails.css?t=11101">
+</head>
+
+<body>
+    <!-- 头部导航栏 -->
+    <header class="headerContainer" id="headerContainer">
+        <!-- 顶部提示 -->
+        <div class="warnContainer">
+            <h4 class="warnText">containscontainscontainsWARNING: This product contains nicotine. Nicotine is an addicti
+            </h4>
+        </div>
+        <!-- pc端头部 -->
+        <div id="computerEndHeader">
+            <a href="./index.html">
+                <h1 class="computerLogo">
+                    <img src="/assets/api/asstes/icon/logo.png" alt="Free Shipping Vapes" title="Free Shipping Vapes">
+                </h1>
+            </a>
+            <div class="headNavContainer">
+                <nav class="headNavItem active">
+                    <h2 class="headNavTitle">NEW VAPES</h2>
+                    <p class="back"></p>
+                </nav>
+                <nav class="headNavItem">
+                    <h2 class="headNavTitle">DISPOSABLES</h2>
+                    <p class="back"></p>
+                </nav>
+            </div>
+            <div class="headIconContainer">
+                <!-- 购物车 -->
+                <div class="headIconItem shoppingCartIcon">
+                    <img src="/assets/api/asstes/icon/shoppingCart.png" alt="shoppingCart" tabindex="shoppingCart">
+                </div>
+                <!-- 收藏 -->
+                <div class="headIconItem collectIcon">
+                    <img src="/assets/api/asstes/icon/collect.png" alt="collect" tabindex="collect">
+                </div>
+                <!-- 个人中心 -->
+                <div class="headIconItem userIcon">
+                    <img src="/assets/api/asstes/icon/user.png" alt="user" tabindex="user">
+                </div>
+            </div>
+        </div>
+        <!-- 移动端头部 -->
+        <div id="mobileEndHeader">
+            <div class="mobileEndHeaderConten">
+                <a href="./index.html">
+                    <h1 class="mobileLogo">
+                        <img src="/assets/api/asstes/icon/logo.png" alt="Free Shipping Vapes" title="Free Shipping Vapes">
+                    </h1>
+                </a>
+                <div class="mobileUserIconList">
+                    <div class="mobileUserIcon userIcon">
+                        <img src="/assets/api/asstes/icon/user.png" alt="user" tabindex="user">
+                    </div>
+                </div>
+                <div class="mobileMenu">
+                    <p id="mobileMenuBot">
+                        <span id="mobileMenuLink"></span>
+                    </p>
+                </div>
+            </div>
+            <!-- 移动端菜单 -->
+            <section class="mobileMenuFixed">
+                <div class="mobileMenuItem active">
+                    <a href="#">
+                        <h2 class="menuItemTitle">NEW VAPES</h2>
+                    </a>
+                </div>
+                <div class="mobileMenuItem">
+                    <a href="#">
+                        <h2 class="menuItemTitle">DISPOSABLES</h2>
+                    </a>
+                </div>
+                <div class="mobileMenuItem">
+                    <h2 class="menuItemTitle shoppingCartIcon">Shopping Cart</h2>
+                </div>
+                <div class="mobileMenuItem">
+                    <h2 class="menuItemTitle collectIcon">Collect</h2>
+                </div>
+                <div class="mobileMenuItem">
+                    <h2 class="menuItemTitle userIcon">Personal</h2>
+                </div>
+            </section>
+        </div>
+    </header>
+    <main id="main">
+        <section class="sectionContainer">
+            <div class="elementorContainer">
+                <!-- 产品模块 -->
+                <section class="productContainer">
+                    <!-- 产品图片 -->
+                    <div class="productImgContainer">
+                        <div class="prViewImgBox">
+                            <img class="prViewImg lazy" src="/assets/api/asstes/icon/transparent.png"
+                                data-original="{$goods.goods_image}" alt="">
+                        </div>
+                        <div class="prImgContainer">
+                            <div class="prImgList">
+                                {foreach $goods.goods_images as $img}
+                                <div class="prImgItem">
+                                    <img class="lazy" src="/assets/api/asstes/icon/transparent.png"
+                                         data-original="{$img.preview_url}" alt="">
+                                </div>
+                                {/foreach}
+                            </div>
+                            <div class="prevArrow">&lt;</div>
+                            <div class="nextArrow">&gt;</div>
+                        </div>
+
+                    </div>
+
+                    <!-- 产品信息 -->
+                    <div class="productInfoContainer">
+                        <div>
+                            <h1 class="productTitle">{$goods.goods_name}</h1>
+                            <div class="productPrice">
+                                <p><span>$</span>{$goods.goods_price_min}</p>
+                            </div>
+                        </div>
+                        <div>
+                            <!-- 数量 -->
+                            <div class="productNContainer">
+                                <div class="productNumberBox">
+                                    <div class="numberReduce">-</div>
+                                    <input id="numberInput" value="1" type="text"/>
+                                    <div class="numberAdd">+</div>
+                                </div>
+                                <div class="addToCart">
+                                    <p class="tag">+</p>
+                                    <p>Add To Cart</p>
+                                </div>
+                            </div>
+
+                            <div class="safeContainer">
+                                <p class="safeTag">Guaranteed Safe Checkout</p>
+                                <div class="safeList">
+                                    <div class="safeItem">
+                                        <img src="https://img2.baidu.com/it/u=810087687,2144202516&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1710003600&t=5d86d51c836405ef2225baf3d4aa9349"
+                                            alt="">
+                                    </div>
+                                    <div class="safeItem">
+                                        <img src="https://img2.baidu.com/it/u=810087687,2144202516&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1710003600&t=5d86d51c836405ef2225baf3d4aa9349"
+                                            alt="">
+                                    </div>
+                                    <div class="safeItem">
+                                        <img src="https://img2.baidu.com/it/u=810087687,2144202516&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1710003600&t=5d86d51c836405ef2225baf3d4aa9349"
+                                            alt="">
+                                    </div>
+                                    <div class="safeItem">
+                                        <img src="https://img2.baidu.com/it/u=810087687,2144202516&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1710003600&t=5d86d51c836405ef2225baf3d4aa9349"
+                                            alt="">
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </section>
+
+                <!-- 文案模块 -->
+                <article class="articleContainer">
+                    <div class="articleTabBox">
+                        <div class="articleTabItem active">
+                            <p class="tabTag"></p>
+                            <h2 class="articleTabTitle">Description</h2>
+                        </div>
+                        <div class="articleTabItem">
+                            <p class="tabTag"></p>
+                            <h2 class="articleTabTitle">Reviews (0)</h2>
+                        </div>
+                    </div>
+                    <div class="articleInfo">
+                        <h2 class="articleTitle">Product description</h2>
+                        <div id="richTextContainer"></div>
+                    </div>
+                </article>
+
+                <!-- 悬浮底部模块 -->
+                <section class="fixedAddSection">
+                    <div class="fixedAddContainer">
+                        <div class="elementorContainer">
+                            <div class="fixedAddBox">
+                                <div class="fPrInfo">
+                                    <img class="img lazy" src="/assets/api/asstes/icon/transparent.png"
+                                        data-original="https://www.buranshao.com/Content/Img/iqos3duo.jpg" alt="">
+                                    <h3 class="fTitle">NEW VAPES</h3>
+                                </div>
+                                <div class="fPrNumberContainer">
+                                    <p class="fPrPrice">$9999.99</p>
+                                    <div class="fPrNumberBox">
+                                        <div class="fPrNumberReduce">-</div>
+                                        <input id="fPrNumberInput" value="1" type="text" />
+                                        <div class="fPrNumberAdd">+</div>
+                                    </div>
+                                    <div class="fPrAddToCart">
+                                        <p class="tag">+</p>
+                                        <p>Add To Cart</p>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </section>
+            </div>
+        </section>
+    </main>
+    <!-- 底部 -->
+    <footer class="footerContainer" id="footerContainer">
+        <section class="sectionContainer">
+            <div class="elementorContainer">
+                <div class="footerConter">
+                    <div class="leftText">
+                        <p class="ltK">NEWALETTER</p>
+                        <p class="ltV">Sign up for the Vapesourcing newsletter</p>
+                    </div>
+                    <div class="footerInputBox">
+                        <img class="mailIcon" src="/assets/api/asstes/icon/mailIcon.png" alt="">
+                        <input class="footerInput" type="text" />
+                        <img class="arrowIcon" src="/assets/api/asstes/icon/arrowIcon.png" alt="">
+                    </div>
+                    <div class="footerIconContainer">
+                        <div class="footerIconList">
+                            <a href="#">
+                                <div class="footerIconItem">
+                                    <img src="https://i1.branchcn.com/social_media/Wechat.png" alt="">
+                                </div>
+                            </a>
+                            <a href="#">
+                                <div class="footerIconItem">
+                                    <img src="https://i1.branchcn.com/social_media/Wechat.png" alt="">
+                                </div>
+                            </a>
+                            <a href="#">
+                                <div class="footerIconItem">
+                                    <img src="https://i1.branchcn.com/social_media/Wechat.png" alt="">
+                                </div>
+                            </a>
+                        </div>
+                        <div class="footerVlsaImg">
+                            <a href="#">
+                                <div class="footerVlsaItem">
+                                    <img src="https://img2.baidu.com/it/u=1367821108,121397947&fm=253&fmt=auto&app=138&f=JPEG?w=1200&h=500"
+                                        alt="">
+                                </div>
+                            </a>
+                            <a href="#">
+                                <div class="footerVlsaItem">
+                                    <img src="https://img2.baidu.com/it/u=1367821108,121397947&fm=253&fmt=auto&app=138&f=JPEG?w=1200&h=500"
+                                        alt="">
+                                </div>
+                            </a>
+                            <a href="#">
+                                <div class="footerVlsaItem">
+                                    <img src="https://img2.baidu.com/it/u=1367821108,121397947&fm=253&fmt=auto&app=138&f=JPEG?w=1200&h=500"
+                                        alt="">
+                                </div>
+                            </a>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </section>
+    </footer>
+    <!-- 年龄提示层 -->
+    <section class="maskContainer">
+        <div class="ageReminderBox">
+            <img class="ageReminderBack" src="/assets/api/asstes/ageReminderBack.jpg" alt="">
+            <div class="ageReminderInfo">
+                <h3>ARE YOU OF LEAAL SMOKIND AGE?</h3>
+                <div class="ageReminderButBox">
+                    <div class="ageRBut ageReminderNo"><span>NO</span></div>
+                    <div class="ageRBut ageReminderYes"><span>Yes, I am 21+</span></div>
+                </div>
+            </div>
+        </div>
+    </section>
+    <!-- 吐司提示 -->
+    <div id="toastContainer"></div>
+</body>
+<script src="/assets/api/js/jquery-1.12.0.js"></script>
+<script src="/assets/api/js/flexible.js"></script>
+<script src="/assets/api/js/public.js?t=11"></script>
+<script src="/assets/api/js/productDetails.js?t=11"></script>
+<script src="/assets/api/js/jquery.lazyload.js"></script>
+<script>
+    $(document).ready(function () {
+        //触屏事件 || 点击事件
+        const tap = "ontouchstart" in window ? "touchstart" : "click";
+
+        //用户存储token名
+        const VAPES_TOKEN = "vapes_token"
+
+        //富文本处理
+        function initRichText() {
+            $("#richTextContainer").html(`{$goods.content | raw}`)
+        }
+
+
+        /**
+         * 登录校验点击
+         * @param state 是否需要跳转登录页
+         * @returns 
+         */
+        const isLogin = (state) => {
+            const vapesToken = localStorage.getItem(VAPES_TOKEN);
+            state = state || true;
+            if (!vapesToken || vapesToken === "" && state) {
+                window.location.href = "./login.html?return=1"
+            }
+            return vapesToken && vapesToken !== "";
+        }
+
+        /**
+          * 添加购物车
+          * @param number 数量
+          * @returns 
+          */
+        function addCart(number) {
+            if (!number || number <= 0) {
+                showToast("Please enter the quantity of products")
+                return
+            }
+            console.log("商品数量", number)
+        }
+
+        /**
+         * 吐司提示
+         * @param message 消息
+         * @returns 
+         */
+        function showToast(message) {
+            var toastElement = $('#toastContainer');
+            toastElement.text(message);
+            toastElement.stop(true, true).fadeIn(200).delay(2000).fadeOut(200);
+        }
+
+        //商品数量减少
+        $('.numberReduce, .fPrNumberReduce').click(function () {
+            var container = $(this).closest('.productNumberBox, .fPrNumberBox');
+            var inputElement = container.find('#numberInput, #fPrNumberInput');
+            var currentValue = parseInt(inputElement.val());
+            if (currentValue > 1) {
+                inputElement.val(currentValue - 1);
+            }
+        });
+
+        //商品数量增加
+        $('.numberAdd, .fPrNumberAdd').click(function () {
+            var container = $(this).closest('.productNumberBox, .fPrNumberBox');
+            var inputElement = container.find('#numberInput, #fPrNumberInput');
+            var currentValue = parseInt(inputElement.val());
+            inputElement.val(currentValue + 1);
+        });
+
+        // 输入框禁止为空小于等于0
+        $('#numberInput, #fPrNumberInput').change(function () {
+            var inputElement = $(this);
+            var currentValue = parseInt(inputElement.val());
+            if (currentValue < 1 || isNaN(currentValue)) {
+                inputElement.val(1);
+            }
+        });
+
+
+        //上面的添加按钮
+        $(".addToCart").on(tap, function () {
+            const state = isLogin()
+            if (state) {
+                const number = $('#numberInput').val();
+                addCart(number)
+            }
+        });
+
+        //悬浮模块的添加按钮
+        $(".fPrAddToCart").on(tap, function () {
+            const state = isLogin()
+            if (state) {
+                const number = $('#fPrNumberInput').val();
+                addCart(number)
+            }
+        });
+        initRichText()
+    });
+</script>
+
+</html>

+ 274 - 0
app/api/view/passport/logIn.html

@@ -0,0 +1,274 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport"
+        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
+    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
+    <meta name='apple-touch-fullscreen' content='yes'>
+    <meta name="apple-mobile-web-app-capable" content="yes" />
+    <meta content="fullscreen=yes,preventMove=no" name="ML-Config">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="renderer" content="webkit">
+    <meta name="apple-mobile-web-app-capable" content="yes" />
+    <meta name="keywords" content="电子烟,关键字" />
+    <meta name="Description" content="网站描述" />
+    <title>登录|注册</title>
+    <link rel="stylesheet" href="./css/common.css?t=10100">
+    <link rel="stylesheet" href="./css/login.css?t=101">
+</head>
+
+<body>
+    <main id="main">
+        <div class="pageContainer">
+            <div class="pageLogo">
+                <img src="./asstes/icon/logo.png" alt="">
+            </div>
+            <section class="pageSection">
+                <!-- 登录模块 -->
+                <div id="loginModel">
+                    <h1 class="modelTitle">Log in</h1>
+                    <div class="modelContainer">
+                        <!-- 用户名或电子邮箱 -->
+                        <div class="modelItem">
+                            <p class="miTitle">用户名或电子邮箱</p>
+                            <input class="input" type="text" name="" id="userName">
+                        </div>
+                        <!-- 密码 -->
+                        <div class="modelItem">
+                            <p class="miTitle">密码</p>
+                            <input class="input" type="password" name="" id="password">
+                        </div>
+                        <p class="forgotPassword">忘记密码?</p>
+                        <!-- 登录 -->
+                        <div class="pageButton" id="loginButton">登录</div>
+                        <!-- 没有账户 -->
+                        <div class="accountTips">
+                            <p>没有账户?</p>
+                            <span id="toRegister">注册</span>
+                        </div>
+                    </div>
+                </div>
+
+                <!-- 注册模块 -->
+                <div id="registerModel">
+                    <!-- 电子邮箱输入模块 -->
+                    <div id="emailInputModel">
+                        <h1 class="modelTitle">Register</h1>
+                        <div class="modelContainer">
+                            <!-- 电子邮箱地址 -->
+                            <div class="modelItem">
+                                <p class="miTitle">电子邮箱地址</p>
+                                <input class="input" type="text" name="" id="email">
+                            </div>
+                            <div class="pageButton" id="continueButton">继续</div>
+                            <div class="accountTips">
+                                <p>已经拥有账号?</p>
+                                <span id="toLogin">登录</span>
+                            </div>
+                        </div>
+                    </div>
+                    <!-- 电子邮箱验证模块 -->
+                    <div id="emailVerifyModel">
+                        <h1 class="modelTitle">验证电子邮箱</h1>
+                        <p class="modelTips">您的验证码已发送至<span id="emailAddress"></span></p>
+                        <div class="modelContainer">
+                            <!-- 电子邮箱验证码 -->
+                            <div class="modelItem">
+                                <p class="miTitle">验证码</p>
+                                <input class="input" type="text" name="" id="vcode">
+                            </div>
+                            <!-- 验证 -->
+                            <div class="pageButton" id="verifyButton">验证</div>
+                        </div>
+                    </div>
+                    <!-- 设置密码 -->
+                    <div id="setPasswordModel">
+                        <h1 class="modelTitle">设置密码</h1>
+                        <div class="modelContainer">
+                            <!-- 设置密码 -->
+                            <div class="modelItem">
+                                <p class="miTitle">设置密码</p>
+                                <input class="input" type="password" name="" id="regPassword">
+                            </div>
+                            <!-- 注册 -->
+                            <div class="pageButton" id="registerButton">注册</div>
+                        </div>
+                    </div>
+                </div>
+            </section>
+        </div>
+    </main>
+    <!-- 年龄提示层 -->
+    <section class="maskContainer">
+        <div class="ageReminderBox">
+            <img class="ageReminderBack"
+                src="https://img1.baidu.com/it/u=3449617615,1431463931&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1709485200&t=489bafcac7c5bebed91cf50c14356269"
+                alt="">
+            <div class="ageReminderInfo">
+                <h3>ARE YOU OF LEAAL SMOKIND AGE?</h3>
+                <div class="ageReminderButBox">
+                    <div class="ageRBut ageReminderNo"><span>NO</span></div>
+                    <div class="ageRBut ageReminderYes"><span>Yes, I am 21+</span></div>
+                </div>
+            </div>
+        </div>
+    </section>
+    <!-- 吐司提示 -->
+    <div id="toastContainer"></div>
+</body>
+<script src="./js/jquery-1.12.0.js"></script>
+<script src="./js/flexible.js"></script>
+<script src="./js/public.js"></script>
+<script src="./js/login.js?y=10"></script>
+<script>
+    $(document).ready(function () {
+        //用户存储token名
+        const VAPES_TOKEN = "vapes_token"
+        //触屏事件 || 点击事件
+        const tap = "ontouchstart" in window ? "touchstart" : "click";
+
+        /**
+         * 吐司提示
+         * @param message 消息
+         * @returns 
+         */
+        function showToast(message) {
+            var toastElement = $('#toastContainer');
+            toastElement.text(message);
+            toastElement.stop(true, true).fadeIn(200).delay(2000).fadeOut(200);
+        }
+
+        //去登录
+        $("#toLogin").on(tap, function () {
+            $("#registerModel").hide(0)
+            $("#loginModel").show(0)
+        });
+
+        //去注册
+        $("#toRegister").on(tap, function () {
+            $("#loginModel").hide(0)
+            $("#registerModel").show(0)
+        });
+
+
+        //登录
+        $("#loginButton").on(tap, function (event) {
+            event.preventDefault();
+            const userNameEle = $("#userName");
+            const passwordEle = $("#password");
+            //输入框不存在
+            if (!userNameEle || !passwordEle) {
+                return
+            }
+            //用户名
+            const userName = userNameEle.val()
+            //密码
+            const password = passwordEle.val()
+            if (!userName || userName == "") {
+                userNameEle.focus();
+                return
+            }
+            if (!password || password == "") {
+                passwordEle.focus();
+                return
+            }
+            console.log("用户名", userName)
+            console.log("密码", password)
+            // 登录成功后进入
+            if (true) {
+                console.log("登录成功")
+                localStorage.setItem(VAPES_TOKEN, "1")
+                jumpPage()
+            }
+        });
+
+        //继续(注册)
+        $("#continueButton").on(tap, function (event) {
+            console.log(1)
+            event.preventDefault();
+            console.log(2)
+            const emailEle = $("#email");
+            //输入框不存在
+            if (!emailEle) {
+                return
+            }
+            //电子邮箱地址
+            const email = emailEle.val()
+            if (!email || email == "") {
+                emailEle.focus();
+                return
+            }
+            //验证成功后进入
+            if (true) {
+                const parentElement = $(this).parent();
+                parentElement.hide(0)
+                parentElement.siblings().hide(0)
+                $("#emailVerifyModel").show(0)
+                $("#emailAddress").text(email)
+            }
+        });
+
+        //验证电子邮箱(注册)
+        $("#verifyButton").on(tap, function (event) {
+            event.preventDefault();
+            const vcodeEle = $("#vcode");
+            //输入框不存在
+            if (!vcodeEle) {
+                return
+            }
+            //验证码
+            const vcode = vcodeEle.val()
+            if (!vcode || vcode == "") {
+                vcodeEle.focus();
+                return
+            }
+            console.log("验证码", vcode)
+            //验证成功后进入
+            if (true) {
+                const parentElement = $(this).parent();
+                parentElement.hide(0)
+                parentElement.siblings().hide(0)
+                $("#setPasswordModel").show(0)
+            }
+        });
+
+        //确认注册(注册)
+        $("#registerButton").on(tap, function (event) {
+            event.preventDefault();
+
+            const emailEle = $("#email");
+            const vcodeEle = $("#vcode");
+            const regPasswordEle = $("#regPassword");
+            const email = emailEle.val()
+            const vcode = vcodeEle.val()
+            const password = regPasswordEle.val()
+            if (!password || password == "") {
+                regPasswordEle.focus();
+                return
+            }
+
+            //注册成功后进入
+            if (true) {
+                console.log("注册成功")
+                localStorage.setItem(VAPES_TOKEN, "1")
+                jumpPage()
+            }
+        });
+
+        function jumpPage() {
+            const url = window.location.href;
+            // 判断是否存在 return 参数 && 可返回上一页
+            if (url.indexOf('return') != -1 && window.history.length > 1) {
+                // 返回上一页
+                window.history.back();
+            } else {
+                //跳转首页
+                window.location.replace('./index.html');
+            }
+        }
+    })
+</script>
+
+</html>

+ 10 - 5
app/common/library/paypal/PayPal.php

@@ -33,6 +33,7 @@ use PayPal\Exception\PayPalConnectionException;
 use PayPal\Rest\ApiContext;
 use think\Exception;
 use think\exception\HttpException;
+use think\facade\Cache;
 
 /**
  * paypal驱动
@@ -55,6 +56,8 @@ class PayPal
 
     public $apiContext;
 
+    const PRE_STR = 'paypal-token';
+
     public function __construct($config)
     {
         // 秘钥配置
@@ -108,8 +111,10 @@ class PayPal
 
         $redirectUrls = new RedirectUrls();
         //live
-        $return_url = config('app.app_host') . $this->config['return_url'] . $outTradeNo;
-        $cancel_url = config('app.app_host').$this->config['cancel_url'];
+        $token = md5(uniqid());
+        Cache::set(PayPal::PRE_STR . $outTradeNo, $token, 600);
+        $return_url = config('app.app_host') . sprintf($this->config['return_url'], $outTradeNo, $token);
+        $cancel_url = config('app.app_host') . $this->config['cancel_url'];
         //sandbox
         //$return_url = 'https://lar.lmm.gold/api/index/index';
         //$cancel_url = 'https://lar.lmm.gold/store/index.html';
@@ -126,7 +131,7 @@ class PayPal
         $this->result = $payment->create($apiContext);// This will print the detailed information on the exception.
         //REALLY HELPFUL FOR DEBUGGING
         //echo "\n\nRedirect user to approval_url: " . $payment->getApprovalLink() . "\n";
-        return ['approval_link' => $payment->getApprovalLink(),'order_no' => $outTradeNo];
+        return ['approval_link' => $payment->getApprovalLink(), 'order_no' => $outTradeNo];
     }
 
     /**
@@ -141,11 +146,11 @@ class PayPal
 
             $payment = Payment::get($outTradeNo, $this->apiContext);
             // 记录日志
-            Log::append('Paypal-tradeQuery', ['outTradeNo' => $outTradeNo, 'result' => json_encode($result)]);
+            Log::append('Paypal-tradeQuery', ['outTradeNo' => $outTradeNo, 'result' => json_encode($payment)]);
             // 处理响应或异常
             //$this->throwError($result->msg . "," . $result->subMsg);
             // 返回查询成功的结果
-            return $result->toArray();
+            return $payment->toArray();
         } catch (\Throwable $e) {
             $this->throwError('支付宝API交易查询失败:' . $e->getMessage(), true, 'tradeQuery');
         }

+ 1 - 1
config/paypal.php

@@ -4,6 +4,6 @@ return [
     'web_hook_id' => '3NP026061E6858914',
     'client_id' => 'AS0FH780ZGtSAdpT1NTjwkFzryCPf69rZb_FR9Rt_rZdasB80cmjqTQ6CQELWiFVh_MU9e31CSnyz7Ai',
     'secret' => 'EDqRQhgLNHCb5bxld98T8-JJJZKvMIeqxudO7lMwDFOxBfy138PjM5A21FnDNyb3q4yYUh8r7Qr2BnVi',
-    'return_url' => '/api/checkout/payPayExecutePay/orderNo/',//'https://lar.lmm.gold/api/index/index',//vp.com/index.php/api/checkout/payPayExecutePay/orderNo/9999
+    'return_url' => '/api/checkout/payPayExecutePay/orderNo/%s/token/%s',//'https://lar.lmm.gold/api/index/index',//vp.com/index.php/api/checkout/payPayExecutePay/orderNo/9999
     'cancel_url' => '/api/index/index.html',//'https://lar.lmm.gold/store/index.html',
 ];

BIN
public/assets/api/asstes/ageReminderBack.jpg


+ 47 - 24
public/assets/api/css/common.css

@@ -81,11 +81,11 @@ a:active, a:focus {
     word-break: break-all;
     line-height: 1.4;
     font-weight: bold;
-    font-size: .18rem;
+    font-size: .16rem;
     color: rgba(255, 255, 255, .7);
 }
 /* PC端头部 */
-.computerEndHeader{
+#computerEndHeader{
     width: 13.2rem;
     height: .7rem;
     margin: 0 auto;
@@ -94,13 +94,13 @@ a:active, a:focus {
     align-items: center;
     cursor: pointer;
 }
-.computerEndHeader .computerLogo{
+#computerEndHeader .computerLogo{
     color: rgba(79, 73, 222, 1);
     font-weight: bold;
     font-size: .28rem;
     padding-right: .5rem;
 }
-.computerEndHeader .computerLogo img{
+#computerEndHeader .computerLogo img{
     height: .22rem;
     width: auto;
 }
@@ -109,6 +109,8 @@ a:active, a:focus {
     display: flex;
     align-items: center;
     height: 100%;
+    overflow: hidden;
+
 }
 .headNavItem{
     height: .7rem;
@@ -122,7 +124,7 @@ a:active, a:focus {
     padding: 0 .28rem;
     font-weight: bold;
     color: #333333;
-    font-size: .24rem;
+    font-size: .22rem;
     position: relative;
     z-index: 2;
     letter-spacing: .02rem;
@@ -131,7 +133,7 @@ a:active, a:focus {
 
 .headNavItem.active .headNavTitle{
     color: #FFFFFF;
-    font-size: .28rem;
+    font-size: .24rem;
 }
 .headNavItem.active .back{
     position: absolute;
@@ -164,7 +166,7 @@ a:active, a:focus {
 
 
 /* 移动端头部 */
-.mobileEndHeader{
+#mobileEndHeader{
     display: none;
     position: relative;
 }
@@ -307,11 +309,11 @@ a:active, a:focus {
     display: none;
 }
 .ageReminderBox{
-    width: 9rem;
+    width: 7rem;
     background-color: #FFF;
-    height: 5rem;
+    height: 3.8rem;
     left: 50%;
-    margin-left: -4.5rem;
+    transform: translateX(-50%);
     top: 30%;
     position: absolute;
 }
@@ -332,7 +334,7 @@ a:active, a:focus {
 }
 .ageReminderInfo h3{
     line-height: 1.4;
-    font-size: .5rem;
+    font-size: .36rem;
     max-width: 60%;
     font-weight: bold;
 }
@@ -348,12 +350,12 @@ a:active, a:focus {
     display: flex;
     align-items: center;
     justify-content: center;
-    height: .6rem;
+    height: .56rem;
     border-radius: .08rem;
-    font-size: .28rem;
+    font-size: .22rem;
     font-weight: bold;
-    min-width: 1.8rem;
-    padding: 0 .24rem;
+    min-width: 1.6rem;
+    padding: 0 .12rem;
     margin-right: .32rem;
     cursor: pointer;
 }
@@ -443,9 +445,27 @@ a:active, a:focus {
     width: .4rem;
     height: .26rem;
 }
+#toastContainer {
+    position: fixed;
+    top: 40%;
+    left: 50%;
+    transform: translateX(-50%);
+    background-color: #333;
+    color: #fff;
+    padding: .08rem .12rem;
+    border-radius: .04rem;
+    word-break: break-all;
+    z-index: 9999;
+    display: none;
+    font-size: .18rem;
+    max-width: 70%;
+    text-align: center;
+    line-height: 1.4;
+  }
+
 /* end 底部模块 --> */
 @media (max-width: 1320px) {
-    .computerEndHeader{
+    #computerEndHeader{
         width: auto;
     }
     .computerLogo{
@@ -472,10 +492,10 @@ a:active, a:focus {
     .warnContainer .warnText{
         font-size: .15rem;
     }
-    .computerEndHeader{
+    #computerEndHeader{
         display: none;
     }
-    .mobileEndHeader{
+    #mobileEndHeader{
         display: flex;
     }
     .footerContainer{
@@ -520,19 +540,18 @@ a:active, a:focus {
 
 @media (max-width: 899px) {
     .ageReminderBox{
-        width: 7rem;
-        margin-left: -3.5rem;
-        height: 3.5rem;
+        width: 6rem;
+        height: 3rem;
     }
     .ageReminderInfo{
         padding-top: .6rem;
     }
     .ageReminderInfo h3{
-        font-size: .4rem;
+        font-size: .3rem;
     }
     .ageReminderInfo .ageReminderButBox .ageRBut{
-        font-size: .24rem;
-        min-width: 1.4rem;
+        font-size: .2rem;
+        min-width: 1rem;
     }
 
     .leftText .ltK{
@@ -549,5 +568,9 @@ a:active, a:focus {
     .footerVlsaImg img{
         height: .4rem;
     }
+    #toastContainer{
+        font-size: .24rem;
+        padding: .1rem .16rem;
+    }
 }
 

+ 2 - 1
public/assets/api/css/index.css

@@ -557,6 +557,7 @@ body{
     .newConterItem .newConterInfo{
        flex-direction: column;
        justify-content: space-between;
+       align-items: flex-start;
        min-height: 1.4rem;
     }
     .newConterInfo .newConterTitle{
@@ -610,7 +611,7 @@ body{
     }
     .partnersItem{
         height: .8rem;
-    } 
+    }
     .goodsCollect .collectNumber{
         font-size: .18rem;
         padding-left: .06rem;

+ 202 - 0
public/assets/api/css/login.css

@@ -0,0 +1,202 @@
+#main{
+}
+.pageContainer{
+    max-width: 13.2rem;
+    min-height: 100vh;
+    margin: 0 auto;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+}
+
+.pageLogo{
+    padding-top: 1rem;
+}
+.pageLogo img{
+    height: .3rem;
+}
+.pageSection{
+    flex: 1;
+    padding-top: 1.6rem;
+}
+#registerModel{
+    display: none;
+}
+#emailVerifyModel,#setPasswordModel{
+    display: none;
+}
+.modelTitle{
+    font-weight: bold;
+    font-size: .36rem;
+    color: #333333;
+}
+.modelTips{
+    font-size: .14rem;
+    color: #999999;
+    padding-top: .08rem;
+}
+.modelContainer{
+    padding-top: .48rem;
+}
+.modelItem{
+    border-radius: .08rem;
+    height: .58rem;
+    width: 4.5rem;
+    border: .02rem solid rgba(0, 0, 0, .05);
+    margin-bottom: .24rem;
+    position: relative;
+    display: flex;
+    justify-content: space-between; 
+    align-items: center;
+    transition: border .1s;
+}
+.modelItem .miTitle{
+    position: absolute;
+    z-index: 1;
+    background: #FFF;
+    line-height: 1;
+    color: #666666;
+    font-size: .14rem;
+    left: .12rem;
+    top: 0;
+    transform: translateY(-50%);
+    padding: 0 .08rem;
+    transition: color .1s;
+}
+.modelItem.active{
+    border-color: rgba(79, 73, 222, 1);
+}
+.modelItem.active .miTitle{
+    color: rgba(79, 73, 222, 1);
+}
+.modelItem .input{
+    flex: 1;
+    height: 100%;
+    outline: none;
+    font-size: .18rem;
+    padding-left: .12rem;
+    padding: .12rem;
+    padding-top: .1rem;
+    box-sizing: border-box;
+    border: none;
+    background-color: transparent;
+}
+.forgotPassword{
+    font-size: .14rem;
+    color: rgba(79, 73, 222, 1);
+    margin-bottom: .36rem;
+    cursor: pointer;
+}
+.pageButton{
+    width: 4.5rem;
+    height: .6rem;
+    background-color: rgba(79, 73, 222, 1);
+    border-radius: .08rem;
+    font-size: .22rem;
+    letter-spacing: .02rem;
+    font-weight: bold;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    color: #fff;
+    cursor: pointer;
+}
+.otherButton{
+    width: 4.5rem;
+    height: .5rem;
+    border-radius: .08rem;
+    font-size: .18rem;
+    letter-spacing: .02rem;
+    font-weight: bold;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    color: #434343;
+    cursor: pointer;
+    margin-top: .24rem;
+}
+.accountTips{
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    padding-top: .24rem;
+    font-size: .16rem;
+    color: #434343;
+}
+.accountTips span{
+    color: rgba(79, 73, 222, 1);
+    cursor: pointer;
+}
+
+@media (max-width: 899px) {
+    .modelTitle{
+        font-size: .4rem;
+    }
+   .pageSection{
+        width: 6rem;
+        padding-top: 1rem;
+   }
+   .modelItem{
+        width: 100%;
+        height: .7rem;
+        margin-bottom: .32rem;
+   }
+   .modelItem .miTitle{
+    font-size: .18rem;
+   }
+   .modelItem .input{
+    font-size: .22rem;
+   }
+   .pageButton{
+        width: 100%;
+        height: .8rem;
+        font-size: .26rem;
+   }
+   .forgotPassword{
+    font-size: .16rem;
+   }
+   .accountTips{
+    font-size: .18rem;
+   }
+   .modelTips{
+    font-size: .18rem;
+   }
+}
+@media (max-width: 750px) {
+    .modelTitle{
+        font-size: .42rem;
+    }
+   .pageSection{
+        width: 5.5rem;
+        padding-top: 2rem;
+   }
+   .modelItem{
+        width: 100%;
+        height: .8rem;
+        margin-bottom: .32rem;
+   }
+   .modelItem .miTitle{
+    font-size: .2rem;
+   }
+   .modelItem .input{
+    font-size: .24rem;
+   }
+   .pageButton{
+        width: 100%;
+        height: .8rem;
+        font-size: .26rem;
+   }
+   .forgotPassword{
+    font-size: .18rem;
+   }
+   .accountTips{
+    font-size: .2rem;
+   }
+   .modelTips{
+    font-size: .2rem;
+    padding-top: .18rem;
+   }
+   .modelContainer{
+    padding-top: .6rem;
+   }
+}

+ 525 - 0
public/assets/api/css/productDetails.css

@@ -0,0 +1,525 @@
+
+body{
+    background-color: #F8F8F8;
+}
+.sectionContainer{
+    display: flex;
+    justify-content: center;
+}
+.elementorContainer{
+    max-width: 13.2rem; 
+    flex: 1;
+    -moz-box-sizing: border-box;
+    -webkit-box-sizing: border-box; 
+    box-sizing: border-box;
+}
+.footerContainer{
+  padding-bottom: 1.2rem;
+}
+.productContainer{
+    padding-top: .3rem;
+    display: flex;
+    justify-content: space-between;
+    margin-bottom: .6rem;
+}
+.productImgContainer{
+    width: 6.48rem;
+}
+.prViewImgBox{
+    background-color: #fff;
+    width: 100%;
+    height: 6.48rem;
+    overflow: hidden;
+    font-size: 0;
+    position: relative;
+}
+.prViewImgBox .prViewImg{
+    width: 100%;
+    height: 100%;
+}
+.prImgContainer{
+    width: 100%;
+    overflow: hidden;
+    position: relative;
+}
+.prImgList{
+    padding-top: .3rem;
+    cursor: pointer;
+    width: 100%;
+    white-space: nowrap;
+    font-size: 0;
+     transition: transform 0.3s ease;
+}
+.prImgList .prImgItem{
+    display: inline-block;
+    width: 1.42rem;
+    height: 1.42rem;
+    overflow: hidden;
+    font-size: 0;
+    background-color: #fff;
+    margin-right: .25rem;
+}  
+.prImgList .prImgItem:last-child{
+    margin-right: 0;
+}
+.prImgList .prImgItem img{
+    width: 100%;
+    height: 100%;
+}   
+.prevArrow,
+.nextArrow {
+  position: absolute;
+  top: 50%;
+  transform: translateY(-50%);
+  width: 30px;
+  height: 30px;
+  background-color: #000;
+  color: #fff;
+  text-align: center;
+  line-height: 30px;
+  cursor: pointer;
+  display: none;
+}
+
+
+.prevArrow {
+    left: 10px;
+  }
+  
+  .nextArrow {
+    right: 10px;
+  }
+
+
+  .productInfoContainer{
+    flex: 1;
+    border: .02rem solid rgba(0, 0, 0, .1); 
+    min-height: 8.36rem;
+    margin-left: .34rem;
+    padding: 0 .28rem;
+    display: flex;
+    flex-direction: column;
+    justify-content: space-between;
+    box-sizing: border-box;
+  }
+  .productTitle{
+    color: #434343;
+    line-height: 1.6;
+    padding-top: .6rem;
+    font-size: .24rem;
+    word-break: break-all;
+  }
+  .productPrice p{
+    color: #333333;
+    font-weight: bold;
+    font-size: .32rem;
+    padding-top: .32rem;
+  }
+  .productPrice p span{
+    padding-right: .02rem;
+  }
+
+  .productNContainer{
+    display: flex;
+    align-items: center;
+    padding: .28rem 0;
+    border-top: .02rem solid rgba(0, 0, 0, .02);
+    border-bottom: .02rem solid rgba(0, 0, 0, .02);
+    margin-bottom: .24rem;
+  }
+  .productNumberBox{
+    display: flex;
+    align-items: center;
+    height: .62rem;
+    box-sizing: border-box;
+    border: .02rem solid rgba(0, 0, 0, .1); 
+    cursor: pointer;
+  }
+  .numberReduce,.numberAdd{
+    height: 100%;
+    width: .6rem;
+    border-right: .02rem solid rgba(0, 0, 0, .1); 
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    font-size: .2rem;
+  }
+  .numberAdd{
+    border-right: none;
+    border-left: .02rem solid rgba(0, 0, 0, .1);  
+  }
+  #numberInput{
+    height: 100%;
+    flex: 1;
+    font-size: .2rem;
+    border: none;
+    width: .8rem;
+    text-align: center;
+  }
+  .addToCart{
+    background-color: rgba(191, 77, 240, 1);
+    height: .62rem;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    width: 3rem;
+    color: #fff;
+    font-weight: bold;
+    font-size: .2rem;
+    cursor: pointer;
+    margin-left: .24rem;
+    border-radius: .08rem;
+  }
+  .addToCart .tag{
+    font-weight: 400;
+    margin-right: .08rem;
+  }
+  .safeContainer{
+    width: 100%;
+    min-height: .9rem;
+    border: .02rem solid rgba(0, 0, 0, .05); 
+    border-radius: .06rem;
+    position: relative;
+    margin-bottom: .32rem;
+  }
+  .safeContainer .safeTag{
+    position: absolute;
+    height: .2rem;
+    padding: 0 .12rem;
+    background: #F8F8F8;
+    font-size: .16rem;
+    color: #666666;
+    left: 50%;
+    transform: translateX(-50%);
+    top: -.1rem;
+    z-index: 1;
+  }
+  .safeList{
+    display: flex;
+    flex-wrap: wrap;
+    gap: .12rem;
+    align-items: center;
+    justify-content: center;
+    padding-top: .28rem;
+    padding-bottom: .12rem;
+  }
+  .safeList .safeItem{
+    width: .6rem;
+    height: .42rem;
+  }
+  .safeList .safeItem img{
+    width: 100%;
+    height: 100%;
+  }
+  .articleContainer{
+
+  }
+  .articleTabBox{
+    display: flex;
+    border-top: .02rem solid rgba(0, 0, 0, .1); 
+  }
+  .articleTabItem{
+    position: relative;
+    min-width: .6rem;
+    margin-right: .24rem;
+    cursor: pointer;
+  }
+  .articleTabItem .tabTag{
+    width: 80%;
+    left: 0;
+    top: -.04rem;
+    height: .08rem;
+    background-color: rgba(191, 77, 240, 1);
+    z-index: 1;
+    display: none;
+    position: absolute;
+  }
+  .articleTabTitle{
+    font-size: .2rem;
+    font-weight: 400;
+    padding-top: .12rem;
+    color: #666666;
+
+    display: flex;
+    align-items: center;
+  }
+  .active .articleTabTitle{
+    font-weight: bold;
+    color: #333333;
+  }
+  .active .tabTag{
+    display: block;
+  }
+  .articleInfo{
+    padding: .36rem 0;
+  }
+  .articleTitle{
+    color: #333333;
+    font-size: .28rem;
+    line-height: 1.4;
+  }
+  #richTextConatiner,
+  #richTextConatiner h1,
+  #richTextConatiner h2,
+  #richTextConatiner h3,
+  #richTextConatiner h4,
+  #richTextConatiner h5,
+  #richTextConatiner h6,
+  #richTextConatiner p,
+  #richTextConatiner ul,
+  #richTextConatiner ol {
+    font-style: .24rem;
+    color: #434343;
+    line-height: 1.5;   
+    margin-bottom: .32rem;
+    word-break: break-all;
+  }
+  .fixedAddSection{
+    display: none;
+    position: fixed; 
+    left: 0;
+    right: 0;
+    bottom: 0;
+    z-index: 9999;
+    height: 1.1rem;
+    background: #FFF;
+    -webkit-box-shadow: 0 -.02rem .05rem rgba(0,0,0,.01);
+    box-shadow: 0 -.02rem .05rem rgba(0,0,0,.01);
+  }
+  .fixedAddContainer{
+    height: 100%;
+    display: flex;
+    justify-content: center;
+}
+.fixedAddBox{
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    height: 100%;
+}
+.fPrInfo{
+    display: flex;
+    align-items: center;
+    flex: 1;
+}
+.fPrInfo img{
+    width: .67rem;
+    height: .67rem;
+}
+.fPrInfo .fTitle{
+    color: #666666;
+    font-size: .18rem;
+    padding-left: .12rem;
+    font-weight: 400;
+}
+  .fPrNumberContainer{
+    display: flex;
+    align-items: center;
+    box-sizing: border-box;
+    cursor: pointer;
+  }
+  .fPrPrice{
+    color: #333333;
+    font-size: .24rem;
+    font-weight: bold;
+    padding-right: .24rem;
+  }
+
+.fPrNumberBox{
+    display: flex;
+    align-items: center;
+    border: .02rem solid rgba(0, 0, 0, .1);
+    height: .4rem;
+  }
+  .fPrNumberReduce,.fPrNumberAdd{
+    height: 100%;
+    width: .4rem;
+    border-right: .02rem solid rgba(0, 0, 0, .1); 
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    font-size: .18rem;
+  }
+  .fPrNumberAdd{
+    border-right: none;
+    border-left: .02rem solid rgba(0, 0, 0, .1);  
+  }
+  #fPrNumberInput{
+    height: 100%;
+    flex: 1;
+    font-size: .18rem;
+    border: none;
+    width: .4rem;
+    text-align: center;
+  }
+  .fPrAddToCart{
+    background-color: rgba(191, 77, 240, 1);
+    height: .4rem;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    width: 2.1rem;
+    color: #fff;
+    font-weight: bold;
+    font-size: .18rem;
+    cursor: pointer;
+    margin-left: .24rem;
+    border-radius: .08rem;
+  }
+  .fPrAddToCart .tag{
+    font-weight: 400;
+    margin-right: .08rem;
+  }
+
+  @media (max-width: 1320px) {
+    .sectionContainer{
+        padding: 0 .12rem;
+    }
+    .fixedAddBox{
+        padding: 0 .12rem;
+    }
+    .productContainer{
+       
+    }
+    .productImgContainer{
+        width: 5.4rem;
+    }
+    .prViewImgBox{
+        height: 5rem;
+    }
+    .prImgList .prImgItem{
+        width: 1.16rem;
+        height: 1.16rem;
+    }
+    .productInfoContainer{
+      min-height: 6.46rem;
+    }
+  }
+  @media (max-width: 1199px) {
+    .elementorContainer{
+        width: 100%;
+        max-width: none;
+    }
+    .productInfoContainer{
+        padding-left: .24rem;
+    }
+    .productNumberBox{
+        height: .5rem;
+    }
+    .numberReduce, .numberAdd{
+        width: .5rem;
+    }
+    .addToCart{
+        width: auto;
+        flex: 1;
+        height: .5rem;
+    }
+    .productImgContainer{
+        width: 4.8rem;
+    }
+    .prImgList .prImgItem{
+        width: 1.01rem;
+        height: 1.01rem;
+    }
+    .productInfoContainer{
+      min-height: 6.3rem;
+    }
+  }
+
+  @media (max-width: 1080px) {
+    .sectionContainer{
+        padding: 0 .24rem;
+    }
+    .productContainer{
+        display: block;
+    }
+    .productImgContainer{
+        width: 7rem;
+        margin: 0 auto;
+    }
+    .prViewImgBox{
+        height: 7rem;
+    }
+    .prImgList .prImgItem{
+        width: 1.56rem;
+        height: 1.56rem;
+    }
+    .productInfoContainer{
+        margin-top: .4rem;
+        margin-left: 0;
+        height: auto;
+        min-height: auto;
+    }
+    .productTitle{
+        padding-top: .24rem;
+    }
+    #numberInput{
+        width: 1.2rem;
+    }
+    .productNContainer{
+        padding: .20rem 0;
+        margin-top: .12rem;
+    }
+    .productNumberBox{
+        height: .64rem;
+    }
+    .numberReduce,.numberAdd{
+        width: .64rem;
+    }
+    .addToCart{
+        height: .64rem;
+        font-size: .22rem;
+    }
+    .articleTabTitle{
+        font-size: .26rem;
+        padding-top: .16rem;
+    }
+    .articleTitle{
+        font-size: .32rem;
+    }
+    #richTextConatiner,
+    #richTextConatiner h1,
+    #richTextConatiner h2,
+    #richTextConatiner h3,
+    #richTextConatiner h4,
+    #richTextConatiner h5,
+    #richTextConatiner h6,
+    #richTextConatiner p,
+    #richTextConatiner ul,
+    #richTextConatiner ol {
+        font-size: .24rem;
+    }
+    .fixedAddSection{
+        height: 1.2rem;
+    }
+    .fPrInfo{
+        display: none;
+    }
+    .fPrNumberContainer{
+        flex: 1;
+    }
+    .fPrPrice{
+        flex: 1;
+        font-size: .28rem;
+    }
+    .fPrNumberBox{
+        height: .5rem;
+    }
+    .fPrNumberReduce,.fPrNumberAdd{
+        width: .5rem;
+        font-size: .22rem;
+    }
+    #fPrNumberInput{
+        font-size: .22rem;
+        width: 1rem;
+    }
+    .fPrAddToCart{
+        height: .6rem;
+        font-size: .2rem;
+    }
+  }
+  @media (max-width: 750px) {
+    .prViewImgBox{
+        width: 100%;
+    }
+  }

+ 0 - 3
public/assets/api/js/flexible.js

@@ -11,9 +11,6 @@
             } else {
                 docEl.style.fontSize = number + 'px';
             }
-            // let rem = clientWidth * (100 / 1920);
-            // docEl.style.fontSize = rem + 'px';
-
         };
     if (!doc.addEventListener) return;
     win.addEventListener(resizeEvt, recalc, false);

+ 0 - 55
public/assets/api/js/index.js

@@ -1,62 +1,7 @@
 $(document).ready(function () {
-    const VAPES_AGEREMINDER = "vapes_ageReminder"
 
-    $("img.lazy").lazyload();
 
-    //菜单按钮
-    const mobileMenuBot = $('#mobileMenuBot');
 
 
-    /**
-     * 年龄提示方法
-     */
-    function ageReminderMethod() {
-        const ageReminder = localStorage.getItem(VAPES_AGEREMINDER);
-        const maskElement = $(".maskContainer");
-        if (!ageReminder) {
-            maskElement.show(0)
-        } else {
-            maskElement.hide(0)
-        }
-    }
-
-    /**
-     * 手机端菜单展开收起
-     */
-    function starSlideToggle() {
-        $(".mobileMenuFixed").stop().slideToggle(80);
-        if (mobileMenuBot.hasClass('open')) {
-            mobileMenuBot.removeClass('open');
-        } else {
-            mobileMenuBot.addClass('open');
-        }
-    }
-
-    /**
-    * 手机端菜单绑定事件
-    */
-    mobileMenuBot.on('tap', starSlideToggle)
-
-
-    /**
-     * 年龄提示 NO 点击
-     */
-    $(".ageReminderNo").on('click', function () {
-        window.close()
-        history.back();
-    });
-
-
-    /**
-     * 年龄提示 Yes 点击
-     */
-    $(".ageReminderYes").on('click', function () {
-        localStorage.setItem(VAPES_AGEREMINDER, "1");
-        $(".maskContainer").hide(0)
-    });
-
-
-    ageReminderMethod()
-
 
 })

+ 25 - 0
public/assets/api/js/login.js

@@ -0,0 +1,25 @@
+$(document).ready(function () {
+
+    //输入框聚焦
+    $('.input').focus(function () {
+        $(this).closest('.modelItem').addClass('active');
+    });
+
+    //输入框失焦
+    $('.input').blur(function () {
+        $(this).closest('.modelItem').removeClass('active');
+    });
+
+    //限制输入框不能输入空格跟汉字
+    $('.input').on('input', function () {
+        var inputValue = $(this).val();
+        var sanitizedValue = sanitizeInput(inputValue);
+        $(this).val(sanitizedValue);
+    });
+
+    function sanitizeInput(input) {
+        // 替换空格和汉字为空字符串
+        var sanitizedInput = input.replace(/\s+|[\u4e00-\u9fa5]+/g, '');
+        return sanitizedInput;
+    }
+});

+ 97 - 0
public/assets/api/js/productDetails.js

@@ -0,0 +1,97 @@
+$(document).ready(function () {
+    //触屏事件 || 点击事件
+    const tap = "ontouchstart" in window ? "touchstart" : "click";
+    //缩略图长度
+    let slideCount = 0
+    const visibleSlides = 4;
+    let currentSlide = 0;
+    let isSlidedOut = false;
+
+    //其他详情图是否超出4张
+    const initThumbnail = () => {
+        setTimeout(() => {
+            slideCount = $('.prImgList .prImgItem').length;
+            if (slideCount > visibleSlides) {
+                $('.prevArrow').show(0)
+                $('.nextArrow').show(0)
+            }
+        }, 0)
+    }
+
+    initThumbnail()
+
+
+    //商品其他详情图滑动
+    function updateSlider() {
+        var slideWidth = $('.prImgItem').outerWidth(true);
+        var slideOffset = currentSlide * slideWidth;
+        $('.prImgList').css('transform', 'translateX(' + - slideOffset + 'px)');
+    }
+
+
+    //上一张
+    $(".prevArrow").on(tap, function () {
+        if (currentSlide > 0) {
+            currentSlide--;
+            updateSlider();
+        }
+    });
+
+    //下一张
+    $(".nextArrow").on(tap, function () {
+        if (currentSlide < slideCount - visibleSlides) {
+            currentSlide++;
+            updateSlider();
+        }
+    });
+
+
+
+    //监听页面滚动
+    $(window).scroll(function () {
+        //页面滚动高度
+        let windowTop = $(window).scrollTop();
+        if (windowTop > 100 && !isSlidedOut) {
+            $('.fixedAddSection').slideDown();
+            isSlidedOut = true;
+        } else if (windowTop <= 100 && isSlidedOut) {
+            $('.fixedAddSection').slideUp();
+            isSlidedOut = false;
+        }
+    });
+
+
+    //商品其他详情图点击
+    $(".prImgItem").on(tap, function () {
+        const src = $(this).find("img").attr('src')
+        if (src && src != "") {
+            $('.prViewImg').attr('src', src);
+        }
+    });
+
+    // 限制商品数量只能输入数字
+    const nonNumeric = (event) => {
+        // 获取按下的键的键码
+        var keyCode = event.which || event.keyCode;
+
+        // 允许使用的特殊键的键码(例如:Backspace、Delete、方向键等)
+        var allowedSpecialKeys = [8, 9, 37, 39, 46];
+
+        // 允许使用的数字键的键码(0-9)
+        var allowedNumericKeys = [48, 49, 50, 51, 52, 53, 54, 55, 56, 57];
+
+        // 检查是否按下了允许使用的特殊键
+        if ($.inArray(keyCode, allowedSpecialKeys) !== -1) {
+            return;
+        }
+
+        // 检查是否按下了允许使用的数字键
+        if ($.inArray(keyCode, allowedNumericKeys) === -1) {
+            event.preventDefault();
+        }
+    }
+
+
+    $('#numberInput').keydown(nonNumeric);
+    $('#fPrNumberInput').keydown(nonNumeric);
+});

+ 73 - 0
public/assets/api/js/public.js

@@ -0,0 +1,73 @@
+$(document).ready(function () {
+    const VAPES_AGEREMINDER = "vapes_ageReminder"
+    //用户存储token名
+    const VAPES_TOKEN = "vapes_token"
+    //菜单按钮
+    const mobileMenuBot = $('#mobileMenuBot');
+    //触屏事件 || 点击事件
+    const tap = "ontouchstart" in window ? "touchstart" : "click";
+
+    if ($.fn.lazyload) {
+        $("img.lazy").lazyload();
+    }
+
+    const initMainHeight = () => {
+        setTimeout(() => {
+            const browserHeight = $(window).height();
+            const headerHeight = $("#headerContainer").height();
+            const footerHeight = $("#footerContainer").height();
+            $('#main').css('min-height', browserHeight - headerHeight - footerHeight);
+        }, 0)
+    }
+
+    /**
+     * 年龄提示方法
+     */
+    function ageReminderMethod() {
+        const ageReminder = localStorage.getItem(VAPES_AGEREMINDER);
+        const maskElement = $(".maskContainer");
+        if (!ageReminder) {
+            maskElement.show(0)
+        } else {
+            maskElement.hide(0)
+        }
+    }
+
+    /**
+     * 手机端菜单展开收起
+     */
+    function starSlideToggle() {
+        $(".mobileMenuFixed").stop().slideToggle(80);
+        if (mobileMenuBot.hasClass('open')) {
+            mobileMenuBot.removeClass('open');
+        } else {
+            mobileMenuBot.addClass('open');
+        }
+    }
+
+    /**
+     * 年龄提示 NO 点击
+     */
+    $(".ageReminderNo").on(tap, function () {
+        window.close()
+        history.back();
+    });
+
+
+    /**
+     * 年龄提示 Yes 点击
+     */
+    $(".ageReminderYes").on(tap, function () {
+        localStorage.setItem(VAPES_AGEREMINDER, "1");
+        $(".maskContainer").hide(0)
+    });
+
+
+    /**
+    * 手机端菜单绑定事件
+    */
+    mobileMenuBot.on('tap', starSlideToggle)
+
+    ageReminderMethod()
+    initMainHeight()
+})