-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
08f0f62
commit e39a463
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<template> | ||
<view class="phone-container p-0 px-6 pt-10"> | ||
<login | ||
v-if="pupup_index == 0" | ||
@success="loginSuccess" | ||
@goRegister="pupup_index = 1" | ||
></login> | ||
<register | ||
v-else | ||
@goLogin="pupup_index = 0" | ||
@success="registerSuccess" | ||
></register> | ||
</view> | ||
</template> | ||
|
||
<script> | ||
import lpopup from "@/components/popup.vue"; | ||
import login from "@/pages/components/login.vue"; | ||
import register from "@/pages/components/register.vue"; | ||
import { mapState, mapMutations, mapActions } from "vuex"; | ||
export default { | ||
data() { | ||
return { | ||
pupup_index: 0, | ||
title: "Hello", | ||
redirect: "", | ||
}; | ||
}, | ||
onLoad(option) { | ||
this.redirect = option.redirect; | ||
console.log("option", option); | ||
}, | ||
methods: { | ||
loginSuccess(){ | ||
this.goRedirect(); | ||
}, | ||
registerSuccess(){ | ||
this.goRedirect(); | ||
}, | ||
goRedirect(){ | ||
var pages = getCurrentPages(); | ||
if(pages.length > 1) | ||
uni.navigateBack(); | ||
else if(this.redirect && this.redirect.length > 0) { | ||
uni.reLaunch({ | ||
url: this.redirect , | ||
}); | ||
} | ||
else uni.reLaunch({url:"/pages/tab/templates"}); | ||
} | ||
}, | ||
onShow() { | ||
}, | ||
computed: { | ||
}, | ||
components: { lpopup, login, register }, | ||
}; | ||
</script> | ||
|
||
<style> | ||
</style> |