qrcode.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <view class="content">
  3. <view style="margin-top: 200rpx;margin-left: auto;margin-right: auto;width: 630rpx;">
  4. <view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30">
  5. <view class="u-m-r-10">
  6. <u-avatar :src="userData.user.avatar" size="140"></u-avatar>
  7. </view>
  8. <view class="u-flex-1">
  9. <view class="u-font-18 u-p-b-20">{{userData.user.realname}}</view>
  10. <view class="u-font-14 u-tips-color">积分: {{userData.user.money}}</view>
  11. </view>
  12. </view>
  13. <view class="u-flex">
  14. <view class="u-m-r-10">
  15. <image :src="createQRCode(userData.user.operId, 80)"></image>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. import QR from '@/components/wxqrcode.js'
  23. export default {
  24. data() {
  25. return {
  26. $url:''
  27. };
  28. },
  29. methods:{
  30. createQRCode: function (text, size) {
  31. //调用插件中的draw方法,绘制二维码图片
  32. let that = this
  33. try {
  34. let _img = QR.createQrCodeImg(text, {
  35. size: parseInt(size)
  36. })
  37. return _img;
  38. } catch (e) {
  39. console.warn(e)
  40. }
  41. }
  42. }
  43. }
  44. </script>
  45. <style lang="scss">
  46. .content{
  47. }
  48. </style>