Browse Source

feat:登录页新增邀请码

dxj
杜贤金 1 year ago
parent
commit
9d1a65eefe
  1. 8
      src/views/login/index.vue
  2. 26
      src/views/task/components/BasicTask/index.vue

8
src/views/login/index.vue

@ -2,7 +2,7 @@
import { reactive, ref } from 'vue'
import { Button, Form, FormItem, Input, message } from 'ant-design-vue'
import { useRouter } from 'vue-router'
import { useRoute, useRouter } from 'vue-router'
import type { Rule } from 'ant-design-vue/es/form'
import { UsergroupAddOutlined } from '@ant-design/icons-vue'
@ -19,6 +19,9 @@ import Yzm from '@/assets/images/login/yzm.png'
const router = useRouter()
const userStore = useUserStore()
const route = useRoute()
const inviteCode = route.query.inviteCode
const formRef = ref()
const btnTxt = ref('获取验证码')
const disabled = ref(false)
@ -29,6 +32,9 @@ const ruleForm = reactive<LoginForm>({
code: '',
inviteCode: '',
})
if (inviteCode) {
ruleForm.inviteCode = inviteCode as string
}
const loading = ref(false)
async function validatePhone(_rule: Rule, value: string) {
if (!value || !(/^1\d{10}$/.test(value)))

26
src/views/task/components/BasicTask/index.vue

@ -169,17 +169,22 @@ function handleInvite() {
</div>
</div>
<div v-show="item.status === 2" class="add-dot-btn accomplish">
已完成
</div>
<div v-if="item.status === 1 " class="add-dot-btn invite" @click="handleGetDot(item.id)">
领取
</div>
<div v-if="item.status === 0">
<div v-if="item.name === '邀请注册'" class="add-dot-btn invite" @click="handleInvite">
<div v-if="item.name === '邀请注册'" class="flex">
<div v-if="item.status === 1" class="add-dot-btn invite" style="margin-right: 3px;" @click="handleGetDot(item.id)">
领取
</div>
<div v-if="item.status !== 2" class="add-dot-btn invite" @click="handleInvite">
去邀请
</div>
<div v-else class="add-dot-btn unfinished">
</div>
<div v-else>
<div v-show="item.status === 2" class="add-dot-btn accomplish">
已完成
</div>
<div v-if="item.status === 1" class="add-dot-btn invite" @click="handleGetDot(item.id)">
领取
</div>
<div v-if="item.status === 0" class="add-dot-btn unfinished">
未完成
</div>
</div>
@ -465,6 +470,7 @@ function handleInvite() {
text-align: center;
padding: 2px 5px;
&.accomplish {
width: 45px;
background: linear-gradient(
90deg,
#b5ceff 0%,
@ -473,12 +479,14 @@ function handleInvite() {
color: #ffffff;
}
&.unfinished {
width: 48px;
background: #ffffff;
border: 1px solid #cdcdcd;
line-height: 18px;
color: #888c90;
}
&.invite {
width: 47px;
background: linear-gradient(
90deg,
#6fa3ff 0%,

Loading…
Cancel
Save