diff --git a/components/shopping-carts/cart-slide.vue b/components/shopping-carts/cart-slide.vue index cb74f7c..43117f3 100644 --- a/components/shopping-carts/cart-slide.vue +++ b/components/shopping-carts/cart-slide.vue @@ -41,7 +41,7 @@ - + diff --git a/components/swiper-tab/swiper-tab-jl.vue b/components/swiper-tab/swiper-tab-jl.vue index 930226d..12d09c5 100644 --- a/components/swiper-tab/swiper-tab-jl.vue +++ b/components/swiper-tab/swiper-tab-jl.vue @@ -13,7 +13,7 @@ + :style="{background: lineColor, width: lineStyle.width, transform: lineStyle.transform}"> diff --git a/jsFile/requst.js b/jsFile/requst.js index bb2da0e..3ee4d4c 100644 --- a/jsFile/requst.js +++ b/jsFile/requst.js @@ -7,8 +7,18 @@ const goLogin = () => { } let flag = true; // 刷新token并跳转到当前页面 +var authTimer = null; const refreshTokenPage = () => { - + clearTimeout(authTimer); + uni.showToast({ + title: `请授权登录`, + icon:'none', + duration: 1000 + }); + authTimer = setTimeout(()=>{ + uni.reLaunch({url:'/pagesB/login/login'}); + },1000) + flag = true; } // 请求错误处理 const checkError = (e) => { diff --git a/pages/tabbar/my/my.vue b/pages/tabbar/my/my.vue index eab416d..1b45c25 100644 --- a/pages/tabbar/my/my.vue +++ b/pages/tabbar/my/my.vue @@ -106,13 +106,13 @@ methods: { getUserInfo(){ this.$requst.get('/api/user/info').then(res=>{ + console.log(res,'用户信息') if(res.code==0) { this.userImg = res.data.headimgurl; this.userName = res.data.nickname; this.list[0].num = res.data.order_count.order_placed; this.list[1].num = res.data.order_count.makeing; this.list[2].num = res.data.order_count.shipped; - } }) }, diff --git a/pagesB/login/login.vue b/pagesB/login/login.vue index 3abb58c..f1b2c44 100644 --- a/pagesB/login/login.vue +++ b/pagesB/login/login.vue @@ -149,7 +149,7 @@ is_active:1 } this.$requst.post('/api/user/login',params).then(res => { - if(res.data.token!=''){ + if(res.code == 0){ uni.setStorageSync('userId',res.data.account_id) uni.setStorageSync('token',res.data.token)//缓存token uni.setStorageSync('openid',res.data.openid)//缓存openid diff --git a/pagesB/settlement/settlement.vue b/pagesB/settlement/settlement.vue index 3cfe1b9..c76c3d3 100644 --- a/pagesB/settlement/settlement.vue +++ b/pagesB/settlement/settlement.vue @@ -51,7 +51,21 @@ onLoad() { console.log(uni.getStorageSync('buyList'),'缓存数组') }, + onShow() { + this.getUserInfo() + }, methods: { + // 获取默认信息 + getUserInfo(){ + this.$requst.get('/api/user/info').then(res=>{ + console.log(res,'用户信息') + if(res.code==0) { + this.address = res.data.address; //地址 + this.name = res.data.contacts; //联系人 + this.phone = res.data.mobile; //电话 + } + }) + }, // 提交 submit(){ if(this.checkEmpty() && this.flag){