|
@@ -1,5 +1,10 @@
|
|
|
+<route lang="yaml">
|
|
|
+style:
|
|
|
+ navigationBarTitleText: 登录
|
|
|
+</route>
|
|
|
<script lang="ts" setup>
|
|
|
import { weixinMiniAppLogin } from '@/core/libs/requests'
|
|
|
+import { logo } from '@/core/libs/svgs'
|
|
|
|
|
|
const loginCode = ref('')
|
|
|
const phoneCode = ref('')
|
|
@@ -40,17 +45,11 @@ const toUserInfoPage = () => {
|
|
|
url: '/uni_modules/uni-id-pages/pages/userinfo/userinfo?showLoginManage=true',
|
|
|
})
|
|
|
}
|
|
|
-const weixinLogin = async () => {
|
|
|
- // wx.getPhoneNumber
|
|
|
-}
|
|
|
-const getPhoneNumber = async ({ detail }) => {
|
|
|
- console.log(phoneCode)
|
|
|
- phoneCode.value = detail.code
|
|
|
+const getPhoneNumber = async ({ detail: { code: phoneCode } }) => {
|
|
|
const { code } = await uni.login()
|
|
|
- loginCode.value = code
|
|
|
- console.log(code)
|
|
|
- const a = await weixinMiniAppLogin(phoneCode.value, code, '9b2ffbc1-7425-4155-9894-9d5c08541d62')
|
|
|
- console.log(a)
|
|
|
+ console.log(code, phoneCode)
|
|
|
+ const res = await weixinMiniAppLogin(phoneCode, code, '9b2ffbc1-7425-4155-9894-9d5c08541d62')
|
|
|
+ console.log(res)
|
|
|
}
|
|
|
const getTestCode = async ({ detail }) => {
|
|
|
phoneCode.value = detail.code
|
|
@@ -59,7 +58,36 @@ const getTestCode = async ({ detail }) => {
|
|
|
}
|
|
|
</script>
|
|
|
<template>
|
|
|
- <view class="content">
|
|
|
+ <div class="w-full flex flex-col items-center justify-around px-3.5">
|
|
|
+ <div>
|
|
|
+ <wd-img :src="logo" width="78" height="78"></wd-img>
|
|
|
+ <div class="text-black text-2xl font-normal font-['PingFang SC'] leading-[10.18px]">
|
|
|
+ 筑巢荟
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="w-full">
|
|
|
+ <button
|
|
|
+ type="primary"
|
|
|
+ size="large"
|
|
|
+ :style="{
|
|
|
+ backgroundColor: 'black',
|
|
|
+ }"
|
|
|
+ open-type="getPhoneNumber"
|
|
|
+ @getphonenumber="getPhoneNumber"
|
|
|
+ >
|
|
|
+ 手机号一键登录
|
|
|
+ </button>
|
|
|
+ <div class="w-[318px] mt-8">
|
|
|
+ <span class="text-black/40 text-xs font-normal font-['PingFang SC'] leading-tight">
|
|
|
+ 如您点击授权,您将同意并授权
|
|
|
+ </span>
|
|
|
+ <span class="text-[#0cbe7c] text-xs font-normal font-['PingFang SC'] leading-tight">
|
|
|
+ 《筑巢荟用户服务协议》、《隐私政策》、《注册协议》
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- <view class="content">
|
|
|
<textarea v-model="loginCode" placeholder="" placeholder-class="textarea-placeholder" />
|
|
|
<textarea v-model="phoneCode" placeholder="" placeholder-class="textarea-placeholder" />
|
|
|
<button style="margin: 20px 0 20px 0" @click="toUserInfoPage">个人资料</button>
|
|
@@ -71,18 +99,18 @@ const getTestCode = async ({ detail }) => {
|
|
|
mode="button"
|
|
|
></uni-data-checkbox>
|
|
|
</uni-forms-item>
|
|
|
- <button @click="weixinLogin">前往登录</button>
|
|
|
- <!-- #ifdef MP-WEIXIN -->
|
|
|
- <button type="primary" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
|
|
|
- 手机号一键登录
|
|
|
- </button>
|
|
|
- <!-- #endif -->
|
|
|
- <!-- #ifdef MP-WEIXIN -->
|
|
|
- <button type="primary" open-type="getPhoneNumber" @getphonenumber="getTestCode">
|
|
|
+ <button @click="weixinLogin">前往登录</button> -->
|
|
|
+ <!-- #ifdef MP-WEIXIN -->
|
|
|
+ <!-- <button type="primary" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"> -->
|
|
|
+ <!-- 手机号一键登录
|
|
|
+ </button> -->
|
|
|
+ <!-- #endif -->
|
|
|
+ <!-- #ifdef MP-WEIXIN -->
|
|
|
+ <!-- <button type="primary" open-type="getPhoneNumber" @getphonenumber="getTestCode">
|
|
|
获取测试码
|
|
|
- </button>
|
|
|
- <!-- #endif -->
|
|
|
- </view>
|
|
|
+ </button> -->
|
|
|
+ <!-- #endif -->
|
|
|
+ <!-- </view> -->
|
|
|
</template>
|
|
|
|
|
|
<style lang="scss">
|