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

118 lines
2.6 KiB

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. }
  54. },
  55. created(){
  56. },
  57. methods: {
  58. dateFinish(){
  59. this.$emit('dateFinish');
  60. },
  61. inputVal(event){
  62. this.code = event;
  63. if(this.code.length >= 6){
  64. this.comfirm();
  65. }
  66. },
  67. comfirm(){
  68. if(this.code.length < 6){
  69. return this.$msg('请输入完整支付密码');
  70. }
  71. this.$emit('comfirm', this.code);
  72. }
  73. }
  74. }
  75. </script>
  76. <style lang="scss" scoped="scoped">
  77. .page{
  78. width: 750rpx;
  79. height: 100vh;
  80. position: fixed;
  81. top: 0;
  82. left: 0;
  83. background-color: #FFFFFF;
  84. z-index: 999;
  85. }
  86. .content{
  87. height: max-content;
  88. width: 750rpx;
  89. box-sizing: border-box;
  90. padding: 0rpx 32rpx 0;
  91. position: absolute;
  92. top: 350rpx;
  93. left: 0;
  94. .title{
  95. font-size: 28rpx;
  96. color: #222222;
  97. text-align: center;
  98. }
  99. .password{
  100. height: 100rpx;
  101. margin-top: 50rpx;
  102. }
  103. }
  104. .btn{
  105. position: absolute;
  106. width: 550rpx;
  107. height: 100rpx;
  108. background: #15716E;
  109. border-radius: 50rpx;
  110. bottom: 10vh;
  111. left: calc(50% - 275rpx);
  112. line-height: 100rpx;
  113. color: #FFFFFF;
  114. }
  115. </style>