用户个人信息没有国家和职业弹窗绑定

This commit is contained in:
X1627315083
2025-01-13 11:27:04 +08:00
parent cfa1a3345d
commit e7c09a27fc
9 changed files with 219 additions and 2018 deletions

View File

@@ -6,14 +6,13 @@
v-model:visible="registerModel"
:footer="null"
:width="pageWidth"
height="60rem"
:height="bindType == 'Modify'?'60rem':'70rem'"
:maskClosable="false"
:centered="true"
:closable="false"
:mask="registerModelMask"
:keyboard="false"
:destroyOnClose="true"
:zIndex="9999"
>
<div class="generalModel_btn" v-if="bindType == 'Modify'">
<div class="generalModel_closeIcon" @click.stop="cancelDsign()">
@@ -39,7 +38,7 @@
]"
>
<span v-if="bindType == 'Modify'">Modify Email</span>
<span v-else>Bind Email</span>
<span v-else>Bind personal information</span>
</div>
</div>
<!-- 账号密码登录 start -->
@@ -53,42 +52,59 @@
v-model="email"
@keydown.enter="submitPerLogin()"
/>
<div class="login_form_title marign_top30">{{$t('account.Country')}}:</div>
<div class="">
<a-select
class="gallerySelect"
v-model:value="Country"
size="large"
optionFilterProp="label"
style="width: 100%;"
:options="countryList"
placeholder="Please select"
allowClear
show-search
></a-select>
</div>
<div class="login_form_title marign_top30">{{$t('account.CompanyName')}}:</div>
<input class="login_form_input" type="text" placeholder="Please enter occupation" v-model="CompanyName">
<!-- 邮箱登录 start -->
<div class="login_form_email" :class="{active:emailStap===2}">
<div v-show="emailStap === 2" class="email_last_step">
<div class="email_last_step_block" >
<span class="email_last_step_content"
>Verify with one-time verification code</span
>
<i class="fi fi-br-cross email_last_step_block_icon" @click="emailLastStepFun()"></i>
</div>
<div class="email_last_step_bottom">
<div class="email_last_step_des">
<div class="sent_email_content">
Sent to {{ email }}
</div>
<div class="tip_content">
<span v-show="time">{{ time }}s</span>
<span v-show="!time" @click="emailNextStepFun()"
>Resend</span
>
</div>
</div>
<VerificationCodeInput
:ct="emailCode"
@sendCaptcha="submitEmailLogin($event)"
></VerificationCodeInput>
<div v-show="emailStap === 2" class="email_last_step">
<div class="email_last_step_block" >
<span class="email_last_step_content"
>Verify with one-time verification code</span
>
<i class="fi fi-br-cross email_last_step_block_icon" @click="emailLastStepFun()"></i>
</div>
<div class="email_last_step_bottom">
<div class="email_last_step_des">
<div class="sent_email_content">
Sent to {{ email }}
</div>
<div class="tip_content">
<span v-show="time">{{ time }}s</span>
<span v-show="!time" @click="emailNextStepFun()"
>Resend</span
>
</div>
</div>
<VerificationCodeInput
:ct="emailCode"
@sendCaptcha="submitEmailLogin($event)"
></VerificationCodeInput>
<div class="email_last_step_des">
<div class="sent_email_content email_tip_content">
Please check the junk box if you haven't received verification code
<div class="email_last_step_des">
<div class="sent_email_content email_tip_content">
Please check the junk box if you haven't received verification code
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class="login_submit_button marign_top40"
@@ -97,7 +113,7 @@
@click="submitPerLogin()"
>
<span v-if="bindType == 'Modify'">Modify Email</span>
<span v-else>Bind Email</span>
<span v-else>Submit</span>
</div>
</div>
<!-- 账号密码登录 end -->
@@ -113,7 +129,7 @@
</template>
<script lang="ts">
import { defineComponent,ref,reactive,toRefs ,computed} from "vue";
import { defineComponent,ref,reactive,toRefs ,computed, onMounted} from "vue";
import { Https } from "@/tool/https";
import { isEmail } from "@/tool/util";
import { setCookie ,WriteCookie } from "@/tool/cookie";
@@ -122,7 +138,7 @@ import VerificationCodeInput from "@/component/LoginPage/verificationCodeInput.v
import { useStore } from "vuex";
import { useI18n } from "vue-i18n";
import { setLang } from "@/tool/guide";
const md5 = require("md5");
import { country } from "@/tool/country";
export default defineComponent({
components: {
VerificationCodeInput,
@@ -132,6 +148,9 @@ export default defineComponent({
let timer:any = 0;
const {locale} = useI18n()
const store = useStore();
let userDetail:any= computed(()=>{
return store.state.UserHabit.userDetail
})
let register = reactive({
registerModel:computed(()=>{
return store.state.UserHabit.bindEmail.isBindEmail
@@ -140,14 +159,28 @@ export default defineComponent({
return store.state.UserHabit.bindEmail.type
}),
registerModelMask:true,
pageWidth:'45%'
pageWidth:'45%',
Country:'',
CompanyName:'',
countryList:country,
email:'',
})
onMounted(()=>{
let country = userDetail.value.country
let CompanyName = userDetail.value.occupation
let email = userDetail.value.email
register.Country = country
register.CompanyName = CompanyName
register.email = email == '-------------'?'':email
})
return{
store,
timer,
userDetail,
...toRefs(register),
locale
}
},
data() {
return {
@@ -155,7 +188,6 @@ export default defineComponent({
emailStap: 1, // 邮箱登录步骤
emailCode: ["", "", "", "", "", ""], //邮箱验证码
emailNextStep: true,
email: "", //邮箱登录邮箱
frogetPasswordStep: 1, //忘记密码的步骤
forgetPasswordEmail: "",
forgetEmailCode: ["", "", "", "", "", ""], //忘记密码的邮箱验证码
@@ -232,15 +264,28 @@ export default defineComponent({
message.info("The email format is incorrect");
return;
}
if (!this.CompanyName) {
message.info("Please enter occupation");
return;
}
if (!this.Country) {
message.info("Please select a country");
return;
}
let type = 'BIND_MAILBOX'
if(this.email == this.userDetail.email)type = 'UPDATE_USERINFO'
let data = {
"email": this.email,
"ip": "",
"operationType": "BIND_MAILBOX"
"operationType": type,
occupation:this.CompanyName,
country:this.Country
};
if(this.loginTime){
this.loginTime = false
Https.axiosPost(Https.httpUrls.accountSendEmail, data).then(
(rv: any) => {
if(type == 'UPDATE_USERINFO')this.setSuccessLogin(rv)
this.emailStap = 2;
if (rv) {
this.userId = rv.userId
@@ -266,7 +311,9 @@ export default defineComponent({
setSuccessLogin(rv:any){
if (rv) {
let value = {
email:this.email
email:this.email,
occupation:this.CompanyName,
country:this.Country,
}
this.store.commit("upUserDetail", value)
window.location.reload();
@@ -443,7 +490,17 @@ export default defineComponent({
cursor: pointer;
}
}
.gallerySelect{
margin-top: 1rem;
:deep(.ant-select-selector){
height: 5rem;
border: 0.1rem solid #dfdfdf;
border-radius: 2.5rem;
}
:deep(.ant-select-selector):hover{
border: 0.1rem solid #000;
}
}
.login_form_input {
width: 100%;
height: 5rem;