Files
pupil/packageMy/browseHistory/browseHistory.vue
2023-01-30 14:40:45 +08:00

53 lines
1.1 KiB
Vue

<template>
<view>
<productsBtn :type="2" 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: '',
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>