From bd56b05e60ded8946854f2c8a40501f785e9c4a9 Mon Sep 17 00:00:00 2001 From: xingyy <64720302+Concur-max@users.noreply.github.com> Date: Thu, 6 Feb 2025 14:03:09 +0800 Subject: [PATCH] =?UTF-8?q?refactor(collect-code):=20=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E6=94=B6=E8=97=8F=E7=A0=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改了 API 接口命名和路径,以适应新的业务逻辑 - 优化了登录流程,增加了验证码登录方式 - 重构了个人中心页面,增加了新的功能组件 - 新增了支付相关页面和逻辑- 优化了代码结构和命名,提高了可维护性 --- app/api-collect-code/auth/index.js | 22 +- app/api-collect-code/goods/index.js | 8 +- app/pages/collectCode/login/index.vue | 54 +++-- .../mine/components/codeCard/index.vue | 49 ++++ app/pages/collectCode/mine/index.vue | 227 +++++++----------- app/pages/collectCode/payment/index.vue | 43 ++++ app/static/images/dddf34@2x.png | Bin 0 -> 61741 bytes app/stores-collect-code/goods/index.js | 42 +--- 8 files changed, 232 insertions(+), 213 deletions(-) create mode 100644 app/pages/collectCode/mine/components/codeCard/index.vue create mode 100644 app/pages/collectCode/payment/index.vue create mode 100644 app/static/images/dddf34@2x.png diff --git a/app/api-collect-code/auth/index.js b/app/api-collect-code/auth/index.js index 66c5ee3..b8ab883 100644 --- a/app/api-collect-code/auth/index.js +++ b/app/api-collect-code/auth/index.js @@ -1,24 +1,22 @@ import { request } from '@/api/http.js' -export async function senCode(data) { - +export async function checkPhone(data) { return await request({ + url:'/api/v1/common/check/phone', + method: 'POST', + data + }) +} +export async function userSend(data) { + return await request( { url:'/api/v1/m/user/send', method: 'POST', data }) } -export async function userLogin(data) { - +export async function mobileLogin(data) { return await request( { - url:'/api/v1/m/user/login', - method: 'POST', - data - }) -} -export async function userUpdate(data) { - return await request( { - url:'/api/v1/m/user/update', + url:'/api/v1/m/user/mobile/login', method: 'POST', data }) diff --git a/app/api-collect-code/goods/index.js b/app/api-collect-code/goods/index.js index 99c537d..ebb8eb9 100644 --- a/app/api-collect-code/goods/index.js +++ b/app/api-collect-code/goods/index.js @@ -1,15 +1,15 @@ import { request } from '@/api/http.js' -export async function artworkList(data) { +export async function offlineQrcodeList(data) { return await request( { - url:'/api/v1/m/auction/default/artwork/list', + url:'/api/v1/offlineQrcode/query', method: 'POST', data }) } -export async function defaultDetail(data) { +export async function offlineQrcodeCreate(data) { return await request ({ - url:'/api/v1/m/auction/default/detail', + url:'/api/v1/offlineQrcode/create', method: 'POST', data }) diff --git a/app/pages/collectCode/login/index.vue b/app/pages/collectCode/login/index.vue index d251a55..7065d7c 100644 --- a/app/pages/collectCode/login/index.vue +++ b/app/pages/collectCode/login/index.vue @@ -2,11 +2,12 @@ import { useRouter, useRoute } from 'vue-router'; import { useI18n } from 'vue-i18n' import { senCode, userLogin } from "@/api/auth/index.js"; -import { authStore } from "@/stores/auth/index.js"; +import { codeAuthStore } from "@/stores-collect-code/auth/index.js"; import { message } from '@/components/x-message/useMessage.js' // ... 现有导入 ... import FingerprintJS from '@fingerprintjs/fingerprintjs' -const { userInfo, token,fingerprint } = authStore() +import {checkPhone, mobileLogin, userSend} from "@/api-collect-code/auth/index.js"; +const { userInfo, token,fingerprint } = codeAuthStore() const router = useRouter(); const route = useRoute(); const { locale } = useI18n() @@ -52,11 +53,19 @@ checkFingerprint() const vanSwipeRef = ref(null) const getCode = async () => { loadingRef.value.loading1 = true - const res = await senCode({ - telNum: phoneNum.value, - zone: '86' + const res = await checkPhone({ + tel: phoneNum.value, }) loadingRef.value.loading1 = false + if (res.status === 0){ + const res=await userSend({telNum:phoneNum.value,zone:'+86'}) + if (res.status === 0){ + pane.value = 1 + vanSwipeRef.value?.swipeTo(pane.value) + showKeyboard.value = true + } + } +/* loadingRef.value.loading1 = false if (res.status === 0) { @@ -64,7 +73,7 @@ const getCode = async () => { pane.value = 1 vanSwipeRef.value?.swipeTo(pane.value) showKeyboard.value = true - startCountdown(); + startCountdown();*/ /* pane.value = 1 vanSwipeRef.value?.swipeTo(pane.value) showKeyboard.value=true @@ -81,10 +90,10 @@ const goBack = () => { } const goLogin = async () => { loadingRef.value.loading2 = true - const res = await userLogin({ - telNum: phoneNum.value, - zone: '86', - code: code.value + const res = await mobileLogin({ + TelNum: phoneNum.value, + Password:loginType.value===1?password.value:'', + Code: loginType.value===0?code.value:'' }) if (res.status === 0) { userInfo.value = res.data.accountInfo @@ -110,7 +119,7 @@ const goLogin = async () => {
- +