hxqm.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <view class="content" style="height: 100vh;">
  3. <view class="" style="height: 87rpx;">
  4. </view>
  5. <view class="djq-wrap">
  6. <view class="djq-top flex f-d-c f-j-c">
  7. <view class="djq-name">
  8. 服务确认二维码
  9. </view>
  10. <view class="djq-time">
  11. 请扫码核销
  12. </view>
  13. </view>
  14. <view class="djq-body">
  15. <view class="ewm">
  16. <tki-qrcode :cid="cid" ref="qrcode" :val="val" :size="size" :unit="unit" :background="background"
  17. :foreground="foreground" :pdground="pdground" :iconSize="iconSize" :lv="lv" :onval="onval"
  18. :loadMake="loadMake" :usingComponents="usingComponents" @result="qrR" />
  19. </view>
  20. <view class="ewm-code" >
  21. {{showVal}}
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue';
  29. import {
  30. orderDetail
  31. } from '@/api/order.js';
  32. export default {
  33. components: {
  34. tkiQrcode
  35. },
  36. data() {
  37. return {
  38. showVal: '',
  39. type: 1,//1->普通商品核销 2-> 电池核销
  40. orderInfo: {},
  41. order_id: '', //订单编号
  42. cid: 'tki-qrcode-canvas', //canvasId,页面存在多个二维码组件时需设置不同的ID
  43. size: 440, //生成的二维码大小
  44. unit: 'upx', //大小单位尺寸
  45. show: true, //默认使用组件中的image标签显示二维码
  46. val: '', //要生成的内容
  47. background: '#ffffff', //二维码背景色
  48. foreground: '#333333', //二维码前景色
  49. pdground: '#333333', //二维码角标色
  50. icon: '', //二维码图标URL(必须是本地图片,网络图需要先下载至本地)
  51. iconSize: 40, //二维码图标大小
  52. lv: 3, //容错级别
  53. onval: true, //监听val值变化自动重新生成二维码
  54. loadMake: true, //组件初始化完成后自动生成二维码,val需要有值
  55. usingComponents: false, //是否使用了自定义组件模式(主要是为了修复非自定义组件模式时 v-if 无法生成二维码的问题)
  56. showLoading: false, //是否显示loading
  57. loadingText: '二维码生成中', //loading文字
  58. src: '', // 二维码生成后的图片地址或base64
  59. ratio: 1, //页面比例用于计算
  60. ctxSrc: '', //要显示的图片
  61. loading: true, //是否载入图片中
  62. }
  63. },
  64. onLoad(opt) {
  65. this.type = opt.type
  66. this.val = opt.val
  67. },
  68. onShow() {
  69. },
  70. onReachBottom() {
  71. },
  72. onReady() {
  73. },
  74. methods: {
  75. getOrderDetail() {
  76. let that = this;
  77. orderDetail({}, that.order_id).then(e => {
  78. // that.item = e.data;
  79. that.orderInfo = e.data
  80. that.val = that.orderInfo.verify_code
  81. that.showVal = that.val
  82. });
  83. },
  84. qrR() {
  85. },
  86. }
  87. }
  88. </script>
  89. <style lang="scss" scoped>
  90. page .content{
  91. min-height: 100%;
  92. height: auto;
  93. background:$base-color !important;
  94. }
  95. .djq-wrap {
  96. width: 696rpx;
  97. background-color: #fff;
  98. position: relative;
  99. margin: auto;
  100. .djq-top {
  101. height: 185rpx;
  102. background: #F5F5F5;
  103. overflow: hidden;
  104. flex-direction: column;
  105. justify-content: center;
  106. .djq-name {
  107. font-size: 44rpx;
  108. font-weight: bold;
  109. color: #222222;
  110. }
  111. .djq-time {
  112. font-size: 24rpx;
  113. font-weight: 500;
  114. color: #686868;
  115. }
  116. &::after,
  117. &::before {
  118. content: '';
  119. height: 120rpx;
  120. width: 120rpx;
  121. border-radius: 50%;
  122. position: absolute;
  123. top: -60rpx;
  124. background-color: $base-color;
  125. }
  126. &::before {
  127. left: -60rpx;
  128. }
  129. &::after {
  130. right: -60rpx;
  131. }
  132. }
  133. .djq-body {
  134. height: 770rpx;
  135. position: relative;
  136. padding-top: 115rpx;
  137. &::after,
  138. &::before {
  139. content: '';
  140. height: 120rpx;
  141. width: 120rpx;
  142. border-radius: 50%;
  143. position: absolute;
  144. bottom: -60rpx;
  145. background-color: $base-color;
  146. }
  147. &::before {
  148. left: -60rpx;
  149. }
  150. &::after {
  151. right: -60rpx;
  152. }
  153. .ewm {
  154. width: 440rpx;
  155. height: 440rpx;
  156. margin: auto;
  157. }
  158. .ewm-code {
  159. padding-top: 55rpx;
  160. font-size: 44rpx;
  161. font-weight: bold;
  162. color: #333333;
  163. text-align: center;
  164. }
  165. }
  166. }
  167. </style>