cannibalize.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <view>
  3. <u-navbar :title="headTile" autoBack placeholder></u-navbar>
  4. <view class="card_erweima_af">
  5. <canvas id="qrcode" canvas-id="qrcode" style="width: 140px;height:140px;" />
  6. <view class="title_balize">调拨码</view>
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. import UQRCode from "static/js/uqrcode.js";
  12. export default {
  13. data() {
  14. return {
  15. orderId: '',
  16. headTile: '',
  17. }
  18. },
  19. onLoad(value) {
  20. this.orderId = value.type
  21. this.headTile = value.title
  22. },
  23. mounted() {
  24. var userInfo = this.$cache.getCache('userInfo')
  25. this.userInfo = userInfo
  26. const qr = new UQRCode();
  27. let numarr = 'dialCode?' + this.orderId + ',' + userInfo.id + ',' + userInfo.nickName + ',' + userInfo.dept
  28. .id + ',' +
  29. userInfo.dept.name + ','
  30. qr.data = numarr;
  31. qr.size = 140;
  32. qr.make();
  33. const ctx = uni.createCanvasContext('qrcode', this);
  34. qr.canvasContext = ctx;
  35. qr.drawCanvas();
  36. },
  37. methods: {
  38. }
  39. }
  40. </script>
  41. <style lang="scss" scoped>
  42. page {
  43. background-color: #f4f4f5;
  44. }
  45. .card_erweima_af {
  46. display: flex;
  47. align-items: center;
  48. justify-content: center;
  49. margin: 30rpx;
  50. flex-direction: column;
  51. background-color: #fff;
  52. padding: 30rpx;
  53. border-radius: 10rpx;
  54. }
  55. .title_balize {
  56. font-size: 40rpx;
  57. margin-top: 10rpx;
  58. font-weight: 600;
  59. }
  60. </style>