解决体验版弹出登录框
This commit is contained in:
@@ -1,18 +1,52 @@
|
||||
<template>
|
||||
<view>
|
||||
<productsBtn :type="1"></productsBtn>
|
||||
<productsBtn :type="1" ref="browseHistory"></productsBtn>
|
||||
<!-- <view style="margin:0 20rpx;">
|
||||
<u-overlay :show="!isLoad">
|
||||
<login @success="reOnLoad()" @fail="failToLoad()"></login>
|
||||
</u-overlay>
|
||||
</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import login from 'pages/my/login/login'
|
||||
export default {
|
||||
components: {
|
||||
login
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
type: ''
|
||||
type: '',
|
||||
isLoad: true,
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
|
||||
this.isLoad = false
|
||||
// uni.navigateTo({
|
||||
// url: '../../pages/my/login/login'
|
||||
// })
|
||||
return
|
||||
}
|
||||
this.isLoad = true
|
||||
},
|
||||
methods: {
|
||||
|
||||
reOnLoad() {
|
||||
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
|
||||
this.$toast.warn('登录失败请重试')
|
||||
this.isLoad = false
|
||||
// uni.navigateTo({
|
||||
// url: '../../pages/my/login/login'
|
||||
// })
|
||||
return
|
||||
}
|
||||
this.isLoad = true
|
||||
this.$refs.browseHistory.getHistoryOrCollection()
|
||||
},
|
||||
failToLoad() {
|
||||
this.$toast.warn('登录失败请重试')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user