金诚优选前端代码
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.

125 lines
2.7 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <template>
  2. <view class="page">
  3. <view class="content">
  4. <view class="title">{{ title }}</view>
  5. <view class="password">
  6. <smh-pwd :unit="6" :focus="true" :ontime="true" @change="inputVal"></smh-pwd>
  7. </view>
  8. <view class="lf-flex lf-m-t-45 lf-row-center" v-if="showCountdown">
  9. <view class="lf-font-24 lf-m-r-10" style="color:#FF9D9D">
  10. 剩余支付时间
  11. </view>
  12. <!-- <countdown-timer :time="time" :autoStart="true" @finish="dateFinish">
  13. <template v-slot="{minute, second}">
  14. <view class="lf-flex">
  15. <view class="lf-font-24" style="color:#FF9D9D">{{ minute >= 10 ? minute : "0" + minute }}</view>
  16. <view class="lf-font-24" style="color:#FF9D9D">:</view>
  17. <view class="lf-font-24" style="color:#FF9D9D">{{ second >= 10 ? second : "0" + second }}</view>
  18. </view>
  19. </template>
  20. </countdown-timer> -->
  21. <countdown-time minute="5" second="0" :showDay="false" :showHour="false"></countdown-time>
  22. </view>
  23. </view>
  24. <button class="btn" hover-class="lf-opacity" @click="comfirm">{{ buttonText }}</button>
  25. </view>
  26. </template>
  27. <script>
  28. import countdownTime from '@/components/uni-countdown/uni-countdown';
  29. import smhPwd from '@/components/smh-pwd/smh-pwd.vue';
  30. export default {
  31. components: {
  32. countdownTime,
  33. smhPwd
  34. },
  35. props: {
  36. title: {
  37. type: String,
  38. default: '请输入支付密码'
  39. },
  40. showCountdown: {
  41. type: Boolean,
  42. default: false
  43. },
  44. buttonText: {
  45. type: String,
  46. default: '确认'
  47. }
  48. },
  49. data(){
  50. return {
  51. code: '', // 密码
  52. time: new Date('2021/09/8 14:15:00').getTime() - new Date('2021/09/8 14:10:00').getTime(),
  53. is_auto: false
  54. }
  55. },
  56. created(){
  57. },
  58. methods: {
  59. dateFinish(){
  60. this.$emit('dateFinish');
  61. },
  62. inputVal(event){
  63. this.code = event;
  64. if(this.code.length >= 6){
  65. this.comfirm();
  66. this.is_auto = true;
  67. }else{
  68. this.is_auto = false;
  69. }
  70. },
  71. comfirm(){
  72. if(this.code.length < 6){
  73. return this.$msg('请输入完整支付密码');
  74. }
  75. if(this.is_auto){
  76. return;
  77. }
  78. this.$emit('comfirm', this.code);
  79. }
  80. }
  81. }
  82. </script>
  83. <style lang="scss" scoped="scoped">
  84. .page{
  85. width: 750rpx;
  86. height: 100vh;
  87. position: fixed;
  88. top: 0;
  89. left: 0;
  90. background-color: #FFFFFF;
  91. z-index: 999;
  92. }
  93. .content{
  94. height: max-content;
  95. width: 750rpx;
  96. box-sizing: border-box;
  97. padding: 0rpx 32rpx 0;
  98. position: absolute;
  99. top: 350rpx;
  100. left: 0;
  101. .title{
  102. font-size: 28rpx;
  103. color: #222222;
  104. text-align: center;
  105. }
  106. .password{
  107. height: 100rpx;
  108. margin-top: 50rpx;
  109. }
  110. }
  111. .btn{
  112. position: absolute;
  113. width: 550rpx;
  114. height: 100rpx;
  115. background: #15716E;
  116. border-radius: 50rpx;
  117. bottom: 10vh;
  118. left: calc(50% - 275rpx);
  119. line-height: 100rpx;
  120. color: #FFFFFF;
  121. }
  122. </style>