46 lines
878 B
Vue
46 lines
878 B
Vue
|
<template>
|
|||
|
<view class="login-container">
|
|||
|
<button :disabled="loading" @click="login()">
|
|||
|
{{ loading ? '加载中...' : '微信登录' }}
|
|||
|
</button>
|
|||
|
<text v-if="error">错误:{{ error.message }}</text>
|
|||
|
<view class="" @click="jump">
|
|||
|
111111111111111111111111111111111
|
|||
|
</view>
|
|||
|
<view class="" @click="jumpto">
|
|||
|
2222
|
|||
|
</view>
|
|||
|
</view>
|
|||
|
|
|||
|
</template>
|
|||
|
|
|||
|
<script setup>
|
|||
|
import { useWeChatAuth } from '@/compontent/useWeChatAuth.js';
|
|||
|
const { login, loading, error } = useWeChatAuth();
|
|||
|
const jump = () =>{
|
|||
|
console.log("???")
|
|||
|
uni.navigateTo({
|
|||
|
url: "/pages/index/callback"
|
|||
|
});
|
|||
|
}
|
|||
|
|
|||
|
</script>
|
|||
|
|
|||
|
<style scoped>
|
|||
|
.login-container {
|
|||
|
display: flex;
|
|||
|
flex-direction: column;
|
|||
|
justify-content: center;
|
|||
|
align-items: center;
|
|||
|
height: 100vh;
|
|||
|
}
|
|||
|
button {
|
|||
|
padding: 12px 24px;
|
|||
|
font-size: 16px;
|
|||
|
border-radius: 4px;
|
|||
|
}
|
|||
|
text {
|
|||
|
margin-top: 8px;
|
|||
|
color: red;
|
|||
|
}
|
|||
|
</style>
|