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

115 lines
2.5 KiB

  1. <template>
  2. <view class="page">
  3. <view class="content">
  4. <view class="title">{{ title }}</view>
  5. <view class="password">
  6. <lf-jp-coded :width="686" @inputVal="inputVal"></lf-jp-coded>
  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>{{minute}}:{{second}}</view> -->
  15. <view class="lf-flex">
  16. <view class="lf-font-24" style="color:#FF9D9D">{{ minute >= 10 ? minute : "0" + minute }}</view>
  17. <view class="lf-font-24" style="color:#FF9D9D">:</view>
  18. <view class="lf-font-24" style="color:#FF9D9D">{{ second >= 10 ? second : "0" + second }}</view>
  19. </view>
  20. </template>
  21. </countdown-timer>
  22. </view>
  23. </view>
  24. <button class="btn" hover-class="lf-opacity" @click="comfirm">{{ buttonText }}</button>
  25. </view>
  26. </template>
  27. <script>
  28. import countdownTimer from '@/components/countdown-timer/countdown-timer';
  29. import lfJpCoded from '@/components/lf-jpCoded/lf-jpCoded.vue'
  30. export default {
  31. components: {
  32. lfJpCoded,
  33. countdownTimer
  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. },
  64. comfirm(){
  65. if(this.code.length < 6){
  66. return this.$msg('请输入完整支付密码');
  67. }
  68. this.$emit('comfirm', this.code);
  69. }
  70. }
  71. }
  72. </script>
  73. <style lang="scss" scoped="scoped">
  74. .page{
  75. width: 750rpx;
  76. height: 100vh;
  77. position: fixed;
  78. top: 0;
  79. left: 0;
  80. background-color: #FFFFFF;
  81. z-index: 999;
  82. }
  83. .content{
  84. height: max-content;
  85. width: 750rpx;
  86. box-sizing: border-box;
  87. padding: 0rpx 32rpx 0;
  88. position: absolute;
  89. top: 350rpx;
  90. left: 0;
  91. .title{
  92. font-size: 28rpx;
  93. color: #222222;
  94. text-align: center;
  95. }
  96. .password{
  97. height: 100rpx;
  98. margin-top: 50rpx;
  99. }
  100. }
  101. .btn{
  102. position: absolute;
  103. width: 550rpx;
  104. height: 100rpx;
  105. background: #15716E;
  106. border-radius: 50rpx;
  107. bottom: 10vh;
  108. left: calc(50% - 275rpx);
  109. line-height: 100rpx;
  110. color: #FFFFFF;
  111. }
  112. </style>