From fa2f172812de8344fa22c4ef088ea2a67257a0d3 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期二, 05 九月 2023 10:21:17 +0800
Subject: [PATCH] Merge branch 'dev' of http://139.186.142.91:10010/r/productDev/dmMes into dev
---
minipro_standard/pages/updatePhone/updatePhone.vue | 41 ++++++++++++++++++++++++++++++++++++++---
1 files changed, 38 insertions(+), 3 deletions(-)
diff --git a/minipro_standard/pages/updatePhone/updatePhone.vue b/minipro_standard/pages/updatePhone/updatePhone.vue
index b70fb79..46dd2ba 100644
--- a/minipro_standard/pages/updatePhone/updatePhone.vue
+++ b/minipro_standard/pages/updatePhone/updatePhone.vue
@@ -8,7 +8,7 @@
<view class="password_list_item">
<text>褰撳墠缁戝畾</text>
<view class="password_list_item_box">
- <input type="number" disabled v-model="form.currentPhone" maxlength="11">
+ <input type="number" disabled v-model="userInfo.companyUser.phone" maxlength="11">
</view>
</view>
<view class="password_list_item">
@@ -22,7 +22,7 @@
<view class="password_list_item_box">
<input type="text" v-model="form.verificationCode" maxlength="4" placeholder="璇疯緭鍏ユ墜鏈洪獙璇佺爜">
<p @click="getVerificationCode" v-if="!code.isOpen">鑾峰彇楠岃瘉鐮�</p>
- <p @click="getVerificationCode" v-else>{{code.num}}</p>
+ <p v-else>{{code.num}}</p>
</view>
</view>
</view>
@@ -35,15 +35,50 @@
</template>
<script>
+ import { mapState } from 'vuex'
+ import { phoneRegular } from '@/common/config.js'
export default {
data() {
return {
form: {
- currentPhone: '',
newPhone: '',
verificationCode: ''
+ },
+ code: {
+ num: 60,
+ isOpen: false,
+ timer: 0
}
};
+ },
+ computed: mapState([
+ 'userInfo'
+ ]),
+ methods: {
+ // 鑾峰彇楠岃瘉鐮�
+ getVerificationCode() {
+ this.code.isOpen = true
+ this.code.timer = setInterval(() => {
+ if (this.code.num === 0) {
+ clearInterval(this.code.timer)
+ this.code.isOpen = false
+ this.code.num = 60
+ }
+ this.code.num = this.code.num - 1
+ }, 1000)
+ },
+ // 鎻愪氦淇敼
+ submit() {
+ if (!this.form.newPhone) {
+ uni.showToast({ title: '鏂版墜鏈哄彿涓嶈兘涓虹┖', icon: 'none', duration: 2000 });
+ } else if (!phoneRegular.test(this.form.newPhone)) {
+ uni.showToast({ title: '鎵嬫満鍙蜂笉鍚堟硶', icon: 'none', duration: 2000 });
+ } else if (!this.form.verificationCode) {
+ uni.showToast({ title: '楠岃瘉鐮佷笉鑳戒负绌�', icon: 'none', duration: 2000 });
+ } else {
+ console.log('鍙互鎻愪氦')
+ }
+ }
}
}
</script>
--
Gitblit v1.9.3