pay-qrcode.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <view class="code-container">
  3. <view class="title center">向商家付款</view>
  4. <!-- <image class="bar-code" :src="barCode"></image> -->
  5. <view class="main-content">
  6. <view class="bar-code center">
  7. <tki-barcode
  8. ref="barcode"
  9. :val="barContent"
  10. onval=true
  11. :opations="barOption"
  12. /></view>
  13. <view class="qr-code center">
  14. <ayQrcode ref="qrcode" :modal="true" :url="url" :height="150" :width="150" />
  15. </view>
  16. </view>
  17. <view class="footer center">
  18. <view @click="isPayment=!isPayment" class="cu-btn round cuIcon-qrcode text-orange" style="font-size: 50rpx;height: 100rpx;">
  19. <view class="text-black text-xl margin-left-30">{{ isPayment? " 切换收款码":"切换付款码"}}</view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import ayQrcode from "@/components/ay-qrcode/ay-qrcode.vue"
  26. import tkiBarcode from "@/components/tki-barcode/tki-barcode.vue"
  27. export default {
  28. components: { ayQrcode ,tkiBarcode},
  29. mounted(option){
  30. //生成动态密码
  31. this.$refs.qrcode.crtQrCode()
  32. const totp = require("totp-generator");
  33. totp("JBSWY3DPEHPK3PXP");
  34. },
  35. watch:{
  36. },
  37. computed:{
  38. },
  39. data() {
  40. return {
  41. id: '',
  42. isPayment: true,
  43. barContent: '321968494981965849',
  44. url: 'https://pixabay.com/images/search/?order=ec',
  45. barOption: {
  46. width: 4,
  47. fontColor: "#caad20"
  48. }
  49. }
  50. },
  51. methods: {
  52. }
  53. }
  54. </script>
  55. <style>
  56. page {
  57. background-color: #FE9644;
  58. }
  59. </style>
  60. <style lang="scss" scoped>
  61. .code-container{
  62. background-color: #FFFFFF;
  63. border-radius: 25rpx;
  64. width: 90%;
  65. min-height: 900rpx;
  66. margin: 20rpx 5%;
  67. .title{
  68. border-radius: 25rpx 25rpx 0 0;
  69. height: 100rpx;
  70. width: 100%;
  71. font-size: 35rpx;
  72. color: #FD711B;
  73. background-color: #F7F7F7;
  74. font-weight: 600;
  75. letter-spacing: 3rpx;
  76. }
  77. .footer{
  78. width: 90%;
  79. height: 200rpx;
  80. margin-left: 5%;
  81. border-top: 1rpx dashed #dddddd;
  82. }
  83. .main-content{
  84. width: 100%;
  85. height: 550rpx;
  86. .bar-code{
  87. width: 90%;
  88. margin-left: 5%;
  89. height: 150rpx;
  90. margin-top: 50rpx;
  91. }
  92. .qr-code{
  93. width: 100%;
  94. height: 400rpx;
  95. }
  96. }
  97. }
  98. </style>