|
|
@@ -51,9 +51,9 @@
|
|
|
</div>
|
|
|
</a>
|
|
|
<!-- 收藏 -->
|
|
|
-<!-- <div class="headIconItem collectIcon">-->
|
|
|
-<!-- <img src="/assets/index/asstes/icon/collect.png" alt="collect" tabindex="collect">-->
|
|
|
-<!-- </div>-->
|
|
|
+ <!-- <div class="headIconItem collectIcon">-->
|
|
|
+ <!-- <img src="/assets/index/asstes/icon/collect.png" alt="collect" tabindex="collect">-->
|
|
|
+ <!-- </div>-->
|
|
|
<!-- 个人中心 -->
|
|
|
|
|
|
<a href="/index/user/order.html">
|
|
|
@@ -97,9 +97,9 @@
|
|
|
<a href="/index/cart/shoppingCart.html">
|
|
|
<h2 class="menuItemTitle shoppingCartIcon">Shopping Cart</h2>
|
|
|
</a>
|
|
|
-<!-- <div class="mobileMenuItem">-->
|
|
|
-<!-- <h2 class="menuItemTitle collectIcon">Collect</h2>-->
|
|
|
-<!-- </div>-->
|
|
|
+ <!-- <div class="mobileMenuItem">-->
|
|
|
+ <!-- <h2 class="menuItemTitle collectIcon">Collect</h2>-->
|
|
|
+ <!-- </div>-->
|
|
|
<div class="mobileMenuItem">
|
|
|
<a href="/index/user/personal.html">
|
|
|
<h2 class="menuItemTitle userIcon">Personal</h2>
|
|
|
@@ -310,11 +310,6 @@
|
|
|
//触屏事件 || 点击事件
|
|
|
const tap = "ontouchstart" in window ? "touchstart" : "click";
|
|
|
|
|
|
- //用户存储token名
|
|
|
- const VAPES_TOKEN = "PHPSESSID"
|
|
|
-
|
|
|
- var vapesToken = '';
|
|
|
-
|
|
|
var goodsId = {$goods.goods_id};
|
|
|
var goodsSkuId = {$goods['skuList'][0]['goods_sku_id']};
|
|
|
|
|
|
@@ -324,20 +319,6 @@
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 登录校验点击
|
|
|
- * @param state 是否需要跳转登录页
|
|
|
- * @returns
|
|
|
- */
|
|
|
- const isLogin = (state) => {
|
|
|
- vapesToken = sessionStorage.getItem(VAPES_TOKEN);
|
|
|
- state = state || true;
|
|
|
- if (!vapesToken || vapesToken === 'undefined' || vapesToken === "" && state) {
|
|
|
- window.location.href = "../passport/login.html?return=1"
|
|
|
- }
|
|
|
- return vapesToken && vapesToken !== "";
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
* 添加购物车
|
|
|
* @param number 数量
|
|
|
* @returns
|
|
|
@@ -354,7 +335,7 @@
|
|
|
}
|
|
|
$.ajax({
|
|
|
url: "/index/cart/add",
|
|
|
- headers: {platform: 'H5', "Access-Token": vapesToken},
|
|
|
+ headers: {platform: 'H5'},
|
|
|
dataType: 'json',
|
|
|
data: JSON.stringify(dp),
|
|
|
type: "POST",
|
|
|
@@ -365,9 +346,9 @@
|
|
|
showToast("Successful")
|
|
|
window.location.href = '/index/cart/shoppingCart.html';
|
|
|
return
|
|
|
- }else if (obj.status === 401 || obj.status === '401'){
|
|
|
+ } else if (obj.status === 401 || obj.status === '401') {
|
|
|
window.location.replace('../passport/logIn.html')
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
showToast(obj.message)
|
|
|
}
|
|
|
}
|
|
|
@@ -421,20 +402,14 @@
|
|
|
|
|
|
//上面的添加按钮
|
|
|
$(".addToCart").on(tap, function () {
|
|
|
- const state = isLogin()
|
|
|
- if (state) {
|
|
|
- const number = $('#numberInput').val();
|
|
|
- addCart(number)
|
|
|
- }
|
|
|
+ const number = $('#numberInput').val();
|
|
|
+ addCart(number)
|
|
|
});
|
|
|
|
|
|
//悬浮模块的添加按钮
|
|
|
$(".fPrAddToCart").on(tap, function () {
|
|
|
- const state = isLogin()
|
|
|
- if (state) {
|
|
|
- const number = $('#fPrNumberInput').val();
|
|
|
- addCart(number)
|
|
|
- }
|
|
|
+ const number = $('#fPrNumberInput').val();
|
|
|
+ addCart(number)
|
|
|
});
|
|
|
initRichText()
|
|
|
});
|