Commit 0e9e3c6d authored by leiqingsong's avatar leiqingsong

Merge branch 'dev_lqs' into 'master'

Dev lqs

See merge request !124
parents c6b9efee 0b35e094
...@@ -24,10 +24,11 @@ ...@@ -24,10 +24,11 @@
size="large" size="large"
/> />
<van-field <van-field
v-model="form.idCardNo" v-model="form.idCardNo"
label="身份证号" maxlength="18"
placeholder="请输入" label="身份证号"
size="large" placeholder="请输入"
size="large"
/> />
</van-cell-group> </van-cell-group>
<van-button <van-button
...@@ -70,7 +71,7 @@ export default { ...@@ -70,7 +71,7 @@ export default {
cardNumber: "", cardNumber: "",
name: "", name: "",
id: "", id: "",
idCardNo:'', idCardNo: ""
} }
}; };
}, },
...@@ -100,8 +101,13 @@ export default { ...@@ -100,8 +101,13 @@ export default {
} else if (!this.form.name) { } else if (!this.form.name) {
this.$toast.fail("请填写姓名"); this.$toast.fail("请填写姓名");
return; return;
}else if(!this.form.idCardNo){ } else if (!this.form.idCardNo) {
this.$toast.fail("请输入身份证号"); this.$toast.fail("请输入身份证号");
return;
}
if (!/^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(this.form.idCardNo)) {
this.$toast.fail("请输入正确的身份证号");
return;
} }
const params = this.form; const params = this.form;
if (this.form.id) { if (this.form.id) {
......
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
type="number" type="number"
class="validCodeInput" class="validCodeInput"
placeholder="请输入" placeholder="请输入"
center
> >
<img <img
slot="left-icon" slot="left-icon"
...@@ -71,15 +72,14 @@ ...@@ -71,15 +72,14 @@
src="@/assets/images/验证码.png" src="@/assets/images/验证码.png"
/> />
<van-button <van-button
slot="button" slot="button"
size="small" size="small"
type="primary" type="primary"
class="verify-code" class="verify-code"
:disabled="disabled" @click="sendVerification"
@click="sendSms"
> >
<span v-if="!disabled">发送验证码</span> <span v-if="!canSend">{{ time }}秒后重新发送</span>
<span v-else>{{ time }}秒后重新发送</span> <span v-else>发送验证码</span>
</van-button> </van-button>
</van-field> </van-field>
</div> </div>
...@@ -120,11 +120,11 @@ export default { ...@@ -120,11 +120,11 @@ export default {
resultDialogTip: "", resultDialogTip: "",
resultDialogImg: "", resultDialogImg: "",
resultDialog: false, resultDialog: false,
disabled: false, canSend: true,
textName: "", textName: "",
validCodeDialogShow: false, validCodeDialogShow: false,
validCode: null, validCode: null,
time: 60, time: 60
}; };
}, },
created() { created() {
...@@ -138,12 +138,28 @@ export default { ...@@ -138,12 +138,28 @@ export default {
return false; return false;
} }
}, },
sendVerification() {
sendSms() { const params = {
const _this = this; userId: JSON.parse(localStorage.getItem("user")).userId
_this.time = 60; };
_this.disabled = true; sendSms(params).then(res => {
}, if (res.code == 0) {
this.timeDown();
} else {
this.$toast.fail(res.message);
}
});
},
timeDown() {
this.canSend = false;
const timer = setInterval(() => {
this.time -= 1;
if (this.time <= 0) {
clearInterval(timer);
this.canSend = true;
}
}, 1000);
},
inputClick() { inputClick() {
this.rate = this.money * 0.02; this.rate = this.money * 0.02;
...@@ -184,10 +200,6 @@ export default { ...@@ -184,10 +200,6 @@ export default {
this.$toast.fail("输入超过可提现金额,请重新输入"); this.$toast.fail("输入超过可提现金额,请重新输入");
return; return;
} }
const params = {
userId: JSON.parse(localStorage.getItem("user")).userId
};
sendSms(params).then();
this.validCode = null; this.validCode = null;
this.validCodeDialogShow = true; this.validCodeDialogShow = true;
}, },
...@@ -223,7 +235,7 @@ export default { ...@@ -223,7 +235,7 @@ export default {
}, },
onSubmit() { onSubmit() {
if (!this.validCode) { if (!this.validCode) {
this.$toast.fail('请输入验证码'); this.$toast.fail("请输入验证码");
return; return;
} }
this.validCodeDialogShow = false; this.validCodeDialogShow = false;
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
:max-count="1" :max-count="1"
:before-delete="onDeleteAvatar" :before-delete="onDeleteAvatar"
:after-read="onRead" :after-read="onRead"
:max-size="2 * 1024 * 1024"
@oversize="onOversize"
> >
<van-button type="primary">上传新头像</van-button> <van-button type="primary">上传新头像</van-button>
</van-uploader> </van-uploader>
...@@ -59,6 +61,9 @@ export default { ...@@ -59,6 +61,9 @@ export default {
} }
}); });
}, },
onOversize() {
this.$toast.fail("上传头像超过了2M的限制,请重新上传");
},
onRead(file) { onRead(file) {
console.log("读取到图片了", file); console.log("读取到图片了", file);
const inviteCode = JSON.parse(localStorage.getItem("user")).inviteCode; const inviteCode = JSON.parse(localStorage.getItem("user")).inviteCode;
......
...@@ -159,10 +159,10 @@ export default { ...@@ -159,10 +159,10 @@ export default {
console.log("tab", name); console.log("tab", name);
this.getRecommendDetail(name); this.getRecommendDetail(name);
}, },
changeTabs(name){ changeTabs(name) {
console.log("tab", name); console.log("tab", name);
this.getRecommendDetail(name); this.getRecommendDetail(name);
}, },
onDownLoad(val) { onDownLoad(val) {
console.log("下拉加载", val); console.log("下拉加载", val);
}, },
......
...@@ -110,7 +110,7 @@ export default { ...@@ -110,7 +110,7 @@ export default {
onClickHide() { onClickHide() {
this.show = false; this.show = false;
}, },
sendSms() { sendSms() {
const _this = this; const _this = this;
// if (_this.timer) { // if (_this.timer) {
// return false; // return false;
...@@ -169,7 +169,7 @@ export default { ...@@ -169,7 +169,7 @@ export default {
this.$toast.clear(); this.$toast.clear();
_this.registerBtnDisabled = false; _this.registerBtnDisabled = false;
if (res.code === 0) { if (res.code === 0) {
this.$toast.success("注册成功"); this.$toast.success("注册成功");
//_this.$toast.sucess(res.msg); //_this.$toast.sucess(res.msg);
} else { } else {
_this.show = true; _this.show = true;
......
...@@ -65,7 +65,7 @@ export default { ...@@ -65,7 +65,7 @@ export default {
inviteeCodeDialog: false inviteeCodeDialog: false
}; };
}, },
created() { mounted() {
this.imageBaseUrl = process.env.VUE_APP_BASE_URL; this.imageBaseUrl = process.env.VUE_APP_BASE_URL;
this.getUser(); this.getUser();
}, },
...@@ -86,7 +86,6 @@ export default { ...@@ -86,7 +86,6 @@ export default {
? "请填写推荐人邀请码" ? "请填写推荐人邀请码"
: res.beInvitedCode; : res.beInvitedCode;
this.avatar = res.headImage; this.avatar = res.headImage;
// this.avatar = "http://8.131.244.76:81" + res.headImage;
this.headImage = res.headImage; this.headImage = res.headImage;
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment