Merge pull request 'fix: 注册模块->修复倒计时60秒后显示NAN的问题,修复注册mapActions方法引入不对的问题,修复倒计时显示没有S单位' (#1) from feat-tanjy into main
Reviewed-on: http://git.gpxscs.cn/front/merchapp/pulls/1
This commit is contained in:
commit
b4203b3ae5
@ -45,7 +45,7 @@
|
|||||||
:hair-line="false"
|
:hair-line="false"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="getSmsCode"
|
@click="getSmsCode"
|
||||||
>{{ verifyText }}</u-button
|
>{{ parseInt(verifyText) > 0 ? `${verifyText}S` : verifyText }}</u-button
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
</u-input>
|
</u-input>
|
||||||
@ -82,6 +82,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { mapActions, mapState } from "vuex";
|
import { mapActions, mapState } from "vuex";
|
||||||
import { GetSmsCode } from "../../api/login";
|
import { GetSmsCode } from "../../api/login";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "login",
|
name: "login",
|
||||||
data() {
|
data() {
|
||||||
@ -102,7 +103,7 @@ export default {
|
|||||||
},
|
},
|
||||||
onLoad(options) {},
|
onLoad(options) {},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState("user", ["ukey", "approvalStatus"]),
|
...mapState(["userInfo"]),
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
if (this.ukey && [1, 2, 3].includes(this.approvalStatus)) {
|
if (this.ukey && [1, 2, 3].includes(this.approvalStatus)) {
|
||||||
@ -121,6 +122,7 @@ export default {
|
|||||||
},
|
},
|
||||||
onHide() {},
|
onHide() {},
|
||||||
methods: {
|
methods: {
|
||||||
|
...mapActions("user", ["GetLogin", "GetSmsCode", "GetAccountLogin"]),
|
||||||
// 手机注册
|
// 手机注册
|
||||||
async handleRegister() {
|
async handleRegister() {
|
||||||
if (!this.account) {
|
if (!this.account) {
|
||||||
@ -159,12 +161,13 @@ export default {
|
|||||||
await this.GetLogin(params);
|
await this.GetLogin(params);
|
||||||
},
|
},
|
||||||
loadSmsTime() {
|
loadSmsTime() {
|
||||||
|
clearInterval(this.time);
|
||||||
this.time = setInterval(() => {
|
this.time = setInterval(() => {
|
||||||
this.verifyText--;
|
this.verifyText--;
|
||||||
|
|
||||||
uni.setStorageSync("registerSmsTime", this.verifyText);
|
uni.setStorageSync("registerSmsTime", this.verifyText);
|
||||||
|
|
||||||
if (this.verifyText == 0) {
|
if (this.verifyText <= 0) {
|
||||||
clearInterval(this.time);
|
clearInterval(this.time);
|
||||||
this.verifyText = "获取验证码";
|
this.verifyText = "获取验证码";
|
||||||
uni.removeStorageSync("registerSmsTime");
|
uni.removeStorageSync("registerSmsTime");
|
||||||
@ -196,12 +199,12 @@ export default {
|
|||||||
if (Number(this.verifyText) > 0) return;
|
if (Number(this.verifyText) > 0) return;
|
||||||
|
|
||||||
this.verifyText = 60;
|
this.verifyText = 60;
|
||||||
|
clearInterval(this.time);
|
||||||
this.time = setInterval(() => {
|
this.time = setInterval(() => {
|
||||||
this.verifyText--;
|
this.verifyText--;
|
||||||
|
|
||||||
uni.setStorageSync("registerSmsTime", this.verifyText);
|
uni.setStorageSync("registerSmsTime", this.verifyText);
|
||||||
|
|
||||||
if (this.verifyText == 0) {
|
if (this.verifyText <= 0) {
|
||||||
clearInterval(this.time);
|
clearInterval(this.time);
|
||||||
this.verifyText = "获取验证码";
|
this.verifyText = "获取验证码";
|
||||||
uni.removeStorageSync("registerSmsTime");
|
uni.removeStorageSync("registerSmsTime");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user