You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
1.9 KiB

4 years ago
  1. <template>
  2. <uni-popup ref="uniPopup" type="bottom">
  3. <view class="content">
  4. <text class="mix-icon icon-guanbi" @click="close"></text>
  5. <view class="center title">
  6. <text>输入支付密码</text>
  7. </view>
  8. <view class="input center">
  9. <view class="item center" :class="{has: pwd.length > index}" v-for="(item, index) in 6" :key="index"></view>
  10. </view>
  11. <view class="reset-btn center" @click="navTo('/pages/auth/payPassword')">
  12. <text>重置密码</text>
  13. </view>
  14. <number-keyboard ref="keybord" @onChange="onNumberChange"></number-keyboard>
  15. </view>
  16. </uni-popup>
  17. </template>
  18. <script>
  19. /**
  20. * 支付密码键盘
  21. */
  22. export default {
  23. data() {
  24. return {
  25. pwd: ''
  26. };
  27. },
  28. watch: {
  29. pwd(pwd){
  30. if(pwd.length === 0){
  31. this.$refs.keybord.val = '';
  32. }
  33. }
  34. },
  35. methods: {
  36. open(){
  37. this.$refs.uniPopup.open();
  38. },
  39. close(){
  40. this.$refs.uniPopup.close();
  41. },
  42. onNumberChange(pwd){
  43. this.pwd = pwd;
  44. if(pwd.length >= 6){
  45. this.$emit('onConfirm', pwd.substring(0,6));
  46. }
  47. }
  48. }
  49. }
  50. </script>
  51. <style scoped lang="scss">
  52. .content{
  53. border-radius: 20rpx 20rpx 0 0;
  54. background-color: #fff;
  55. position: relative;
  56. }
  57. .title{
  58. height: 110rpx;
  59. font-size: 32rpx;
  60. color: #333;
  61. font-weight: 700;
  62. }
  63. .input{
  64. padding: 30rpx 0 60rpx;
  65. .item{
  66. width: 88rpx;
  67. height: 88rpx;
  68. margin: 0 10rpx;
  69. border: 1px solid #ddd;
  70. border-radius: 4rpx;
  71. }
  72. .has:after{
  73. content: '';
  74. width: 16rpx;
  75. height: 16rpx;
  76. border-radius: 100rpx;
  77. background-color: #333;
  78. }
  79. }
  80. .reset-btn{
  81. padding-bottom: 20rpx;
  82. margin-top: -10rpx;
  83. margin-bottom: 30rpx;
  84. font-size: 28rpx;
  85. color: #007aff;
  86. }
  87. .icon-guanbi{
  88. position: absolute;
  89. left: 10rpx;
  90. top: 24rpx;
  91. padding: 20rpx;
  92. font-size: 28rpx;
  93. }
  94. </style>