From 64b432916af9c9218ab3f3eca614e26c542142ae Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 07 十一月 2023 15:47:13 +0800
Subject: [PATCH] bug
---
minipro_standard/pages/updatePhone/updatePhone.vue | 162 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 162 insertions(+), 0 deletions(-)
diff --git a/minipro_standard/pages/updatePhone/updatePhone.vue b/minipro_standard/pages/updatePhone/updatePhone.vue
index e69de29..46dd2ba 100644
--- a/minipro_standard/pages/updatePhone/updatePhone.vue
+++ b/minipro_standard/pages/updatePhone/updatePhone.vue
@@ -0,0 +1,162 @@
+<template>
+ <view class="password">
+ <view class="password_tip">
+ <image src="@/static/password_ic_tip@2x.png" alt="" />
+ <text>缁戝畾鎵嬫満鍙峰彲浠ユ洿濂藉湴淇濇姢鎮ㄧ殑璐︽埛瀹夊叏锛屼繚鎶や釜浜轰俊鎭笉琚镜瀹炽��</text>
+ </view>
+ <view class="password_list">
+ <view class="password_list_item">
+ <text>褰撳墠缁戝畾</text>
+ <view class="password_list_item_box">
+ <input type="number" disabled v-model="userInfo.companyUser.phone" maxlength="11">
+ </view>
+ </view>
+ <view class="password_list_item">
+ <text>鏂版墜鏈哄彿</text>
+ <view class="password_list_item_box">
+ <input type="text" v-model="form.newPhone" maxlength="11" placeholder="璇疯緭鍏ユ柊鎵嬫満鍙�">
+ </view>
+ </view>
+ <view class="password_list_item">
+ <text>楠岃瘉鐮�</text>
+ <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 v-else>{{code.num}}</p>
+ </view>
+ </view>
+ </view>
+ <view class="password_footer">
+ <button v-preventReClick class="password_footer_submit" @click="submit">
+ <text>瀹屾垚</text>
+ </button>
+ </view>
+ </view>
+</template>
+
+<script>
+ import { mapState } from 'vuex'
+ import { phoneRegular } from '@/common/config.js'
+ export default {
+ data() {
+ return {
+ form: {
+ 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>
+
+<style lang="scss" scoped>
+ .password {
+ width: 100%;
+ .password_tip {
+ padding: 20rpx 30rpx;
+ display: flex;
+ background: #F7F7F7;
+ box-sizing: border-box;
+ image {
+ width: 24rpx;
+ height: 24rpx;
+ margin-right: 10rpx;
+ margin-top: 8rpx;
+ }
+ text {
+ font-size: 24rpx;
+ font-weight: 400;
+ color: #666666;
+ }
+ }
+ .password_list {
+ padding: 0 30rpx;
+ .password_list_item {
+ display: flex;
+ align-items: center;
+ height: 90rpx;
+ border-bottom: 1rpx solid #E5E5E5;
+ text {
+ width: 150rpx;
+ flex-shrink: 0;
+ font-size: 30rpx;
+ font-weight: 400;
+ color: #222222;
+ }
+ .password_list_item_box {
+ display: flex;
+ justify-content: space-between;
+ flex: 1;
+ input {
+ border: none;
+ font-size: 30rpx;
+ }
+ input::-webkit-input-placeholder {
+ font-size: 28rpx;
+ font-weight: 400;
+ color: #B2B2B2;
+ }
+ p {
+ font-size: 26rpx;
+ font-weight: 400;
+ color: #4275FC;
+ }
+ }
+ }
+ }
+ .password_footer {
+ margin-top: 80rpx;
+ padding: 0 30rpx;
+ .password_footer_submit {
+ width: 100%;
+ height: 88rpx;
+ border: none;
+ background: #4275FC;
+ box-shadow: 0 0 12rpx 0 rgba(0, 0, 0, 0.08);
+ border-radius: 8rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ text {
+ font-size: 30rpx;
+ font-weight: 500;
+ color: #FFFFFF;
+ }
+ }
+ }
+ }
+</style>
--
Gitblit v1.9.3