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

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