| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |