123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <template>
- <view>
- <view class="back-icon" @click="backPage"><u-icon name="close" size="32"></u-icon></view>
- <view>
- <view class="top-view">
- <view class="title">设置支付密码</view>
- <view class="desc">请输入支付密码,以验证身份</view>
- </view>
- <view class="u-flex u-row-center">
- <u-message-input :mask="false" mode="box" :maxlength="6" :dot-fill="true" v-model="password" :disabled-keyboard="true" @finish="finish"></u-message-input>
- </view>
- </view>
- <u-keyboard
- default=""
- ref="uKeyboard"
- mode="number"
- :mask="false"
- :mask-close-able="false"
- :dot-enabled="false"
- v-model="show"
- :safe-area-inset-bottom="true"
- :tooltip="false"
- @change="onChange"
- @backspace="onBackspace"
- ></u-keyboard>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- show: true,
- password: ''
- };
- },
- computed: {
- userInfo() {
- return this.$store.state.userStatus;
- }
- },
- onLoad() {},
- methods: {
- backPage() {
- uni.navigateBack();
- },
- //按键被点击(不包含退格键被点击)
- onChange(val) {
- if (this.password.length < 6) {
- this.password += val;
- }
- if (this.password.length >= 6) {
- this.checkPayPassword();
- }
- },
- //键盘退格键被点击
- onBackspace(e) {
- if (this.password.length > 0) {
- this.password = this.password.substring(0, this.password.length - 1);
- }
- },
- checkPayPassword() {
- this.$u.api
- .checkPayPassword({
- id: this.userInfo.id,
- payPassword: this.password
- })
- .then(res => {
- this.goPage('/pagesT/money/PayPassword', 'redirectTo');
- })
- .catch(err => {
- this.password = '';
- });
- },
- showPop(flag = true) {
- this.password = '';
- this.show = flag;
- },
- finish() {
- console.log(11111);
- }
- }
- };
- </script>
- <style>
- page {
- background-color: #ffffff;
- }
- </style>
- <style lang="scss" scoped>
- .top-view {
- text-align: center;
- padding-top: 300rpx;
- .title {
- font-size: 32rpx;
- font-weight: bold;
- padding-bottom: 30rpx;
- }
- .desc {
- padding-bottom: 100rpx;
- }
- }
- .back-icon {
- position: fixed;
- top: 100rpx;
- left: 40rpx;
- z-index: 999999;
- }
- </style>
|