|
@@ -189,24 +189,29 @@ var globalHead = new Vue({
|
|
|
this.GetProductClassify(1);
|
|
|
this.GetProductClassify(2);
|
|
|
// this.GetNavigationMenu();
|
|
|
- // 信息中心
|
|
|
- this.articleType = getUrlParam("type");
|
|
|
- },
|
|
|
- mounted:function(){
|
|
|
- var _self = this;
|
|
|
// 判断登录状态
|
|
|
- if (GLOBAL_TOKEN) {
|
|
|
- _self.loginStatus = true;
|
|
|
- _self.userIdentity = GLOBAL_USER_IDENTITY;
|
|
|
- _self.shopId = GLOBAL_SHOP_ID;
|
|
|
- _self.userData = globalUserData;
|
|
|
- if(GLOBAL_USER_ID){
|
|
|
+ if (globalUserData.token) {
|
|
|
+ this.loginStatus = true;
|
|
|
+ this.userData = globalUserData;
|
|
|
+ var userId = this.userData.userId;
|
|
|
+ if(userId){
|
|
|
+ var _self = this;
|
|
|
// 获取头部购物车数据
|
|
|
setTimeout(function(){
|
|
|
- _self.getHeadCart(GLOBAL_USER_ID);
|
|
|
+ _self.getHeadCart(userId);
|
|
|
}, 1000);
|
|
|
}
|
|
|
}
|
|
|
+ // 信息中心
|
|
|
+ this.articleType = getUrlParam("type");
|
|
|
+ },
|
|
|
+ mounted:function(){
|
|
|
+ var _self = this;
|
|
|
+ var userData = JSON.parse(window.localStorage.getItem('userInfo'));
|
|
|
+ if(userData!=null) {
|
|
|
+ this.userIdentity = userData.userIdentity;
|
|
|
+ this.shopId = userData.shopId;
|
|
|
+ }
|
|
|
if($(window).width() > 1400){
|
|
|
$(window).on('scroll', function() {
|
|
|
var scrollTop = $(this).scrollTop();
|