diff --git a/components/OrderGoods.vue b/components/OrderGoods.vue index 50fac18..19b22f5 100644 --- a/components/OrderGoods.vue +++ b/components/OrderGoods.vue @@ -12,7 +12,8 @@ x {{ cart.cartNum }} {{ cart.productInfo.attrInfo.sku }} - ¥{{ cart.truePrice }} + {{ cart.costPrice }}积分 + ¥{{ cart.truePrice }} 评价 @@ -28,6 +29,7 @@ export default { type: Array, default: () => [], }, + isIntegral: Boolean, }, data: function() { return {} diff --git a/components/t-goods-item/t-goods-item.vue b/components/t-goods-item/t-goods-item.vue index 1543b89..033e062 100644 --- a/components/t-goods-item/t-goods-item.vue +++ b/components/t-goods-item/t-goods-item.vue @@ -1,5 +1,5 @@ diff --git a/utils/index.js b/utils/index.js index 911ccae..8a2b27a 100644 --- a/utils/index.js +++ b/utils/index.js @@ -499,6 +499,22 @@ export const handleLoginStatus = (location, complete, fail, success) => { path: '/pages/home/index', name: '首页', }, + { + path: '/pages/shop/HotNewGoods/index', + name: '热门榜单', + }, + { + path: '/pages/activity/GoodsGroup/index', + name: '超值拼团', + }, + { + path: '/pages/shop/Live/LiveList/index', + name: '热门直播', + }, + { + path: '/pages/shop/GoodsClass/index', + name: '商品分类', + }, { path: '/pages/user/Login/index', name: '登录页面', @@ -520,7 +536,7 @@ export const handleLoginStatus = (location, complete, fail, success) => { } else { path = location.path } - + console.log(path) // 判断用户是否有token if (!handleAuth()) { page.map(item => { @@ -531,28 +547,34 @@ export const handleLoginStatus = (location, complete, fail, success) => { } else { isAuth = true } - + console.log(isAuth) return new Promise((resolve, reject) => { - if (isAuth) { - // 有token - if (path == '/pages/home/index' || path == '/pages/shop/GoodsClass/index' || path == '/pages/shop/ShoppingCart/index' || path == '/pages/user/User/index') { - // switchTab({ - // path: parseUrl(location), - // }) - // return - } - - resolve({ - url: parseUrl(location), - complete, - fail, - success, - }) - } else { - // 没有token,先校验用户是否授权,如果授权了,进行自动登录 - routerPermissions(parseUrl(location)) - reject() - } + resolve({ + url: parseUrl(location), + complete, + fail, + success, + }) + // if (isAuth) { + // // 有token + // if (path == '/pages/home/index' || path == '/pages/shop/GoodsClass/index' || path == '/pages/shop/ShoppingCart/index' || path == '/pages/user/User/index') { + // // switchTab({ + // // path: parseUrl(location), + // // }) + // // return + // } + + // resolve({ + // url: parseUrl(location), + // complete, + // fail, + // success, + // }) + // } else { + // // 没有token,先校验用户是否授权,如果授权了,进行自动登录 + // routerPermissions(parseUrl(location)) + // reject() + // } }).catch(error => { console.log(error) }) diff --git a/utils/request.js b/utils/request.js index b9db3d4..bbe4574 100644 --- a/utils/request.js +++ b/utils/request.js @@ -72,13 +72,13 @@ function baseRequest(options) { } } - // 如果需要登录才可访问的接口没有拿到 token 视为登录失效 - if (options.login === true && !token) { - // 跳转到登录或授权页面 - handleLoginFailure() - // 提示错误信息 - return Promise.reject({ msg: '未登录', toLogin: true }) - } + // // 如果需要登录才可访问的接口没有拿到 token 视为登录失效 + // if (options.login === true && !token) { + // // 跳转到登录或授权页面 + // handleLoginFailure() + // // 提示错误信息 + // return Promise.reject({ msg: '未登录', toLogin: true }) + // } // 结构请求需要的参数 const { url, params, data, login, ...option } = options