调试接口

This commit is contained in:
wangxiaowei
2025-12-23 17:55:14 +08:00
parent 3af440cd21
commit 716160c113
13 changed files with 133 additions and 50 deletions

View File

@ -67,7 +67,7 @@
const userInfo = ref<IUserInfoVo>(null)
// 支付倒计时取消
const time = ref<number>(30 * 60 * 60 * 1000)
const time = ref<number>(3 * 60 * 1000)
// 支付金额
const money = ref<number>(0)

View File

@ -70,7 +70,7 @@
{{ item.name }}
</view>
<view class="flex items-center mt-12rpx leading-34rpx">
<view class="font-400 text-[#F29747] text-24rpx mr-18rpx">半年预约{{ item.half_year_nums > 10 ? item.half_year_nums + '+' : item.half_year_nums }}</view>
<view class="font-400 text-[#F29747] text-24rpx mr-18rpx" v-if="item.operation_type == 1">半年预约{{ item.half_year_nums > 300 ? item.half_year_nums + '+' : item.half_year_nums }}</view>
<view class="font-400 bg-[#F3F3F3] text-[#818CA9] text-22rpx px-8rpx rounded-4rpx">刚有人预约了</view>
</view>
<view class="flex items-center mt-12rpx leading-34rpx">
@ -84,7 +84,7 @@
<view class="flex items-center mt-20rpx">
<wd-img width="26rpx" height="26rpx" :src="`${OSS}icon/icon_location.png`"
mode="aspectFit" />
<view class="ml-4rpx line-1 font-400 text-22rpx text-[#606266] leading-32rpx">
<view class="ml-4rpx line-1 font-400 text-22rpx text-[#606266] leading-32rpx w-175rpx">
{{ item.address }}
</view>
</view>

View File

@ -8,6 +8,17 @@
<template>
<view>
<wd-popup v-model="showBindMobilePopup" lock-scroll custom-style="border-radius: 32rpx 32rpx 0rpx 0rpx;" position="bottom">
<view class="relative pt-54rpx pb-74rpx">
<view class="text-[#303133] text-36rpx leading-46rpx text-center">绑定手机号码</view>
<view class="flex justify-center items-center mt-78rpx">
<wd-button type="text" open-type="getPhoneNumber" @getphonenumber="Login.handleBindMobile" custom-class="!p-0 !m-0 !bg-[#4C9F44] !h-90rpx !leading-90rpx !w-630rpx !text-[#fff] !rounded-8rpx">
一键绑定
</wd-button>
</view>
</view>
</wd-popup>
<view class="mx-48rpx mt-50rpx">
<view class="text-[#303133] text-40rpx leading-56rpx">
<text class="font-400 mr-24rpx">欢迎使用</text>
@ -20,7 +31,7 @@
</view>
<view class="mt-124rpx mx-60rpx box-border">
<wd-button custom-class="!bg-[#4C9F44] !rounded-8rpx !text-[#fff] !text-30rpx !leading-42rpx !h-90rpx !w-[100%] box-border" @click="Login.handleLogin">立即登录</wd-button>
<wd-button custom-class="!bg-[#4C9F44] !rounded-8rpx !text-[#fff] !text-30rpx !leading-42rpx !h-90rpx !w-[100%] box-border" @click="Login.handleMobileLogin">测试-账号登录</wd-button>
<!-- <wd-button custom-class="!bg-[#4C9F44] !rounded-8rpx !text-[#fff] !text-30rpx !leading-42rpx !h-90rpx !w-[100%] box-border" @click="Login.handleMobileLogin">测试-账号登录</wd-button> -->
<!-- <wd-button open-type="getUserInfo" @getuserinfo="Login.handleWxLogin" custom-class="!bg-[#4C9F44] !rounded-8rpx !text-[#fff] !text-30rpx !leading-42rpx !h-90rpx !w-[100%] box-border">立即登录</wd-button> -->
<!-- <view class="text-30rpx font-400 text-[#303133] leading-42rpx text-center mt-32rpx">其它手机号登录</view> -->
</view>
@ -42,6 +53,7 @@
import { getWxCode } from '@/api/login'
import { useUserStore } from '@/store'
import { router } from '@/utils/tools'
import { getMobileByMnp } from '@/api/user'
const OSS = inject('OSS')
@ -51,6 +63,9 @@
const redirectUrl = ref<string>('')
const redirectParams = ref<string>('')
// 绑定手机号码popup
const showBindMobilePopup = ref<boolean>(false)
onLoad((args) => {
redirectUrl.value = args.redirect || ''
})
@ -70,34 +85,81 @@
try {
const userStore = useUserStore()
const res = await userStore.wxLogin()
console.log("🚀 ~ res:", res)
uni.hideLoading()
if (res) {
const decoded = decodeURIComponent(redirectUrl.value)
console.log("🚀 ~ decoded:", decoded)
if (decoded == '/bundle/order/tea-room/order-detail') {
const transferOrderParams = uni.getStorageSync('transferOrderParams')
uni.$emit('transferOrder', transferOrderParams)
}
toast.info('登录成功')
router.navigateBack(1, 500)
if (!res.mobile) {
showBindMobilePopup.value = true
return false
}
Login.handleToLogin()
// Login.handleToLogin()
// if (res) {
// const decoded = decodeURIComponent(redirectUrl.value)
// console.log("🚀 ~ decoded:", decoded)
// if (decoded == '/bundle/order/tea-room/order-detail') {
// const transferOrderParams = uni.getStorageSync('transferOrderParams')
// uni.$emit('transferOrder', transferOrderParams)
// }
// toast.info('登录成功')
// router.navigateBack(1, 500)
// }
} catch(error) {
uni.hideLoading()
}
},
/**
* 一键授权绑定手机号码
*/
handleBindMobile: async (e: any) => {
uni.showLoading({ title: '绑定中...', mask: true })
try {
await getMobileByMnp(e.code)
showBindMobilePopup.value = false
// 手动设置登录状态
const userStore = useUserStore()
userStore.isLoggedIn = true
uni.hideLoading()
Login.handleToLogin()
} catch(error) {
uni.hideLoading()
}
},
// 手机登录
handleMobileLogin: async () => {
const userStore = useUserStore()
console.log("🚀 ~ userStore:", userStore)
const res = await userStore.mobileLogin('15005837859', 1, 2)
if (res) {
uni.setStorageSync('latitude', '30.74744')
uni.setStorageSync('longitude', '120.78483')
toast.info('登录成功')
router.navigateBack(1, 500)
/**
* 测试-账号登录
*/
// handleMobileLogin: async () => {
// const userStore = useUserStore()
// console.log("🚀 ~ userStore:", userStore)
// const res = await userStore.mobileLogin('18868040087', 1, 2)
// if (res) {
// uni.setStorageSync('latitude', '30.74744')
// uni.setStorageSync('longitude', '120.78483')
// toast.info('登录成功')
// router.navigateBack(1, 500)
// }
// },
/**
* 登录成功跳转页面
*/
handleToLogin: () => {
const decoded = decodeURIComponent(redirectUrl.value)
console.log("🚀 ~ decoded:", decoded)
if (decoded == '/bundle/order/tea-room/order-detail') {
const transferOrderParams = uni.getStorageSync('transferOrderParams')
uni.$emit('transferOrder', transferOrderParams)
}
toast.info('登录成功')
router.navigateBack(1, 500)
},
handleAgree: async (e: any) => {

View File

@ -316,6 +316,7 @@
onShow(() => {
const userStore = useUserStore()
isLogin.value = userStore.isLoggedIn
console.log("🚀 ~ isLogin.value:", isLogin.value)
if (isLogin.value) {
// 获取用户详情信息接口
getUserInfo().then(res => {