diff --git a/web1/src/api/index.js b/web1/src/api/index.js
index 48bf84d..3ff9d86 100644
--- a/web1/src/api/index.js
+++ b/web1/src/api/index.js
@@ -8,6 +8,9 @@ export default {
// 手机号
registerPhone: (data) => request.post('/app-user/register', data, { noNeedToken: true }),
loginPhone: (data) => request.post('/app-user/login', data, { noNeedToken: true }),
+ // 短信验证码(待后端实现)
+ sendVerifyCode: (data) => request.post('/app-user/send-verify-code', data, { noNeedToken: true }),
+ loginWithVerifyCode: (data) => request.post('/app-user/login-with-code', data, { noNeedToken: true }),
// pages
getIndustryList: () => request.get('/industry/list'),
getHistoryList: (params) => request.get('/app-valuations/', { params }),
diff --git a/web1/src/router/routes/index.js b/web1/src/router/routes/index.js
index ed33d7e..3ba5200 100644
--- a/web1/src/router/routes/index.js
+++ b/web1/src/router/routes/index.js
@@ -6,9 +6,63 @@ const Layout = () => import('@/layout/index.vue')
export const basicRoutes = [
{
path: '/',
- redirect: '/pages', // 默认跳转到首页
+ redirect: '/home', // 默认跳转到首页
meta: { order: 0 },
},
+ {
+ name: 'Home',
+ path: '/home',
+ component: () => import('@/views/home/index.vue'),
+ isHidden: true,
+ meta: {
+ title: '首页',
+ },
+ },
+ {
+ name: 'UserCenter',
+ path: '/user-center',
+ component: () => import('@/views/user-center/index.vue'),
+ redirect: '/user-center/history',
+ isHidden: true,
+ meta: {
+ title: '个人中心',
+ },
+ children: [
+ {
+ name: 'ValuationHistory',
+ path: 'history',
+ component: () => import('@/views/user-center/components/ValuationHistory.vue'),
+ meta: {
+ title: '估值记录',
+ },
+ },
+ {
+ name: 'CorporateTransfer',
+ path: 'transfer',
+ component: () => import('@/views/user-center/components/CorporateTransfer.vue'),
+ meta: {
+ title: '对公转账',
+ },
+ },
+ {
+ name: 'InvoiceManagement',
+ path: 'invoice',
+ component: () => import('@/views/user-center/components/InvoiceManagement.vue'),
+ meta: {
+ title: '开票管理',
+ },
+ },
+ ],
+ },
+ {
+ name: 'InvoiceHeaderAdd',
+ path: '/invoice-header/add',
+ component: () => import('@/views/invoice-header/add.vue'),
+ isHidden: true,
+ meta: {
+ title: '添加抬头',
+ },
+ },
{
name: t('views.workbench.label_workbench'),
path: '/workbench',
diff --git a/web1/src/views/home/index.vue b/web1/src/views/home/index.vue
new file mode 100644
index 0000000..978373d
--- /dev/null
+++ b/web1/src/views/home/index.vue
@@ -0,0 +1,162 @@
+
+
+
+
+
+
+
非遗IP价值评估系统
+
基于深度学习算法的智能评估系统,为您的知识产权和非物质文化遗产提供专业的价值评估服务
+
+
+
+
+ 开始评估
+
+
+
+
+
+
+
+
+
diff --git a/web1/src/views/invoice-header/add.vue b/web1/src/views/invoice-header/add.vue
new file mode 100644
index 0000000..06f2d60
--- /dev/null
+++ b/web1/src/views/invoice-header/add.vue
@@ -0,0 +1,496 @@
+
+
+
+
+
+
+
diff --git a/web1/src/views/login/index.vue b/web1/src/views/login/index.vue
index 7d9cbdf..07eb5bb 100644
--- a/web1/src/views/login/index.vue
+++ b/web1/src/views/login/index.vue
@@ -5,7 +5,7 @@
class="m-auto max-w-1500 min-w-750 f-c-c rounded-12 bg-white bg-opacity-80"
dark:bg-dark
>
-
+
非遗IP价值评估系统
@@ -18,8 +18,8 @@
v-model:value="loginInfo.phone"
style="display: inline-block; width: 260px; height: 42px; text-align: left; line-height: 42px;"
placeholder="请输入手机号"
- :maxlength="20"
- @keypress.enter="handleRegister"
+ :maxlength="11"
+ @keypress.enter="handleLogin"
>
@@ -32,12 +32,29 @@
rounded-5
type="primary"
style="background: linear-gradient( 93deg, #880C22 0%, #A30113 100%); margin-left: 20px; font-size: 16px; border: none !important;"
- @click="handleRegister"
+ @click="handleLogin"
>
立即登录
+
+
+
+
+ {{ countdown > 0 ? `${countdown}秒后重试` : '发送验证码' }}
+
+
@@ -56,8 +73,12 @@ const { t } = useI18n({ useScope: 'global' })
const loginInfo = ref({
phone: '',
+ verifyCode: '',
})
+const countdown = ref(0)
+let countdownTimer = null
+
initLoginInfo()
function initLoginInfo() {
@@ -73,37 +94,110 @@ function initLoginInfo() {
const loading = ref(false)
-async function handleRegister() {
+// 验证手机号格式
+function validatePhone(phone) {
+ const phoneReg = /^1[3-9]\d{9}$/
+ return phoneReg.test(phone)
+}
+
+// 发送验证码
+async function handleSendCode() {
const { phone } = loginInfo.value
+
if (!phone) {
$message.warning('请输入手机号')
return
}
- loading.value = true
- await api.registerPhone({ phone })
- .then(res=>{
- handleLogin()
- })
- .catch(res=>{
- handleLogin()
- })
+
+ if (!validatePhone(phone)) {
+ $message.warning('请输入正确的手机号')
+ return
+ }
+
+ try {
+ // TODO: 调用发送验证码接口
+ // await api.sendVerifyCode({ phone })
+
+ // 模拟发送成功
+ $message.success('验证码已发送')
+
+ // 开始倒计时
+ countdown.value = 60
+ countdownTimer = setInterval(() => {
+ countdown.value--
+ if (countdown.value <= 0) {
+ clearInterval(countdownTimer)
+ countdownTimer = null
+ }
+ }, 1000)
+ } catch (error) {
+ $message.error('验证码发送失败,请重试')
+ }
}
+// 登录
async function handleLogin() {
- const { phone } = loginInfo.value
- loading.value = true
- await api.loginPhone({ phone, password: phone.slice(5,11) }).catch(res=>{
- setToken(res.error.access_token)
- if (query.redirect) {
- const path = query.redirect
- localStorage.setItem('phone', phone)
- Reflect.deleteProperty(query, 'redirect')
- router.push({ path, query })
- } else {
- router.push('/')
- }
- loading.value = false
- })
+ const { phone, verifyCode } = loginInfo.value
+ if (!phone) {
+ $message.warning('请输入手机号')
+ return
+ }
+
+ if (!validatePhone(phone)) {
+ $message.warning('请输入正确的手机号')
+ return
+ }
+
+ // TODO: 等待后端接口完成后再启用验证码验证
+ // if (!verifyCode) {
+ // $message.warning('请输入验证码')
+ // return
+ // }
+ //
+ // if (verifyCode.length < 4) {
+ // $message.warning('请输入完整的验证码')
+ // return
+ // }
+
+ loading.value = true
+
+ try {
+ // TODO: 调用登录接口,传入手机号和验证码
+ // const res = await api.loginWithVerifyCode({ phone, verifyCode })
+ // setToken(res.access_token)
+
+ // 模拟登录成功(暂时使用原有的注册+登录逻辑)
+ await api.registerPhone({ phone })
+ .then(res => {
+ return api.loginPhone({ phone, password: phone.slice(5, 11) })
+ })
+ .catch(res => {
+ if (res.error && res.error.access_token) {
+ setToken(res.error.access_token)
+ localStorage.setItem('phone', phone)
+
+ if (query.redirect) {
+ const path = query.redirect
+ Reflect.deleteProperty(query, 'redirect')
+ router.push({ path, query })
+ } else {
+ router.push('/home')
+ }
+ }
+ })
+ } catch (error) {
+ $message.error('登录失败,请重试')
+ } finally {
+ loading.value = false
+ }
}
+
+// 组件卸载时清除定时器
+onBeforeUnmount(() => {
+ if (countdownTimer) {
+ clearInterval(countdownTimer)
+ countdownTimer = null
+ }
+})
diff --git a/web1/src/views/user-center/components/CorporateTransfer.vue b/web1/src/views/user-center/components/CorporateTransfer.vue
new file mode 100644
index 0000000..26124ba
--- /dev/null
+++ b/web1/src/views/user-center/components/CorporateTransfer.vue
@@ -0,0 +1,532 @@
+
+
+
+
+
+
+
+
+
第一步
+
+
+ 评估收费标准:
+ 6000元/次
+
+
+ 请汇款以下账户:
+
+
+ 公司名称:
+ 成都文化产权交易所有限公司
+
+
+ 税号:
+ 91510104586429590T
+
+
+ 注册地址:
+ 成都市锦江区工业园区三色路38号
+
+
+ 开户行:
+ 中国民生银行股份有限公司成都科华支行
+
+
+ 开户账号:
+ 6343 8264 7
+
+
+ 电话:
+ (028) 85915289
+
+
+
+ 下一步
+
+
+
+
+
+
+
+
+
+
上传成功!预计N个小时内到账
+
请耐心等待
+
+
+ 返回首页
+
+
+
+
+
+
+
+
+
diff --git a/web1/src/views/user-center/components/InvoiceManagement.vue b/web1/src/views/user-center/components/InvoiceManagement.vue
new file mode 100644
index 0000000..64ea186
--- /dev/null
+++ b/web1/src/views/user-center/components/InvoiceManagement.vue
@@ -0,0 +1,157 @@
+
+
+
+
+
+
+
+
+
{{ invoice.name }}
+
{{ invoice.status }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/web1/src/views/user-center/components/UserSidebar.vue b/web1/src/views/user-center/components/UserSidebar.vue
new file mode 100644
index 0000000..95a28f3
--- /dev/null
+++ b/web1/src/views/user-center/components/UserSidebar.vue
@@ -0,0 +1,140 @@
+
+
+
+
+
+
+
diff --git a/web1/src/views/user-center/components/ValuationHistory.vue b/web1/src/views/user-center/components/ValuationHistory.vue
new file mode 100644
index 0000000..938fd13
--- /dev/null
+++ b/web1/src/views/user-center/components/ValuationHistory.vue
@@ -0,0 +1,187 @@
+
+
+
+
+
+
{{ formatDate(item.created_at) }}
+
+
+
+
+
+
+
+
+
diff --git a/web1/src/views/user-center/index.vue b/web1/src/views/user-center/index.vue
new file mode 100644
index 0000000..956c322
--- /dev/null
+++ b/web1/src/views/user-center/index.vue
@@ -0,0 +1,227 @@
+
+
+
+
+
+
+