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

146 lines
3.2 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 class="fixed-agreement">购买须知</view>
  39. </view>
  40. </template>
  41. <script>
  42. import countdownTimer from '@/components/countdown-timer/countdown-timer';
  43. export default {
  44. components: {
  45. countdownTimer
  46. },
  47. data(){
  48. return {
  49. pay_list: [{
  50. name: '余额支付',
  51. icon: 'icon--',
  52. checked: false
  53. },{
  54. name: '微信支付',
  55. icon: 'icon--1',
  56. checked: true
  57. }],
  58. time: new Date('2021/09/8 14:15:00').getTime() - new Date('2021/09/8 14:10:00').getTime()
  59. }
  60. },
  61. onLoad(){
  62. },
  63. methods: {
  64. checkChange(event, current){
  65. let list = this.pay_list.map((item, index) => {
  66. if(index == current){
  67. item.checked = true;
  68. }else{
  69. item.checked = false;
  70. }
  71. return item;
  72. })
  73. this.pay_list = list;
  74. },
  75. dateFinish(){
  76. console.log("倒计时结束");
  77. },
  78. confirm(){
  79. this.$msg('支付成功')
  80. }
  81. }
  82. }
  83. </script>
  84. <style>
  85. page{
  86. background-color: #F8F8F8;
  87. }
  88. </style>
  89. <style lang="scss" scoped="scoped">
  90. .content{
  91. padding: 30rpx 32rpx;
  92. width: 750rpx;
  93. height: max-content;
  94. box-sizing: border-box;
  95. .card{
  96. width: 100%;
  97. height: max-content;
  98. padding: 30rpx 40rpx;
  99. background-color: #FFFFFF;
  100. border-radius: 20rpx;
  101. &:nth-child(n+2){
  102. margin-top: 30rpx;
  103. }
  104. .symbol{
  105. color: #15716E;
  106. font-size: 32rpx;
  107. }
  108. .price{
  109. font-size: 72rpx;
  110. color: #15716E;
  111. font-weight: bold;
  112. }
  113. .tips{
  114. font-size: 24rpx;
  115. color: #FF9D9D;
  116. display: flex;
  117. }
  118. }
  119. }
  120. .fixed-agreement {
  121. position: fixed;
  122. bottom: 5vh;
  123. font-size: 28rpx;
  124. color: #15716E;
  125. left: calc(50% - 84rpx);
  126. width: 168rpx;
  127. }
  128. .fixed-btn{
  129. position: fixed;
  130. bottom: 10vh;
  131. left: calc(50% - 275rpx);
  132. width: 550rpx;
  133. height: 100rpx;
  134. background-color: #15716E;
  135. color: #FFFFFF;
  136. text-align: center;
  137. line-height: 100rpx;
  138. font-size: 32rpx;
  139. border-radius: 50rpx;
  140. }
  141. </style>