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

101 lines
2.3 KiB

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