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

136 lines
3.0 KiB

  1. <template>
  2. <view>
  3. <lf-nav title="支付收银台" :showIcon="true" bgColor="#fff"></lf-nav>
  4. <view class="content">
  5. <view class="card lf-flex-column lf-row-center">
  6. <view class="lf-font-28 lf-color-222">需要支付</view>
  7. <view class="lf-m-t-10 lf-m-b-10">
  8. <text class="symbol"></text>
  9. <text class="price">385</text>
  10. </view>
  11. <view class="tips">
  12. <view>剩余支付时间</view>
  13. <view>
  14. <countdown-timer :time="time" :autoStart="true" @finish="dateFinish">
  15. <template v-slot="{minute, second}">
  16. <!-- <view>{{minute}}:{{second}}</view> -->
  17. <view class="lf-flex">
  18. <view>{{ minute >= 10 ? minute : "0" + minute }}</view>
  19. <view>:</view>
  20. <view>{{ second >= 10 ? second : "0" + second }}</view>
  21. </view>
  22. </template>
  23. </countdown-timer>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="card lf-row-between" v-for="(item, index) in pay_list" :key="index">
  28. <view>
  29. <text class="lf-iconfont" :class="item.icon"></text>
  30. <text class="lf-m-l-10 lf-font-28 lf-color-222">{{ item.name }}</text>
  31. </view>
  32. <radio-group @change="checkChange($event, index)">
  33. <radio :checked="item.checked"></radio>
  34. </radio-group>
  35. </view>
  36. </view>
  37. <view class="fixed-btn" hover-class="lf-opacity" @click="confirm">立即支付</view>
  38. </view>
  39. </template>
  40. <script>
  41. import countdownTimer from '@/components/countdown-timer/countdown-timer';
  42. export default {
  43. components: {
  44. countdownTimer
  45. },
  46. data(){
  47. return {
  48. pay_list: [{
  49. name: '余额支付',
  50. icon: 'icon--',
  51. checked: false
  52. },{
  53. name: '微信支付',
  54. icon: 'icon--1',
  55. checked: true
  56. }],
  57. time: new Date('2021/09/8 14:15:00').getTime() - new Date('2021/09/8 14:10:00').getTime()
  58. }
  59. },
  60. onLoad(){
  61. },
  62. methods: {
  63. checkChange(event, current){
  64. let list = this.pay_list.map((item, index) => {
  65. if(index == current){
  66. item.checked = true;
  67. }else{
  68. item.checked = false;
  69. }
  70. return item;
  71. })
  72. this.pay_list = list;
  73. },
  74. dateFinish(){
  75. console.log("倒计时结束");
  76. },
  77. confirm(){
  78. this.$msg('支付成功')
  79. }
  80. }
  81. }
  82. </script>
  83. <style>
  84. page{
  85. background-color: #F8F8F8;
  86. }
  87. </style>
  88. <style lang="scss" scoped="scoped">
  89. .content{
  90. padding: 30rpx 32rpx;
  91. width: 750rpx;
  92. height: max-content;
  93. box-sizing: border-box;
  94. .card{
  95. width: 100%;
  96. height: max-content;
  97. padding: 30rpx 40rpx;
  98. background-color: #FFFFFF;
  99. border-radius: 20rpx;
  100. &:nth-child(n+2){
  101. margin-top: 30rpx;
  102. }
  103. .symbol{
  104. color: #15716E;
  105. font-size: 32rpx;
  106. }
  107. .price{
  108. font-size: 72rpx;
  109. color: #15716E;
  110. font-weight: bold;
  111. }
  112. .tips{
  113. font-size: 24rpx;
  114. color: #FF9D9D;
  115. display: flex;
  116. }
  117. }
  118. }
  119. .fixed-btn{
  120. position: fixed;
  121. bottom: 10vh;
  122. left: calc(50% - 275rpx);
  123. width: 550rpx;
  124. height: 100rpx;
  125. background-color: #15716E;
  126. color: #FFFFFF;
  127. text-align: center;
  128. line-height: 100rpx;
  129. font-size: 32rpx;
  130. border-radius: 50rpx;
  131. }
  132. </style>