解决体验版弹出登录框

This commit is contained in:
dengjie
2023-01-28 22:33:37 +08:00
parent 5678815237
commit 1f6d21a1a0
14 changed files with 213 additions and 83 deletions

View File

@@ -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>