This commit is contained in:
2026-01-04 19:18:03 +08:00
parent 2caf2d3c0c
commit da078d07c1
2 changed files with 35 additions and 3 deletions

View File

@@ -22,6 +22,11 @@ const countdown = ref(60)
const isPhoneDisabled = ref(false) const isPhoneDisabled = ref(false)
let timer = null let timer = null
// 填充默认邀请码
function fillInviteCode() {
inviteCode.value = '16800'
}
// 从URL参数中读取邀请码并自动填入如果用户已登录且有手机号则自动填充 // 从URL参数中读取邀请码并自动填入如果用户已登录且有手机号则自动填充
onMounted(async () => { onMounted(async () => {
const inviteCodeParam = route.query.invite_code; const inviteCodeParam = route.query.invite_code;
@@ -245,7 +250,10 @@ const onClickLeft = () => {
<!-- 邀请码输入 --> <!-- 邀请码输入 -->
<div class="form-item"> <div class="form-item">
<div class="form-label">邀请码</div> <div class="form-label">邀请码</div>
<input v-model="inviteCode" class="form-input" type="text" placeholder="请输入邀请码" /> <div class="input-with-btn">
<input v-model="inviteCode" class="form-input" type="text" placeholder="请输入邀请码" />
<button class="get-invite-code-btn" @click="fillInviteCode">获取邀请码</button>
</div>
</div> </div>
<!-- 手机号输入 --> <!-- 手机号输入 -->
@@ -327,6 +335,30 @@ const onClickLeft = () => {
border-bottom: 1px solid var(--color-border-primary); border-bottom: 1px solid var(--color-border-primary);
} }
/* 输入框和按钮组合 */
.input-with-btn {
position: relative;
display: flex;
align-items: center;
flex: 1;
}
.input-with-btn .form-input {
padding-right: 6rem;
}
.get-invite-code-btn {
position: absolute;
right: 0;
background: none;
border: none;
color: var(--color-primary);
font-size: 0.875rem;
cursor: pointer;
padding: 0.5rem;
font-weight: 500;
}
.form-label { .form-label {
font-size: 0.9375rem; font-size: 0.9375rem;
color: var(--color-text-primary); color: var(--color-text-primary);

View File

@@ -15,8 +15,8 @@ export default defineConfig({
strictPort: true, // 如果端口被占用则抛出错误而不是使用下一个可用端口 strictPort: true, // 如果端口被占用则抛出错误而不是使用下一个可用端口
proxy: { proxy: {
"/api/v1": { "/api/v1": {
target: "http://127.0.0.1:8888", // 本地接口地址 // target: "http://127.0.0.1:8888", // 本地接口地址
// target: "https://quannengcha.com", // 本地接口地址 target: "https://www.quannengcha.com", // 本地接口地址
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path, // 可选:确保路径不被修改 rewrite: (path) => path, // 可选:确保路径不被修改
}, },