WriteOff.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <view class="content">
  3. <view class="qr-box position-relative">
  4. <view class="title-box">
  5. <view class="title">
  6. 服务确认二维码
  7. </view>
  8. <view class="tip-text">
  9. 请扫码核销
  10. </view>
  11. </view>
  12. <view class="qr-content flex-center">
  13. <uqrcode :loading='loading' :auto='false' :start='false' sizeUnit='rpx' ref="qrcode" canvas-id="qrcode" :value="item.verify_code" size="500"></uqrcode>
  14. </view>
  15. <view class="text-code">
  16. {{item.verify_code}}
  17. </view>
  18. <view class="tip-icon top-left"></view>
  19. <view class="tip-icon bottom-left"></view>
  20. <view class="tip-icon top-right"></view>
  21. <view class="tip-icon bottom-right"></view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. import {
  27. orderDetail
  28. } from '@/api/order.js';
  29. export default {
  30. data() {
  31. return {
  32. orderId: '',
  33. item: {
  34. verify_code: ''
  35. },
  36. loading:true
  37. };
  38. },
  39. onLoad(option) {
  40. this.orderId = option.id;
  41. this.loadOrder();
  42. },
  43. methods: {
  44. // 载入订单详细
  45. loadOrder() {
  46. let obj = this;
  47. orderDetail({}, obj.orderId).then(e => {
  48. obj.item = e.data;
  49. obj.$refs.qrcode.make({
  50. success: () => {
  51. obj.loading=false;
  52. console.log('生成成功');
  53. },
  54. fail: err => {
  55. console.log(err)
  56. }
  57. });
  58. });
  59. }
  60. }
  61. };
  62. </script>
  63. <style lang="scss">
  64. page {
  65. background-color: $base-color;
  66. }
  67. .qr-box{
  68. color: $font-color-dark;
  69. background-color: #FFF;
  70. text-align: center;
  71. margin: 0 30rpx;
  72. .title-box{
  73. padding-top: 50rpx;
  74. padding-bottom: 30rpx;
  75. background-color: #F5F5F5;
  76. .title{
  77. font-weight: bold;
  78. font-size: 44rpx;
  79. }
  80. .tip-text{
  81. font-size: $font-sm;
  82. color: $font-color-light;
  83. }
  84. }
  85. .qr-content{
  86. padding-top: 110rpx;
  87. }
  88. .tip-icon{
  89. position: absolute;
  90. background-color: $base-color;
  91. border-radius: 99rpx;
  92. width: 100rpx;
  93. height: 100rpx;
  94. }
  95. .top-left,.bottom-left{
  96. left: -40rpx;
  97. }
  98. .top-right,.bottom-right{
  99. right: -40rpx;
  100. }
  101. .bottom-left,.bottom-right{
  102. bottom: -40rpx;
  103. }
  104. .top-left,.top-right{
  105. top: -40rpx;
  106. }
  107. .text-code{
  108. font-size: 44rpx;
  109. font-weight: bold;
  110. padding-top: 60rpx;
  111. padding-bottom: 110rpx;
  112. }
  113. }
  114. .content{
  115. padding-top: 90rpx;
  116. }
  117. </style>