feat: 新增授权页面及功能,去除我的页面登录按钮;

master
chris 2 weeks ago
parent 44dd0a2f9e
commit 13469fcde4

@ -1,3 +1,9 @@
<!--
* @Author: chris
* @Date: 2025-10-20 10:45:46
* @LastEditors: chris
* @LastEditTime: 2025-10-31 16:39:29
-->
<script setup lang="ts">
import { ref } from 'vue'
import { useThemeStore } from '@/store'
@ -8,6 +14,7 @@ import { currRoute } from './utils'
const themeStore = useThemeStore()
const isCurrentPageTabbar = ref(true)
onShow(() => {
console.log('App.ku.vue onShow', currRoute())
const { path } = currRoute()

@ -1,3 +1,9 @@
<!--
* @Author: chris
* @Date: 2025-10-20 10:45:46
* @LastEditors: chris
* @LastEditTime: 2025-10-28 11:11:53
-->
<script setup lang="ts">
import { onHide, onLaunch, onShow } from '@dcloudio/uni-app'
import { navigateToInterceptor } from '@/router/interceptor'

@ -0,0 +1,84 @@
<!--
* @Author: chris
* @Date: 2025-10-29 11:34:52
* @LastEditors: chris
* @LastEditTime: 2025-10-29 15:51:46
-->
<script setup>
import orchard from '@/static/svg/orchard.svg'
// import {
// getWxCode,
// } from '@/api/login'
const loading = ref(false)
const wxCode = ref('')
function handleAuth() {
loading.value = true
uni.login({
onlyAuthorize: true,
success: (res) => {
wxCode.value = res.code
console.log(res)
},
error: (err) => {
console.log(err)
},
finally: () => {
loading.value = false
},
})
}
function getPhoneNumber(e) {
console.log(e)
handleAuth()
}
</script>
<template>
<view class="auth-page">
<view class="content-box">
<view class="logo">
<image :src="orchard" mode="contain" />
</view>
<view class="title">
荔枝园监控系统
</view>
<wd-button block size="large" :loading="loading" open-type="getPhoneNumber" @get-phone-number="getPhoneNumber">
授权获取手机号
</wd-button>
</view>
<view class="copyright pb-safe">
© 2025 荔枝园监控系统
</view>
</view>
</template>
<style lang="scss" scoped>
.auth-page {
@apply flex flex-col items-center justify-between h-[100vh];
.content-box {
@apply flex flex-col items-center justify-center gap-[40rpx] w-70% mt-[35%];
}
.logo {
@apply w-[160rpx] h-[160rpx];
}
.title {
@apply text-[46rpx] tracking-[4rpx] font-bold;
color: #666;
}
.wd-button {
@apply w-full;
}
.copyright {
@apply text-[24rpx] text-center;
color: #999;
}
}
</style>

@ -2,7 +2,7 @@
* @Author: chris
* @Date: 2025-09-15 09:51:59
* @LastEditors: chris
* @LastEditTime: 2025-10-23 16:53:59
* @LastEditTime: 2025-10-29 14:13:34
-->
<script setup>
import BasicInfo from './components/basicInfo.vue'
@ -19,7 +19,8 @@ definePage({
//
function handleMoreWarning() {
uni.navigateTo({
url: '/pages/warning/warning',
// url: '/pages/warning/warning',
url: '/pages/auth/auth',
})
}
</script>

@ -113,9 +113,6 @@ function handleLogout() {
<wd-button v-if="tokenStore.hasLogin" type="warning" block @click="handleLogout">
退出登录
</wd-button>
<!-- <button v-else type="primary" class="w-full" @click="handleLogin">
登录
</button> -->
</view>
</view>
</view>
@ -126,7 +123,6 @@ $avatar-size: 120rpx;
/* 基础样式 */
.profile-container {
overflow: hidden;
font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
background-color: #f7f8fa;
height: 100vh;
padding: 20rpx 0;

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.0 KiB

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save