| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <template>
- <view class="login-page">
- <!--
- 兜底整页登录壳:全部登录逻辑已迁移至全局组件 login-sheet(components/login-sheet.vue)。
- 历史整页登录的 URL 参数(?inviteCode=&inviteType=&refCode=&redirect=)在 onLoad 透传给浮层。
- standalone 模式语义:登录成功(无跳转需求)/ 暂不登录 → 回首页,保持旧整页登录行为。
- 触发场景:登出流程的 reLaunch 到本页、或宿主页面未挂载浮层时的 openLoginSheet() 回退。
- -->
- <login-sheet ref="loginSheet" :standalone="true" />
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- _sheetOptions: {}
- }
- },
- onLoad(options) {
- this._sheetOptions = {
- inviteCode: (options && options.inviteCode) || '',
- inviteType: (options && options.inviteType) || '',
- refCode: (options && options.refCode) || '',
- redirect: (options && options.redirect) || ''
- }
- },
- mounted() {
- // 页面渲染完成后自动弹出浮层(子组件先于父组件 mounted,$refs 可用)
- if (this.$refs.loginSheet) {
- this.$refs.loginSheet.open(this._sheetOptions)
- }
- },
- onUnload() {
- // 清理 tap 锁兜底定时器,避免登录成功跳转后定时器仍在已销毁组件上置值(组件自身也会清理)
- if (this.$refs && this.$refs.loginSheet && this.$refs.loginSheet._tapLockTimer) {
- clearTimeout(this.$refs.loginSheet._tapLockTimer)
- this.$refs.loginSheet._tapLockTimer = null
- }
- }
- }
- </script>
- <style scoped>
- .login-page {
- min-height: 100vh;
- background: linear-gradient(180deg, #FFF9F0 0%, #FFEEDB 100%);
- }
- </style>
|