|
|
@@ -62,7 +62,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <Server />
|
|
|
+ <!-- <Server /> -->
|
|
|
</scroll-view>
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -160,13 +160,13 @@ export default {
|
|
|
this.getMenuButtonInfo(); // 初始化获取胶囊信息
|
|
|
if (option.userCode != null) {
|
|
|
uni.setStorageSync('userCode', option.userCode)
|
|
|
- if (this.utils.checkLoginState()) this.getUserInfo()
|
|
|
+ if (this.$isLogin()) this.getUserInfo()
|
|
|
}
|
|
|
if (option.hasOwnProperty('q') && option.q) {
|
|
|
const url = decodeURIComponent(option.q)
|
|
|
const obj = this.utils.urlToObj(url)
|
|
|
uni.setStorageSync('userCode', obj.userCode)
|
|
|
- if (this.utils.checkLoginState()) this.getUserInfo()
|
|
|
+ if (this.$isLogin()) this.getUserInfo()
|
|
|
}
|
|
|
},
|
|
|
onUnload() {
|
|
|
@@ -225,7 +225,7 @@ export default {
|
|
|
} else {
|
|
|
this.isuser = true
|
|
|
}
|
|
|
- if (this.utils.checkLoginState()) this.getCartCount()
|
|
|
+ if (this.$isLogin()) this.getCartCount()
|
|
|
this.getStoreConfig()
|
|
|
},
|
|
|
// 获取胶囊按钮布局参数
|
|
|
@@ -350,11 +350,12 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
getCartCount() {
|
|
|
- this.utils.isLogin().then(res => {
|
|
|
- if (res) getCartCount().then(cartRes => {
|
|
|
+ if (this.$isLogin()){
|
|
|
+ getCartCount().then(cartRes => {
|
|
|
if (cartRes.code == 200) this.cartCount = cartRes.data
|
|
|
+ this.$emit('updateMallIndexCartCount', cartRes.data || 0)
|
|
|
})
|
|
|
- })
|
|
|
+ }
|
|
|
},
|
|
|
getStoreConfig() {
|
|
|
getStoreConfig().then(res => {
|
|
|
@@ -410,9 +411,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
goAuthUrl(url) {
|
|
|
- this.utils.isLogin().then(res => {
|
|
|
- if (res) uni.switchTab({ url })
|
|
|
- })
|
|
|
+ if (this.$isLogin()) {
|
|
|
+ uni.switchTab({ url })
|
|
|
+ }
|
|
|
},
|
|
|
navTo(url) {
|
|
|
uni.navigateTo({ url })
|